/* =====================================================================
   TATRA HUB — styles
   Brand (tatraco.com): Archivo with width axis, white paper, cool grey,
   hairline rules, square-ish corners, orange used sparingly. Light only.
   Phone first: 17px base text, 44px+ tap targets, thumb navigation.
   The header and bottom bar are fixed and never scale with the text-size
   setting, so large text can't push them around.
   ===================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  --tatra-orange: #f05710; --tatra-orange-deep: #c8430a; --tatra-build: #55831c; --tatra-systems: #12557d;
  --tatra-ink: #141a1f; --tatra-navy: #0c2838;
  --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bg: #f2f5f6; --panel: #ffffff; --ink: #141a1f; --muted: #4f5b64;
  --line: rgba(20,26,31,.16); --line2: rgba(20,26,31,.08); --field-line: rgba(20,26,31,.22);
  --accent: #c8430a; --accent-hi: #f05710; --accent-press: #a93806; --accent-ink: #fff; --accent-soft: #fdf2ed;
  --blue: #12557d; --blue-soft: #eef4f8; --green: #4a7217; --green-soft: #f3f9e9; --amber: #94560a; --amber-soft: #fdf3e2;
  --red: #b42318; --red-soft: #fdeceb; --violet: #5b3fa0; --violet-soft: #f1edf9; --grey-soft: #eef1f3;
  --radius: 4px; --radius-ctl: 3px;
  --top-h: 64px; --nav-h: 0px; --nav-total: 0px; --safe-b: env(safe-area-inset-bottom);
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
@media (max-width: 760px) { :root { --top-h: 56px; --nav-h: 72px; --nav-total: calc(72px + env(safe-area-inset-bottom)); } }

/* ---------- 2. base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { --scale: 1; font-size: calc(17px * var(--scale)); -webkit-text-size-adjust: 100%; }
html[data-size="l"] { --scale: 1.15; }
html[data-size="xl"] { --scale: 1.3; }
@media (min-width: 900px) { html { font-size: calc(15px * var(--scale)); } }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.5; overflow-x: clip; max-width: 100%; }
body { -webkit-font-smoothing: antialiased; }
html.noscroll, body.noscroll { overflow: hidden; }
.modal-bg, .sheet-bg { overscroll-behavior: contain; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); font-stretch: 112%; letter-spacing: -.012em; }
h1 { font-size: 1.375rem; font-weight: 800; font-stretch: 118%; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; line-height: 1.2; }
h3 { font-size: .9375rem; font-weight: 700; margin: 0 0 10px; }
h4 { font-size: .8125rem; font-weight: 700; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
small, .small { font-size: max(.86rem, 14px); }
.muted { color: var(--muted); }
.bad { color: var(--red); }
.warnt { color: var(--amber); }
.appr, .ok-on { color: var(--green); font-weight: 700; }
.grow { flex: 1; }
.pre { white-space: pre-wrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.show-sm { display: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------- 3. controls ---------- */
button, .button {
  font: inherit; font-weight: 600; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-ctl);
  padding: 7px 12px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.2;
  transition: background-color .15s, border-color .15s, transform .08s, box-shadow .15s; touch-action: manipulation;
}
@media (hover: hover) { button:hover, .button:hover { border-color: var(--muted); text-decoration: none; } }
button:active:not(:disabled), .button:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: default; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
button.ghost, .button.ghost { background: transparent; }
button.danger { color: var(--red); }
button.small, .button.small { padding: 4px 9px; min-height: 36px; font-size: .75rem; }
button.block, .button.block { width: 100%; justify-content: center; padding: 10px; }
button.icon { border: 0; background: transparent; padding: 4px 8px; min-height: 36px; min-width: 36px; font-size: 1rem; color: var(--muted); justify-content: center; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; align-self: center; min-height: 36px; padding: 4px 6px; }
.icon-btn { display: flex; align-items: center; justify-content: center; min-width: 46px; min-height: 46px; padding: 0; cursor: pointer; }

input, select, textarea {
  font: inherit; font-size: max(1rem, 16px); /* 16px+ stops iPhone zooming into fields */
  color: var(--ink); background: var(--panel); border: 1px solid var(--field-line); border-radius: var(--radius-ctl);
  padding: 8px 10px; min-height: 44px; width: 100%; max-width: 100%; min-width: 0;
}
textarea { min-height: 0; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { background: var(--line2); color: var(--muted); }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex: none; }
input[type="range"] { padding: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 40px; }

.seg { display: inline-flex; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-ctl); overflow: hidden; background: var(--panel); }
.seg button { border: 0; border-radius: 0; padding: 6px 11px; background: transparent; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:active:not(:disabled) { transform: none; background: var(--line); color: var(--ink); }
.seg button.on:active:not(:disabled) { background: var(--ink); color: #fff; filter: brightness(1.25); }
.seg.busy button { opacity: .75; } .seg.busy button.on { opacity: 1; animation: segpulse 1s ease-in-out infinite; }
@keyframes segpulse { 50% { filter: brightness(1.35); } }
@media (hover: none) { .seg button { -webkit-tap-highlight-color: transparent; } .seg button:active:not(:disabled) { background: var(--line); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; scroll-snap-type: x proximity; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { min-height: 40px; border-radius: 999px; padding: 6px 14px; background: var(--panel); white-space: nowrap; font-weight: 600; scroll-snap-align: start;
  display: inline-flex; align-items: center; color: var(--ink); border: 1px solid var(--line); }
a.chip:hover { text-decoration: none; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on span { color: rgba(255,255,255,.75); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span, .field-label { font-size: max(.86rem, 14px); font-weight: 600; color: var(--muted); font-stretch: 86%; letter-spacing: .01em; }
.field small { color: var(--muted); }
.field > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid2 > * { min-width: 0; }
.grid2 .span { grid-column: 1 / -1; }
.savebar { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.sticky-save { position: sticky; bottom: var(--nav-total); background: var(--bg); padding: 10px 0; z-index: 5; }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; font-stretch: 92%; padding: 3px 9px; border-radius: var(--radius-ctl); white-space: nowrap; line-height: 1.3; }
.badge.grey { background: var(--grey-soft); color: var(--muted); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }

/* ---------- 4. surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: 16px; }
.card.pad, .pad { padding: 12px 14px; margin: 0; }
.boxed { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 14px 0; }
.bar { height: 6px; background: var(--line2); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--tatra-build); border-radius: 99px; transition: width .4s var(--ease); }
.bar.over i { background: var(--red); }
.bar.thin { height: 4px; margin: 4px 0 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-family: var(--display); font-size: 1rem; margin-bottom: 6px; }
.empty p { max-width: 460px; margin: 0 auto; }
.errbox { background: var(--red-soft); color: var(--red); padding: 12px 14px; border-radius: var(--radius); margin: 12px 0; }
.note { background: var(--blue-soft); color: var(--ink); padding: 10px 12px; border-radius: var(--radius); }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 40px auto;
  animation: spin .8s linear infinite, fadein .2s .25s both; } /* appears only if loading takes a moment */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat small { color: var(--muted); font-weight: 600; font-stretch: 86%; letter-spacing: .01em; }
.stat b { font-family: var(--display); font-stretch: 112%; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat.warn { border-color: var(--red); }
.stat.warn b { color: var(--red); }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.cols > * { min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li, .list li > a { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line2); }
.list li:last-child { border: 0; }
.list li > a { color: var(--ink); width: 100%; }
.list li > a:hover { text-decoration: none; }
.list li div { display: flex; flex-direction: column; min-width: 0; }
.list li > span { text-align: right; font-size: .75rem; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; margin: 0 0 18px; }
.kv dt { color: var(--muted); font-size: max(.86rem, 14px); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.big { grid-template-columns: 90px 1fr; font-size: 1.05rem; }
.feed { list-style: none; padding: 0; margin: 0; font-size: .8125rem; }
.feed li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.feed small { display: block; }

.table { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: max(.82rem, 14px); font-weight: 600; font-stretch: 86%; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tr:last-child td { border: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--line2); }

/* rows you tap: one look everywhere */
.exp-row, .inv-row, .thread-row, .frow, .lead-row, .spec-row, .ts-entry, .jobpick, .bill-row, .ar-row, .est-line-sum, .jc-head { transition: background-color .12s; }
.exp-row:active, .inv-row:active, .thread-row:active, .frow:active, .lead-row:active, .spec-row:active, .ts-entry:active, .ar-row:active { background: var(--grey-soft); }

/* ---------- 5. app frame ---------- */
.shell { padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); }
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: calc(var(--top-h) + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 18px;
  padding: env(safe-area-inset-top, 0px) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); background: #fff; color: var(--ink); border-bottom: 1px solid var(--line2); font-size: 15px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; }
/* "HUB" next to the logo: as tall as TATRA's letters, so the two read as one name */
.hublabel { font-family: var(--display); font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink); opacity: .72; padding: 3px 0 3px 12px; border-left: 2px solid var(--line); line-height: 1; margin-bottom: 7px; }
.mainnav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav a { position: relative; color: var(--muted); font-size: 15px; font-weight: 500; padding: 7px 10px; white-space: nowrap; }
.mainnav a:hover { color: var(--ink); text-decoration: none; }
.mainnav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent-hi); }
.usermenu { position: relative; }
.usermenu > button { color: var(--ink); border-color: transparent; background: transparent; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; }
.dropdown { position: absolute; right: 0; top: 46px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); min-width: 240px; overflow: hidden; animation: pop .14s var(--ease); }
.dropdown a, .dd-head { display: block; padding: 10px 14px; color: var(--ink); }
.dropdown a:hover { background: var(--line2); text-decoration: none; }
.dd-head { border-bottom: 1px solid var(--line); font-size: .8125rem; }
.dd-head small { display: block; color: var(--muted); text-transform: capitalize; }
.dd-links { border-bottom: 1px solid var(--line); }
.dd-links a { display: block; padding: 12px 14px; color: var(--ink); font-weight: 600; }
.dd-size { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dd-size > span { font-stretch: 86%; }
.dd-size .seg button { padding: 4px 12px; min-height: 40px; color: var(--ink); }
.hdr-icon { display: none; }
.hdr-refresh { display: flex; align-items: center; justify-content: center; gap: 6px; background: none; border: 0; padding: 6px 8px; min-height: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 8px; }
.hdr-refresh svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hdr-refresh:hover { color: var(--ink); background: var(--line2); }
.hdr-refresh.spin-now svg { animation: hdrspin .7s linear infinite; }
@keyframes hdrspin { to { transform: rotate(360deg); } }
.nbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: #fff;
  font-size: 12px; font-style: normal; font-weight: 700; margin-left: 6px; }
.nbadge.sos { background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.nbadge.alert { padding: 0; min-width: 20px; font-size: 13px; font-weight: 900; }
.nbadge.alert.over { background: var(--red); animation: flash 1.1s ease-in-out infinite; }
.nbadge.alert.soon { background: var(--amber); color: #fff; animation: flash 1.8s ease-in-out infinite; }
@keyframes flash { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .nbadge.alert { animation: none; } }

.main { max-width: 1400px; margin: 0 auto; padding: 20px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left)); min-width: 0; overflow-x: clip; }
.main img, .main video, .main canvas, .main table { max-width: 100%; }
.main > * { animation: fadein .18s ease-out; }

.bottomnav { display: none; }
.sheet-bg { display: none; }

.toasts { pointer-events: none; position: fixed; bottom: calc(20px + var(--nav-total)); left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--tatra-ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 500; max-width: 92vw;
  animation: toastin .22s var(--ease); }
.toast.err { background: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

.pagehead, .projhead { display: flex; align-items: flex-start; gap: 10px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead > h1 { flex: 1 1 auto; min-width: 0; }
.crumb { font-size: max(.8rem, 13px); color: var(--muted); display: inline-block; margin-bottom: 4px; font-stretch: 86%; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; }
.toolbar input[type="search"] { flex: 1; min-width: 180px; max-width: 420px; }
.tabs { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--bg); display: flex; gap: 2px; border-bottom: 1px solid var(--line2);
  margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.shell:has(.clockbanner) .tabs { top: calc(var(--top-h) + 40px + env(safe-area-inset-top, 0px)); }
.tabs a { padding: 12px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; scroll-snap-align: start; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent-hi); }

/* ---------- 6. modal & sheets ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,20,25,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
  animation: fadein .15s ease-out; }
.modal { background: var(--panel); border-radius: 6px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); min-width: 0; animation: modalin .2s var(--ease); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0 20px; }
.modal header h3 { margin: 0; font-size: 1.062rem; }
.modal-body { padding: 14px 20px 20px; }
.modal form, .modal .grid2 { min-width: 0; }
@keyframes modalin { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 7. login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-top: 3px solid var(--accent-hi); }
.login-card small { color: var(--muted); }
.login-logo { width: 190px; height: auto; display: block; margin-bottom: 4px; }
.login-links { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .8125rem; }

/* ---------- 8. projects ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card.proj { color: var(--ink); display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card.proj:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20,26,31,.06); }
.card.proj:active { transform: scale(.99); }
.card.proj h3 { margin: 4px 0 0; font-size: 1.05rem; }
.proj-top { display: flex; justify-content: space-between; align-items: center; }
.proj-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.projhead > div:first-child { min-width: 0; flex: 1 1 auto; }
.projhead > .grow { flex: 0 0 0; }
.projhead .projmeta { overflow: hidden; text-overflow: ellipsis; }

/* ---------- 9. schedule / gantt ---------- */
.gantt { padding: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.gantt-scroll { overflow-x: auto; display: flex; align-items: flex-start; }
.gantt-left { position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--line); flex: 0 0 auto; width: 380px; }
.gl-head, .gl-row { display: grid; grid-template-columns: 1fr 58px 38px 34px; align-items: center; gap: 4px; padding-right: 8px; }
.gl-head { font-size: max(.82rem, 14px); font-weight: 600; font-stretch: 86%; color: var(--muted); border-bottom: 1px solid var(--line); padding-left: 10px; align-items: end; padding-bottom: 6px; }
.gl-row { border-bottom: 1px solid var(--line2); font-size: .8125rem; }
.gl-row > span:not(.gl-name) { font-size: .75rem; text-align: right; font-variant-numeric: tabular-nums; }
.gl-row.summary { font-weight: 600; background: var(--line2); }
.gl-name { display: flex; align-items: center; min-width: 0; }
.gl-name a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw { width: 18px; flex: 0 0 18px; padding: 0; min-height: 0; border: 0; background: none; color: var(--muted); font-size: .6875rem; display: inline-block; text-align: center; }
.gantt-svg { display: block; flex: 0 0 auto; touch-action: pan-x pan-y; }
.gantt-svg text { font-family: var(--body); }
.gantt-svg .grid { stroke: var(--line); stroke-width: 1; }
.gantt-svg .grid.faint { stroke: var(--line2); }
.gantt-svg .weekend { fill: var(--line2); opacity: .7; }
.gantt-svg .ghead { fill: var(--panel); }
.gantt-svg .gmonth { font-size: 11px; font-weight: 600; fill: var(--ink); }
.gantt-svg .gday { font-size: 10px; fill: var(--muted); }
.gantt-svg .gday.we { opacity: .6; }
.gantt-svg .gday.today { fill: var(--accent); font-weight: 700; }
.gantt-svg .todayline { stroke: var(--accent-hi); stroke-width: 2; }
.gantt-svg .target { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gantt-svg .target-l { font-size: 10px; fill: var(--red); }
.gantt-svg .bar .bg { fill: var(--blue-soft); stroke: var(--tatra-systems); stroke-width: 1; touch-action: none; }
.gantt-svg .bar .fill { fill: var(--tatra-systems); opacity: .85; }
.gantt-svg .bar.done .bg { fill: var(--green-soft); stroke: var(--tatra-build); }
.gantt-svg .bar.done .fill { fill: var(--tatra-build); }
.gantt-svg .bar.blocked .bg { stroke: var(--red); stroke-width: 2; }
.gantt-svg .bar.late .bg { stroke: var(--red); fill: var(--red-soft); }
.gantt-svg .bar.late .fill { fill: var(--red); opacity: .6; }
.gantt-svg .bar.dragging { opacity: .85; }
.gantt-svg .handle { fill: transparent; cursor: ew-resize; touch-action: none; }
.gantt-svg .blabel { font-size: 11px; fill: var(--ink); }
.gantt-svg .blabel.in { fill: var(--ink); font-weight: 500; }
.gantt-svg .sumbar rect { fill: var(--tatra-ink); opacity: .8; cursor: pointer; }
.gantt-svg .sumbar rect.pct { fill: var(--accent-hi); opacity: 1; }
.gantt-svg .sumbar path { fill: var(--tatra-ink); }
.gantt-svg .ms path { fill: var(--accent-hi); stroke: var(--panel); stroke-width: 1.5; touch-action: none; }
.gantt-svg .ms path.done { fill: var(--green); }
.gantt-svg .dep { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .8; pointer-events: none; }
.gantt-svg .dep.bad { stroke: var(--red); opacity: 1; }
.gantt-svg .arrowhead { fill: var(--muted); }
.gantt-svg .arrowhead.bad { fill: var(--red); }
.tasklist { padding: 0; }
.tl-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2); }
.tl-row:last-child { border: 0; }
.tl-row.summary { background: var(--line2); font-weight: 600; }
.tl-row.late .tl-name { color: var(--red); }
.tl-main { flex: 1; min-width: 0; cursor: pointer; }
.tl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-pct { width: 70px; text-align: right; }
.tl-pct .bar { margin: 0 0 2px; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.card.tpl { flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; gap: 4px; padding: 14px; }
.card.tpl:hover { border-color: var(--accent); }
.deps { border-top: 1px solid var(--line); padding-top: 4px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.deps h4 { margin-bottom: 0; }
.deprow { display: grid; grid-template-columns: 1fr 140px 70px 32px; gap: 6px; width: 100%; }

/* ---------- 10. logs, photos, files, plans ---------- */
.logs { display: flex; flex-direction: column; gap: 12px; }
.log header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.log header small { display: block; }
.delay { background: var(--amber-soft); padding: 8px 10px; border-radius: var(--radius); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.photos.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.ph { padding: 0; min-height: 0; border: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--line2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; padding: 0 5px; min-height: 0; font-size: .6875rem; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; border: 0; }
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; animation: fadein .15s; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 90vh; text-align: center; color: #ddd; }
.lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; }
.lightbox figcaption small { display: block; opacity: .7; }
.lightbox .icon { color: #fff; font-size: 1.875rem; position: absolute; }
/* round, easy-to-hit buttons on the photo viewer */
.lb-btn { position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; cursor: pointer; transition: background .15s; }
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-btn:disabled { opacity: .25; cursor: default; }
.lb-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: 14px; width: 46px; height: 46px; }
.lb-prev { left: max(12px, env(safe-area-inset-left)); top: calc(50% - 26px); }
.lb-next { right: max(12px, env(safe-area-inset-right)); top: calc(50% - 26px); }
.lb-count { position: absolute; top: max(22px, calc(env(safe-area-inset-top) + 10px)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 600; font-size: .95rem;
  background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: 999px; }
@media (max-width: 760px) { .lb-prev, .lb-next { top: auto; bottom: max(18px, env(safe-area-inset-bottom)); } .lb-prev { left: calc(50% - 64px); } .lb-next { right: calc(50% - 64px); } }

.files.dropping .filelist { outline: 3px dashed var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 1rem; }
.crumbs a { color: var(--muted); padding: 6px 2px; }
.crumbs a.on { color: var(--ink); font-weight: 600; }
.filelist { padding: 0; }
.frow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line2); cursor: pointer; min-height: 56px; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--line2); }
.frow.folder .fname { font-weight: 600; }
.ficon { font-size: 1.4rem; width: 28px; text-align: center; flex: 0 0 28px; }
.fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.fmeta { font-size: max(.85rem, 14px); white-space: nowrap; }
.fvis { display: flex; gap: 4px; }
.filedetail .fprev { width: 100%; max-height: 55vh; object-fit: contain; border-radius: var(--radius); background: var(--line2); display: block; margin-bottom: 10px; }
.fprev-open { display: block; width: 100%; padding: 0; border: 0; background: none; min-height: 0; cursor: zoom-in; }
.fprev-pdf { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; padding: 28px 16px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--line2); color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
.fprev-pdf small { color: var(--muted); font-weight: 500; }

.grouphead { margin: 18px 0 10px; color: var(--muted); font-size: max(.8rem, 13px); font-stretch: 86%; text-transform: uppercase; letter-spacing: .05em; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card.sheet { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.sheet-thumb { aspect-ratio: 1.4; background: #fff; display: block; border-bottom: 1px solid var(--line); }
.sheet-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.sheet-name { color: var(--ink); }
.inline-edit { display: flex; flex-wrap: wrap; gap: 4px; }
.inline-edit input { padding: 5px 7px; font-size: .75rem; }

/* ---------- 11. punch, comments, specs ---------- */
.punch { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.punch-item { display: flex; gap: 12px; padding: 10px; cursor: pointer; align-items: stretch; }
.punch-item:hover { border-color: var(--accent); }
.punch-item.closed { opacity: .65; }
.punch-item img, .punch-item .noimg { width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; flex: 0 0 72px; }
.noimg { background: var(--line2); display: grid; place-items: center; color: var(--muted); font-size: 1.375rem; }
.pi-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pi-foot { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.signbox { background: var(--accent-soft); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.signbox input { margin: 4px 0; }

.thread { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.cmt { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.cmt-head { display: flex; align-items: center; gap: 8px; }
.cmt-head .icon { margin-left: auto; font-size: .85rem; }
.cmt-new { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.cmt-new textarea { flex: 1; }

.spec-sum { margin: 0 0 10px; }
.spec-group { padding: 0; margin-bottom: 12px; overflow: hidden; }
.spec-group > h3 { padding: 14px 14px 6px; margin: 0; }
.spec-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 4px; border-bottom: 1px solid var(--line2); }
.spec-title { flex: 1; border: 0; background: none; justify-content: flex-start; gap: 8px; padding: 6px; text-align: left; }
.spec-title h3 { margin: 0; font-size: 1.1rem; }
.spec-row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0;
  background: none; text-align: left; white-space: normal; min-height: 72px; }
.spec-row:last-child { border-bottom: 0; }
.spec-row:hover { background: var(--line2); }
.spec-row img, .spec-noimg { width: 52px; height: 52px; border-radius: var(--radius); object-fit: cover; flex: 0 0 52px; }
.spec-noimg { background: var(--line2); display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: .9rem; text-transform: uppercase; }
.spec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.spec-item { font-weight: 600; font-size: 1.02rem; }
.spec-detail { color: var(--ink); overflow-wrap: anywhere; }
.spec-meta { color: var(--muted); font-size: max(.85rem, 14px); }
.spec-big { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 6px; background: var(--line2); margin-bottom: 12px; }
.spec-media { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spec-media img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius); }

/* ---------- 12. sales & estimates ---------- */
.due { border-left: 3px solid var(--accent-hi); margin-bottom: 14px; }
.lead-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); color: var(--ink); min-height: 56px; }
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { text-decoration: none; background: var(--grey-soft); }
.lr-main { display: flex; flex-direction: column; min-width: 0; }
.lr-main span { color: var(--muted); }
.lr-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: var(--grey-soft); border-radius: var(--radius); padding: 8px; min-height: 140px; display: flex; flex-direction: column; gap: 8px; }
.col.droppable { outline: 2px dashed var(--line); }
.col-head { display: flex; flex-direction: column; padding: 4px 4px 2px; }
.col-head b { font-family: var(--display); font-stretch: 106%; }
.lead-card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); padding: 12px; cursor: pointer; }
.lead-card:hover { text-decoration: none; border-color: var(--accent-hi); }
.lc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lc-foot { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.lc-next { font-size: .9rem; }
.leadlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.contact-actions .button { flex: 1 1 auto; justify-content: center; min-width: 96px; }
.stage-select { font-weight: 600; font-size: 1.05rem; }
.lead .card { margin-bottom: 14px; }
.nextstep { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.ns-row { display: flex; gap: 8px; }
.ns-row input { flex: 1; }
.sec-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sec-row h3 { margin: 0; }
.act-new { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.act-new .primary { align-self: flex-end; }
.act-icon { width: 24px; flex: 0 0 24px; text-align: center; }

.est { padding-bottom: 110px; }
.title-input { font-family: var(--display); font-stretch: 106%; font-weight: 600; font-size: 1.15rem; border-color: transparent; padding-left: 0; background: transparent; }
.title-input:focus { border-color: var(--line); padding-left: 8px; }
.save-state { font-size: .9rem; }
.est-settings { margin-bottom: 14px; }
.est-sec { padding: 0; margin: 14px 0; overflow: hidden; }
.est-sec-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line2); background: var(--grey-soft); }
.est-sec-head h3 { margin: 0; cursor: pointer; }
.est-line { border-bottom: 1px solid var(--line2); }
.est-line.opt { background: var(--amber-soft); }
.est-line-sum { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "d t" "q t"; gap: 2px 12px; border: 0; border-radius: 0;
  background: none; text-align: left; padding: 12px 14px; white-space: normal; min-height: 64px; }
.est-line-sum:hover { background: var(--grey-soft); }
.est-line-sum:active:not(:disabled) { transform: none; }
.est-desc { grid-area: d; font-weight: 600; }
.est-qty { grid-area: q; font-size: .9rem; }
.est-line-sum b { grid-area: t; align-self: center; font-variant-numeric: tabular-nums; }
.est-line.open .est-line-sum { background: var(--accent-soft); }
.est-line-edit { padding: 12px 14px 14px; background: var(--panel); }
.add-line { margin: 8px 14px 12px; }
.add-sec { margin: 14px 0; }
.add-sec select { font-weight: 600; }
.est-block { margin: 14px 0; }
.est-block .chips { margin-bottom: 10px; }
.payrow { display: grid; grid-template-columns: 1fr 76px 110px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.payrow .num { text-align: right; font-weight: 600; }
.payrow .pay-inv { grid-column: 1 / -1; justify-self: end; display: flex; gap: 6px; align-items: center; font-size: .9rem; margin-top: -4px; }
.est .field { margin: 14px 0; }
.est-totals { position: fixed; left: 0; right: 0; bottom: var(--nav-total); z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: var(--panel); border-top: 1px solid var(--line); padding: 10px max(16px, calc((100vw - 1400px) / 2 + 20px)); }
.est-totals div { display: flex; flex-direction: column; }
.est-totals small { color: var(--muted); }
.est-totals b { font-family: var(--display); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.est-totals .tot b { color: var(--accent); font-size: 1.25rem; }
.linkbox input { font-size: .95rem; }
.send-actions { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.send-actions > * { justify-content: center; }

/* ---------- 13. client documents: quote / proposal / invoice (screen + print) ---------- */
.public { max-width: 880px; margin: 0 auto; padding: 16px 12px 60px; }
.quote { --q-rule: #c9d1d6; --q-band: #f2f5f6; --q-ink: #141a1f; --q-soft: #4f5b64;
  background: #fff; color: var(--q-ink); border: 1px solid var(--q-rule); border-radius: var(--radius); padding: clamp(18px, 4vw, 44px); font-size: 15px; line-height: 1.45; }
.modal .quote { border: 0; padding: 0; }
.q-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 2px solid var(--q-ink); }
.q-logo { width: 165px; height: auto; display: block; }
.q-doc { text-align: right; }
.q-docname { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.q-co { font-size: 12.5px; color: var(--q-soft); line-height: 1.5; }
.q-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--q-rule); border-radius: var(--radius-ctl); margin: 18px 0 4px; }
.q-meta > div { display: flex; flex-direction: column; padding: 9px 12px; border-left: 1px solid var(--q-rule); }
.q-meta > div:first-child { border-left: 0; }
.q-meta small { color: var(--q-soft); font-size: 11.5px; font-stretch: 86%; text-transform: uppercase; letter-spacing: .06em; }
.q-meta b { font-size: 14.5px; }
.q-meta span { color: var(--q-soft); font-size: 13px; }
.q-title { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: clamp(1.3rem, 3.6vw, 1.75rem); margin: 18px 0 6px; }
.q-intro { max-width: 72ch; margin: 0 0 6px; }
.q-table { width: 100%; border-collapse: collapse; margin-top: 16px; border: 1px solid var(--q-rule); font-size: 14px; }
.q-table th { text-align: left; font-family: var(--display); font-weight: 700; font-stretch: 100%; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--q-ink); background: var(--q-band); padding: 8px 12px; border-bottom: 1px solid var(--q-rule); }
.q-table td { padding: 7px 12px; border-bottom: 1px solid #e3e8eb; vertical-align: top; }
.q-table tr:last-child td { border-bottom: 0; }
.q-table tbody + tbody { border-top: 1px solid var(--q-rule); }
.q-secrow td { font-family: var(--display); font-weight: 700; font-size: 13.5px; padding-top: 10px; padding-bottom: 4px; border-bottom: 0; color: var(--q-ink); }
.q-secnote td { padding-top: 0; color: var(--q-soft); font-size: 12.5px; line-height: 1.45; border-bottom: 1px solid #e3e8eb; }
.est-secnote { margin: 2px 0 8px; }
.est-secnote summary { cursor: pointer; padding: 2px 0; }
.est-secnote textarea { width: 100%; margin-top: 4px; font-size: .9rem; }
.imp-sec { border-top: 1px solid var(--line); padding: 8px 0; }
.imp-sec:first-child { border-top: 0; }
.imp-sec h4 { margin: 0 0 4px; display: flex; gap: 8px; }
.imp-sec h4 span { flex: 1; }
.imp-sec ul { margin: 0; padding-left: 18px; }
.imp-sec li { display: flex; gap: 8px; }
.imp-sec li span { flex: 1; }
.imp-warn { background: var(--amber-soft, #fff5e0); color: #7a4b00; border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
.imp-ok { color: var(--green); font-weight: 700; }
.q-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
.q-sub { color: var(--q-soft); font-size: 12.5px; margin-top: 1px; }
.q-totalbox { margin: 0 0 0 auto; width: min(320px, 100%); border: 1px solid var(--q-rule); border-top: 0; }
.q-totalbox > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; font-variant-numeric: tabular-nums; }
.q-totalbox .grand { background: var(--q-band); border-top: 2px solid var(--q-ink); font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.q-totalbox .grand b { color: var(--accent); }
.q-opts th { background: #fdf3e2; }
.q-pay, .q-block { margin-top: 18px; }
.q-block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--q-rule); padding-bottom: 5px; margin: 0 0 6px; }
.q-block p { margin: 0; }
.q-terms p { font-size: 12.5px; color: var(--q-soft); }
.q-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; }
.q-sigs > div { display: flex; flex-direction: column; gap: 4px; }
.q-sigs small { color: var(--q-soft); font-size: 11.5px; }
.q-line-sig { border-bottom: 1px solid var(--q-ink); height: 34px; display: flex; align-items: flex-end; padding-bottom: 3px; font-size: 18px; }
.q-line-sig i { font-family: "Mrs Saint Delafield", "Brush Script MT", "Segoe Script", cursive; font-style: normal; font-size: 32px; line-height: 1; color: #12355b; transform: translateY(5px); }
.q-line-sig .q-sigdate { margin-left: auto; font-size: 13px; color: var(--q-ink); }
.q-sign { margin-top: 26px; padding: 18px; border: 2px solid var(--q-ink); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.q-sign h3 { margin: 0; }
.q-signed { background: var(--green-soft); padding: 14px; border-radius: var(--radius); }
.print-btn { align-self: center; }
.pay-panel h3 { font-size: 1.3rem; }
.pay-btns { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
/* Tatra's payment form on the invoice (Stripe's secure fields inside, styled to match) */
.tpay { display: none; }
.tpay.on { display: block; margin: 6px 0 4px; animation: tpay-in .28s var(--ease); }
@keyframes tpay-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tpay-express { display: none; }
.tpay-express.on { display: block; margin-bottom: 4px; }
.tpay-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; color: var(--muted); font-size: .82rem; letter-spacing: .02em; }
.tpay-or::before, .tpay-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tpay-form { min-height: 150px; }
.tpay-note { margin: 14px 0 0; padding: 10px 12px; background: var(--accent-soft); border-left: 3px solid var(--accent-hi); border-radius: var(--radius); font-size: .88rem; color: var(--ink); }
.tpay-err { margin: 12px 0 0; padding: 10px 12px; background: var(--red-soft); color: var(--red); border-radius: var(--radius); font-size: .92rem; font-weight: 500; }
.tpay .tpay-go { margin-top: 18px; min-height: 56px; font-size: 1.1rem; font-weight: 700; letter-spacing: .01em; }
.tpay-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 4px; color: var(--muted); font-size: .8rem; text-align: center; }
.tpay-lock { width: 11px; height: 13px; display: inline-block; background: currentColor; opacity: .75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 13'%3E%3Cpath d='M2.5 5V3.5a3 3 0 0 1 6 0V5h.5A1 1 0 0 1 10 6v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 13'%3E%3Cpath d='M2.5 5V3.5a3 3 0 0 1 6 0V5h.5A1 1 0 0 1 10 6v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") no-repeat center / contain; }
.tpay-foot .linkish { font-size: .8rem; }
@media print { .tpay { display: none !important; } }
.pay-btns button { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.05rem; white-space: normal; }
.pay-btns button small { font-weight: 500; opacity: .9; }
.pay-btns a.button { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.05rem; white-space: normal; text-align: center; text-decoration: none; }
.pay-btns a.button small { font-weight: 500; opacity: .9; }
.pay-alt { text-align: center; margin: 4px 0 10px; }
.tpay-brands { display: flex; gap: 6px; align-items: center; margin: 2px 0 12px; }
.tpay-brands span { display: inline-flex; line-height: 0; }
.tpay-brands > span > svg { width: 38px; height: 24px; }

@page { margin: .55in .6in .7in;
  @bottom-left { content: "Tatra Building Company, Inc. · 508.619.6073"; font: 8.5pt Archivo, Helvetica, sans-serif; color: #6b757c; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8.5pt Archivo, Helvetica, sans-serif; color: #6b757c; } }
#print-root { display: none; }
@media print {
  html, body { background: #fff !important; font-size: 10.5pt; }
  .topbar, .bottomnav, .tabs, .toolbar, .projhead button, .spec-head .ghost, .clockbanner { display: none !important; }
  .shell { padding-top: 0; }
  .main { padding: 0; }
  .card { break-inside: avoid; }
  .public { padding: 0; max-width: none; }
  .quote { border: 0; padding: 0; font-size: 10.5pt; }
  .q-sign, .print-btn, .toasts, .no-print { display: none !important; }
  .q-table, .q-meta, .q-totalbox { break-inside: auto; }
  .q-table tr, .q-meta, .q-totalbox, .q-sigs, .q-block, .q-close { break-inside: avoid; }
  .q-table thead { display: table-header-group; }
  .q-secrow, .q-secnote { break-after: avoid; }
  .q-sigs { margin-top: 18px; }
  .q-table { margin-top: 12px; font-size: 9.8pt; }
  .q-table td { padding: 5px 10px; }
  .q-table th { padding: 6px 10px; }
  .q-secrow td { padding-top: 7px; padding-bottom: 2px; }
  .q-meta { margin-top: 14px; }
  .q-title { margin-top: 14px; }
  .q-block { margin-top: 12px; }
  .q-line-sig { height: 28px; }
  a { color: inherit; text-decoration: none; }
  /* an open window (the invoice preview) holds the page still on screen — never on paper: every page prints */
  html, body, html.noscroll, body.noscroll { overflow: visible !important; height: auto !important; max-height: none !important; position: static !important; }
  .quote { max-width: none !important; width: auto !important; box-shadow: none !important; }
  /* printing the preview from inside the app: only the copied document */
  body.print-quote > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  .main > * { animation: none; }
}

/* ---------- 14. time & fleet ---------- */
.clockcard { background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; padding: 18px; margin-bottom: 16px; text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.clockcard.on { border: 2px solid var(--tatra-build); background: var(--green-soft); }
.cc-status { font-family: var(--display); font-stretch: 86%; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; }
.clockcard.on .cc-status { color: var(--green); }
.cc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tatra-build); display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.cc-job { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.35rem; }
.cc-addr { margin-top: 2px; font-size: .95rem; } .cc-addr a { color: inherit; opacity: .85; text-decoration: underline; text-underline-offset: 3px; }
.cc-timer { font-family: var(--display); font-weight: 800; font-size: 2.6rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; }
.cc-meta { color: var(--muted); }
.cc-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 6px; }
.cc-in, .cc-out { min-height: 64px; font-family: var(--display); font-size: 1.3rem; font-weight: 800; border-radius: 6px; justify-content: center; color: #fff; border: 0; }
.cc-in { background: var(--tatra-build); }
.cc-in:hover { filter: brightness(1.08); border: 0; }
.cc-out { background: var(--tatra-ink); }
.cc-in.small-cc { min-height: 48px; font-size: 1.05rem; padding: 0 24px; }
.cc-totals { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--muted); margin-top: 4px; }
.cc-totals b { color: var(--ink); }
.clockbanner { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 25; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px max(20px, env(safe-area-inset-left));
  background: var(--green-soft); border-bottom: 1px solid rgba(85,131,28,.35); color: var(--ink); }
.clockbanner:hover { text-decoration: none; }
.joblist { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; margin: 8px 0 12px; }
/* rows never shrink to fit the scroll box (that's what piled long names on top of each other on Android) */
.joblist > .jobpick { flex: 0 0 auto; }
.jobpick { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; white-space: normal; min-height: 60px; height: auto; padding: 10px 12px; background: var(--panel); }
.jobpick.on { border: 2px solid var(--tatra-build); background: var(--green-soft); }
.jp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
/* job name: at most two lines, then … — the number and town go on the line under it */
.jp-main b { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.jp-main small { font-size: .82rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.jp-dist { flex: 0 0 auto; white-space: nowrap; color: var(--muted); font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--bg, rgba(0,0,0,.04)); }
.jp-dist.here { color: var(--green); font-weight: 700; }
.quicklinks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.quicklinks .card { display: flex; flex-direction: column; color: var(--ink); padding: 14px; }
.quicklinks .card:hover { text-decoration: none; border-color: var(--accent-hi); }
.maploc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ts-person { padding: 0; margin-bottom: 12px; overflow: hidden; }
.ts-head { width: 100%; display: flex; justify-content: space-between; gap: 12px; border: 0; border-radius: 0; background: none; text-align: left; padding: 14px; white-space: normal; }
.ts-name { display: flex; flex-direction: column; }
.ts-tot { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.ts-tot b { font-family: var(--display); font-size: 1.25rem; }
.ts-days { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line2); }
.ts-days div { display: flex; flex-direction: column; align-items: center; padding: 6px 0; color: var(--muted); border-left: 1px solid var(--line2); }
.ts-days div:first-child { border-left: 0; }
.ts-days div.has { color: var(--ink); }
.ts-days b { font-variant-numeric: tabular-nums; }
.ts-entries { border-top: 1px solid var(--line2); padding: 0 14px 12px; }
.ts-entry { width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left; white-space: normal; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; background: none; padding: 12px 0; min-height: 60px; }
.te-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.te-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.te-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.fleetmap { height: min(52vh, 520px); border-radius: 6px; border: 1px solid var(--line2); margin-bottom: 16px; z-index: 0; }
.map-truck b { display: inline-block; transform: translate(-50%, -50%); background: var(--tatra-ink); color: #fff; font: 600 12px var(--body); padding: 3px 8px; border-radius: 3px; white-space: nowrap; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.map-truck.moving b { background: var(--tatra-orange-deep); }
.map-job span { display: inline-block; transform: translate(-50%, -50%); background: #fff; color: var(--tatra-systems); font: 600 11px var(--body); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--tatra-systems); white-space: nowrap; }
.truck { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.truck:last-child { border-bottom: 0; }
.truck .tr-main { display: flex; flex-direction: column; min-width: 0; }
.truck .tr-end { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }

/* ---------- 15. people & access ---------- */
.access { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line2); border-radius: 6px; padding: 12px; }
.levels { display: flex; flex-wrap: wrap; gap: 6px; }
.level { min-height: 40px; border-radius: 999px; padding: 6px 14px; }
.level.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cancant { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: var(--grey-soft); border-radius: var(--radius); padding: 10px 12px; }
.cancant ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cancant li { padding-left: 22px; position: relative; }
.cancant li.yes::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.cancant li.no::before { content: "✕"; position: absolute; left: 0; color: var(--red); font-weight: 700; }
.custom-perms fieldset { border: 0; border-top: 1px solid var(--line2); margin: 8px 0 0; padding: 8px 0 0; }
.custom-perms legend { font-family: var(--display); font-weight: 700; padding: 0 6px 0 0; }

/* ---------- 16. expenses ---------- */
.expform { display: flex; flex-direction: column; gap: 14px; }
.expform .field-label { margin-bottom: -8px; }
.receipt-shot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; border: 2px dashed var(--line); border-radius: 6px;
  background: var(--bg); cursor: pointer; text-align: center; padding: 14px; transition: border-color .15s, background-color .15s; }
.receipt-shot:hover { border-color: var(--accent); background: var(--accent-soft); }
.receipt-shot b { font-size: 1.05rem; }
.receipt-shot.has { border-style: solid; padding: 6px; min-height: 0; background: #fff; }
.receipt-shot img { max-height: 200px; max-width: 100%; object-fit: contain; border-radius: 3px; }
.rs-icon { display: flex; color: var(--accent); }
.rs-icon svg { width: 34px; height: 34px; }
.reading .bar i { background: var(--accent); transition: width .2s; }
.exp-amount { display: flex; align-items: center; gap: 6px; border-bottom: 2px solid var(--ink); padding: 2px 4px; }
.exp-amount:focus-within { border-bottom-color: var(--accent); }
.exp-amount span { font-size: 1.8rem; font-weight: 700; color: var(--muted); }
.exp-amount input { border: 0; font-size: 2rem; font-weight: 700; padding: 4px 0; background: transparent; font-variant-numeric: tabular-nums; min-width: 0; width: 100%; outline: none; }
.catgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 66px; min-width: 0; padding: 8px 4px; font-size: .8rem; font-weight: 600; line-height: 1.15;
  text-align: center; background: var(--panel); white-space: normal; overflow-wrap: anywhere; }
.cat-ic svg { width: 24px; height: 24px; display: block; }
.cat.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.exp-list, .inv-list, .thread-list { padding: 0; }
.exp-row, .inv-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line2); background: none; text-align: left; color: var(--ink); border-radius: 0; min-height: 64px; white-space: normal; }
.exp-row:last-child, .inv-row:last-child { border-bottom: 0; }
.exp-row:hover, .inv-row:hover { background: var(--bg); text-decoration: none; }
.exp-row:active:not(:disabled) { transform: none; }
.exp-row img, .exp-icon { width: 46px; height: 46px; flex: none; border-radius: 3px; object-fit: cover; background: var(--bg); display: flex; align-items: center; justify-content: center; border: 1px solid var(--line2); color: var(--muted); }
.exp-icon svg { width: 22px; height: 22px; }
.exp-main, .inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exp-main > *, .inv-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-end, .inv-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.exp-quick { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-bottom: 16px; padding: 14px 16px; background: var(--panel); color: var(--ink); white-space: normal; }
.exp-quick span:last-child { display: flex; flex-direction: column; min-width: 0; }
.exp-add-top { border: 2px solid var(--orange, #e0561c); padding: 18px 16px; }
.exp-add-top .rs-icon { color: var(--orange, #e0561c); }
.exp-add-top b { font-size: 1.15em; }
.exp-recent-h { margin: 6px 2px 10px; font-size: 1rem; color: var(--muted, #6b7680); font-weight: 600; }

/* ---------- 17. invoices & money ---------- */
.bill-pick h4 { margin-top: 16px; }
.bill-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); cursor: pointer; min-height: 48px; }
.bill-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bill-row .num { font-weight: 600; }
.bill-pick .field { margin-top: 10px; max-width: 220px; }
.inv-editor { display: flex; flex-direction: column; gap: 14px; }
.inv-editor .pagehead { flex-wrap: wrap; gap: 8px; margin-bottom: 0; }
.inv-items { display: flex; flex-direction: column; gap: 10px; }
.inv-item { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 10px; border-bottom: 1px solid var(--line2); }
.inv-item .grow { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.inv-item .desc { font-weight: 600; }
.inv-item .details { font-size: .85rem; }
.inv-item label { display: flex; flex-direction: column; width: 84px; }
.inv-item .price.sign-field { display: flex; gap: .25rem; align-items: flex-end; width: 140px; }
.inv-item .price.sign-field label { flex: 1 1 auto; width: auto; min-width: 0; }
.sign-field .sign-btn { height: 2.6rem; }
.inv-item .amt { width: 100px; text-align: right; padding-bottom: 10px; font-variant-numeric: tabular-nums; }
.inv-total { display: flex; justify-content: flex-end; gap: 24px; font-size: 1.15rem; padding-top: 4px; }
.qbo-line { margin: -6px 0 0; }
.aging-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.aging .ab { display: flex; flex-direction: column; }
.aging .ab b { font-variant-numeric: tabular-nums; }
.aging .ab .bar i { background: var(--amber); }
.aging .ab.current .bar i { background: var(--green); }
.aging .ab.d60 .bar i, .aging .ab.d90 .bar i, .aging .ab.d90p .bar i { background: var(--red); }
.money .card { margin-bottom: 14px; }

/* ---------- 18. messages ---------- */
.msg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 6px; }
.msg-actions > button { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; font-size: 1.02rem; font-weight: 700; border-radius: var(--radius); white-space: normal; line-height: 1.2; }
.sos-btn { background: var(--red); border: 1px solid var(--red); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.sos-btn:hover, .sos-btn:active { background: #b3261e; border-color: #b3261e; color: #fff; }
.sos-hint { margin: 0 0 14px; }
.msg-latest { margin: 0 0 8px; }
button.primary.sos { background: var(--red); border-color: var(--red); }
.sos-to { padding: 12px 14px; border: 1px solid var(--red); background: var(--red-soft); border-radius: var(--radius); color: var(--ink); }
.sos-to b { color: var(--red); }
.thread-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line2); color: var(--ink); min-height: 64px; }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--bg); text-decoration: none; }
.thread-row.unread b { font-weight: 800; }
.thread-row .tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-row .tr-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-top { display: flex; gap: 8px; align-items: center; }
.thread-row .tr-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 99px; background: var(--accent); display: block; }
.people-find { margin: 6px 0 4px; }
.people-pick h4 { margin: 10px 0 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; }
.person { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 10px; min-height: 52px; background: var(--panel); white-space: normal; }
.person small { color: var(--muted); font-weight: 500; }
.person.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.photo-btn { align-self: flex-start; cursor: pointer; }
.sos-state { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--red); background: var(--red-soft); color: var(--red); border-radius: var(--radius); margin-bottom: 12px; }
.sos-state.done { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.bubbles { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 90px; }
.bubble { max-width: min(80%, 560px); align-self: flex-start; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px 12px 12px 3px; padding: 8px 12px; animation: fadein .2s; }
.bubble.mine { align-self: flex-end; background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 12px 12px 3px 12px; }
.bubble p { margin: 0; }
.bubble img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 4px 0; }
.bubble .by { display: block; font-weight: 700; color: var(--muted); }
.bubble .at { display: block; opacity: .65; font-size: 12px; margin-top: 2px; }
.composer { position: sticky; bottom: var(--nav-total); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 10px 0; }
.composer textarea { flex: 1; min-height: 46px; resize: none; }

/* ---------- 19. finance & QuickBooks ---------- */
.finance { display: flex; flex-direction: column; gap: 16px; }
.fin-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.period { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period select, .period input { width: auto; }
.mbars { display: flex; gap: 6px; align-items: flex-end; height: 180px; padding-top: 8px; overflow-x: auto; }
.mbar { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.mbar-cols { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.mbar-cols i { width: 42%; max-width: 18px; min-height: 2px; border-radius: 2px 2px 0 0; transition: height .5s var(--ease); }
.mbar small { font-size: 11px; color: var(--muted); white-space: nowrap; }
i.in { background: var(--tatra-build); } i.out { background: var(--accent-hi); }
.legend { display: flex; gap: 16px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.jobcost, .ar { padding: 0; }
.jc-row, .ar-client { border-bottom: 1px solid var(--line2); padding: 12px 14px; }
.jc-row:last-child, .ar-client:last-child { border-bottom: 0; }
.jc-head { display: flex; width: 100%; gap: 12px; align-items: center; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); min-height: 0; white-space: normal; }
.jc-head:active:not(:disabled) { transform: none; }
.jc-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.jc-fig { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.jc-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 8px; }
.jc-bars small { color: var(--muted); }
.jc-detail { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); animation: fadein .15s; }
.ar-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.ar-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 6px 0; color: var(--ink); font-size: .95rem; }
.ar-row:hover { text-decoration: none; }
.ar-row b { font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.qbo .kv { margin-bottom: 14px; }
.qbo-result { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); }
.qbo-result.err { border-color: var(--red); background: var(--red-soft); }
.qbo-result pre { margin: 6px 0 0; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.qbo-report table { font-size: .9rem; }
.qbo-report td.num, .qbo-report th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qbo-report tr.head td { font-weight: 700; padding-top: 12px; }
.qbo-report tr.sum td { font-weight: 700; border-top: 1px solid var(--line); }
.sync-setup h4 { margin-top: 18px; }
.sync-setup .field { margin-bottom: 10px; }
.sync-log li small { white-space: normal; }
.row-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.row-pick select { flex: 1; min-width: 200px; }

/* =====================================================================
   20. phones
   ===================================================================== */
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .show-sm { display: block; }
  h1 { font-size: 1.25rem; }
  .main { padding: 14px 12px calc(var(--nav-total) + 24px); }
  .cols, .grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 1.15rem; }
  .kv { grid-template-columns: 80px 1fr; }
  table { font-size: .95rem; }

  /* header: logo + optional admin gear; navigation lives in the bottom bar */
  .topbar { padding: 0 4px 0 12px; gap: 10px; }
  .mainnav, .usermenu { display: none; }
  .brand-logo { height: 26px; }
  .hublabel { font-size: 19px; padding-left: 10px; margin-bottom: 6px; }
  .hdr-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 52px; height: var(--top-h); color: var(--muted); font-size: 11px; font-weight: 600; }
  .hdr-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .hdr-icon.on { color: var(--accent); }
  .hdr-refresh { flex-direction: column; gap: 1px; padding: 0; border-radius: 0; font-size: 11px; background: none !important; }
  .hdr-refresh svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .hdr-icon:hover { text-decoration: none; }
  .clockbanner { padding: 8px 12px; }

  /* bottom bar: fixed size, never scales with text size */
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: var(--nav-total);
    background: var(--panel); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) var(--safe-b) env(safe-area-inset-left); }
  .bottomnav a { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h);
    padding: 6px 2px 8px; color: var(--muted); font-size: 11px; font-weight: 650; font-stretch: 88%; line-height: 1.2; white-space: nowrap; transition: color .15s; }
  .bottomnav a.desk { display: none; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav a:active .bn-icon { transform: scale(.9); }
  .bottomnav a.on { color: var(--accent); }
  .bottomnav a > span:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bottomnav .nbadge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; font-size: 11px; height: 18px; min-width: 18px; }
  .bn-icon { display: grid; place-items: center; transition: transform .1s; }
  .bn-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* account sheet + forms open between the header and the bottom bar and scroll inside */
  .sheet-bg { display: flex; position: fixed; left: 0; right: 0; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); bottom: var(--nav-total); z-index: 55; background: rgba(15,20,25,.45); align-items: flex-end; animation: fadein .15s; }
  .sheet { background: var(--bg, #f3f5f6); width: 100%; border-radius: 18px 18px 0 0; padding: 8px 0 12px; max-height: calc(100% - 56px); overflow-y: auto; animation: sheetin .22s var(--ease); box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
  .sheet-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: #cdd3d8; margin: 2px auto 8px; }
  .sheet a, .sheet .dd-head { display: block; padding: 16px 18px; color: var(--ink); font-size: 1.05rem; }
  .sheet .dd-head small { display: block; color: var(--muted); text-transform: capitalize; }
  .sheet .dd-size { padding: 12px 18px; }
  .modal-bg { top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); bottom: var(--nav-total); z-index: 55; padding: 0; align-items: flex-end; }
  .modal { border-radius: 12px 12px 0 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; animation: sheetin .24s var(--ease); }
  .modal.wide { max-width: none; }

  /* sideways-scrolling rows fade at the edge so it's clear there's more */
  .tabs { margin: 0 -12px 14px; padding: 0 12px; }
  .tabs, .chips.scroll, .fin-head .chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .fin-head .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .toolbar > input[type="search"] { flex: 1 1 100%; max-width: none; order: -1; }
  .toasts { bottom: calc(var(--nav-total) + 16px); }

  /* project header: compact so the work is visible */
  .projhead { flex-wrap: nowrap; margin-bottom: 8px; }
  .projhead h1 { font-size: 1.15rem; }
  .projhead .projmeta { white-space: nowrap; font-size: .9rem; }
  .projhead .ghost { min-height: 36px; padding: 6px 10px; font-size: .9rem; }

  .gantt-left { width: 190px; }
  .gl-head, .gl-row { grid-template-columns: 1fr; }
  .gl-head span:not(:first-child), .gl-row > span:not(.gl-name) { display: none; }
  .deprow { grid-template-columns: 1fr 1fr; }
  .viewer { height: calc(100vh - 210px); }
  .spec-row { display: grid; grid-template-columns: 52px 1fr; column-gap: 12px; row-gap: 6px; }
  .spec-row > .badge { grid-column: 2; justify-self: start; }
  .board { display: none; }
  .est-totals { grid-template-columns: 1fr 1fr 1fr; padding: 8px 12px; }
  .est-totals div:nth-child(3) { display: none; }
  .est { padding-bottom: 150px; }
  .payrow { grid-template-columns: 1fr 64px 92px 32px; }
  .jc-bars { grid-template-columns: 1fr; }
  .aging-bars { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .inv-item { flex-wrap: wrap; }
  .inv-item .grow { flex-basis: 100%; }
  .inv-item .amt { flex: 1; }
}
@media (max-width: 560px) {
  .cancant { grid-template-columns: 1fr; }
  .q-head { align-items: flex-start; } .q-doc { text-align: left; }
  .q-meta { grid-template-columns: 1fr 1fr; } .q-meta > div:nth-child(3) { border-left: 0; }
  .q-meta > div:nth-child(n+3) { border-top: 1px solid var(--q-rule); }
  .q-sigs { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .catgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat { flex-direction: row; justify-content: flex-start; min-height: 48px; padding: 8px 10px; gap: 8px; text-align: left; }
}
@media (min-width: 761px) { .sheet-bg { display: none !important; } }
@keyframes sheetin { from { transform: translateY(24px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- new-message alert (must tap Read) ---------- */
.msg-alert-bg { position: fixed; inset: 0; z-index: 300; background: rgba(15,20,25,.6); display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); animation: fadein .15s; }
.msg-alert { width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; background: var(--panel); border-radius: 10px; border-top: 6px solid var(--accent-hi);
  padding: 18px 18px 16px; box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: alertin .25s var(--ease); }
.msg-alert.sos { border-top-color: var(--red); }
.ma-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ma-kind { font-family: var(--display); font-weight: 800; font-stretch: 112%; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-size: .85rem; }
.msg-alert.sos .ma-kind { color: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.ma-count { color: var(--muted); font-size: .9rem; }
.msg-alert h2 { font-size: 1.35rem; margin: 0 0 4px; line-height: 1.2; overflow-wrap: anywhere; }
.ma-from { color: var(--muted); margin-bottom: 12px; }
.ma-from b { color: var(--ink); }
.ma-photo { width: 100%; max-height: 40vh; object-fit: contain; border-radius: 6px; background: var(--line2); margin-bottom: 10px; }
.ma-body { font-size: 1.1rem; background: var(--bg); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; overflow-wrap: anywhere; }
.ma-actions { display: flex; flex-direction: column; gap: 8px; }
.ma-actions .primary { min-height: 54px; font-size: 1.15rem; }
.receipts { font-size: .9rem; margin: -4px 2px 0; text-align: right; }
@keyframes alertin { from { opacity: 0; transform: scale(.96) translateY(8px); } }

/* conversation: messages fill the screen, typing box sits at the bottom */
.page.convo > div { min-height: calc(100vh - var(--top-h) - var(--nav-total) - 40px); display: flex; flex-direction: column; }
.page.convo .bubbles { flex: 1; padding-bottom: 12px; }

/* =====================================================================
   21. plan viewer (full screen)
   ===================================================================== */
.plans .upload-prog { margin-bottom: 14px; padding: 10px 14px; }
.sheet-name { display: flex; align-items: center; gap: 4px; color: var(--ink); min-width: 0; }
.sheet-name a { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.card.sheet.old { opacity: .7; }
.inline-edit select { font-size: .8rem; padding: 5px 7px; min-height: 36px; }

body.pv-open { overscroll-behavior: none; }
.pv { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; background: #e9ecee; color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; animation: fadein .15s; }
.pv-top { display: flex; align-items: center; gap: 2px; padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left));
  background: #fff; border-bottom: 1px solid var(--line2); min-height: 56px; z-index: 3; font-size: 15px; }
.pv-ib { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 22px; color: var(--ink); justify-content: center; padding: 0; border-radius: 8px; }
.pv-ib:disabled { opacity: .3; }
.pv-ib.on { background: var(--grey-soft); }
.pv-ib svg, .pv-tool svg, .pv-zoom svg { width: 23px; height: 23px; display: block; }
.pv-title { border: 0; background: transparent; display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; padding: 4px 22px 4px 6px; position: relative; text-align: left; line-height: 1.15; }
.pv-title b { font-family: var(--display); font-stretch: 112%; font-size: 17px; }
.pv-title small { color: var(--muted); font-size: 13px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-caret { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }

.pv-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; background: #dfe3e6; }
.pv-stage.tool-select:active { cursor: grabbing; }
.pv-stage:not(.tool-select) { cursor: crosshair; }
.pv-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; --inv: 1; }
.pv-base { display: block; max-width: none !important; pointer-events: none; -webkit-user-drag: none; box-shadow: 0 2px 18px rgba(0,0,0,.18); background: #fff; image-rendering: auto; }
.pv-detail { position: absolute; display: none; pointer-events: none; }
.pv-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.pv-stage.tool-select .pv-hit { pointer-events: stroke; cursor: pointer; }
.pv-stage.tool-select .pv-hit-text { pointer-events: auto; cursor: pointer; }
.pv-label { pointer-events: none; }
.pv-hl { fill: rgba(255, 212, 59, .45); stroke: #f08c00; stroke-width: calc(2px * var(--inv)); }
.pv-hl.on { fill: rgba(240, 87, 16, .35); stroke: var(--accent-hi); }
.pv-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

.pv-pin { position: absolute; width: 34px; height: 34px; min-height: 0; padding: 0; margin: 0; border-radius: 50% 50% 50% 4px; border: 2px solid #fff; color: #fff; justify-content: center;
  transform: translate(-50%, -100%) scale(var(--inv)) rotate(-45deg); transform-origin: 50% 100%; box-shadow: 0 2px 8px rgba(0,0,0,.35); touch-action: none; }
.pv-pin > * { transform: rotate(45deg); }
.pv-pin svg { width: 17px; height: 17px; }
.pv-pin.note { background: var(--blue); }
.pv-pin.photo { background: var(--tatra-build); }
.pv-pin.punch { background: var(--accent); font-weight: 800; }
.pv-pin.punch.closed { background: var(--green); }
.pv-pin.punch.ready_for_review { background: var(--violet); }
.pv-pin.sel { outline: 3px solid #ffd43b; }
.pv-pin:active:not(:disabled) { transform: translate(-50%, -100%) scale(calc(var(--inv) * .92)) rotate(-45deg); }

.pv-zoom { position: absolute; right: max(10px, env(safe-area-inset-right)); top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.pv-zoom button { width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 22px; border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: var(--line2); }
.pv-float, .pv-ctx { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; display: flex; gap: 6px; align-items: center; z-index: 2;
  background: rgba(255,255,255,.97); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; box-shadow: 0 6px 22px rgba(0,0,0,.16); max-width: calc(100% - 20px); overflow-x: auto; animation: toastin .18s var(--ease); }
.pv-sw { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.pv-sw.on { box-shadow: 0 0 0 3px var(--ink); }
.pv-sw.big { width: 40px; height: 40px; }
.pv-tip { background: #fff; color: var(--muted); font-size: 13px; text-align: center; padding: 4px 10px; border-top: 1px solid var(--line2); min-height: 24px; }

.pv-tools { display: flex; align-items: stretch; background: #fff; border-top: 1px solid var(--line2); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); z-index: 3; }
.pv-toolrow { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.pv-toolrow::-webkit-scrollbar { display: none; }
.pv-side { display: flex; border-left: 1px solid var(--line2); }
.pv-tool { flex: none; min-width: 58px; min-height: 60px; border: 0; border-radius: 0; background: transparent; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 4px;
  color: var(--muted); font-size: 11px; font-weight: 600; scroll-snap-align: start; }
.pv-tool small { font-size: 11px; font-stretch: 86%; }
.pv-tool.on { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 3px 0 var(--accent-hi); }
.pv-tool:disabled { opacity: .35; }
.pv-dot { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--c); background: var(--c); position: relative; }
.pv-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: var(--w); height: var(--w); max-width: 12px; max-height: 12px; min-width: 3px; min-height: 3px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; }

.pv-pop { position: absolute; z-index: 5; background: #fff; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 10px; animation: pop .14s var(--ease); }
.pv-pop-t { top: calc(62px + env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); width: min(300px, calc(100vw - 16px)); }
.pv-pop-b { bottom: calc(96px + env(safe-area-inset-bottom)); right: max(8px, env(safe-area-inset-right)); }
.pv-colors { display: flex; gap: 8px; }
.pv-search { flex-direction: row; flex-wrap: wrap; align-items: center; width: min(520px, calc(100vw - 16px)); }
.pv-search input { flex: 1 1 100%; }
.pv-text { position: absolute; z-index: 4; display: flex; gap: 6px; transform: translate(-6px, -50%); background: #fff; padding: 6px; border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.2); }
.pv-text input { width: min(260px, 60vw); font-weight: 700; }

.pv-sheets { position: absolute; z-index: 6; inset: calc(56px + env(safe-area-inset-top)) 0 0 0; background: var(--bg); display: flex; flex-direction: column; animation: sheetin .2s var(--ease); }
.pv-sheets-head { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line2); }
.pv-sheets-list { flex: 1; overflow-y: auto; padding: 10px 12px calc(20px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; align-content: start; }
.pv-sheetrow { display: flex; gap: 12px; align-items: center; text-align: left; white-space: normal; background: #fff; padding: 8px; min-height: 72px; }
.pv-sheetrow.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pv-sheetrow img { width: 84px; height: 56px; object-fit: contain; background: #fff; border: 1px solid var(--line2); border-radius: 3px; flex: none; }
.pv-sheetrow span { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 760px) {
  .pv-zoom { display: none; }
  .pv-tip { font-size: 12px; }
}
@media print {
  .pv { position: static; background: #fff; }
  .pv-top, .pv-tools, .pv-tip, .pv-zoom, .pv-ctx, .pv-float, .pv-pop { display: none !important; }
  .pv-stage { overflow: visible; }
  .pv-layer { position: static; transform: none !important; }
  .pv-base { width: 100%; height: auto; box-shadow: none; }
  .pv-svg { width: 100%; height: auto; }
}

/* ---------- 22. Document reader (files) ---------- */
.dv { background: #dfe3e6; }
.dv-bar { display: flex; align-items: center; gap: 6px; padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); background: #fff; border-bottom: 1px solid var(--line2); z-index: 3; flex-wrap: wrap; }
.dv-bar input { flex: 1 1 180px; min-width: 0; min-height: 40px; }
.dv-bar .muted { font-size: .85rem; white-space: nowrap; }
.dv-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; overscroll-behavior: contain; position: relative; }
.dv-content { padding: 12px; margin: 0 auto; min-height: 100%; position: relative; will-change: transform; }
.dv-page { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.dv-page canvas, .dv-page img { display: block; }
.dv-page small { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #8a949b; }
.dv-zoom, .dv .dv-zoom { display: flex; top: auto; bottom: max(16px, env(safe-area-inset-bottom)); }

/* ---------- 23. Truck care ---------- */
.truck a.tr-main { color: var(--ink); gap: 2px; }
.truck a.tr-main:hover { text-decoration: none; }
.truck a.tr-main:hover b { color: var(--accent); }
.truckstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.truckstats > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.truckstats small:first-child { color: var(--muted); font-size: .8rem; }
.truckstats b { font-size: 1.25rem; overflow-wrap: anywhere; }
.truckpage .cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.truckpage .cardhead h3 { margin: 0; }
.duelist { list-style: none; margin: 0 0 10px; padding: 0; }
.svcdue { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.svcdue:last-child { border-bottom: 0; }
.svcdue .due-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.svcdue .due-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svcdue .due-main small { color: var(--ink); }
.svcdue .due-main small.muted { color: var(--muted); }
.svcdue.over .due-main > small:first-of-type { color: var(--red); font-weight: 600; }
.svcdue .due-act { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.row.gap { display: flex; gap: 8px; flex-wrap: wrap; }
.list.svc li > a { cursor: pointer; }
.list.svc li small + small { color: var(--ink); }
.rcpt-thumb { display: block; max-width: 160px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; object-fit: cover; }
.card.mytruck { display: flex; flex-direction: column; gap: 6px; color: var(--ink); padding: 14px 16px; margin-bottom: 16px; border-left: 5px solid var(--green); }
.card.mytruck.soon { border-left-color: var(--amber); }
.card.mytruck.over { border-left-color: var(--red); }
.card.mytruck:hover { text-decoration: none; border-color: var(--accent-hi); }
.mytruck .mt-head { display: flex; justify-content: space-between; gap: 10px; font-size: 1.05rem; }

/* ---------- 24. Companies: W-9 & insurance ---------- */
.banner { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.banner.bad { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.banner.warn { background: var(--amber-soft); color: #7a4b00; border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.banner .button { margin-top: 6px; }
.co-list { display: flex; flex-direction: column; gap: 8px; }
.co-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--ink); flex-wrap: wrap; }
.co-row:hover { text-decoration: none; border-color: var(--accent-hi); }
.co-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.co-flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.co-info { margin: -6px 0 14px; overflow-wrap: anywhere; }
.companypage .cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.companypage .cardhead h3 { margin: 0; }
.companypage .pagehead h2 { margin: 0; }
.doclist { list-style: none; margin: 0 0 8px; padding: 0; }
.docrow { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.docrow:last-child { border-bottom: 0; }
.doc-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.doc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docrow.expired .doc-main > small:first-of-type { color: var(--red); font-weight: 600; }
.docrow.soon .doc-main > small:first-of-type { color: #7a4b00; font-weight: 600; }
.doc-act { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.linkish { background: none; border: 0; padding: 4px 0; min-height: 0; color: var(--blue); font-weight: 600; cursor: pointer; }
.badge.coi { margin-left: 6px; }

/* ---------- 25. Daily reports per job visit ---------- */
.jr-head { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; }
.jr-fields { display: flex; flex-direction: column; gap: 4px; }
.jr-box { border: 2px solid var(--accent-hi); border-radius: var(--radius); padding: 12px 14px 4px; margin: 6px 0 12px; background: #fff; }
.jr-box.done { border-color: var(--green); }
.jr-box h4 { margin: 0 0 8px; font-size: 1rem; }
.jr-box.done h4 { color: var(--green); }
.jr-skip { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; text-align: center; color: var(--muted); font-size: .9rem; }
.reportscard { margin-bottom: 16px; }
.reportscard h3 { margin-top: 0; }
.reportscard.owe { border-left: 5px solid var(--red); }
.jr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.jr-row:last-child { border-bottom: 0; }
.jr-row > div { display: flex; flex-direction: column; min-width: 0; }
.jr-owe { margin-top: 6px; }
.jr-owe > b { color: var(--red); display: block; margin-bottom: 2px; }

/* ---------- 26. Account (phone sheet + desktop menu) ---------- */
.acct { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 6px; color: var(--ink); }
.dropdown .acct { width: 360px; padding: 14px; }
.acct-head { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.acct-av { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; box-shadow: 0 4px 12px rgba(200,67,10,.3); }
.acct-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acct-who b { font-family: var(--display); font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.acct-who small { color: var(--muted); overflow-wrap: anywhere; }
.acct-role { align-self: flex-start; margin-top: 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: #fff;
  border: 1px solid var(--accent-hi); border-radius: 99px; padding: 2px 10px; }
.acct-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.acct .acct-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink);
  font-size: 1rem; transition: transform .12s var(--ease), box-shadow .12s; min-width: 0; }
.acct .acct-tile:hover, .acct .acct-tile:active { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.acct-tile b { font-size: 1.02rem; }
.acct-tile small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.acct-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 6px; }
.acct-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.c-orange .acct-ic { background: var(--accent-soft); color: var(--accent); }
.c-blue .acct-ic { background: var(--blue-soft); color: var(--blue); }
.c-green .acct-ic { background: var(--green-soft); color: var(--green); }
.c-violet .acct-ic { background: var(--violet-soft); color: var(--violet); }
.c-ink .acct-ic { background: var(--grey-soft); color: var(--ink); }
.acct-size { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.acct-size > div:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 150px; }
.acct-size small { color: var(--muted); font-size: .8rem; }
.acct-size .seg button { min-height: 44px; padding: 4px 14px; color: var(--ink); }
.acct-size .seg button.on { color: #fff; }
.acct .acct-out { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border-radius: 14px; background: #fff;
  border: 1px solid var(--red-soft); color: var(--red); font-weight: 700; font-size: 1rem; }
.acct-out span { display: inline-flex; }
.acct-out svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acct .acct-out:hover { background: var(--red-soft); }
.sheet .acct a.acct-tile { padding: 14px; font-size: 1rem; }
.dropdown:has(.acct) { background: var(--bg); border-radius: 16px; }

/* ---------- 27. Deposit on signed proposals ---------- */
.q-deposit { margin-top: 14px; padding: 16px; border: 2px solid var(--accent-hi); border-radius: 14px; background: linear-gradient(135deg, #fff, var(--accent-soft)); }
.q-deposit h3 { margin: 0 0 10px; }
.q-deposit .muted { margin: 8px 0 0; }
.q-paid { border-color: var(--green); }
.q-paynote { margin-top: 8px; }
.pay-btns a.button { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; white-space: normal; min-height: 56px; padding: 10px 16px; line-height: 1.25; }
.sub-can { background: var(--blue-soft); border-radius: 12px; padding: 12px 14px; }
.sub-can ul { margin: 6px 0; padding-left: 20px; }
.sub-can li { margin: 2px 0; }
.c-teal .acct-ic { background: #e6f5f3; color: #0f6b62; }

/* ---------- 28. Time off ---------- */
.to-balance { background: linear-gradient(135deg, #fff 0%, #e6f5f3 100%); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.to-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.to-big b { font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; color: #0f6b62; }
.to-big span { font-weight: 600; }
.to-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.to-list { list-style: none; margin: 0; padding: 0; }
.to-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.to-row:last-child { border-bottom: 0; }
.to-row.cancelled, .to-row.denied { opacity: .75; }
.to-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; }
.to-dates { font-weight: 700; }
.to-act { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.to-type { display: flex; margin-top: 6px; }
.to-type button { flex: 1; min-height: 46px; }
.to-sum { background: var(--grey-soft); border-radius: 10px; padding: 10px 12px; margin: 0; }
.to-sum.bad { background: var(--red-soft); color: var(--red); }
.card.to-pending { border-left: 5px solid var(--amber); }
.to-days { width: 70px; text-align: right; padding: 6px 8px; min-height: 40px; }
.to-table td, .to-table th { white-space: nowrap; }
.to-table { width: 100%; }
.to-table td:first-child { white-space: normal; }
.to-wait { display: block; font-weight: 500; }
@media (max-width: 480px) { .to-table th, .to-table td { padding-left: 6px; padding-right: 6px; } .to-days { width: 56px; } }
.acct .acct-pw { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 1rem; }
.acct-pw span { display: inline-flex; }
.acct-pw svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.te-edit { font-size: .8rem; font-weight: 700; color: var(--blue); white-space: nowrap; }

/* ---------- 29. Project → Time ---------- */
.card.onsite { border-left: 5px solid var(--line); }
.card.onsite.live { border-left-color: var(--green); background: linear-gradient(135deg, #fff, var(--green-soft)); }
.card.onsite h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.os-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0 0; }
.ptime-stats { margin-bottom: 10px; }
.ptime-actions { margin-bottom: 8px; }
.ptime-people { margin: 4px 0 14px; }
.ptime-day h4 { display: flex; justify-content: space-between; margin: 0 0 6px; }
.pt-entry { border-top: 1px solid var(--line2); padding: 10px 0; }
.pt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-top[role=button] { cursor: pointer; }
.pt-report { margin: 6px 0 0; padding: 8px 12px; background: var(--grey-soft); border-radius: 10px; }
.pt-report p { margin: 0 0 4px; }
.pt-noreport { margin: 6px 0 0; color: var(--amber); font-size: .9rem; }
.card.onsite { margin-bottom: 14px; }
.inv-item .qbo-item { flex-basis: 100%; display: flex; flex-direction: column; gap: 2px; }
.inv-item .qbo-item small { color: var(--muted); }
.inv-item .qbo-item select { min-height: 40px; font-size: .9rem; }
.item-map .field select { width: 100%; }
.item-list { margin-top: 10px; }
.item-list summary { cursor: pointer; font-weight: 600; color: var(--blue); padding: 6px 0; }
.item-list input { margin: 6px 0; }
.inv-item { flex-wrap: wrap; }

/* ---------- 30. Clients & import ---------- */
.clientpage .cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.clientpage .cardhead h3, .clientpage .pagehead h2 { margin: 0; }
.importer section.card p { margin: 6px 0 10px; }
.import-log { font-family: var(--mono, ui-monospace, monospace); font-size: .85rem; line-height: 1.6; }

/* ---------- 31. On-the-clock job shortcuts ---------- */
.jobshort h3 { margin: 0 0 10px; }
.jobshort h3:has(+ .js-addr) { margin-bottom: 2px; } .jobshort .js-addr { margin: 0 0 10px; }
.js-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 8px; }
.js-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--bg); color: var(--ink); font-weight: 600; font-size: .85rem; text-align: center; }
.js-grid a:hover { text-decoration: none; background: var(--accent-soft); }
.js-ic svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.list.crew li { align-items: center; }
.crew-act { display: flex; gap: 6px; }

/* ---------- 32. Admin home ---------- */
.adm-group { margin-bottom: 22px; }
.adm-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 2px; font-family: var(--body, inherit); font-weight: 700; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.adm-tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.adm-tile:hover { text-decoration: none; border-color: var(--accent-hi); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.adm-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.adm-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.t-blue .adm-ic { background: var(--blue-soft); color: var(--blue); }
.t-green .adm-ic { background: var(--green-soft); color: var(--green); }
.t-orange .adm-ic { background: var(--accent-soft); color: var(--accent); }
.t-grey .adm-ic { background: var(--grey-soft); color: var(--ink); }
.adm-txt { display: flex; flex-direction: column; min-width: 0; }
.adm-tile.has-count .adm-txt { padding-right: 26px; }
.adm-txt b { font-size: 1.02rem; }
.adm-txt small { color: var(--muted); font-size: .82rem; }
.adm-count { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--red); color: #fff; font-style: normal; font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.admin-sub .crumb { display: inline-block; margin-bottom: 4px; }

/* =====================================================================
   33. One look everywhere — filters, actions, empty states, sections
   ===================================================================== */
/* every filter row (Open / Active / All …) uses the same pill chips */
.toolbar .seg, .pagehead .seg { display: inline-flex; flex-wrap: wrap; gap: 6px; border: 0; background: none; overflow: visible; border-radius: 0; }
.toolbar .seg button, .pagehead .seg button { min-height: 40px; border-radius: 999px; padding: 6px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; }
.toolbar .seg button + button, .pagehead .seg button + button { border-left: 1px solid var(--line); }
.toolbar .seg button.on, .pagehead .seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips .chip { border: 1px solid var(--line); }
/* the main "+ Add" action always sits on the right of its row */
.toolbar > .primary:last-child, .toolbar > label.primary:last-child, .toolbar > button.primary:last-of-type { margin-left: auto; }
/* empty states look the same on every page */
.empty { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: 36px 20px; }
.card .empty, .empty .empty { background: none; border: 0; padding: 20px 8px; }
/* sections inside a card are clearly separated */
.card > h3:first-child, .card > .cardhead, .card > .toolbar:first-child h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line2); margin-bottom: 12px; }
.card > .cardhead h3, .card > .toolbar:first-child { margin-bottom: 0; }
.card > .toolbar:first-child { padding-bottom: 8px; border-bottom: 1px solid var(--line2); margin-bottom: 12px; }
.card > .toolbar:first-child h3 { padding: 0; border: 0; margin: 0; }
section.card + section.card, .card + .card:not(.co-row):not(.co-list > *) { margin-top: 14px; }
.co-list .card + .card { margin-top: 0; }
/* page titles carry a small colour mark for the area you're in */
.pagehead > h1::before, .admin-sub .pagehead > h1::before { content: ''; width: 6px; align-self: stretch; min-height: 1.1em; border-radius: 3px; background: var(--area, var(--accent-hi)); flex: 0 0 auto; }
body[data-area="my"], body[data-area="time"], body[data-area="timeoff"], body[data-area="expenses"] { --area: var(--tatra-build); }
body[data-area="sales"], body[data-area="lead"], body[data-area="est"], body[data-area="money"], body[data-area="inv"] { --area: #12557d; }
body[data-area="msg"] { --area: #5b3fa0; }
body[data-area="fleet"], body[data-area="truck"] { --area: #0f6b62; }
body[data-area="admin"] { --area: #141a1f; }
body[data-area="p"], body[data-area="projects"] { --area: #f05710; }
/* project page: tabs fade at the edge so it's obvious they scroll */
.project .tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }

/* ---------- 34. Typing on a phone: no bottom bar, nothing pinned above the keyboard ---------- */
@media (max-width: 760px) {
  body.kb-open { --nav-total: 0px; }
  body.kb-open .bottomnav, body.kb-open .clockbanner { display: none; }
  body.kb-open .composer { bottom: 0; padding-bottom: 8px; }
  body.kb-open .est-totals { display: none; }
}

/* 35. account footer: privacy, terms, delete account */
.acct .acct-legal { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.acct .acct-legal a, .acct .acct-legal .linkish { color: var(--muted); text-decoration: underline; background: none; border: 0; padding: 4px 2px; font: inherit; min-height: 0; }
.acct .acct-legal .linkish { color: var(--red, #c62828); }
.savebar button.danger { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; } .savebar button.danger:disabled { opacity: .45; }

/* 36. new estimate for an existing client */
.card .cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card .cardhead h3 { margin: 0; }
.modal .pick-list { margin-top: 6px; width: 100%; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.modal .pick-list option { padding: 8px 6px; border-radius: 6px; }
.sales .pagehead { align-items: center; }
.sales .sales-actions { flex: 0 0 auto; }
@media (max-width: 760px) { .sales .sales-actions { flex-basis: 100%; } .sales .sales-actions button { flex: 1; } }

/* 37. duplicate products & services */
.dups { margin: 10px 0; }
.dup-group { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 8px 0; }
.dup-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line2); }
.dup-row:first-child { border-top: 0; }
.dup-row > span:first-of-type { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dup-row.keep { background: var(--green-soft, #eef8f0); border-radius: 8px; }
.dup-row.drop b { text-decoration: line-through; color: var(--muted); }

/* 38. sales tax on invoices */
.inv-item .tax-check { font-size: .85rem; white-space: nowrap; align-self: center; }
.inv-tax { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 4px 0; color: var(--muted); }
.inv-tax label { display: inline-flex; align-items: center; gap: 6px; }
.inv-tax input { width: 64px; min-height: 34px; text-align: right; }
.inv-tax b { min-width: 110px; text-align: right; color: var(--ink); }
.q-totalbox .q-discnote { margin: 8px 0 0; font-size: .9rem; color: var(--muted); text-align: left; }
.q-bankopt { align-items: flex-start; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.q-bankopt small { display: block; margin-top: 4px; }

/* 39. send email with preview */
.send-tabs { margin-bottom: 12px; }
.send-email { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.send-preview { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.send-preview iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 10px; background: #f2f5f6; }
.send-preview-empty { height: 200px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; }
@media (max-width: 760px) { .send-email { grid-template-columns: 1fr; } .send-preview iframe { height: 420px; } }

/* 40. Lead photos from the website request form */
.lead-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.lead-photos a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--soft, #f2f5f6); }
.lead-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 41. CARE+ (tatra.care plans and visits) */
.care-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.care-stats > .card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; margin: 0 !important; }
.care-stats b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.care-tabs { margin-bottom: 12px; }
.care-list { padding: 4px 16px; }
.care-past { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 14px; margin: 0 0 10px; border: 1px solid var(--line); border-left: 4px solid var(--brand, #e8641b); border-radius: 8px; background: var(--card, #fff); }
.care-clean { max-height: 55vh; overflow: auto; margin: 8px 0 14px; }
.care-clean-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.care-clean-row input { margin-top: 3px; }
.care-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.care-row:first-child { border-top: 0; }
.care-when { min-width: 92px; display: flex; flex-direction: column; }
.care-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.care-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.care-billing .check { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) { .care-stats { grid-template-columns: 1fr 1fr; } .care-row { flex-wrap: wrap; } .care-end { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; } }
.care-from { max-width: 340px; margin: 10px 0; }

/* 42. CARE+ billing: payment options, checks, authorization */
.good { color: var(--green); }
.warn { color: var(--amber); }
.care-checks h3 { margin: 0 0 8px; }
.care-check { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 0; cursor: pointer; font: inherit; color: inherit; }
.care-check:first-of-type { border-top: 0; }
.care-check span { color: var(--muted); }
.care-check.bad span { color: var(--red); }
.care-check.warn span { color: var(--amber); }
.care-plan[role=button] { cursor: pointer; }
.care-plan[role=button]:hover { background: color-mix(in srgb, var(--line) 30%, transparent); }
.care-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.care-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.care-opt { display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; position: relative; }
.care-opt.on { border-color: var(--brand, var(--ink)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, var(--ink)) 20%, transparent); }
.care-opt input { position: absolute; opacity: 0; pointer-events: none; }
.care-price { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.care-price small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.care-ach, .care-auth { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.care-auth h3 { margin: 0; }
.care-auth p { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.care-ach-form, .care-send { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.care-send input { flex: 1; min-width: 200px; }
.care-view { margin-top: 12px; }
.care-view iframe { width: 100%; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.care-invs { display: flex; flex-direction: column; }
.care-inv { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .care-opts { grid-template-columns: 1fr; } }
.care-ach h3 { margin: 0; }
.care-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; counter-reset: s; }
.care-steps li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 0 9px 34px; border-top: 1px solid var(--line); position: relative; counter-increment: s; }
.care-steps li:first-child { border-top: 0; }
.care-steps li::before { content: counter(s); position: absolute; left: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.care-steps li.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.care-achforms { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.care-achforms > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.care-achforms > div > span { flex: 1; min-width: 180px; }
.care-achforms > button { align-self: flex-start; }
.care-steps li.care-legacy { padding-left: 0; counter-increment: none; }
.care-steps li.care-legacy::before { display: none; }
.care-legacy details { width: 100%; }
.care-legacy .care-steps { margin-top: 6px; }
.care-steps li > span { flex: 1; min-width: 180px; }

/* 43. Cost codes & accounts */
.accts-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.accts-bar input[type=search] { flex: 1; min-width: 220px; }
.acct { padding: 10px 16px; margin-bottom: 10px; }
.acct-head { display: flex; gap: 10px; align-items: center; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.acct-items { list-style: none; margin: 0; padding: 0; }
.acct-items li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 7px 0 7px 22px; border-top: 1px solid var(--line); }
.acct-items li:first-child { border-top: 0; }
.acct-items li .check { display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 0; }
.acct-items li .check span { display: flex; flex-direction: column; min-width: 0; }
.acct-items li.off b { color: var(--muted); font-weight: 500; }
.codes-table { padding: 6px 14px; }
.codes-row { display: grid; grid-template-columns: 44px 110px minmax(140px, 1fr) minmax(220px, 1.4fr) 40px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.codes-row.head { border-top: 0; font-size: .8rem; color: var(--muted); font-weight: 600; }
.codes-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.codes-row input:not([type=checkbox]), .codes-row select { width: 100%; }
.codes-row.off input:not([type=checkbox]) { color: var(--muted); }
@media (max-width: 760px) { .codes-row { grid-template-columns: 34px 80px 1fr; } .codes-row > span:nth-child(4) { grid-column: 2 / -1; } .codes-row > span:nth-child(5) { grid-column: 3; justify-self: end; } .codes-row.head { display: none; } }

/* 44. Sales: Pipeline / Clients tabs */
.sales-tabs { margin: 0 0 14px; }
.seg a { padding: 8px 16px; color: var(--muted); text-decoration: none; font-weight: 600; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: var(--ink); color: #fff; }
.pick-client { display: flex; flex-direction: column; gap: 6px; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-ctl); }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-radius: 0; padding: 9px 12px; }
.pick-list button:hover { background: color-mix(in srgb, var(--line) 35%, transparent); }
.pick-list li.muted { padding: 10px 12px; }
.pick-list .pick-addr { font-size: .95em; }
.pick-chosen { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 8px 12px; }
.pick-chosen span { display: flex; flex-direction: column; }
.banner.good { background: var(--green-soft); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.mail-check { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.pick-add button b { color: var(--brand, var(--accent, #c7400a)); }
.pick-new { border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 10px 12px; }
.care-bill, .care-agr { display: flex; flex-direction: column; gap: 10px; }
.care-eq { list-style: none; margin: 0; padding: 0; columns: 2 240px; }
.care-eq li { display: flex; flex-direction: column; padding: 5px 0; break-inside: avoid; }
.care-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .care-head p { margin: 0; }

/* 45. One Tatra ID — CARE+ links */
.care-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; margin-bottom: 14px; text-decoration: none; color: inherit; border-left: 4px solid var(--accent, #c8102e); }
.care-link:hover { background: var(--hover, rgba(0,0,0,.03)); }
.care-tid { margin-top: 6px; }

/* 46. Client page (Jobber-style: details, properties, contacts, work overview, billing; overview, tags, notes on the side) */
.cp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cp-grid { grid-template-columns: minmax(0, 1fr); } }
.cp-main, .cp-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cp-main > .card, .cp-aside > .card { margin: 0; }
.cp-head h2 { margin: 0; font-size: 1.6rem; }
.cp-co { margin: 0; color: var(--muted); font-weight: 600; }
.cp-flags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.cp-flags a.badge { text-decoration: none; }
.cp-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 10px 0 0; }
.cp-kv dt { color: var(--muted); font-size: .88rem; }
.cp-kv dd { margin: 0; overflow-wrap: anywhere; }
.cp-table { width: 100%; border-collapse: collapse; }
.cp-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.cp-table td { padding: 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.cp-table tr.click { cursor: pointer; }
.cp-table tr.click:hover td { background: var(--grey-soft); }
.cp-table .num { text-align: right; white-space: nowrap; }
.cp-table td.good { color: var(--green); }
.cp-acts { white-space: nowrap; text-align: right; }
.cp-pager { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cp-search { max-width: 200px; }
.cp-bill { display: flex; flex-direction: column; margin: 0 0 8px; }
.cp-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.cp-filters select { width: auto; }
.cp-side h3 { margin-top: 0; }
.cp-money { display: flex; flex-direction: column; gap: 10px; }
.cp-money > div { display: flex; flex-direction: column; }
.cp-money b { font-size: 1.5rem; font-family: var(--display); }
.cp-money .bad { color: var(--red); }
.cp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cp-tags .linkish { padding: 0 0 0 2px; font-size: .75rem; }
.cp-noteform { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cp-noteform button { align-self: flex-end; }
.cp-note { border-top: 1px solid var(--line2); padding: 8px 0; }
.cp-note.pinned { background: var(--amber-soft); margin: 0 -10px; padding: 8px 10px; border-radius: var(--radius); border-top: 0; }
.cp-notehead { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cp-note p { margin: 4px 0 0; }
.cp-extras { display: flex; flex-direction: column; gap: 6px; }
.cp-extras .cp-lbl { max-width: 110px; }
.cp-sm { display: none; }
@media (max-width: 760px) { .cp-sm { display: inline; } }
.cp-side form.row { display: flex; gap: 6px; }
.cp-side form.row input { flex: 1; min-width: 0; }
.cp-extras .row.gap { flex-wrap: nowrap; }
.cp-extras .row.gap input:not(.cp-lbl) { flex: 1; min-width: 0; }
.cp-extras .cp-lbl { max-width: 160px; flex: 0 0 160px; }
.cp-extras .linkbtn { align-self: flex-start; }

/* 47. Statements */
.cp-baltag { white-space: nowrap; }
.st-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.st-controls .seg { flex-wrap: wrap; }
.st-preview { border: 1px solid var(--line); border-radius: var(--radius); max-height: 60vh; overflow: auto; background: #fff; }
.st-preview .quote { margin: 0; box-shadow: none; }
.st-send { flex-wrap: wrap; }
.st-send input[type=email] { width: auto; min-width: 220px; flex: 0 1 280px; }
.statement .st-table td, .statement .st-table th { white-space: nowrap; }
.statement .st-table td:nth-child(2) { white-space: normal; }
.statement .st-h { margin: 22px 0 6px; font-size: 1rem; }
.statement .st-aging { margin-top: 10px; }
.statement .st-late { color: var(--red); }
.statement .st-open td { background: var(--grey-soft); }
.statement .st-paid { margin: 18px 0; }
.statement .st-foot { margin-top: 18px; }
.est-desc .est-prod { display: block; font-size: .78rem; line-height: 1.2; }
.q-table .q-name { font-weight: 700; }
.inv-item textarea.details { font-size: .85rem; min-height: 0; resize: vertical; }
.inv-item .grow label.qbo-item { width: auto; flex-basis: auto; }
.cat-table tr.off td { color: var(--muted); }
.cat-table select { max-width: 320px; font-size: .85rem; }

/* 48. Sections on estimates and invoices */
.blk-title { font-family: var(--display); font-weight: 800; font-size: 1.05rem; margin: 0; }
input.blk-title { border: 1px solid transparent; background: transparent; padding: 4px 6px; margin-left: -6px; flex: 1; min-width: 0; max-width: 520px; border-radius: var(--radius-ctl); }
input.blk-title:hover { border-color: var(--line); background: var(--panel); }
input.blk-title:focus { border-color: var(--field-line); background: var(--panel); outline: none; }
.est-sec-head.nohead input.blk-title { font-weight: 500; font-size: .9rem; color: var(--muted); }
.blk-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel); }
.blk-add input { flex: 1; min-width: 220px; }
.blk-or { font-size: .85rem; }
.inv-blk { display: flex; flex-direction: column; gap: 10px; }
.inv-blk + .inv-blk { margin-top: 6px; }
.inv-blk-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--grey-soft); border-radius: var(--radius); }
.inv-blk .add-line { align-self: flex-start; }
.tx { display: flex; flex-direction: column; gap: 12px; }
.tx .seg { flex-wrap: wrap; }
.tx-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-sub.q-only { color: var(--q-ink, inherit); font-size: inherit; }

/* 49. Today — company at a glance */
.today .td-date { margin: 2px 0 0; }
.td-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.td-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); color: var(--ink); text-decoration: none; border-top: 3px solid var(--line); }
.td-tile:hover { text-decoration: none; border-color: var(--line); }
.td-tile small { color: var(--muted); font-size: .8rem; }
.td-tile b { font-family: var(--display); font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.td-tile span { color: var(--muted); font-size: .82rem; }
.td-tile.go { border-top-color: var(--green); }
.td-tile.warn { border-top-color: var(--amber); }
.td-tile.bad { border-top-color: var(--red); }
.td-tile.bad b { color: var(--red); }
.td-attn ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.td-attn a.bad { color: var(--red); font-weight: 600; }
.td-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .td-grid { grid-template-columns: minmax(0, 1fr); } }
.td-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.td-col > .card { margin: 0; }
.td-list { list-style: none; margin: 0; padding: 0; }
.td-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line2); }
.td-list li:first-child { border-top: 0; }
.td-main { display: flex; flex-direction: column; flex: 1; min-width: 0; color: inherit; }
.td-main small { overflow-wrap: anywhere; }   /* dates and notes wrap instead of being cut off */
.td-side { flex: 0 0 auto; }
a.td-main:hover { text-decoration: none; }
a.td-main:hover b { text-decoration: underline; }
.td-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.td-side b.bad { color: var(--red); }
.td-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: 0 0 9px; }
.td-dot.go { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.td-notin { margin: 10px 0 0; }
.td-job { padding: 8px 0; border-top: 1px solid var(--line2); }
.td-job:first-of-type { border-top: 0; }
.td-job ul { list-style: none; margin: 4px 0 0; padding: 0; }
.td-job li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 3px 0 3px 12px; border-left: 2px solid var(--line2); margin: 3px 0; }
.td-job li small { grid-column: 1; }
.td-job li .td-pct { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: .85rem; }
.td-fu { margin-top: 8px; }
.td-fu summary { cursor: pointer; }
.td-fu summary.bad { color: var(--red); }
.td-attn { margin: 0 0 16px; }
.qb-what { border: 1px solid var(--line2); border-radius: var(--radius); padding: 8px 12px 10px; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.qb-what legend { font-weight: 700; padding: 0 4px; }
.qb-what .check { align-items: flex-start; }
.banner.ok { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.qb-paused { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }

/* 50. QuickBooks sync log */
.synclog .toolbar input[type=search] { max-width: 220px; }
.sl-run { border-top: 1px solid var(--line2); }
.sl-run.bad .sl-head { background: var(--red-soft); }
.sl-head { display: grid; grid-template-columns: 170px 170px minmax(0, 1fr) 20px; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 10px 6px; cursor: pointer; color: inherit; font: inherit; }
.sl-head:hover { background: var(--grey-soft); }
.sl-head > span { display: flex; flex-direction: column; min-width: 0; }
.sl-counts { flex-direction: row !important; flex-wrap: wrap; gap: 4px; }
.sl-chev { color: var(--muted); }
.sl-items { margin: 0 0 10px; font-size: .9rem; }
.sl-items tr.bad td { color: var(--red); }
.sl-items .sl-t { white-space: nowrap; color: var(--muted); width: 90px; }
@media (max-width: 760px) { .sl-head { grid-template-columns: minmax(0, 1fr) 20px; } .sl-head .sl-who, .sl-head .sl-counts { grid-column: 1; } }

/* 51. Statement reconciliation */
.recon .toolbar p.grow { margin: 0; flex: 1; min-width: 240px; }
.recon .pagehead { flex-wrap: wrap; gap: 8px; align-items: center; }
.recon .pagehead h2 { margin: 0; }
.rc-table td { vertical-align: middle; }
.rc-table tr.off td { color: var(--muted); }
.rc-d { white-space: nowrap; width: 80px; color: var(--muted); }
.rc-exp { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.rc-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rc-preview { max-height: 300px; overflow: auto; border: 1px solid var(--line2); border-radius: var(--radius); }

/* Project → Cost-plus billing */
.costplus .card { margin-top: 14px; }
.cpb td { font-size: .92rem; }
.cpb .cp-tick { width: 34px; }
.cpb .cp-tick input { width: 22px; height: 22px; }
.cpb .cp-act { white-space: nowrap; text-align: right; }
.cpb .rc-d { white-space: nowrap; color: var(--muted); }
.cpb tr.on td { background: var(--green-soft, #eaf6ee); }
.cpb tr.warn:not(.on) td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.cp-make .cp-kv, .ts-bill .cp-kv { max-width: 560px; margin-bottom: 12px; grid-template-columns: minmax(0, 1fr) max-content; }
.cp-make .cp-kv dd, .ts-bill .cp-kv dd { text-align: right; overflow-wrap: normal; }
.cp-make .primary { margin-right: 10px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.field-inline input { width: auto; }


/* Billing type, check / wire discount */
.billing .bill-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.bill-type { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); white-space: normal; min-height: 64px; }
.bill-type small { color: var(--muted); font-weight: 500; line-height: 1.3; }
.bill-type.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bill-type.on b::before { content: '✓ '; }
.ms-edit input { width: 100%; }
.inv-disc { margin: 4px 0 12px; }
.disc-box { background: var(--grey-soft, #f4f5f5); border-radius: var(--radius); padding: 10px 12px; }
.disc-box p { margin: 6px 0 0; }
.pay-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 14px; }
.pay-switch.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .pay-switch.three { grid-template-columns: 1fr; } .pay-switch.three button { min-height: 0; flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; } }
.pay-switch button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); white-space: normal; min-height: 92px; }
.pay-switch button small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.pay-switch button b { font-size: 1.35rem; }
.pay-switch button span { font-size: .85rem; color: var(--muted); }
.pay-switch button.on { border-color: var(--accent, #d4512b); box-shadow: 0 0 0 1px var(--accent, #d4512b); }
.pay-switch button.on span { color: var(--green, #2e7d32); font-weight: 600; }
.pay-offline p { margin: 8px 0; }
@media print { .pay-switch, .pay-offline { display: none; } }

/* Paid leave on timesheets; time-off calendar */
.td-dot.warn { background: var(--amber); }
.leave-t { color: #0f6b62; font-weight: 600; }
.ts-entry.leave { background: #eef7f5; }
.ts-entry.leave.sick { background: #fdf3e7; }
.ts-entry.leave.holiday { background: #eef1fb; }
.ts-entry.leave .te-main b::before { content: '● '; color: #0f6b62; }
.ts-entry.leave.sick .te-main b::before { color: #b26a00; }
.ts-entry.leave.holiday .te-main b::before { color: #3f51b5; }
.ts-days div.leave { background: #e3f3f0; color: #0f6b62; }
.ts-days div.leave.sick { background: #fbecd9; color: #8a5200; }
.ts-days div.leave.holiday { background: #e6eafa; color: #2f3e9e; }
.ts-days div i { font-style: normal; font-size: .7rem; font-weight: 700; }
.kind-seg { display: flex; width: 100%; }
.kind-seg button { flex: 1; min-height: 42px; }
.to-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.to-scroll { overflow-x: auto; padding: 0; }
.to-grid { border-collapse: collapse; font-size: .85rem; min-width: 100%; }
.to-grid th, .to-grid td { border: 1px solid var(--line2); padding: 4px 3px; text-align: center; min-width: 26px; }
.to-grid th { font-weight: 600; background: var(--panel); position: sticky; top: 0; }
.to-grid th small { display: block; color: var(--muted); font-weight: 500; font-size: .7rem; }
.to-grid .to-who { text-align: left; white-space: nowrap; padding: 4px 10px; position: sticky; left: 0; background: #fff; z-index: 1; font-weight: 600; }
.to-grid .we { background: #f3f4f4; }
.to-grid .now { box-shadow: inset 0 0 0 2px var(--accent, #d4512b); }
.to-grid tfoot td.busy { color: var(--red); font-weight: 700; }
.to-year td { min-width: 54px; }
.tc { display: inline-block; min-width: 22px; padding: 1px 4px; border-radius: 4px; font-style: normal; font-weight: 700; font-size: .72rem; margin: 1px; }
.tc.pto { background: #cfeee8; color: #0f6b62; }
.tc.unpaid { background: #e4e4e4; color: #444; }
.tc.pending { background: repeating-linear-gradient(45deg, #fff4dc, #fff4dc 4px, #ffe6a8 4px, #ffe6a8 8px); color: #7a5300; }
.tc.sick { background: #fbe0bd; color: #8a5200; }
.tc.holiday { background: #dfe4fb; color: #2f3e9e; }
.leave-pick { background: #eef7f5; border: 1px solid #cfe7e2; border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.leave-pick .chip.on { background: #0f6b62; border-color: #0f6b62; }

/* Supplier bills inbox */
.chip-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent, #d4512b); color: #fff; font-size: .75rem; font-weight: 700; }
.chip.on .chip-n { background: #fff; color: var(--ink); }
.bills-bar { flex-wrap: wrap; gap: 8px; }
.bills-table td { vertical-align: top; }
.bills-help ol { margin: 6px 0 8px 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.exp-pdf { display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; color: #b3261e; background: #fdecea; }
.bill-review { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bill-doc { display: flex; flex-direction: column; gap: 8px; }
.bill-doc iframe { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.bill-doc img { width: 100%; max-height: 68vh; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.bill-mail pre { white-space: pre-wrap; font: inherit; background: var(--panel); padding: 10px; border-radius: var(--radius); max-height: 50vh; overflow: auto; }
.bill-form { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 760px) { .bill-review { grid-template-columns: 1fr; } .bill-doc iframe { height: 50vh; } }


/* ===== Polish pass (Oct 2026) ===== */
/* phone-only lead list stays hidden on desktop (the board shows the same leads) */
.leadlist.show-sm { display: none; }
@media (max-width: 760px) { .leadlist.show-sm { display: grid; } }

/* a view switch inside a section: one joined control, so it doesn't read as a second row of page tabs */
.toolbar .seg.sub { gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); flex-wrap: nowrap; }
.toolbar .seg.sub button { border: 0; border-radius: 0; min-height: 36px; padding: 5px 14px; background: transparent; font-weight: 600; color: var(--muted); }
.toolbar .seg.sub button + button { border-left: 1px solid var(--line); }
.toolbar .seg.sub button.on { background: var(--ink); color: #fff; }

/* time-off calendar keeps its grid on the last row (tables drop the last row's border elsewhere) */
.to-grid tr:last-child td { border: 1px solid var(--line2); }

/* invoice: check / wire discount as a tidy strip */
.inv-disc { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
.inv-disc input { flex: 0 0 auto; }

/* job → invoices: billing card */
.billing { margin-bottom: 14px; }
.billing .bill-go { margin-top: 4px; }

/* cost-plus: make-invoice row */
.cp-make .cp-go { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* client pay choice fits small phones */
.pay-switch button { min-width: 0; padding: 12px 6px; }
.pay-switch button b { font-size: clamp(1.05rem, 5vw, 1.35rem); }
@media screen { .public.has-pay .q-howpay { display: none; } }

/* lists that are tables on a computer become stacked rows on a phone */
@media (max-width: 700px) {
  .cpb, .cpb tbody { display: block; }
  .cpb tr { display: grid; grid-template-columns: 30px 1fr auto; grid-template-areas: "tick date amt" "tick main main" "tick hrs act"; column-gap: 10px; row-gap: 2px; padding: 10px 6px; border-bottom: 1px solid var(--line2); }
  .cpb td { border: 0 !important; padding: 0; box-shadow: none !important; background: none !important; }
  .cpb tr.on { background: var(--green-soft, #eaf6ee); }
  .cpb tr.warn:not(.on) { box-shadow: inset 3px 0 0 var(--amber); }
  .cpb td:nth-child(1) { grid-area: tick; padding-top: 2px; }
  .cpb td:nth-child(2) { grid-area: date; }
  .cpb td:nth-child(3) { grid-area: main; }
  .cpb td:nth-child(4) { grid-area: hrs; text-align: left; }
  .cpb td:nth-child(4) br { display: none; }
  .cpb td:nth-child(4) small { margin-left: 6px; }
  .cpb td:nth-child(5) { grid-area: amt; }
  .cpb td:nth-child(6) { grid-area: act; }

  .bills-table thead { display: none; }
  .bills-table, .bills-table tbody { display: block; }
  .bills-table tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "sup amt" "what what" "rec rec"; gap: 2px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line2); }
  .bills-table td { border: 0 !important; padding: 0; }
  .bills-table td:nth-child(1) { grid-area: rec; font-size: .85rem; color: var(--muted); }
  .bills-table td:nth-child(1) br { display: none; }
  .bills-table td:nth-child(2) { grid-area: sup; }
  .bills-table td:nth-child(3) { grid-area: what; }
  .bills-table td:nth-child(4) { display: none; }
  .bills-table td:nth-child(5) { grid-area: amt; font-weight: 700; }
  .bills-bar .grow { display: none; }
}
/* side-by-side cards line up at the top */
.cols > .card + .card, .cols > section + section { margin-top: 0 !important; }
/* settings forms: each section heading starts a new group */
.grid2 > h3.span:not(:first-child) { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line2); }
/* cards laid out in a grid (templates, tiles) never get the stacked-card top gap */
.tpl-pick > .card, .adm-grid > *, .td-tiles > *, .stats > *, .bill-types > * { margin-top: 0 !important; }
/* page titles with a subtitle underneath get the same colour mark */
.pagehead h1.titled { display: flex; align-items: center; gap: 10px; }
.pagehead h1.titled::before { content: ''; width: 6px; align-self: stretch; min-height: 1.1em; border-radius: 3px; background: var(--area, var(--accent-hi)); flex: 0 0 auto; }
/* payment schedule (milestones) on a phone */
@media (max-width: 700px) {
  .ms-list, .ms-list tbody, .ms-list tfoot { display: block; }
  .ms-list tr { display: grid; grid-template-columns: 18px 1fr auto; grid-template-areas: "ck lab amt" "ck inv inv"; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
  .ms-list td { border: 0 !important; padding: 0; text-align: left !important; }
  .ms-list td:nth-child(1) { grid-area: ck; } .ms-list td:nth-child(2) { grid-area: lab; }
  .ms-list td:nth-child(3) { grid-area: amt; text-align: right !important; } .ms-list td:nth-child(4) { grid-area: inv; font-size: .88rem; }

  .ms-edit thead { display: none; }
  .ms-edit, .ms-edit tbody, .ms-edit tfoot { display: block; }
  .ms-edit tr { display: grid; grid-template-columns: 1fr 1fr 1fr 28px; grid-template-areas: "lab lab lab x" "pct usd tot x"; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line2); align-items: center; }
  .ms-edit td { border: 0 !important; padding: 0; }
  .ms-edit td:nth-child(1) { grid-area: lab; } .ms-edit td:nth-child(2) { grid-area: pct; } .ms-edit td:nth-child(3) { grid-area: usd; }
  .ms-edit td:nth-child(4) { grid-area: tot; text-align: right; } .ms-edit td:nth-child(5) { grid-area: x; }
  .ms-edit td input { width: 100% !important; }
  .ms-edit tbody td:nth-child(2) input::placeholder { color: var(--muted); }
  .ms-edit tfoot tr { grid-template-areas: "lab lab tot tot"; border: 0; }
  .ms-edit tfoot td:nth-child(2) { display: none; }
}

/* estimate payment schedule: just 50/50 or thirds */
.pay-pick { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); margin-bottom: 12px; }
.pay-pick button { border: 0; border-radius: 0; min-height: 36px; padding: 5px 16px; background: transparent; font-weight: 600; color: var(--muted); }
.pay-pick button + button { border-left: 1px solid var(--line); }
.pay-pick button.on { background: var(--ink); color: #fff; }
.payrow { grid-template-columns: 1fr 56px 110px; }
.payrow .pct { text-align: right; color: var(--muted); font-weight: 600; }
@media (max-width: 700px) { .payrow { grid-template-columns: 1fr 48px 92px; } }

/* payroll totals per person for a pay period */
.pr-card { padding: 18px; }
.pr-controls { display: grid; gap: 12px; margin-bottom: 14px; }
.pr-controls .seg { justify-self: start; }
.pr-controls .tx-period { display: flex; align-items: center; gap: 8px; }
.pr-warn { background: var(--amber-bg, #fff6e5); border: 1px solid var(--amber-line, #f1d9a8); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.pr-h { margin: 18px 0 8px; font-size: 15px; }
.pr-table { width: 100%; border-collapse: collapse; }
.pr-table th, .pr-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.pr-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.pr-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-table tr.zero td { color: var(--muted); }
.pr-table tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 600; }
.pr-table small.warnt { margin-left: 6px; font-weight: 600; }
@media (max-width: 700px) {
  .pr-card { padding: 14px; }
  .pr-controls .seg { justify-self: stretch; flex-wrap: wrap; }
  .pr-table thead { display: none; }
  .pr-table, .pr-table tbody, .pr-table tfoot, .pr-table tr, .pr-table td { display: block; width: 100%; }
  .pr-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
  .pr-table td { border: 0; padding: 2px 0; width: auto; }
  .pr-table td[data-l=""] { width: 100%; font-weight: 600; }
  .pr-table td.num[data-l]:not([data-l=""])::before { content: attr(data-l) " "; color: var(--muted); font-size: 12px; }
  .pr-table tbody td.num { text-align: left; }
  .pr-table tfoot tr { border-top: 2px solid var(--ink); }
  .pr-table tfoot td { border: 0; }
  .pr-table tfoot td.num { text-align: left; }
}
@media print {
  .pr-controls .seg, .pr-controls button, .pr-controls .check, .no-print, .timesheets > .toolbar { display: none !important; }
  .pr-card { border: 0; box-shadow: none; padding: 0; }
}
.pr-actions { flex-wrap: wrap; gap: 8px; }
.pcx { display: grid; gap: 10px; }
.pcx h4 { margin: 10px 0 0; }
.pcx-ids { display: grid; gap: 6px; }
.pcx-ids label { display: grid; grid-template-columns: 1fr 140px; gap: 10px; align-items: center; }
.pcx-how { background: var(--panel-2, #f4f2ee); border-radius: 10px; padding: 10px 12px; margin: 4px 0; }

/* admin "View as…" — picker, the phone / iPad panel beside the admin's own screen, and the bar inside it */
.viewas-bar { position: sticky; top: 0; z-index: 60; background: #5b3fd1; color: #fff; padding: 4px 12px; font-size: 13px; font-weight: 600; text-align: center; }
.viewas-q { width: 100%; margin: 6px 0 10px; }
.viewas-list { max-height: 55vh; overflow-y: auto; }
.viewas-list li { padding: 0; }
.viewas-item { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px; padding: 10px 8px; gap: 0 10px; }
.viewas-item:hover { background: var(--panel-2, #f4f2ee); }
.viewas-item small { grid-column: 1; }
.viewas-go { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; color: var(--accent, #e8561c); }
.va-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; background: #23252b; padding: 8px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: -8px 0 24px rgba(0,0,0,.18); }
.va-head { display: flex; align-items: center; gap: 6px; width: 100%; color: #fff; font-size: 14px; }
.va-head small { color: #c9b8ff; font-weight: 600; margin-left: 4px; }
.va-head > button { background: #3a3d45; color: #fff; border: 0; border-radius: 8px; min-height: 32px; min-width: 32px; padding: 0 8px; }
.va-head .va-dev { background: #3a3d45; border-color: #3a3d45; }
.va-head .va-dev button { color: #c8cbd2; padding: 4px 10px; min-height: 30px; }
.va-head .va-dev button.on { background: #fff; color: #23252b; }
.va-device { overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 0 0 6px #000; flex: none; }
.va-panel.ipad .va-device { border-radius: 16px; }
.va-device iframe { border: 0; display: block; transform-origin: 0 0; background: #fff; }
@media (min-width: 761px) { body.va-open .shell { margin-right: var(--va-w, 414px); } }
@media (max-width: 760px) { .va-panel { left: 0; padding: 6px 8px 8px; } .va-panel .va-device { box-shadow: none; border-radius: 12px; } }
.va-head > span:first-child { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.va-head .grow { display: none; }
.va-head .va-dev { flex: none; }
.va-head .va-dev button { padding: 4px 8px; }
.va-head .va-act { background: #3a3d45; color: #fff; border: 0; border-radius: 999px; padding: 0 12px; min-height: 32px; font-weight: 700; white-space: nowrap; }
.va-head .va-act.on { background: #d93025; }
.va-panel.acting { background: #5a1712; }
.va-panel.acting .va-head small { color: #ffb4ab; }
.va-panel.acting .va-device { box-shadow: 0 0 0 6px #d93025; }
.viewas-bar.acting { background: #d93025; }
.va-head { flex-wrap: wrap; row-gap: 6px; }
.va-head > span:first-child { flex: 1 0 100%; }
.va-head .va-act { margin-right: auto; }
/* translated team text: the small "Translated from … · see original" line */
.tx-note { display: block; white-space: normal; margin-top: 2px; }
.tx-note .linkish { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; padding: 0; min-height: 0; background: none; border: 0; }
.tx-preview { margin: 6px 0 0; padding: 8px 10px; background: var(--panel-2, #f4f2ee); border-radius: 8px; font-size: 14px; }
.tx-preview:empty { display: none; }
/* admins: erase a message / conversation */
.convo .pagehead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.danger-t { color: #c62828; }
.bubble-x { background: none; border: 0; padding: 0 2px; min-height: 0; color: inherit; opacity: .45; font-size: 12px; cursor: pointer; }
.bubble-x:hover { opacity: 1; color: #c62828; }
/* clock-out: automatic half-hour lunch, "Had no lunch" for short days */
.lunch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 4px 0 12px; background: var(--panel-2, #f4f2ee); border-radius: 12px; font-weight: 600; }
.lunch-row.off { background: #fff4e5; }
/* supply runs */
.cc-run { width: 100%; margin: 4px 0 2px; }
.cc-back { width: 100%; min-height: 56px; font-size: 19px; font-weight: 800; border: 0; border-radius: 14px; background: #1f6feb; color: #fff; margin: 4px 0 2px; }
.cc-status.run { color: #1f6feb; font-weight: 700; }
.clockbanner.run { background: #1f6feb; }
.run-pick { display: grid; gap: 8px; margin: 10px 0; }
.run-pick button { justify-content: flex-start; min-height: 52px; font-size: 17px; text-align: left; }
.clockcard .cc-status.run { color: #1f6feb; }
.cc-back { display: flex; align-items: center; justify-content: center; }
/* crew: My time → pay period (read only) */
.mypp { padding: 16px; }
.mypp .tx-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mypp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.mypp-tiles > div { background: var(--panel-2, #f4f2ee); border-radius: 12px; padding: 10px 12px; }
.mypp-tiles small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.mypp-tiles b { font-size: 22px; font-variant-numeric: tabular-nums; }
.mypp-tiles .ot b { color: #b26a00; }
.mypp-tiles .tot { background: var(--ink); color: #fff; }
.mypp-tiles .tot small { color: rgba(255,255,255,.7); }
.mypp-status { margin: 0 0 12px; }
.mypp-day { border-top: 1px solid var(--line); padding: 8px 0; }
.mypp-dh { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 4px; }
.mypp-e { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0 6px 10px; border-left: 3px solid var(--line); margin: 4px 0; }
.mypp-e.leave { border-left-color: #2a9d8f; }
.mypp-e small { display: block; }
.mypp-h { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.mypp-note { margin-top: 12px; }
.va-head .va-lang button { padding: 4px 7px; font-size: 12px; }
.va-head { gap: 4px; }
.va-head .va-act { padding: 0 10px; font-size: 13px; }
.va-head .va-dev button { padding: 4px 7px; font-size: 12px; }
.va-head > button { min-width: 30px; padding: 0 6px; }
.va-head .va-who { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; min-width: 0; }
.va-head .va-who > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.va-head .va-x { background: #3a3d45; color: #fff; border: 0; border-radius: 8px; min-height: 30px; min-width: 30px; }
/* clock card totals open My hours (the pay period) */
a.cc-totals { color: inherit; text-decoration: none; flex-wrap: wrap; }
a.cc-totals .cc-more { flex-basis: 100%; text-align: center; font-weight: 700; color: var(--accent, #e8561c); margin-top: 6px; }
/* Follow live */
.watched-bar { position: sticky; top: 0; z-index: 61; background: #0b7a3e; color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 4px 12px; }
.va-head .va-follow { background: #3a3d45; color: #fff; border: 0; border-radius: 999px; padding: 0 10px; min-height: 32px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.va-head .va-follow.on { background: #0b7a3e; }
.va-live { width: 100%; color: #b9f3cf; font-size: 12px; font-weight: 600; text-align: center; }
a.cc-totals { gap: 4px 14px; justify-content: center; }
/* Admin → Pay period */
.pps { padding: 18px; max-width: 760px; }
.pps-prev { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.pps-prev > div { background: var(--panel-2, #f4f2ee); border-radius: 12px; padding: 10px 12px; }
.pps-prev small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pps-prev .now { background: var(--ink); color: #fff; }
.pps-prev .now small { color: rgba(255,255,255,.7); }
@media (max-width: 700px) { .pps-prev { grid-template-columns: 1fr; } }
/* My work: this paycheck's hours */
.cc-pay { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink, #15171c); color: #fff; text-decoration: none; }
.cc-pay:active { transform: scale(.99); }
.cc-pay-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #2f7d32; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.cc-pay-txt { flex: 1; display: grid; line-height: 1.15; text-align: left; }
.cc-pay-txt small { font-size: 12px; color: rgba(255,255,255,.72); font-weight: 600; }
.cc-pay-txt b { font-size: 24px; font-variant-numeric: tabular-nums; }
.cc-pay-go { flex: none; font-weight: 700; color: #ffb27a; }
/* crew hours: compact day-by-day table that fits a phone */
.mypp-tiles { grid-template-columns: repeat(3, 1fr); }
.mypp-tiles > div { padding: 8px 10px; }
.mypp-tiles b { font-size: 19px; }
.mypp-tiles .lv b { color: #1f7a6d; }
.mypp-t { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mypp-t th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.mypp-t td { padding: 6px 4px; vertical-align: top; }
.mypp-t tr.first td { border-top: 1px solid var(--line); }
.mypp-t td.d { width: 44px; line-height: 1.1; }
.mypp-t td.d small, .mypp-t td.j small { display: block; color: var(--muted); font-size: 11.5px; }
.mypp-t td.j { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mypp-t td.j small { white-space: normal; }
.mypp-t td.t { white-space: nowrap; color: #333; }
.mypp-t .h { text-align: right; white-space: nowrap; }
.mypp-t tr.leave td.j b { color: #1f7a6d; }
.mypp-t tr.sub td { color: var(--muted); font-size: 12px; padding-top: 0; }
.mypp-t tfoot td { border-top: 2px solid var(--ink); font-weight: 700; padding-top: 8px; }
.odo-auto { display: grid; gap: 2px; background: var(--panel-2, #f4f2ee); border-radius: 12px; padding: 10px 12px; }
.odo-auto b { font-size: 20px; font-variant-numeric: tabular-nums; }
/* QuickBooks: clients vs. QuickBooks check */
.cm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.cm-grid > div { background: var(--panel-2, #f4f2ee); border-radius: 12px; padding: 10px 12px; }
.cm-grid b { display: block; font-size: 24px; }
.cm-grid small { color: var(--muted); }
.cm-grid .ok b { color: #2f7d32; } .cm-grid .maybe b { color: #b26a00; }
.cm-list { max-height: 260px; overflow-y: auto; margin: 6px 0 10px; padding: 0; list-style: none; }
.cm-list li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.cm-list.plain li { font-size: 14px; }
.cm-opt { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.cm summary { cursor: pointer; padding: 6px 0; }

/* ---------- Retail (Marsh cabinetry, Napoleon fireplaces) ---------- */
.retail-tag { vertical-align: middle; font-size: .55em; }
.retail-intro { margin: 4px 0 10px; }
.retail-month { margin: 6px 0 10px; align-items: center; }
.retail-month select { width: auto; }
.retail-order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.retail-logos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.retail-logos figure { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.retail-logos img { max-height: 56px; max-width: 160px; display: block; margin: 0 auto 4px; }
.retail-logos figcaption { display: flex; gap: 8px; justify-content: center; }
.retail-add { cursor: pointer; }
.q-retail .q-rhead { align-items: center; }
.q-brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-btitle { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.55rem; line-height: 1.1; color: var(--q-ink); }
.q-btag { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--q-soft); }
.q-logos { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 8px; }
.q-logos img { max-height: 46px; max-width: 170px; width: auto; height: auto; display: block; }
.retail-tabs { margin: 8px 0 4px; }
.tax-report h3 { margin: 0; }
.tax-sum { width: 100%; max-width: 560px; border-collapse: collapse; margin: 10px 0; }
.tax-sum td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.tax-sum tr.b td { font-weight: 700; }
.tax-sum tr.tot td { font-weight: 800; font-size: 1.1em; border-top: 2px solid var(--ink, #222); border-bottom: 0; }
.msg-new { background: var(--ink); border: 1px solid var(--ink); color: #fff; }
.msg-new:hover, .msg-new:active { background: #000; color: #fff; }

/* =====================================================================
   HUB DESIGN — "job site, well kept"
   One family (Archivo) used on its width axis: wide and heavy for names of things, condensed and tabular for
   numbers people count (hours, dollars, counts). Granite page, white panels, Tatra orange only for the one action
   that matters on a screen, build green for "go" and for secondary buttons, systems blue only for links.
   ===================================================================== */
:root {
  --bg: #eceff0; --panel: #ffffff; --ink: #1a2329; --muted: #5a666d;
  --line: rgba(26,35,41,.15); --line2: rgba(26,35,41,.085); --field-line: rgba(26,35,41,.24);
  --well: #f4f6f6;                       /* quiet fill: secondary buttons, inset rows */
  --radius: 10px; --radius-ctl: 8px; --radius-chip: 999px;
  --lift: 0 1px 0 rgba(26,35,41,.05), 0 1px 2px rgba(26,35,41,.04);
  --num: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

/* type: names wide, numbers condensed */
h1 { font-size: 1.5rem; font-weight: 800; font-stretch: 120%; letter-spacing: -.022em; }
@media (min-width: 900px) { h1 { font-size: 1.75rem; } }
h3 { font-size: 1rem; font-weight: 750; font-stretch: 110%; letter-spacing: -.01em; }
.pagehead > h1::before, .admin-sub .pagehead > h1::before { width: 5px; border-radius: 3px; }

/* panels: one radius for panels, a smaller one for controls, pills for status */
.card, .stat, .clockcard, .modal, .dropdown { border-radius: var(--radius); }
.card { border-color: var(--line2); box-shadow: var(--lift); }
.card > h3:first-child, .cardhead { padding-bottom: 10px; border-bottom: 1px solid var(--line2); margin-bottom: 12px; }
.cardhead h3 { margin: 0; border: 0; padding: 0; }

/* numbers people count */
.stat b, .ps-total, .cc-timer, .est-totals b, .q-totalbox b { font-family: var(--num); font-stretch: 84%; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat b { font-size: 1.75rem; line-height: 1.1; }
.stat small { font-stretch: 100%; font-weight: 600; letter-spacing: 0; }

/* stat rows read as one instrument panel, not a pile of boxes */
.stats { gap: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--lift); overflow: hidden; }
.stats > .stat { border: 0; border-radius: 0; box-shadow: none; padding: 14px 16px; box-shadow: inset 1px 0 0 var(--line2); }
.stats > a.stat:hover { background: var(--well); text-decoration: none; }
.stat.warn { border: 0; box-shadow: inset 1px 0 0 var(--line2), inset 0 3px 0 var(--red); }

/* buttons: primary (orange) · secondary (well + green edge) · plain */
button, .button { border-radius: var(--radius-ctl); font-weight: 650; }
button.ghost, .button.ghost { background: var(--panel); border-color: var(--line); }
@media (hover: hover) { button.ghost:hover, .button.ghost:hover { border-color: var(--ink); } }
button.secondary, .button.secondary { background: var(--well); color: var(--ink); border: 1.5px solid var(--tatra-build); }
button.secondary:hover, .button.secondary:hover { background: var(--green-soft); border-color: var(--green); }
button.primary, .button.primary { box-shadow: 0 1px 0 rgba(0,0,0,.08); }
button.icon { border-radius: var(--radius-ctl); }

/* fields */
input, select, textarea { border-radius: var(--radius-ctl); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tatra-systems); box-shadow: 0 0 0 3px rgba(18,85,125,.14); }

/* status chips */
.badge { border-radius: var(--radius-chip); padding: 3px 10px; font-stretch: 90%; font-weight: 650; }

/* navigation: the orange line marks where you are */
.mainnav a.on { box-shadow: inset 0 -3px 0 var(--accent-hi); font-weight: 650; }
.tabs a { font-weight: 600; }
.tabs a.on { border-bottom-width: 3px; }
.seg { border-radius: var(--radius-ctl); }

/* ---------- My work: clock ---------- */
.clockcard { border: 1px solid var(--line2); box-shadow: var(--lift); padding: 20px 18px 18px; }
.cc-status { text-transform: none; letter-spacing: 0; font-stretch: 100%; font-weight: 650; font-size: 1rem; }
.cc-in { border-radius: var(--radius-ctl); }
.cc-totals b { font-family: var(--num); font-stretch: 84%; font-weight: 750; font-size: 1.15em; }

/* This paycheck: hours + one bar per day of the pay period */
.paystrip { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head total" "days days" "go go";
  gap: 6px 12px; margin-top: 16px; padding: 14px 16px 12px; text-align: left; color: var(--ink);
  background: var(--well); border: 1px solid var(--line2); border-radius: var(--radius-ctl); }
.paystrip:hover { text-decoration: none; border-color: var(--tatra-build); }
.ps-head { grid-area: head; display: flex; flex-direction: column; min-width: 0; }
.ps-label { font-weight: 750; font-stretch: 110%; }
.ps-range { color: var(--muted); font-size: .9rem; }
.ps-total { grid-area: total; font-size: 2rem; line-height: 1; align-self: center; }
.ps-total small { font-size: .55em; font-weight: 600; color: var(--muted); font-stretch: 100%; }
.ps-days { grid-area: days; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.ps-day { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.ps-day i { display: block; height: 0; min-height: 0; background: var(--tatra-build); border-radius: 3px 3px 1px 1px; align-self: stretch; }
.ps-day { height: 46px; justify-content: flex-end; position: relative; }
.ps-day::before { content: ''; position: absolute; left: 0; right: 0; bottom: 16px; top: 0; border-bottom: 2px solid rgba(26,35,41,.1); pointer-events: none; }
.ps-day i { max-height: 30px; }
.ps-day em { font-style: normal; font-size: 11px; color: var(--muted); text-align: center; line-height: 13px; }
.ps-day.today em { color: var(--ink); font-weight: 800; }
.ps-day.today::before { border-bottom-color: var(--accent-hi); }
.ps-day.later i { background: transparent; }
.ps-go { grid-area: go; justify-self: start; margin-top: 4px; font-weight: 650; color: var(--green); }

/* ---------- Messages ---------- */
.msg-new { background: var(--well); color: var(--ink); border: 1.5px solid var(--tatra-build); }
.msg-new:hover, .msg-new:active { background: #eaf2e0; color: var(--ink); border-color: var(--green); }
.sos-btn { background: var(--accent); border: 1.5px solid var(--accent); color: #fff; }
.sos-btn:hover, .sos-btn:active { background: var(--accent-press); border-color: var(--accent-press); color: #fff; }
.thread-row { border-bottom-color: var(--line2); }
.thread-row.unread b { font-weight: 800; }

/* ---------- Today: the morning read ---------- */
.td-tiles { gap: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--lift); overflow: hidden; }
.td-tile { border: 0; border-radius: 0; box-shadow: inset 1px 0 0 var(--line2); padding: 14px 16px 16px; position: relative; }
.td-tile:hover { background: var(--well); }
.td-tile b { font-family: var(--num); font-stretch: 84%; font-weight: 750; font-size: 2rem; letter-spacing: -.01em; }
.td-tile small { font-weight: 600; color: var(--ink); font-size: .82rem; }
.td-tile::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.td-tile.go::after { background: var(--tatra-build); }
.td-tile.warn::after { background: #e39b2b; }
.td-tile.bad::after { background: var(--red); }
.td-attn { border-left: 4px solid #e39b2b; }
.td-attn ul { margin: 0; padding: 0; list-style: none; }
.td-attn li a { display: block; padding: 8px 0; font-weight: 600; }
.td-attn li + li a { border-top: 1px solid var(--line2); }

/* ---------- active states: a raised white chip, not a black block ---------- */
.seg { background: var(--well); border-color: var(--line2); padding: 3px; gap: 2px; }
.seg button, .seg a { border-radius: calc(var(--radius-ctl) - 2px); border: 0 !important; }
.seg button.on, .seg a.on, .toolbar .seg button.on, .pagehead .seg button.on {
  background: var(--panel); color: var(--ink); border-color: transparent; box-shadow: 0 1px 2px rgba(26,35,41,.14), 0 0 0 1px rgba(26,35,41,.06); }
.dd-size .seg button.on, .acct-size .seg button.on { color: var(--ink); }

/* small headings and table heads: sentence case, condensed, no tracking */
.grouphead, .adm-group h2, .acct-role, .pr-table th, .mypp-t th, .ts-table th, .table th {
  text-transform: none; letter-spacing: 0; font-stretch: 88%; font-weight: 700; }
.adm-group h2 { font-size: .95rem; color: var(--ink); }

/* My hours */
.mypp-tiles > div { background: var(--well); border-radius: var(--radius-ctl); }
.mypp-tiles b { font-family: var(--num); font-stretch: 84%; font-weight: 750; font-size: 1.6rem; }
.mypp-tiles .tot { background: var(--green-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--tatra-build); }
.mypp-tiles .tot small { color: var(--green); }
.mypp-tiles .tot b { color: var(--green); }
.addr-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.2em 6.2em; gap: 0 10px; }
.addr-row input { min-width: 0; width: 100%; }
.addr-row .field { margin: 0; }

/* Admin → Connected apps (approval inbox) */
.inbox { display: flex; flex-direction: column; gap: 12px; }
.inbox-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inbox-item header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.inbox-diff { width: 100%; border-collapse: collapse; font-size: .92rem; }
.inbox-diff th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.inbox-diff td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.inbox-apps { display: flex; flex-direction: column; gap: 14px; }
.inbox-apphead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inbox-apphead h3 { margin: 0; }
.inbox-rules { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.inbox-rules td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.inbox-rules td:last-child { text-align: right; }
.inbox-log { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; }
@media (max-width: 640px) { .inbox-rules td:last-child { text-align: left; } .inbox-rules tr { display: flex; flex-direction: column; } }

/* QuickBooks sync: tiles open the list of what's waiting */
.qb-tile { cursor: pointer; text-align: left; transition: border-color .12s; }
.qb-tile:hover, .qb-tile:focus-visible { border-color: var(--accent); }
.qb-tile.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.qb-tile-more { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.qb-pending { border: 1px solid var(--line2); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 16px; }
.qb-pending h4 { margin: 0; }
.qb-find { width: 100%; max-width: 320px; margin: 4px 0 8px; }
.qb-plist { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.qb-plist li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line2); }
.qb-plist li:first-child { border-top: 0; }
.qb-pmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.qb-pmain b { overflow-wrap: anywhere; }
.qb-plist .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .qb-plist li { flex-wrap: wrap; } .qb-plist .badge { margin-left: auto; } }
.imp-prod { max-width: 100%; font-size: .9rem; }
.imp-line { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.imp-lab { display: flex; flex-direction: column; gap: 2px; }
.imp-prod.need { border-color: var(--amber); background: var(--amber-soft); }

/* Service calls (office side) */
.svc-office { margin: 6px 0 18px; }
.svc-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.svc-tiles .card.warn { border-color: var(--amber); } .svc-tiles .card.bad { border-color: var(--red); }
.svc-board-wrap { overflow-x: auto; }
.svc-board { border-collapse: collapse; width: 100%; min-width: 720px; table-layout: fixed; }
.svc-board th { text-align: left; font-size: .8rem; color: var(--muted); padding: 4px 6px; font-weight: 600; }
.svc-board th:first-child { width: 130px; color: var(--ink); }
.svc-board td { vertical-align: top; padding: 4px; border-top: 1px solid var(--line2); min-height: 52px; height: 52px; }
.svc-time { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.svc-time input { width: auto; }
.svc-ampm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.svc-cell.over { background: var(--blue-soft); }
.svc-chip { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border-radius: 4px; border: 0; border-left: 4px solid var(--muted); background: var(--grey-soft); padding: 6px 8px; margin-bottom: 4px; cursor: grab; font: inherit; color: var(--ink); line-height: 1.25; }
.svc-chip b { font-size: .9rem; } .svc-chip span, .svc-chip small { font-size: .78rem; color: var(--muted); }
.svc-chip.blue { border-left-color: var(--blue); background: var(--blue-soft); }
.svc-chip.green { border-left-color: var(--green); background: var(--green-soft); }
.svc-chip.amber { border-left-color: var(--amber); background: var(--amber-soft); cursor: default; }
.svc-chip.em { border-left-color: var(--red); background: var(--red-soft); }
.svc-chip.em small { color: var(--red); font-weight: 700; }
.svc-unassigned { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.svc-unassigned small { width: 100%; font-weight: 700; letter-spacing: .5px; }
.svc-unassigned .svc-chip { width: auto; min-width: 180px; border-style: dashed; border-left-style: solid; }
.svc-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); }
.svc-row:first-of-type { border-top: 0; }
.svc-consults h3 { margin: 0 0 6px; }
.svc-consult { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.svc-consult .grow { flex: 1 1 360px; min-width: 0; }
.svc-reply { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; }
.svc-reply textarea { width: 100%; box-sizing: border-box; }
.svc-msg { margin: 6px 0; padding: 6px 10px; border-radius: 4px; background: var(--grey-soft); }
.svc-msg.office { background: var(--blue-soft); }
.svc-part { display: flex; gap: 6px; margin-bottom: 6px; } .svc-part input:first-child { flex: 1; }
.svc-preview { width: 100%; border-collapse: collapse; margin: 12px 0; }
.svc-preview td { padding: 6px 0; border-top: 1px solid var(--line2); } .svc-preview td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.svc-preview tr.tot td { border-top: 2px solid var(--ink); font-weight: 700; }
@media (max-width: 760px) { .svc-tiles { grid-template-columns: 1fr 1fr; } }

/* estimate payment schedule: custom rows (label · % · fixed amount · remove) */
.payrow.edit { grid-template-columns: 1fr 72px 120px 36px; }
.payrow.edit .pct-in, .payrow.edit .amt-in { text-align: right; min-width: 0; }
.payrow.edit .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; min-height: 36px; }
.payrow.edit .x:hover { color: var(--bad, #c0392b); }
.pay-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 8px; }
@media (max-width: 700px) { .payrow.edit { grid-template-columns: 1fr 60px 100px 32px; } }

/* points */
.points-card .pts-head { display: flex; align-items: baseline; gap: 10px; }
.points-card .pts-head h3 { margin: 0; }
.pts-nums { display: flex; gap: 22px; margin: 8px 0 6px; }
.pts-nums b { font-size: 28px; font-weight: 800; display: block; line-height: 1.1; }
.pts-nums small { color: var(--muted); }
.points-card.neg .pts-nums b { color: var(--red); }
.pts-neg { background: var(--red-soft); color: var(--red); font-weight: 700; padding: 8px 12px; border-radius: var(--radius); margin: 6px 0; }
.pts-list { list-style: none; margin: 6px 0 0; padding: 0; }
.pts-list li { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.pts-list li:first-child { border-top: 0; }
.pts-list .pts-v { font-weight: 800; }
.pts-list li.plus .pts-v { color: var(--green, #1d8a4a); } .pts-list li.minus .pts-v { color: var(--red); } .pts-list li.pend { opacity: .65; }
.pts-list .pts-d { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.pts-tbl td.pts-v { font-weight: 800; white-space: nowrap; } .pts-tbl .pts-v.plus { color: var(--green, #1d8a4a); } .pts-tbl .pts-v.minus { color: var(--red); }
.pts-tbl td.pts-act { text-align: right; white-space: nowrap; } .pts-tbl td.pts-act button { margin-left: 6px; }
.pts-tbl tr.neg td { background: var(--red-soft); }
.pts-in { width: 64px; text-align: right; }
.seg .cnt { font-style: normal; background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .75rem; margin-left: 4px; }

/* iPad (and other touch tablets): the same bottom bar as the phone, with every section on it; the text menu in the
   header goes away. Mouse-driven laptops of the same width keep the desktop header. */
@media (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  :root { --nav-h: 78px; --nav-total: calc(78px + env(safe-area-inset-bottom)); }
  .mainnav, .usermenu > button { display: none; }
  .usermenu { position: static; }
  .usermenu .dropdown { position: fixed; right: 12px; top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 8px); bottom: calc(var(--nav-total) + 12px); width: min(460px, calc(100vw - 24px)); overflow-y: auto; }
  .main { padding-bottom: calc(var(--nav-total) + 28px); }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: var(--nav-total); justify-content: center;
    background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) var(--safe-b) env(safe-area-inset-left); }
  .bottomnav a { position: relative; flex: 1 1 0; min-width: 0; max-width: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--nav-h);
    padding: 6px 4px 8px; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 12px; transition: color .15s, background .15s; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav a:active .bn-icon { transform: scale(.92); }
  .bottomnav a.on { color: var(--accent); }
  .bottomnav a.on .bn-icon { background: color-mix(in srgb, var(--tatra-build) 14%, transparent); }
  .bottomnav .nbadge { position: absolute; top: 4px; left: calc(50% + 10px); margin: 0; font-size: 11px; height: 18px; min-width: 18px; }
  .bn-icon { display: grid; place-items: center; width: 56px; height: 38px; border-radius: 13px; transition: transform .1s, background .15s; }
  .bn-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .sticky-save, .composer { bottom: var(--nav-total); }
  .sheet-bg, .modal-bg { bottom: var(--nav-total); }
}
/* phone: the selected item gets the same soft pill behind its icon */
@media (max-width: 760px) {
  .bn-icon { width: 52px; height: 34px; border-radius: 12px; transition: transform .1s, background .15s; }
  .bottomnav a.on .bn-icon { background: color-mix(in srgb, var(--tatra-build) 14%, transparent); }
}

/* ---------- interactive system (late, so it wins): orange = act · green = selected / on · light grey = unselected ----------
   Every tap answers at once with a green tint; nothing flashes white or the browser's grey. */
:root { --green-tint: color-mix(in srgb, var(--tatra-build) 14%, transparent); --green-tint-2: color-mix(in srgb, var(--tatra-build) 24%, transparent); --green-line: color-mix(in srgb, var(--tatra-build) 55%, transparent); }
button, .button, .chip, .seg button, .tabs a, .adm-tile, .stat, .bottomnav a, .mainnav a, .list a, .care-inv, .pick-list button { -webkit-tap-highlight-color: transparent; }

/* plain / ghost (white or light grey) */
button, .button { transition: background-color .12s, border-color .12s, color .12s, transform .08s, box-shadow .12s; }
button:not(.primary):not(.danger):not(.on):active:not(:disabled), .button:not(.primary):not(.danger):not(.on):active { background: var(--green-tint); border-color: var(--tatra-build); color: var(--ink); transform: scale(.98); }
button.icon:active:not(:disabled), .linkish:active { background: var(--green-tint); color: var(--tatra-build); }

/* primary (orange) */
button.primary:active:not(:disabled), .button.primary:active { background: var(--accent-press); border-color: var(--accent-press); filter: none; }

/* secondary (green edge) */
button.secondary:active:not(:disabled) { background: var(--green-tint-2); }

/* danger */
button.danger:active:not(:disabled) { background: var(--red-soft); filter: brightness(.97); }

/* selected options: segmented controls and chips are green when on, light grey when not */
.seg button { color: var(--muted); }
.seg button:active:not(:disabled):not(.on) { background: var(--green-tint); color: var(--ink); }
.seg button.on, .seg a.on, .toolbar .seg button.on, .pagehead .seg button.on, .dd-size .seg button.on, .acct-size .seg button.on, .sheet .seg button.on, .care-tabs button.on { background: var(--tatra-build); color: #fff; box-shadow: none; }
.seg button.on:active:not(:disabled) { background: var(--tatra-build); filter: brightness(1.15); }
.seg.busy button.on { animation: segpulse 1s ease-in-out infinite; }
.chip:active:not(.on) { background: var(--green-tint); }
.chip.on { background: var(--tatra-build); border-color: var(--tatra-build); color: #fff; }
.chip.on span { color: rgba(255,255,255,.8); }

/* tabs: green underline when selected, green tint while pressed */
.tabs a:active { background: var(--green-tint); border-radius: var(--radius-ctl) var(--radius-ctl) 0 0; }
.tabs a.on { border-bottom-color: var(--tatra-build); color: var(--ink); }

/* tiles, list rows, nav items */
.adm-tile:active, .stat:active, .list a:active, .care-inv:active, .pick-list button:active { background: var(--green-tint) !important; }
.bottomnav a:active { background: var(--green-tint); }
.mainnav a:active { background: var(--green-tint); border-radius: var(--radius-ctl); }

/* keyboard focus: a green ring instead of the browser's blue */
button:focus-visible, .button:focus-visible, a:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--green-line); outline-offset: 2px; }

/* ---------- brand palette (Tatra style guide): orange e94e1b · blue 009fe3 · ink 0c1119 · the build green in place of
   the guide's yellow. Orange acts, green is selected / on, blue is information and links, ink is text and the dark bar. */
:root {
  --tatra-orange: #e94e1b; --tatra-orange-deep: #c73f12; --tatra-ink: #0c1119; --tatra-navy: #0c1119; --tatra-systems: #009fe3;
  --ink: #0c1119; --muted: #4f5b64;
  --accent: #e94e1b; --accent-hi: #ff6a36; --accent-press: #c73f12; --accent-ink: #fff; --accent-soft: #fdeee8;
  --blue: #0b7fb8;                       /* the guide's 009fe3, deepened just enough to read as text on white */
  --blue-bright: #009fe3; --blue-soft: #e6f5fc;
  --green: #4a7217; --green-soft: #f1f7e8;
  --amber: #b26a00; --amber-soft: #fff4e0;
}
.badge.blue, .badge.info { background: var(--blue-soft); color: var(--blue); }
.tabs a.on { border-bottom-color: var(--tatra-build); }
.pagehead > h1::before { background: var(--tatra-build); }
.mainnav a.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tatra-orange); }
a { color: var(--blue); }
.avatar, .acct-ava { background: var(--tatra-orange); }

/* account tiles: larger icons, CARE+ with its rounded orange plus */
.acct-ic { width: 54px; height: 54px; border-radius: 15px; margin-bottom: 8px; }
.acct-ic svg { width: 30px; height: 30px; stroke-width: 1.8; }
.c-care .acct-ic { background: var(--accent-soft); color: var(--ink); }
.c-care .acct-ic svg { width: 34px; height: 34px; }
.c-care .acct-ic .plus { stroke: var(--tatra-orange); stroke-width: 3.2; }
.c-teal .acct-ic { background: #e3f4f2; color: #0e6e63; } .c-violet .acct-ic { background: var(--violet-soft); color: var(--violet); }
.c-blue .acct-ic { background: var(--blue-soft); color: var(--blue); } .c-green .acct-ic { background: var(--green-soft); color: var(--green); }

/* green = the Tatra build green, ~12% lighter (#55831c → #5f931f); green text a shade deeper so it reads on white */
:root { --tatra-build: #5f931f; --green: #57821b; --green-soft: #f3f9e9; }

@media (hover: hover) {
  button:not(.primary):not(.danger):not(.secondary):not(.on):hover, .button:not(.primary):not(.danger):not(.on):hover { background: var(--grey-soft); border-color: var(--green-line); }
  button.danger.ghost:hover { background: var(--red-soft); border-color: var(--red); }
  
  .chip:hover:not(.on) { background: var(--grey-soft); border-color: var(--green-line); text-decoration: none; }
  .paystrip:hover { border-color: var(--tatra-build); }
}

/* touch: nothing moves on press — just the tint */
.seg button:active, .chip:active, .tabs a:active, .bottomnav a:active, .adm-tile:active, .stat:active { transform: none !important; }
@media (hover: none) { button:active:not(:disabled), .button:active { transform: none; } }

/* Sales header: same shape on every tab so the buttons never move between Pipeline, Retail and Clients */
.sales-head .pagehead { margin-bottom: 10px; }
.sales-head .sales-tabs { margin-bottom: 10px; }
.sales-actions { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; margin-bottom: 14px; }
.sales-actions:empty { min-height: 0; margin-bottom: 4px; }
@media (max-width: 760px) {
  .sales-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px; }
  .sales-actions::-webkit-scrollbar { display: none; }
  .sales-actions > * { flex: 0 0 auto; width: auto; }
}

/* Sales: the orange action sits at the right end of the tabs row on every tab, so it never moves */
.sales-tabsrow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sales-tabsrow .sales-tabs { margin-bottom: 0; }
.sales-tabsrow .primary { flex: 0 0 auto; white-space: nowrap; min-width: 112px; justify-content: center; }
.sales-tabsrow .sales-tabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sales-tabsrow .sales-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 760px) {
  /* the three tabs share the room that is left after the orange button, whatever the text size */
  .sales-tabsrow .sales-tabs { flex: 1 1 auto; display: flex; overflow: visible; }
  /* fixed pixel sizes here (like the bottom bar) so the row still fits when the text size is set to large */
  .sales-tabsrow .sales-tabs a { flex: 1 1 0; min-width: 0; text-align: center; padding: 6px 3px; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .sales-tabsrow .primary { min-width: 0; padding-left: 12px; padding-right: 12px; font-size: 16px; }
}

/* ---------- tiles: icons on plain white, each its own color, no coloured square — so the eye finds the right one fast ---------- */
.adm-ic, .acct-ic { background: none !important; border-radius: 0; }
.adm-ic { width: 48px; height: 48px; }
.adm-ic svg { width: 36px; height: 36px; stroke-width: 1.6; }
.acct-ic { width: 44px; height: 44px; margin-bottom: 6px; }
.acct-ic svg { width: 38px; height: 38px; stroke-width: 1.6; }
.c-care .acct-ic svg { width: 40px; height: 40px; }
.adm-tile { gap: 14px; }
/* one hue per subject */
.adm-ic.i-people { color: #0b7fb8; }  .adm-ic.i-time { color: #0e7490; }  .adm-ic.i-payroll { color: #6d28d9; }  .adm-ic.i-points { color: #d97706; }
.adm-ic.i-timeoff { color: #0891b2; }  .adm-ic.i-companies { color: #475569; }  .adm-ic.i-money { color: #5f931f; }  .adm-ic.i-expenses { color: #e94e1b; }
.adm-ic.i-finance { color: #1d4ed8; }  .adm-ic.i-billing { color: #7c3aed; }  .adm-ic.i-retail { color: #be185d; }  .adm-ic.i-billsin { color: #b45309; }
.adm-ic.i-suppliers { color: #15803d; }  .adm-ic.i-clients { color: #e94e1b; }  .adm-ic.i-apps { color: #0ea5e9; }  .adm-ic.i-codes { color: #334155; }
.adm-ic.i-import { color: #64748b; }
.acct .c-orange .acct-ic { color: #e94e1b; } .acct .c-teal .acct-ic { color: #0e7490; } .acct .c-violet .acct-ic { color: #6d28d9; }
.acct .c-blue .acct-ic { color: #0b7fb8; } .acct .c-green .acct-ic { color: #5f931f; } .acct .c-care .acct-ic { color: var(--ink); }

/* solid "3D" icons: gradient fill + soft shadow, no stroke */
.adm-ic svg.solid, .acct-ic svg.solid { fill: none; stroke: none; filter: drop-shadow(0 2px 2px rgba(12,17,25,.18)) drop-shadow(0 0 1px rgba(255,255,255,.6)); }
.adm-ic svg.solid { width: 40px; height: 40px; }
.acct-ic svg.solid { width: 42px; height: 42px; }
/* CARE+ tile: the 3D heart above the CARE+ wordmark */
.acct .c-care .acct-ic { width: auto; height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 8px; }
.care-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.care-tile .care-heart { width: 46px; height: 46px; }
.care-tile .care-word { width: 104px; height: auto; display: block; margin: 2px 0 4px; }

/* the page's main button beside the title */
.pagehead .page-action { display: inline-flex; align-items: center; margin-left: auto; }
.pagehead:has(.page-action) { flex-wrap: nowrap; align-items: center; }
.pagehead:has(.page-action) > h1 { flex: 1 1 auto; min-width: 0; }
.pagehead .page-action .primary { flex: 0 0 auto; }

.pagehead .page-action .primary { white-space: nowrap; }
@media (max-width: 760px) { .toolbar > .grow:last-child { display: none; } }

/* Sales: title + orange action on the first row; Pipeline · Retail · Clients · Invoices on one line under it */
.sales-head .sales-tabs { display: flex; margin-bottom: 12px; }
.sales-head .sales-tabs a { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 761px) { .sales-head .sales-tabs { display: inline-flex; } .sales-head .sales-tabs a { flex: 0 0 auto; } }
@media (max-width: 760px) { .sales-head .sales-tabs a { padding: 6px 4px; font-size: 16px; } }

/* page title: the colour bar is a flex item beside the text, so a long title wraps its words and the bar stays put */
.pagehead > h1, .admin-sub .pagehead > h1 { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; min-width: 0; }
.pagehead > h1 > * { min-width: 0; }

/* ---------- iPad & desktop: the office screens ---------- */
/* Sales: on anything wider than a phone the secondary buttons (Import PDF, + Estimate, search, filters) sit on the tabs
   row, right end — one row instead of two, and the list starts higher */
@media (min-width: 761px) {
  .sales-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
  .sales-row .sales-tabs { margin-bottom: 0; flex: 0 0 auto; }
  .sales-row .sales-actions { margin: 0 0 0 auto; min-height: 0; flex: 0 1 auto; justify-content: flex-end; }
}
@media (max-width: 760px) { .sales-row { display: contents; } }

/* Today: the eight stat tiles share one panel; hairlines between them come from the grid gap, so 8-across (desktop),
   4+4 (iPad) and 2-up (phone) all look deliberate — no ragged last row */
.td-tiles { gap: 1px; background: var(--line2); }
.td-tile { box-shadow: none; background: var(--panel); }
@media (min-width: 761px) and (max-width: 1499px) { .td-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .td-tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
/* a ninth tile (Past due appears only when something is overdue): the last tile stretches over the rest of its row,
   so there's never an empty grey gap */
@media (max-width: 760px) { .td-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 761px) and (max-width: 1499px) {
  .td-tiles > :last-child:nth-child(4n+1) { grid-column: 1 / -1; }
  .td-tiles > :last-child:nth-child(4n+2) { grid-column: span 3; }
  .td-tiles > :last-child:nth-child(4n+3) { grid-column: span 2; }
}
@media (min-width: 1500px) {
  .td-tiles > :last-child:nth-child(8n+1) { grid-column: 1 / -1; }
  .td-tiles > :last-child:nth-child(8n+2) { grid-column: span 7; }
  .td-tiles > :last-child:nth-child(8n+3) { grid-column: span 6; }
  .td-tiles > :last-child:nth-child(8n+4) { grid-column: span 5; }
  .td-tiles > :last-child:nth-child(8n+5) { grid-column: span 4; }
  .td-tiles > :last-child:nth-child(8n+6) { grid-column: span 3; }
  .td-tiles > :last-child:nth-child(8n+7) { grid-column: span 2; }
}
/* …and the cards go two-up from iPad portrait on, so the morning read fits one screen */
@media (min-width: 761px) and (max-width: 1000px) { .td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Project page: tabs wrap on a tablet or desktop instead of cutting a word off at the edge */
@media (min-width: 761px) {
  .project .tabs { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; padding-right: 0; overflow: visible; }
}

/* Wide screens: phone-width buttons don't stretch across the whole desk */
@media (min-width: 761px) {
  .msg-actions { max-width: 640px; }
  .timeoff button.primary.block { width: auto; align-self: flex-start; min-width: 260px; padding-left: 22px; padding-right: 22px; }
}
/* stat numbers never clip: tiles may shrink, and the figure steps down a little on iPad so "$13,450" fits beside its neighbours */
.td-tiles > * { min-width: 0; }
.td-tile b { overflow-wrap: anywhere; }
/* 7-digit figures ($1,281,796) fit every tile: iPad 4+4 and desktop 8-across both leave room for ten tabular digits */
.td-tile b { white-space: nowrap; font-size: clamp(1.4rem, 1.25vw, 2rem); }
@media (min-width: 761px) and (max-width: 1499px) { .td-tile b { font-size: 1.7rem; } }
.td-tile small { white-space: normal; }
/* Time off balance card in the brand green, not the old teal */
.to-balance { background: linear-gradient(135deg, #fff 0%, var(--green-soft) 100%); }
.to-big b { color: var(--green); }
/* stat rows (Sales, Money, project): a big figure like $1,281,796 shrinks to fit its tile instead of running into the
   next one — the tile that holds the widest number also gets a touch more room */
.stats > .stat { min-width: 0; overflow: hidden; }
.stats > .stat b { white-space: nowrap; font-size: clamp(1.1rem, 2.1vw, 1.75rem); }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(auto-fit, minmax(140px, auto)); } }

/* ---------- working without signal ---------- */
/* a small pill just above the bottom bar (bottom corner on desktop): no signal, saves waiting, or something refused */
.offline-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70; display: inline-flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-size: 14px; font-weight: 650; line-height: 1.2; box-shadow: 0 4px 16px rgba(12, 17, 25, .14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-pill .op-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.offline-pill.off .op-dot { background: #e39b2b; }
.offline-pill.sending .op-dot { background: var(--tatra-build); animation: pulse 1.4s ease-in-out infinite; }
.offline-pill.bad { border-color: var(--red); color: var(--red); }
.offline-pill.bad .op-dot { background: var(--red); }
@media (max-width: 1180px) { .offline-pill { bottom: calc(var(--nav-total, 72px) + 10px); } }
.failed-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.failed-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-offline small { display: block; }

/* Take a payment (office, card over the phone) */
.td-pay { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; }
.td-pay-ic { width: 18px; height: 13px; border: 2px solid currentColor; border-radius: 3px; position: relative; box-sizing: border-box; }
.td-pay-ic::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 2px; background: currentColor; }
.tp-search { display: flex; gap: 8px; margin-bottom: 10px; }
.tp-search input { flex: 1; min-width: 0; }
.tp-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 520px); overflow-y: auto; border: 1px solid var(--line2); border-radius: var(--radius); }
.tp-list li + li { border-top: 1px solid var(--line2); }
.tp-list button { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.tp-list button:hover, .tp-list button:focus-visible { background: var(--accent-soft); }
.tp-main, .tp-side { display: flex; flex-direction: column; min-width: 0; }
.tp-main { flex: 1; } .tp-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-side { align-items: flex-end; text-align: right; } .tp-side b { font-variant-numeric: tabular-nums; }
.tp-side small.bad { color: var(--red); }
.tp-empty { padding: 18px 4px; }
.tp-inv { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--grey-soft); border-radius: var(--radius); }
.tp-inv > span:first-child { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tp-owed { display: flex; flex-direction: column; align-items: flex-end; } .tp-owed b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.tp-card { display: none; } .tp-card.on { display: block; margin: 14px 0 4px; min-height: 200px; }
.tp-err { margin: 10px 0 0; padding: 10px 12px; background: var(--red-soft); color: var(--red); border-radius: var(--radius); font-size: .92rem; font-weight: 500; }
.tp-charge .savebar, .tp-done .savebar { margin-top: 16px; }
.tp-go { min-height: 48px; font-weight: 700; }
.tp-done { text-align: center; padding: 8px 4px; }
.tp-check { width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 30px; font-weight: 700; }
.tp-done .savebar { justify-content: center; }

.inv-bankform { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius); background: var(--blue-soft); }
.inv-bankform h4 { margin: 0 0 4px; }
.inv-bankform p { margin: 0 0 6px; }
.inv-bankform .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.tp-onfile { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tp-onfile > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.tp-onfile-ic { width: 26px; height: 18px; border: 2px solid var(--ink); border-radius: 4px; position: relative; flex: none; }
.tp-onfile-ic::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 3px; background: var(--ink); }
.tp-other { margin: 6px 0 0; }
.tp-keep { margin: 14px 0 0; align-items: flex-start; }

/* login made in the Hub: the temporary password to hand over */
.login-ready { display: flex; flex-direction: column; gap: 14px; }
.login-rows { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; padding: 14px 16px; background: var(--bg, #f2f5f6); border-radius: 10px; }
.login-rows dt { color: var(--muted); font-size: .85rem; }
.login-rows dd { margin: 0 0 8px; font-weight: 700; overflow-wrap: anywhere; }
.login-rows dd:last-child { margin-bottom: 0; }
.login-rows .login-pass { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 1.35rem; letter-spacing: .02em; white-space: nowrap; }
.login-ready .row.end { display: flex; justify-content: flex-end; }
.login-ready a.button { display: inline-flex; align-items: center; text-decoration: none; }
.login-tools { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Admin → People → person: the jobs they can see */
.proj-access { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.proj-access-head small { margin-left: 6px; }
.proj-access-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; }
/* rows keep their height inside the scrolling box (a flex column squeezes them on top of each other otherwise) */
.proj-access-list label.check { display: flex; flex-shrink: 0; align-items: flex-start; gap: 10px; padding: 8px 0; min-height: 0; line-height: 1.3; border-bottom: 1px solid var(--line2); }
.proj-access-list label.check:last-child { border-bottom: 0; }
.proj-access-list label.check input { flex: 0 0 auto; margin-top: 2px; }
.proj-access-list label.check span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

/* travel after a CARE+ service call, still running after 5 PM */
.travel-ask { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: #fff4e5; color: #4a2a00; border: 1px solid #f3c27a; text-align: left; }
.travel-ask b { font-weight: 700; line-height: 1.35; }
.travel-ask .cc-out { min-height: 44px; }
.travel-out { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-weight: 600; }
.travel-out input { max-width: 150px; }


/* service call: what the caller said + instructions, editable */
.call-text { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line2); }

/* Today: automatic 7:30 pm clock-outs to check */
.td-autoout { border-left: 4px solid var(--amber, #d98a00); }
.td-autoout ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.td-autoout li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.td-autoout li .grow { flex: 1; min-width: 180px; }

/* clock out first, then the daily report */
.jr-clocked { font-weight: 700; font-size: 1.05rem; color: var(--good, #1a7f37); margin: 0 0 .25rem; }

.jr-points p { margin: 0; }
.jr-points small { display: block; margin-top: .2rem; opacity: .85; }
.jr-points { background: #fff6e8; border: 1px solid #f3d3a4; color: #7a4a00; border-radius: 8px; padding: .45rem .65rem; font-size: .88rem; margin: .4rem 0 .7rem; }

/* reports still to write: countdown to the points deadline */
.jr-due { display: block; margin-top: .15rem; font-weight: 600; }
.jr-due.ok { color: #1a7f37; } .jr-due.late { color: #b35c00; } .jr-due.over { color: #c62828; }
.reportsdue { border: 2px solid #f3b86b; background: #fffaf2; }
.reportsdue h3 { margin-top: 0; }
/* points flash after a report is saved */
.pts-flash { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(0,0,0,.35); animation: ptsfade 3.2s ease forwards; }
.pts-flash-card { background: #fff; border-radius: 20px; padding: 1.4rem 2rem 1.2rem; text-align: center; max-width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: ptspop .45s cubic-bezier(.2,1.6,.4,1); }
.pts-flash-n { font-size: 4.2rem; font-weight: 800; line-height: 1; }
.pts-flash.plus .pts-flash-n { color: #e8590c; } .pts-flash.minus .pts-flash-n { color: #c62828; } .pts-flash.zero .pts-flash-n { color: #666; }
.pts-flash-w { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: #555; }
.pts-flash-card p { margin: .6rem 0 0; color: #333; font-size: .95rem; }
@keyframes ptspop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ptsfade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* new service call: the first-hour choice */
.first-hour { display: flex; flex-direction: column; gap: .35rem; background: var(--bg2, #f5f6f6); border-radius: 10px; padding: .6rem .75rem; }
.tell-client { display: flex; flex-direction: column; gap: .35rem; background: var(--bg2, #f5f6f6); border-radius: 10px; padding: .6rem .75rem; margin-top: 12px; }
.tell-client small.muted { overflow-wrap: anywhere; }
.first-hour .check.sub { margin-left: 1.6rem; font-size: .92rem; }
.first-hour .check { display: flex; align-items: flex-start; gap: .55rem; text-align: left; justify-content: flex-start; font-weight: 500; }
.first-hour .check input { width: 18px; height: 18px; min-height: 0; margin: 3px 0 0; flex: none; accent-color: var(--brand, #e8590c); }

/* new service call: emergency */
.em-box { display: flex; flex-direction: column; gap: .4rem; border: 1px solid var(--line, #dde1e3); border-radius: 10px; padding: .55rem .75rem; }
.em-box.on { border-color: #e8a59e; background: #fdf0ee; }
.em-box.on > .check b { color: #c2281b; }
.em-box .check { display: flex; align-items: center; gap: .5rem; justify-content: flex-start; }
.em-box .check input { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
.em-within { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-left: 1.6rem; }

/* ================= Ava — Jan's calendar ================= */
.ava-rail { display: none; }
@media (min-width: 1280px) {
  .ava-rail { display: flex; flex-direction: column; gap: 4px; position: fixed; z-index: 30; left: 0; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); bottom: 0; width: 272px;
    background: var(--panel); border-right: 1px solid var(--line); padding: 12px 12px 14px; overflow-y: auto; }
  .ava-rail.mini { width: 48px; padding: 12px 6px; align-items: center; }
  body.has-ava .main { margin-left: 272px; max-width: calc(1400px); }
  body.has-ava.ava-collapsed .main { margin-left: 48px; }
}
.ava-dot { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(145deg, #ff7a3d, #e0561c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.ava-open { background: none; border: 0; padding: 0; cursor: pointer; }
.ava-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ava-head .grow { display: flex; flex-direction: column; line-height: 1.15; }
.ava-head small { color: var(--muted); font-size: 12px; }
.ava-head .icon { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 16px; line-height: 1; }
.ava-day { padding: 6px 0 4px; }
.ava-dh { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 2px 2px 4px; }
.ava-ev { display: flex; gap: 8px; width: 100%; text-align: left; border: 0; background: var(--bg); border-left: 3px solid #8aa4b8; border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; cursor: pointer; font: inherit; color: inherit; }
.ava-ev:hover { filter: brightness(.97); }
.ava-ev .t { font-size: 12px; font-weight: 700; min-width: 42px; color: var(--muted); padding-top: 1px; }
.ava-ev .n { font-size: 13.5px; font-weight: 600; display: flex; flex-direction: column; min-width: 0; }
.ava-ev .n small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava-free { margin: 0 2px 2px; font-size: 12.5px; color: #9aa6ad; }
.ava-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.ava-foot .button, .ava-foot button { justify-content: center; text-align: center; }
/* colors by kind */
.k-meet { --k: #3b7dd8; } .k-book { --k: #e0561c; } .k-block { --k: #7a5cc2; } .k-pers { --k: #2f9e6e; } .k-google { --k: #8aa4b8; }
.ava-ev.k-meet, .ava-ev.k-book, .ava-ev.k-block, .ava-ev.k-pers, .ava-ev.k-google { border-left-color: var(--k); }
.ava-ev.resched, .ava-blk.resched { opacity: .65; border-left-style: dashed; }
/* week */
.ava-gline { margin: 0 0 10px; font-size: 14px; } .ava-gline.ok { color: #2a7a3b; } .ava-gline.warn { color: #a15c00; } .ava-gline.off { color: var(--muted); }
.ava-wk { margin-left: 6px; }
.ava-week { display: grid; grid-template-columns: 38px repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.ava-hours { padding-top: 46px; } .ava-hours div { font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.ava-col { border-left: 1px solid var(--line); min-width: 0; }
.ava-col.today .ava-ch { color: #e0561c; }
.ava-ch { height: 46px; padding: 6px 6px 0; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.ava-allday { font-size: 11px; border: 0; border-radius: 4px; background: color-mix(in srgb, var(--k) 18%, white); color: #222; text-align: left; padding: 1px 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava-grid { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--px) - 1px), var(--line) calc(var(--px) - 1px), var(--line) var(--px)); cursor: copy; }
.ava-blk { position: absolute; left: 3px; right: 3px; border: 0; border-left: 3px solid var(--k); border-radius: 6px; background: color-mix(in srgb, var(--k) 14%, white); color: #1d262c;
  font: 12px/1.25 inherit; padding: 3px 6px; text-align: left; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.ava-blk b { font-weight: 700; } .ava-blk small { color: #5b6870; }
.ava-blk.free { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--k) 10%, white) 0 6px, white 6px 12px); }
.ava-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ava-legend span { display: inline-flex; align-items: center; gap: 6px; } .ava-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--k, #999); display: inline-block; }
.ava-legend .resched i { background: #bbb; }
.ava-kinds { margin-bottom: 10px; flex-wrap: wrap; }
.ava-hrs { display: grid; gap: 6px; } .ava-hr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ava-hr .check { min-width: 130px; } .ava-hr input[type=time] { max-width: 130px; }
.ava-types { display: flex; flex-direction: column; gap: 8px; }
.ava-type { display: grid; grid-template-columns: minmax(0, 1.6fr) 90px 100px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ava-type.off { opacity: .55; } .ava-type label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); } .ava-type label input { width: 54px; }
@media (max-width: 900px) {
  .ava-week { grid-template-columns: 30px repeat(7, minmax(92px, 1fr)); overflow-x: auto; }
  .ava-type { grid-template-columns: 1fr 1fr; }
}

/* ================= public booking page ================= */
.bk { min-height: 100vh; background: #f4f1ec; color: #141a1f; font-family: Archivo, 'Helvetica Neue', Arial, sans-serif; display: flex; flex-direction: column; }
.bk-top { padding: 22px 20px 10px; display: flex; justify-content: center; } .bk-top img { width: 190px; height: auto; }
.bk-main { width: 100%; max-width: 640px; margin: 0 auto; padding: 10px 18px 40px; flex: 1; }
.bk-main h1 { font-size: 28px; margin: 12px 0 6px; letter-spacing: -.3px; }
.bk-main h3 { font-size: 16px; margin: 16px 0 8px; }
.bk-muted { color: #5a6670; margin: 0 0 14px; }
.bk-err { color: #b3261e; background: #fdecea; border-radius: 10px; padding: 10px 12px; }
.bk-types { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.bk-type { text-align: left; background: #fff; border: 1px solid #e6e0d8; border-radius: 14px; padding: 16px 18px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.bk-type:hover { border-color: #e0561c; } .bk-type b { font-size: 17px; } .bk-type span { color: #e0561c; font-weight: 600; font-size: 14px; } .bk-type small { color: #5a6670; font-size: 14px; }
.bk-back, .bk-link { background: none; border: 0; color: #e0561c; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.bk-days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; }
.bk-day { flex: none; min-width: 64px; background: #fff; border: 1px solid #e6e0d8; border-radius: 12px; padding: 8px 6px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bk-day b { font-size: 13px; } .bk-day span { font-size: 13px; color: #5a6670; } .bk-day.on { background: #141a1f; color: #fff; border-color: #141a1f; } .bk-day.on span { color: #d7dde1; } .bk-day.more { color: #e0561c; font-weight: 600; justify-content: center; }
.bk-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.bk-time { background: #fff; border: 1.5px solid #e0561c; color: #c2410c; border-radius: 10px; min-height: 46px; font: inherit; font-weight: 700; cursor: pointer; }
.bk-time:hover, .bk-time.on { background: #e0561c; color: #fff; }
.bk-picked { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid #e6e0d8; border-radius: 12px; padding: 12px 14px; margin: 6px 0 14px; font-weight: 700; }
.bk-form { display: flex; flex-direction: column; gap: 12px; } .bk-form label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: #3c4850; }
.bk-form input, .bk-form textarea { min-height: 48px; border: 1px solid #d9d2c8; border-radius: 10px; padding: 10px 12px; font: 16px inherit; background: #fff; color: #141a1f; }
.bk-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 52px; padding: 0 22px; border-radius: 12px; border: 0; background: #e0561c; color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; }
.bk-btn.ghost { background: #fff; color: #141a1f; border: 1px solid #d9d2c8; } .bk-btn.bad { background: #b3261e; } .bk-btn:disabled { opacity: .6; }
.bk-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.bk-when { font-size: 20px; font-weight: 700; margin: 4px 0; }
.bk-done { text-align: center; padding-top: 20px; } .bk-check { width: 64px; height: 64px; border-radius: 50%; background: #2f9e6e; color: #fff; font-size: 34px; display: grid; place-items: center; margin: 0 auto 8px; }
.bk-foot { text-align: center; font-size: 13px; color: #7a858c; padding: 16px; }
.ava-blk { align-items: flex-start; justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.25; font-size: 12px; min-height: 0; }
.ava-blk b { font-size: 11.5px; }
.ava-ev { align-items: flex-start; } .ava-ev .n { flex: 1; overflow-wrap: anywhere; text-align: left; }
.bk-type { align-items: flex-start; text-align: left; }
.bk-top { background: #fff; border-bottom: 1px solid #ece6de; }
.bk-day, .bk-time { justify-content: center; }
/* booking page: long descriptions wrap inside the card */
.bk-type { white-space: normal; width: 100%; min-width: 0; overflow-wrap: anywhere; }
.bk-type b, .bk-type span, .bk-type small { white-space: normal; display: block; max-width: 100%; }
.ava-who { margin: 4px 0 10px; } .ava-picked { margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; }
.bk-me { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid #e6e0d8; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.bk-me div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; } .bk-me span { color: #3c4850; font-size: 15px; } .bk-me small { color: #5a6670; font-size: 14px; margin-top: 4px; }
.bk-btn.wide { width: 100%; margin-bottom: 80px; }
.bk-form .bk-btn { margin-bottom: 80px; }
/* Ava: month and year */
.ava-views { margin-right: 6px; }
.ava-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.ava-mh { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
.ava-md { min-height: 108px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px 5px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.ava-md:nth-child(7n + 1) { border-left: 0; } .ava-md:hover { background: var(--bg); }
.ava-md.out { background: color-mix(in srgb, var(--bg) 60%, var(--panel)); } .ava-md.out .n { color: #b5bcc1; }
.ava-md .n { font-size: 12.5px; font-weight: 700; color: var(--muted); align-self: flex-start; padding: 1px 6px; border-radius: 99px; }
.ava-md.today .n { background: #e0561c; color: #fff; }
.ava-chip { border: 0; border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 13%, white); color: #1d262c; border-radius: 4px; font: 11.5px/1.3 inherit; padding: 2px 5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; justify-content: flex-start; min-height: 0; display: block; width: 100%; }
.ava-chip b { font-weight: 700; } .ava-chip.resched { opacity: .6; border-left-style: dashed; }
.ava-md .more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.ava-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ava-ym { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ava-ymh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; } .ava-ymh small { color: var(--muted); font-size: 12px; }
.ava-ydays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ava-ydays i { font-style: normal; font-size: 10.5px; color: var(--muted); text-align: center; }
.ava-yd { border: 0; background: none; border-radius: 6px; font: 12px inherit; padding: 4px 0; cursor: pointer; color: var(--text, #222); min-height: 0; justify-content: center; }
.ava-yd:hover { outline: 1px solid #e0561c; } .ava-yd.l1 { background: #fde3d6; } .ava-yd.l2 { background: #f8b99a; } .ava-yd.l3 { background: #ee8a5c; color: #fff; }
.ava-yd.today { box-shadow: inset 0 0 0 2px #141a1f; font-weight: 800; }
@media (max-width: 700px) { .ava-md { min-height: 64px; } .ava-chip b { display: none; } }

/* ================= company calendar ================= */
.c-task { --k: #3b7dd8; } .c-call { --k: #e0561c; } .c-care { --k: #2f9e6e; } .c-off { --k: #9aa4ab; } .c-jan { --k: #7a5cc2; }
.ccal-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 0 12px; font-size: 13.5px; }
.ccal-f { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; } .ccal-f input { margin: 0; } .ccal-f i { width: 12px; height: 12px; border-radius: 3px; background: var(--k); }
.ccal-board { display: grid; grid-template-columns: 190px repeat(var(--days), minmax(84px, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: auto; max-height: calc(100vh - 260px); }
.ccal-corner, .ccal-dh { position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); padding: 6px 8px; font-size: 12px; color: var(--muted); }
.ccal-corner { left: 0; z-index: 3; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ccal-dh { display: flex; flex-direction: column; align-items: center; border-left: 1px solid var(--line); } .ccal-dh b { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; } .ccal-dh span { font-size: 15px; font-weight: 700; color: var(--text, #1d262c); }
.ccal-dh.today span { background: #e0561c; color: #fff; border-radius: 99px; padding: 0 7px; } .ccal-dh.wknd, .ccal-cell.wknd { background: color-mix(in srgb, var(--bg) 55%, var(--panel)); }
.ccal-who { position: sticky; left: 0; z-index: 1; background: var(--panel); border-top: 1px solid var(--line); padding: 7px 10px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.ccal-who b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ccal-who small { color: var(--muted); font-size: 11.5px; }
.ccal-cell { border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 52px; }
.ccal-cell.today { background: color-mix(in srgb, #e0561c 5%, var(--panel)); }
.ccal-cell.off { background: repeating-linear-gradient(45deg, color-mix(in srgb, #9aa4ab 12%, var(--panel)) 0 6px, var(--panel) 6px 12px); }
.ccal-chip { display: block; text-decoration: none; color: #1d262c; font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 13%, white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccal-chip small { display: block; color: #5b6870; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.ccal-chip.done { opacity: .55; text-decoration: line-through; } .ccal-chip.pend { border-left-style: dashed; } .ccal-chip.em { background: #fbe4e1; border-left-color: #c2281b; }
.ccal-chip:hover { filter: brightness(.95); }
.ccal-more { font-size: 11px; color: var(--muted); padding-left: 3px; }
.ccal-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); }
.ccal-month .ava-md { min-height: 116px; cursor: default; }

/* ---------- Texts (voip.ms replies) ---------- */
.tx-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 11px/1 var(--body); font-style: normal; margin-left: 6px; }
.ava-open { position: relative; } .ava-open .tx-badge { position: absolute; top: -6px; right: -10px; margin: 0; }
.ava-texts.has { border-color: var(--accent); color: var(--accent); }
.tx-wrap { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 14px; align-items: start; }
.tx-list { display: flex; flex-direction: column; gap: 2px; padding: 10px; max-height: calc(100vh - 210px); overflow: auto; }
.tx-list input[type=search] { margin-bottom: 6px; }
.tx-empty { padding: 10px 4px; }
.tx-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: var(--radius-ctl); color: inherit; text-decoration: none; }
.tx-row:hover { background: var(--well, var(--bg)); } .tx-row.on { background: var(--accent-soft); }
.tx-av { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-soft); color: var(--muted); font-weight: 700; }
.tx-row.unread .tx-av { background: var(--accent); color: #fff; }
.tx-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-mid b { font-weight: 650; } .tx-row.unread .tx-mid b { font-weight: 800; }
.tx-mid small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row.unread .tx-mid small { color: var(--ink); }
.tx-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--muted); font-size: 12px; }
.tx-none { padding: 40px; text-align: center; }
.tx-thread { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.tx-th { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.tx-th .grow { display: flex; flex-direction: column; line-height: 1.25; }
.tx-msgs { display: flex; flex-direction: column; gap: 6px; padding: 14px; max-height: calc(100vh - 330px); min-height: 220px; overflow: auto; background: var(--well, var(--bg)); }
.tx-thread.compact .tx-msgs { max-height: 340px; min-height: 0; }
.tx-day { align-self: center; font-size: 12px; color: var(--muted); margin: 8px 0 2px; }
.tx-b { max-width: 78%; padding: 8px 11px; border-radius: 14px; display: flex; flex-direction: column; gap: 4px; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.tx-b.in { align-self: flex-start; background: var(--panel); border: 1px solid var(--line2); border-bottom-left-radius: 4px; }
.tx-b.out { align-self: flex-end; background: var(--tatra-systems); color: #fff; border-bottom-right-radius: 4px; }
.tx-b.stop { border-color: var(--red); background: var(--red-soft); }
.tx-b small { font-size: 11px; opacity: .7; }
.tx-b img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; }
.tx-compose { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line2); }
.tx-compose textarea { width: 100%; resize: vertical; min-height: 54px; }
.tx-note { padding: 12px 14px; margin: 0; border-top: 1px solid var(--line2); }
.tx-back { display: none; }
@media (max-width: 760px) {
  .tx-wrap { grid-template-columns: 1fr; }
  .tx-page.tx-open .tx-list, .tx-page:not(.tx-open) .tx-pane, .tx-page.tx-open .pagehead { display: none; }
  .tx-back { display: inline-flex; }
  .tx-list { max-height: none; }
  .tx-msgs { max-height: calc(100vh - 300px - var(--nav-total)); }
  .tx-b { max-width: 88%; }
}

/* ---------- CARE+ booking window ---------- */
.bv { display: flex; flex-direction: column; gap: 14px; }
.bv-sec { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--panel); }
.bv-sec h4 { margin: 0; font-size: .95rem; font-weight: 750; display: flex; gap: 8px; align-items: baseline; }
.bv-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; }
.bv input[type=date], .bv input[type=time] { min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; }
.bv-win { display: flex; align-items: center; gap: 6px; } .bv-win input { flex: 1; }
.bv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bv-chips .chip small { color: var(--muted); margin-left: 4px; }
.bv-chips .chip.on { border-color: var(--accent); background: var(--accent-soft); }
.bv-eq { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bv-eq li { display: flex; flex-direction: column; }
.bv-item { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.bv-item + .bv-item { border-top: 1px dashed var(--line2); padding-top: 10px; }
.bv-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.bv-steps li { display: list-item; }
.bv-steps li > * { vertical-align: middle; }
.bv-steps input { width: calc(100% - 40px); border-color: transparent; background: transparent; padding: 4px 6px; }
.bv-steps input:focus { border-color: var(--field-line); background: var(--panel); }
.bv-steps .icon { width: 30px; height: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.bv-add { display: flex; gap: 6px; align-items: center; } .bv-add input:first-child { flex: 1; min-width: 0; }
.bv-qty { width: 64px; flex: 0 0 64px; }
.bv-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bv-parts li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-ctl); }
.bv-parts li.on { background: var(--green-soft); }
.bv-parts label.check { flex: 1; display: flex; gap: 10px; align-items: flex-start; }
.bv-parts label.check span { display: flex; flex-direction: column; }
.bv textarea { width: 100%; }
@media (max-width: 760px) { .bv-when { grid-template-columns: 1fr; } .bv-sec { padding: 10px; } }

/* ---------- Admin → Email signature ---------- */
.sig { display: flex; flex-direction: column; gap: 14px; }
.sig-bench { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.sig-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.sig-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sig-form .field input, .sig-form .field select, .sig-form .field textarea { font-weight: 400; color: var(--ink); width: 100%; }
.sig-promo { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line2); }
.sig-promo .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sig-promo .chip { font-size: 12px; }
.sig-sheet { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.sig-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line2); font-size: 13px; color: var(--muted); }
.sig-bar b { color: var(--ink); }
.sig-paper { background: #fff; color: #141a1f; padding: 22px; overflow-x: auto; }
.sig-body { font: 15px/1.55 Arial, Helvetica, sans-serif; color: #2b3238; margin: 0 0 18px; }
.sig-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line2); }
.sig-code { margin: 0 14px 14px; min-height: 110px; font: 12px ui-monospace, Menlo, monospace; }
.sig-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 16px; }
.sig-how h3 { margin: 0 0 6px; } .sig-how ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 820px) { .sig-bench { grid-template-columns: minmax(0, 1fr); } .sig-paper { padding: 16px; } }
.sig-paper table { width: auto; margin: 0; } .sig-paper td { border-bottom: 0 !important; border-top: 0; border-right: 0; vertical-align: top; }
.sig-paper td:not([style*="border-left"]) { border-left: 0; }
.seg.ava-via { width: max-content; max-width: 100%; }

/* ---------- Ava: standing blocks, vacations, requests ---------- */
.k-vac { --k: #c2410c; }
.ava-band { position: absolute; left: 0; right: 0; z-index: 0; pointer-events: none; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--k) 9%, transparent) 0 7px, transparent 7px 14px); border-left: 2px solid color-mix(in srgb, var(--k) 45%, transparent); }
.ava-band span { position: absolute; top: 2px; left: 6px; right: 4px; font-size: 10.5px; color: color-mix(in srgb, var(--k) 80%, #333); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava-grid { position: relative; } .ava-blk { z-index: 1; }
.ava-blk.pending, .ava-ev.pending, .ava-chip.pending { border-left-style: dotted; outline: 1.5px dashed color-mix(in srgb, var(--k) 60%, transparent); outline-offset: -2px; }
.ava-wait { color: #b45309 !important; font-weight: 600; }
.ava-std { display: block; width: 100%; text-align: left; border: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--k) 10%, transparent) 0 6px, transparent 6px 12px); border-left: 2px solid color-mix(in srgb, var(--k) 50%, transparent); color: var(--muted); font-size: 12px; padding: 3px 8px; border-radius: 4px; margin: 2px 0; cursor: pointer; }
.ava-std small { color: var(--muted); opacity: .8; }
.ava-allday.k-vac, .ava-chip.k-vac { background: color-mix(in srgb, #c2410c 16%, white); color: #7c2d12; font-weight: 600; }
.ava-yd.vac { box-shadow: inset 0 -3px 0 #c2410c; }
.ava-legend .pending i { background: none; border: 1.5px dashed #888; } .ava-legend .k-vac i { background: #c2410c; }
.ava-pend { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ava-pend button { text-align: left; border: 1.5px dashed #d97706; background: #fffbeb; color: #78350f; border-radius: var(--radius-ctl); padding: 8px 12px; cursor: pointer; }
.ava-pend b { margin-right: 6px; }
.ava-confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .ava-confirm span { flex: 1; min-width: 220px; }
.ava-rules { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ava-rules li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: var(--radius-ctl); }
.ava-rules li i { width: 10px; height: 28px; border-radius: 3px; background: var(--k); flex: 0 0 10px; }
.ava-rules .grow { display: flex; flex-direction: column; }
.ava-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ava-rule-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line2); border-radius: var(--radius); }
.ava-dows { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ava-dows button:not(.linkish) { width: 42px; height: 36px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 700; }
.ava-dows button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ava-rtime .field { min-width: 130px; } .ava-rtime { align-items: flex-end; }
/* booking page */
.bk-time.ask { border-style: dashed; } .bk-time i { font-style: normal; color: #c2410c; margin-left: 2px; }
.bk-note { font-size: 13px; color: #6b7280; margin: 8px 0 0; }
.bk-warn { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; font-size: 14px; line-height: 1.45; }
.bk-check.wait { background: #f59e0b; }
.ava-rb label.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; font-weight: 400; color: var(--ink); text-align: left; }
.ava-rb label.check input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.ava-std { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; padding: 2px 8px; }

/* ---------- booking page: soonest times + month calendar ---------- */
.bk-pick { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.bk-soon h3, .bk-dayt h3 { margin: 0 0 8px; }
.bk-soon-l { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bk-soon-t { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: #fff; border: 1.5px solid #e6e0d8; border-radius: 12px; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.bk-soon-t span { font-size: 13px; color: #5a6670; } .bk-soon-t b { font-size: 17px; color: #c2410c; }
.bk-soon-t:hover, .bk-soon-t.on { border-color: #e0561c; background: #fff7f2; }
.bk-soon-t.on { background: #e0561c; } .bk-soon-t.on span, .bk-soon-t.on b { color: #fff; }
.bk-soon-t.ask { border-style: dashed; } .bk-soon-t i { font-style: normal; color: #c2410c; margin-left: 2px; }
.bk-cal { background: #fff; border: 1px solid #e6e0d8; border-radius: 16px; padding: 12px 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.bk-cal-h { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.bk-cal-h b { font-size: 17px; }
.bk-nav { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e6e0d8; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: #141a1f; }
.bk-nav:disabled { opacity: .3; cursor: default; }
.bk-cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.bk-cal-g i { font-style: normal; text-align: center; font-size: 12px; font-weight: 700; color: #8a949b; padding: 2px 0 6px; }
.bk-cd { position: relative; aspect-ratio: 1; max-height: 52px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; color: #b8bfc4; cursor: default; }
.bk-cd.open { color: #141a1f; font-weight: 700; background: #fbf4ee; cursor: pointer; }
.bk-cd.open::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #e0561c; }
.bk-cd.open.ask::after { background: none; border: 1.5px solid #e0561c; width: 4px; height: 4px; }
.bk-cd.open:hover { background: #fde9dc; }
.bk-cd.today { box-shadow: inset 0 0 0 1.5px #d9d2c8; }
.bk-cd.on { background: #141a1f !important; color: #fff; } .bk-cd.on::after { background: #fff; border-color: #fff; }
.bk-none { margin: 10px 2px 0; }
.bk-part { margin-bottom: 10px; } .bk-part small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a949b; margin: 4px 0 6px; }
@media (min-width: 560px) { .bk-soon-l { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Ava: openings in month / year, book over the phone ---------- */
.k-open { --k: #2f9e6e; }
.ava-otype { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ava-otype select { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.ava-open-c { display: block; width: 100%; margin: 2px 0 3px; border: 1px solid color-mix(in srgb, #2f9e6e 45%, transparent); background: color-mix(in srgb, #2f9e6e 12%, white); color: #1f6b4a; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 6px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava-open-c:hover { background: #2f9e6e; color: #fff; }
.ava-md.has-open .n { color: #1f6b4a; font-weight: 800; }
.ava-yd.op { background: color-mix(in srgb, #2f9e6e 16%, white); color: #1f6b4a; font-weight: 700; }
.ava-yd.op.l1, .ava-yd.op.l2, .ava-yd.op.l3 { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #2f9e6e 50%, transparent); }
.ava-legend .k-open i { background: #2f9e6e; }
.ava-dayo-h { align-items: center; margin-bottom: 4px; }
.ava-dayo { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 8px 0 12px; }
.ava-slot { min-height: 40px; border: 1.5px solid #2f9e6e; color: #1f6b4a; background: var(--panel); border-radius: 8px; font-weight: 700; cursor: pointer; }
.ava-slot:hover, .ava-slot.on { background: #2f9e6e; color: #fff; }
.ava-ob { border-top: 1px solid var(--line2); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ava-ob h4 { margin: 0; }

/* crew: the rest of the techs on a visit */
.crew-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.crew-chip { border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.crew-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* My work / Projects: today's visits first */
.today-visits h3 { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.tv-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line2); }
.tv-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-acts .primary { flex: 1; justify-content: center; min-height: 44px; font-size: 1rem; }
.tv-state { color: var(--green) !important; font-weight: 700; }
.tv-row.going .tv-main { border-left-color: var(--green); background: var(--green-soft); }
.tv-row:first-of-type { border-top: 0; }
.tv-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 6px 8px; border-radius: var(--radius-ctl); background: var(--accent-soft); border-left: 4px solid var(--accent); }
.tv-row.em .tv-main { background: var(--red-soft); border-left-color: var(--red); }
.tv-time { flex: 0 0 auto; font-weight: 800; font-size: 1.05rem; min-width: 58px; }
.tv-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tv-what b { font-weight: 750; } .tv-what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-go { color: var(--accent); font-weight: 700; white-space: nowrap; }

.pm-toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }

/* schedule from the estimate */
.es-top{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin:8px 0 12px}
.es-top .field{margin:0}
.es-sum{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.es-sum b{font-size:18px}
.es-list{max-height:58vh;overflow:auto;border-top:1px solid var(--line)}
.es-sec h4{margin:14px 0 4px;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.es-row{display:grid;grid-template-columns:24px minmax(0,1fr) auto 124px minmax(110px,150px) 112px;gap:8px;align-items:center;padding:6px 0;border-bottom:1px solid var(--line)}
.es-row.sec{grid-template-columns:minmax(0,1fr) auto auto minmax(110px,150px) 112px}
.es-row > .es-name{display:flex;align-items:center;gap:6px}
.es-row > .es-name input{flex:1;min-width:0}
.es-row.off{opacity:.5}
.es-row .es-name{min-width:0}
.es-row.sec .es-name{display:flex;flex-direction:column}
.es-row.sec .es-name small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.es-days{display:flex;align-items:center;gap:4px}
.es-days input{width:62px}
.es-along{white-space:nowrap;font-size:13px}
.es-who{min-width:0;width:100%}
.es-when{font-size:13px;color:var(--muted);text-align:right;white-space:nowrap}
.es-start{margin:4px 0 8px;justify-content:center}
@media (max-width:700px){
  .es-row{grid-template-columns:24px 1fr auto;row-gap:4px}
  .es-row .es-name{grid-column:2/4}
  .es-row .es-days{grid-column:2}
  .es-row .es-rel{grid-column:3}
  .es-row .es-who{grid-column:2/3}
  .es-row .es-when{grid-column:3;text-align:right}
  .es-sum{align-items:flex-start;width:100%}
  .es-row.sec{grid-template-columns:1fr auto}
  .es-row.sec > .es-name{grid-column:1/3;align-items:flex-start;text-align:left}
  .es-row.sec .es-name small{white-space:normal}
  .es-row.sec .es-days{grid-column:1}
  .es-row.sec .es-along{grid-column:2}
  .es-row.sec .es-who{grid-column:1}
  .es-row.sec .es-when{grid-column:2}
}
.es-why{grid-column:2/-1;margin-top:-4px;font-size:12px;color:var(--muted)}
.es-row.sec .es-why{display:none}
.es-size button{white-space:nowrap}
/* Admin → Schedule time */
.stime-def{display:flex;flex-direction:column;gap:4px;font-size:13px}
.stime-v{display:inline-flex;align-items:center;gap:4px}
.stime-v input{width:92px;text-align:right}
.stime-dol{color:var(--muted)}
.stime-table select{max-width:210px}
.stime-table tr.off td{opacity:.6}
@media (max-width:700px){ .es-row .es-why{grid-column:2/4} .stime-table select{max-width:150px} .stime-v input{width:74px} }

.es-facts{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;margin:0 0 12px;padding:10px 12px;background:var(--line2);border-radius:10px}
.es-facts .field{margin:0}
.es-facts input{width:110px}
.es-pct{display:inline-flex;align-items:center;gap:4px}
.es-pct input{width:64px}
.es-rel{width:100%;min-width:0}
.es-row.ms .es-name input{font-weight:600}
.es-top .field > span{display:block}
@media (max-width:700px){ .es-facts input{width:92px} .es-row .es-rel{width:auto} }
.stime-count,.stime-mini{display:flex;gap:4px;align-items:center;flex-wrap:nowrap}
.stime-table .stime-count input,.stime-table .stime-mini input{width:64px;min-width:0;padding-left:6px;padding-right:6px}
.stime-table .stime-count select{width:auto;max-width:130px}
.stime-table td > select{min-width:150px}
.stime-table td{vertical-align:top}
.table.card:has(.stime-table){overflow-x:auto}
.es-facts .check{display:flex;align-items:center;gap:8px;padding-bottom:10px}
.stime-table td:first-child{min-width:220px}
/* project or job from an estimate */
.twk{display:flex;flex-direction:column;gap:12px;width:100%;min-width:0;flex:1 1 100%;grid-column:1/-1}
.twk .grid2{width:100%}
.tw-mode{align-self:flex-start}
.tw-kinds{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tw-kind{display:flex;flex-direction:column;gap:4px;text-align:left;padding:12px 14px;cursor:pointer;border:1.5px solid var(--line)}
.tw-kind.on{border-color:var(--brand,#e8501f);box-shadow:0 0 0 2px color-mix(in srgb,var(--brand,#e8501f) 25%,transparent)}
.tw-kind b{font-size:16px}
.jp .toolbar label.button{cursor:pointer}
.jp-day h4{margin:16px 0 8px}
@media (max-width:520px){ .tw-kinds{grid-template-columns:1fr} }
.twk{text-align:left}
.twk .field > span{text-align:left}
.tw-kinds{grid-template-columns:repeat(2,minmax(0,1fr))}
.tw-kind{margin:0 !important;width:100%;box-sizing:border-box;transform:none !important;align-items:flex-start}
.twk label.check{justify-content:flex-start;text-align:left}
.tw-kind,.tw-kind *{white-space:normal;overflow-wrap:anywhere}
/* budget vs actual */
.bv{margin:0 0 16px}
.bv-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.bv-head h3{margin:0}
.bv-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:14px}
.bv-row{display:grid;grid-template-columns:96px minmax(150px,auto) 1fr 48px;gap:10px;align-items:center}
.bv-row > span{color:var(--muted);font-size:13px}
.bv-bar{height:10px;border-radius:6px;background:var(--line2);overflow:hidden}
.bv-bar i{display:block;height:100%;background:var(--brand,#e8501f);border-radius:6px}
.bv-bar i.done{background:#5b8c2a}
.bv-bar i.bad{background:#c0392b}
.bv-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.bv-grid > div{display:flex;flex-direction:column;gap:2px}
.bv-grid small{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.03em}
.bv-grid b{font-size:18px}
.bv-grid span{font-size:12px}
.bv p{margin:10px 0 0}
@media (max-width:600px){ .bv-row{grid-template-columns:80px 1fr 40px} .bv-row .bv-bar{grid-column:1/-1;grid-row:2} }
.co-rates{display:flex;flex-direction:column;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.tw-sched{display:flex;flex-direction:column;gap:6px}
.es-old{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:0 0 12px}
.es-old summary{cursor:pointer}
.es-old-bar{margin:8px 0;align-items:center;flex-wrap:wrap}
.es-old-list{max-height:28vh;overflow:auto;display:flex;flex-direction:column}
.es-old-row{display:grid;grid-template-columns:24px minmax(0,1fr) auto 56px;gap:8px;align-items:center;padding:5px 0;border-top:1px solid var(--line2);cursor:pointer}
.es-old-row.gone .es-old-name{text-decoration:line-through;color:var(--muted)}
.es-old-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.es-old-tag{font-size:12px;text-align:center;border-radius:6px;padding:2px 0}
.es-old-tag.keep{background:#e6f2dc;color:#3d6b17}
.es-old-tag.erase{background:#fbe3df;color:#a8321f}
/* phone timeline */
.pg{padding:0;overflow:hidden}
.pg-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.pg-inner{position:relative;min-width:100%}
.pg-head{position:relative;height:44px;border-bottom:1px solid var(--line);background:var(--panel)}
.pg-month{position:absolute;top:4px;font-size:12px;font-weight:700;padding-left:6px;white-space:nowrap;border-left:1px solid var(--line)}
.pg-tick{position:absolute;top:24px;font-size:11px;color:var(--muted);padding-left:3px;white-space:nowrap}
.pg-tick.we{color:color-mix(in srgb,var(--muted) 55%,transparent)}
.pg-tick.today{color:var(--brand,#e8501f);font-weight:700}
.pg-body{position:relative;padding:4px 0 10px}
.pg-grid{position:absolute;top:0;bottom:0;width:0;border-left:1px solid var(--line2);pointer-events:none}
.pg-grid.we{background:color-mix(in srgb,var(--line2) 60%,transparent);border-left:0}
.pg-today{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background:var(--brand,#e8501f);opacity:.7;pointer-events:none;z-index:1}
.pg-target{position:absolute;top:0;bottom:0;width:0;border-left:2px dashed #c0392b;opacity:.6;pointer-events:none}
.pg-row,.pg-phase{position:relative;height:50px;cursor:pointer}
.pg-phase{height:44px;background:color-mix(in srgb,var(--line2) 70%,transparent);border-top:1px solid var(--line2)}
.pg-label{position:sticky;left:8px;display:inline-block;max-width:calc(100vw - 72px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:14px;line-height:20px;padding:3px 0 0;background:none;border:0;color:var(--ink);text-align:left;z-index:2}
.pg-label small{color:var(--muted);font-size:12px;font-weight:400}
.pg-phase .pg-label{font-size:13px;padding-top:4px;cursor:pointer}
.pg-bar{position:absolute;top:26px;height:18px;border-radius:5px;background:#dbe9f7;border:1px solid #6a9fd4;overflow:hidden}
.pg-bar i{display:block;height:100%;background:#6a9fd4}
.pg-row.late .pg-bar{background:#fbe3df;border-color:#c0392b}.pg-row.late .pg-bar i{background:#c0392b}
.pg-row.done .pg-bar{background:#e6f2dc;border-color:#5b8c2a}.pg-row.done .pg-bar i{background:#5b8c2a}
.pg-sum{position:absolute;top:28px;height:8px;border-radius:3px;background:#3a4650;overflow:hidden}
.pg-sum i{display:block;height:100%;background:#5b8c2a}
.pg-ms{position:absolute;top:28px;width:14px;height:14px;transform:rotate(45deg);background:#3a4650;border-radius:2px}
.pg-row:active .pg-bar{filter:brightness(.92)}
.sched-more{width:auto;max-width:140px}
@media (max-width:700px){ .schedule > .toolbar{flex-wrap:wrap;gap:8px} .schedule > .toolbar .seg.sub button{padding-left:10px;padding-right:10px} }
.pg-phase{height:54px}
.pg-sum{top:36px}
.pg-row .pg-label{background:var(--panel);padding-right:6px;border-radius:4px}
.pg-phase .pg-label{background:color-mix(in srgb,var(--line2) 70%,var(--panel));padding-right:6px;border-radius:4px}
.pg-phase .pg-label{background:none}
/* schedule list */
.tasklist{padding:0;overflow:hidden}
.tl-phase,.tl-task{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:10px;align-items:center;padding:10px 12px 8px;border-top:1px solid var(--line2);cursor:pointer}
.tl-phase{background:color-mix(in srgb,var(--line2) 70%,var(--panel));grid-template-columns:16px minmax(0,1fr) auto}
.tl-task{grid-template-columns:minmax(0,1fr) auto}
.tl-phase:first-child{border-top:0}
.tl-caret{color:var(--muted);font-size:12px}
.tl-main{display:flex;flex-direction:column;gap:2px;min-width:0}
.tl-name{font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.tl-main small{line-height:1.3}
.tl-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.tl-side small,.tl-pc{font-size:12px;color:var(--muted)}
.tl-bar{grid-column:1/-1;height:4px;border-radius:3px;background:var(--line2);margin-top:8px;overflow:hidden}
.tl-bar i{display:block;height:100%;background:#6a9fd4}
.tl-phase .tl-bar i{background:#3a4650}
.tl-task.done .tl-bar i{background:#5b8c2a}
.tl-task.late{box-shadow:inset 3px 0 0 #c0392b}.tl-task.late .tl-bar i{background:#c0392b}
.tl-task.now{box-shadow:inset 3px 0 0 var(--brand,#e8501f)}
.tl-task:active,.tl-phase:active{background:color-mix(in srgb,var(--line2) 50%,transparent)}
.tasklist .tl-name{white-space:normal;overflow:visible;text-overflow:clip}

/* the schedule uses the whole screen on wide displays */
.main:has(.schedule), body.has-ava .main:has(.schedule), body.has-ava.ava-collapsed .main:has(.schedule){max-width:none}
/* client billing */
.cbill-list{padding:0;overflow:hidden}
.cbill-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center;padding:12px 14px;border-top:1px solid var(--line2);color:inherit;text-decoration:none}
.cbill-row:first-child{border-top:0}
.cbill-row.late{box-shadow:inset 3px 0 0 #c0392b}
.cbill-main,.cbill-end{display:flex;flex-direction:column;gap:2px}
.cbill-end{align-items:flex-end}
.cbill-pay{grid-column:1/-1;justify-self:start}
@media (min-width:700px){ .cbill-row{grid-template-columns:minmax(0,1fr) auto auto} .cbill-pay{grid-column:auto} }
/* client account */
.cacct-list{display:flex;flex-direction:column}
.cacct-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 2px;border-top:1px solid var(--line2);color:inherit;text-decoration:none}
.cacct-row:first-child{border-top:0}
.cacct-row:not(.nolink):hover{background:color-mix(in srgb,var(--line2) 40%,transparent)}
.cacct-main{display:flex;flex-direction:column;gap:1px;min-width:0}
.cacct-main b{overflow-wrap:anywhere}
.cacct-end{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
.cacct-pay .cbill-row{padding-left:2px;padding-right:2px}
@media (min-width:761px){ .acct-tile.m-only{display:none} }
/* Tatra TXT — floating texts window (Hub look: white panel, ink type, the accent used sparingly) */
.txd-fab{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:60;display:flex;align-items:center;gap:7px;
  height:44px;padding:0 16px 0 13px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:var(--ink);
  font:700 13px/1 var(--display);font-stretch:106%;letter-spacing:.06em;box-shadow:0 6px 20px rgba(20,26,31,.12);cursor:pointer}
.txd-fab:hover{border-color:var(--ink)}
.hdr-txt svg{width:24px;height:24px}
.txd-fab svg{width:20px;height:20px}
.txd-fab svg,.hdr-txt svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
.txd-fab .tx-badge{position:absolute;top:-5px;right:-5px;margin:0}
.txd-on .txd-fab{display:none}
.hdr-txt{position:relative;background:none;border:0;padding:0;cursor:pointer;font:inherit}
.hdr-txt .tx-badge{position:absolute;top:6px;right:8px;margin:0;min-width:16px;height:16px;font-size:10px;padding:0 4px}
.txd-on .hdr-txt{color:var(--accent)}
.txd{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:60;width:min(400px,calc(100vw - 24px));height:min(620px,calc(100vh - 120px));
  display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:0 20px 50px rgba(20,26,31,.18);overflow:hidden}
.txd-head{display:flex;align-items:center;gap:4px;min-height:54px;padding:0 8px 0 14px;border-bottom:1px solid var(--line)}
.txd-title{display:flex;align-items:center;gap:8px;font:800 17px/1 var(--display);font-stretch:112%;letter-spacing:-.01em;color:var(--ink);white-space:nowrap}
.txd-title::before{content:'';width:4px;height:18px;border-radius:2px;background:var(--accent)}
.txd-title span{color:var(--accent)}
.txd-ic{display:grid;place-items:center;width:34px;height:34px;min-height:0;padding:0;border:0;border-radius:8px;background:none;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;text-decoration:none}
.txd-ic:hover{background:var(--line2);color:var(--ink);text-decoration:none}
.txd-head .txd-ic:first-child{margin-left:-8px;font-size:24px}
.txd-newbtn{margin-right:4px;min-height:34px;padding:0 12px;border-radius:999px}
.txd-body{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column}
.txd-body > .tx-thread{flex:1;border:0;border-radius:0;margin:0;box-shadow:none;display:flex;flex-direction:column;min-height:0}
.txd-body .tx-msgs{flex:1;min-height:0;max-height:none;overflow:auto}
.txd-pad{padding:14px}
.txd-home{display:flex;flex-direction:column;min-height:0}
.txd-tabs{display:flex;gap:18px;padding:0 14px;border-bottom:1px solid var(--line2)}
.txd-tabs button{position:relative;min-height:40px;padding:0;border:0;background:none;color:var(--muted);font-weight:650;font-size:14px;cursor:pointer;border-radius:0}
.txd-tabs button.on{color:var(--ink)}
.txd-tabs button.on::after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:2px;background:var(--accent)}
.txd-tabs button:active:not(:disabled){transform:none}
.txd-list{display:flex;flex-direction:column}
.txd-list > input{margin:10px 14px 4px;width:auto}
.txd-list .tx-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:11px;align-items:center;padding:11px 14px;border:0;border-radius:0;border-bottom:1px solid var(--line2);background:none;text-align:left;cursor:pointer;color:inherit;white-space:normal}
.txd-list .tx-row:hover{background:var(--well,var(--bg))}
.txd-list .tx-mid small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.txd-list .tx-end{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.txd-list .tx-end small{color:var(--muted);font-size:12px}
.txd-list .tx-end .tx-badge{margin:0}
.txd-filt{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;padding:10px 14px 8px}
.txd-filt input,.txd-filt select{width:auto;min-width:0;margin:0;min-height:36px;font-size:14px}
.txd-filt select{max-width:128px}
.txl-day h4{position:sticky;top:0;z-index:1;margin:0;padding:10px 14px 6px;background:var(--panel);font:700 11px/1.2 var(--display);font-stretch:100%;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.txl-day h4 small{text-transform:none;letter-spacing:0;font-size:11px;font-weight:500;margin-left:4px}
.txl-row{display:grid;grid-template-columns:58px minmax(0,1fr);gap:8px;width:100%;box-sizing:border-box;min-width:0;padding:9px 14px;border:0;border-radius:0;border-top:1px solid var(--line2);background:none;text-align:left;cursor:pointer;color:inherit;white-space:normal}
.txl-row:hover{background:var(--well,var(--bg))}
.txl-t{font-size:12px;color:var(--muted);padding-top:2px;font-variant-numeric:tabular-nums}
.txl-mid{display:flex;flex-direction:column;gap:3px;min-width:0;overflow:hidden}
.txl-who{display:flex;align-items:center;gap:5px;font-size:13px;min-width:0;white-space:nowrap;overflow:hidden}
.txl-who b{overflow:hidden;text-overflow:ellipsis}
.txl-who::before{content:'';flex:0 0 7px;height:7px;border-radius:50%;background:var(--tatra-systems,#0a84d6)}
.txl-row.in .txl-who::before{background:var(--line);box-shadow:inset 0 0 0 1.5px var(--muted)}
.txl-row.unread .txl-who::before{background:var(--accent);box-shadow:none}
.txl-row.unread .txl-body{font-weight:650}
.txl-k{font-style:normal;font-size:11px;padding:1px 7px;border-radius:9px;background:var(--line2);color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.txl-body{font-size:14px;line-height:1.38;color:var(--ink);overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.txd-new{display:flex;flex-direction:column;gap:10px}
.txd-new textarea{min-height:110px;resize:vertical}
.txd-match button{align-items:center}
.txd-mn{display:flex;flex-direction:column;min-width:0}
.txd-mn small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.txd-match button > small{white-space:nowrap;font-variant-numeric:tabular-nums}
.txd-to{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid var(--line);border-radius:12px}
.txd-who{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center}
.txd-nums,.txd-phr{display:flex;flex-wrap:wrap;gap:6px}
.txd-nums .chip,.txd-phr .chip{min-height:32px;padding:4px 12px;font-size:13px}
.txd-phr{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -14px;padding:0 14px}
.txd-phr::-webkit-scrollbar{display:none}
.txd-earlier{align-self:flex-start;padding:0;min-height:0;border:0;background:none;color:var(--link,#0a84d6);cursor:pointer;font-size:13px}
.txd-send{display:flex;align-items:center;gap:10px}
.txd-send small{flex:1}
.txd-match{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.txd-match button{display:flex;justify-content:space-between;gap:8px;padding:9px 12px;border:0;border-radius:0;border-top:1px solid var(--line2);background:var(--panel);text-align:left;cursor:pointer}
.txd-match button:first-child{border-top:0}
@media (max-width:760px){
  .txd-fab{display:none}
  .txd{right:0;left:0;bottom:var(--nav-total,72px);top:calc(var(--top-h,56px) + env(safe-area-inset-top,0px));width:auto;height:auto;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none}
}
@media print{.txd,.txd-fab{display:none}}

/* texts: pictures and files */
.tx-attach{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;border-radius:10px;color:var(--muted);cursor:pointer}
.tx-attach:hover{background:var(--line2);color:var(--ink)}
.tx-attach svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tx-files{display:flex;flex-wrap:wrap;gap:6px}
.tx-file{display:flex;align-items:center;gap:6px;max-width:100%;padding:4px 4px 4px 4px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.tx-file img{width:40px;height:40px;object-fit:cover;border-radius:6px}
.tx-file i{font-style:normal;font-size:22px;width:32px;text-align:center}
.tx-file small{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tx-file button{width:26px;height:26px;min-height:0;padding:0;border:0;border-radius:6px;background:none;color:var(--muted);cursor:pointer}
.tx-file button:hover{background:var(--line2);color:var(--ink)}
.tx-filelink{display:inline-flex;gap:6px;align-items:center;padding:6px 10px;border-radius:10px;background:rgba(255,255,255,.18);color:inherit;text-decoration:underline}
.tx-b.in .tx-filelink{background:var(--line2)}
.txd-add{align-self:flex-start}
.txd-addform input{margin:0}
.txd-crew{display:flex;flex-direction:column;gap:8px}
.txd-time{display:flex;align-items:center;gap:10px;font-weight:600;font-size:14px}
.txd-time input{width:auto;margin:0;min-height:38px}
.txd-lead{font-size:13px;line-height:1.3}
.tx-compose .txd-crew,.tx-compose .txd-lead{padding:0 0 6px}
.tx-compose .txd-phr{margin:0;padding:0}
.ava-opts{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.ava-opt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;cursor:pointer}
.ava-opt.on{border-color:var(--ink);background:var(--well,var(--bg))}
.ava-opt input{margin:3px 0 0;width:18px;height:18px;min-height:0;flex:0 0 18px;padding:0;box-shadow:none;outline-offset:2px}
.ava-opt span{display:flex;flex-direction:column;gap:2px}

/* turn on notifications (web app) */
.notify-ask{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:9px 14px;background:var(--panel);border-bottom:1px solid var(--line);font-size:14px}
.notify-ask > span{flex:1;min-width:200px}
.notify-ask .primary{min-height:34px;padding:0 14px;border-radius:999px}
.notify-x{width:30px;height:30px;min-height:0;padding:0;border:0;border-radius:8px;background:none;color:var(--muted);cursor:pointer}
.notify-x:hover{background:var(--line2);color:var(--ink)}
.notify-ask.inline{padding:6px 0 0;border:0;background:none;font-size:13px}
.notify-ask .bad{flex-basis:100%}
.tx-pic{display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.tx-tofile{min-height:0;padding:3px 9px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:var(--ink);font-size:12px;font-weight:600;cursor:pointer}
.tx-b.out .tx-tofile{border-color:rgba(255,255,255,.5);background:rgba(255,255,255,.15);color:#fff}
.tx-topic img{max-width:100%;max-height:220px;border-radius:10px;display:block;margin:0 auto 10px}
.tx-filelink.in{background:var(--line2);margin:0 0 10px}
.tx-link{padding:0;min-height:0;border:0;background:none;color:var(--link,#0a84d6);font:inherit;cursor:pointer}

/* Mail — the office Gmail inside the Hub */
.mailpage{max-width:none}
.mail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.mail-head .page-title{margin:0}
.mail-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:12px}
.mail-boxes{display:flex;gap:18px;border-bottom:1px solid var(--line);flex:0 0 auto}
.mail-boxes button{position:relative;min-height:38px;padding:0;border:0;background:none;color:var(--muted);font-weight:650;font-size:14px;cursor:pointer;border-radius:0}
.mail-boxes button.on{color:var(--ink)}
.mail-boxes button.on::after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:2px;background:var(--accent)}
.mail-search{flex:1 1 280px;min-width:0}
.mail-search input{width:100%;margin:0}
.mail-cols{display:grid;grid-template-columns:minmax(300px,400px) minmax(0,1fr);gap:16px;align-items:start}
.mail-list,.mail-read{background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow:hidden;min-width:0}
.mail-list{max-height:calc(100vh - 230px);overflow:auto}
.mail-read{min-height:300px}
.mail-pad{padding:14px}
.mail-none{display:grid;place-items:center;min-height:300px;font-size:14px}
.mail-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;width:100%;padding:10px 14px;border:0;border-bottom:1px solid var(--line2);border-left:3px solid transparent;border-radius:0;background:none;text-align:left;color:inherit;cursor:pointer;white-space:normal}
.mail-row:hover{background:var(--well,var(--bg))}
.mail-row.on{background:var(--well,var(--bg));border-left-color:var(--accent)}
.mail-row.unread .mail-from,.mail-row.unread .mail-subj{font-weight:750}
.mail-row.unread{border-left-color:#0a84d6}
.mail-from{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mail-date{font-size:12px;color:var(--muted);white-space:nowrap}
.mail-subj{grid-column:1/-1;font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mail-row.unread .mail-subj{color:var(--ink)}
.mail-pages{display:flex;align-items:center;justify-content:space-between;padding:10px 14px}
.mail-msg{display:flex;flex-direction:column}
.mail-msghead{padding:14px 16px 10px;border-bottom:1px solid var(--line2);display:flex;flex-direction:column;gap:4px}
.mail-msghead h2{margin:0 0 4px;font-size:19px;line-height:1.25}
.mail-meta{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.mail-when{margin-left:auto}
.mail-client{font-size:13px;margin-top:2px}
.mail-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.mail-back{display:none;align-self:flex-start}
.mail-atts{display:flex;flex-wrap:wrap;gap:8px;padding:10px 16px;border-bottom:1px solid var(--line2)}
.mail-att{display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.mail-attname{display:flex;align-items:center;gap:6px;max-width:260px;min-height:36px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);cursor:pointer;text-align:left}
.mail-attname b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.mail-imgs{padding:8px 16px 0;margin:0}
.mail-body{padding:10px 16px 18px}
.mail-body iframe{width:100%;min-height:400px;border:0;display:block;background:#fff}
.mail-text{white-space:pre-wrap;font:14px/1.5 -apple-system,system-ui,sans-serif;margin:0;overflow-wrap:anywhere}
.mail-writer{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:70;width:min(620px,calc(100vw - 24px));height:min(620px,calc(100vh - 110px));display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:0 20px 50px rgba(20,26,31,.22);overflow:hidden}
.mail-writer header,.mail-writer footer{display:flex;align-items:center;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid var(--line2)}
.mail-writer footer{border-bottom:0;border-top:1px solid var(--line2)}
.mail-wbody{flex:1;min-height:0;display:flex;flex-direction:column}
.mail-line{display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--line2)}
.mail-line span{width:56px;flex:0 0 56px;font-size:13px;color:var(--muted)}
.mail-line input{flex:1;border:0;margin:0;padding:10px 0;min-height:40px;background:none;box-shadow:none;border-radius:0}
.mail-line input:focus{outline:none}
.mail-wbody textarea{flex:1;border:0;margin:0;padding:12px 14px;resize:none;border-radius:0;font:15px/1.5 -apple-system,system-ui,sans-serif;min-height:160px}
.mail-wbody textarea:focus{outline:none}
.mail-wbody > small{padding:6px 14px}
@media (max-width:860px){
  .mail-cols{grid-template-columns:1fr}
  .mailpage .mail-read{display:none}
  .mailpage.reading .mail-read{display:block}
  .mailpage.reading .mail-list,.mailpage.reading .mail-bar{display:none}
  .mail-back{display:inline-flex}
  .mail-list{max-height:none}
  .mail-writer{inset:calc(var(--top-h,56px) + env(safe-area-inset-top,0px)) 0 0 0;width:auto;height:auto;border-radius:0;border:0}
}

.mail-files{display:flex;flex-direction:column;gap:6px;padding:8px 12px;border-top:1px solid var(--line2);max-height:170px;overflow:auto}
.mail-file{display:grid;grid-template-columns:26px minmax(0,1fr) auto 30px;gap:8px;align-items:center}
.mail-fi{font-size:18px;text-align:center}
.mail-fn{display:flex;flex-direction:column;min-width:0}
.mail-fn b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mail-fn small{font-size:11px}
.mail-as{flex-wrap:nowrap}
.mail-as button{min-height:28px;padding:0 10px;font-size:12px}
.mail-writer footer{flex-wrap:wrap}
.mail-addf{cursor:pointer}
.mail-pick{max-height:46vh;overflow:auto;margin-top:8px}
.mail-pick h5{margin:10px 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.mail-pickrow{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:8px;align-items:center;padding:5px 0;border-bottom:1px solid var(--line2)}
.mail-pickrow span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}

/* mail tags */
.mt-views{display:flex;flex-wrap:wrap;align-items:center;gap:6px;flex-basis:100%}
.mt-chips{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;margin-top:3px}
.mt-chip{display:inline-flex;align-items:center;gap:4px;font-style:normal;font-size:11.5px;font-weight:600;line-height:1;padding:4px 8px;border-radius:999px;background:var(--line2);color:var(--ink);border:1px solid transparent;white-space:nowrap}
button.mt-chip{cursor:pointer;min-height:0}
.mt-chip.on{border-color:var(--ink);background:var(--panel)}
.mt-chip a{color:inherit;text-decoration:none}
.mt-chip button{border:0;background:none;padding:0 0 0 2px;min-height:0;color:var(--muted);cursor:pointer;font-size:11px}
.mt-chip.k-client{background:#e8f3fd;color:#0b5c99}
.mt-chip.k-sub{background:#fdf0e6;color:#a4480f}
.mt-chip.k-supplier{background:#eef6e6;color:#4b7a1c}
.mt-chip.k-team{background:#f0eefb;color:#5a45a8}
.mt-chip.k-bill{background:#fff4d6;color:#8a6100}
.mt-chip.k-proj{background:#1d2328;color:#fff}
.mt-chip.k-proj button{color:#cfd5d9}
.mt-chip.k-untagged{background:var(--panel);border-color:var(--line)}
.mt-tog.on{border-color:#8a6100}
.mt-panel{display:flex;flex-direction:column;gap:8px;margin-top:10px;padding-top:10px;border-top:1px dashed var(--line)}
.mt-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.mt-row select{width:auto;max-width:260px;margin:0;min-height:32px;font-size:13px}
.mt-add input{width:130px;margin:0;min-height:32px;font-size:13px}
.mt-log{font-size:12px}
.mt-rules{display:flex;flex-direction:column;gap:6px;margin:10px 0}
.mt-rule{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.mt-rule.off{opacity:.55}
.mt-rdesc{display:flex;flex-direction:column;min-width:0}
.mt-h{margin:14px 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.mt-check{align-self:end;padding-bottom:10px}
.mt-sub{padding-left:26px}
.mt-people{display:flex;flex-wrap:wrap;gap:4px 14px}
.mt-proj .mail-row{text-decoration:none}
.mt-on{width:20px;height:20px;margin:0}
.svc-chip.closed{opacity:.6}
/* checklist for the tech on a service call: this house's steps and this visit's */
.steps-box { display: flex; flex-direction: column; gap: .45rem; border: 1px solid var(--line, #dde1e3); border-radius: 10px; padding: .55rem .75rem; margin: .5rem 0; }
.steps-box .steps-have { margin: .25rem 0 0; padding-left: 1.1rem; }
.steps-box .check { display: inline-flex; align-items: center; gap: .4rem; }
.steps-box .check input { width: 16px; height: 16px; min-height: 0; margin: 0; flex: none; }
/* Permits: the towns' permit emails, filed into projects */
.permits .permit, .permit-file { display: flex; flex-direction: column; gap: .4rem; }
.permit-head { align-items: center; }
.permit-last { margin: 0; }
.permit-time { list-style: none; margin: .2rem 0 0; padding: 0 0 0 .7rem; display: flex; flex-direction: column; gap: .45rem; border-left: 2px solid var(--line, #dde1e3); }
.permit-time li { font-size: .92rem; }
.permit-time .row { align-items: center; }
.permit-day { color: var(--muted, #6b7378); min-width: 6.5em; font-variant-numeric: tabular-nums; }
.permit-note { margin: .2rem 0 0 7em; padding: .35rem .55rem; background: var(--blue-soft, #eef4fb); border-radius: 8px; }
.permit-note-edit { margin: .3rem 0 0 7em; align-items: flex-start; }
.permit-file.permit-alert { border-left: 4px solid var(--red, #c0392b); }
.permit-match { display: flex; flex-direction: column; gap: .45rem; border-top: 1px solid var(--line, #dde1e3); padding-top: .55rem; }
.permit-match label { display: flex; flex-direction: column; gap: .25rem; }
.permit-match label.check { flex-direction: row; align-items: center; gap: .45rem; }
.permit-match label.check input { width: 16px; height: 16px; min-height: 0; margin: 0; flex: none; }
.permit-trades { margin: .6rem 0; }
.permit-trades .chip { display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line, #dde1e3); text-decoration: none; color: inherit; font-size: .9rem; }
.permit-trades .chip.on { background: var(--ink, #1d2327); color: #fff; border-color: transparent; }
.permit-trades .chip b { font-weight: 600; opacity: .7; }
.ptrade { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.4; background: #eef0f1; color: #444; }
.ptrade.t-building { background: #fdebd9; color: #9a4a06; } .ptrade.t-electrical { background: #fff4c7; color: #7a5b00; }
.ptrade.t-plumbing { background: #dfeefc; color: #1d5b9a; } .ptrade.t-gas { background: #fde3e1; color: #a12a1f; }
.ptrade.t-conservation { background: #e2f3e4; color: #2c6b34; }
.permit-table { width: 100%; border-collapse: collapse; } .permit-table th, .permit-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line, #dde1e3); vertical-align: top; }
.tabs .nbadge { position: static; margin-left: .3rem; }
.permit-head .grow { flex: 1 1 14rem; min-width: 0; }
.permit-time .row .grow { flex: 1 1 12rem; min-width: 0; }
@media (max-width: 640px) { .permit-note, .permit-note-edit { margin-left: 0; } .permit-day { min-width: 0; } }
.ptrade.t-utility_electric { background: #fff0d6; color: #8a5300; } .ptrade.t-utility_gas { background: #e6e6fb; color: #3b3b9a; }
.permit-group h3 { margin: 0; }
.permit-line { padding: .5rem 0; border-top: 1px solid var(--line, #dde1e3); align-items: center; }
.permit-line .grow { flex: 1 1 16rem; min-width: 0; }
.permit-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .6rem .8rem; margin: .5rem 0; }
.permit-add-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.permit-add-grid .span { grid-column: 1 / -1; }
.c-blue .acct-ic { background: var(--blue-soft); color: var(--blue); }
.bottomnav a { position: relative; }
.ptrade-pick { position: relative; cursor: pointer; } .ptrade-pick select { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.permit-sort { align-items: center; margin: .2rem 0 .6rem; }
.permit-addr { display: flex; flex-direction: column; gap: .35rem; }
.permit-addr.closed { border-left: 4px solid var(--green, #3d8b3d); }
.permit-addr h3 { margin: 0; }
.permit-each { display: flex; flex-direction: column; gap: .6rem; margin-top: .4rem; }
.permit-each .card { box-shadow: none; border: 1px solid var(--line, #dde1e3); }
.permit-only { display: inline-flex; align-items: center; gap: .4rem; margin-left: .6rem; } .permit-only input { width: 16px; height: 16px; min-height: 0; margin: 0; }
/* a permit's steps */
.psteps { border: 1px solid var(--line, #dde1e3); border-radius: 10px; padding: .5rem .7rem; display: flex; flex-direction: column; gap: .35rem; }
.psteps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.psteps-list li { display: flex; align-items: center; gap: .55rem; font-size: .95rem; }
.psteps-list li i { font-style: normal; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; }
.ps-done i { background: var(--green-soft, #e5f3e5); color: var(--green, #3d8b3d); }
.ps-current i { background: var(--blue-soft, #e6effa); color: var(--blue, #2f6fb5); }
.ps-open i { background: #f1f2f3; color: #8a9196; }
.ps-na i { background: #f1f2f3; color: #b4b9bc; } .ps-na span { color: #9aa0a4; text-decoration: line-through; }
.ps-btn { background: none; border: 0; padding: 0; min-height: 0; cursor: pointer; }
.psteps-paste textarea { width: 100%; }
.ps-off { opacity: .4; } .psteps-list li input[type=checkbox] { width: 16px; height: 16px; min-height: 0; margin: 0; flex: none; } .psteps-list code { word-break: break-all; font-size: .7rem; }
.qtype { margin: .3rem 0 0 7em; align-items: center; } @media (max-width:640px){ .qtype { margin-left: 0; } } .small-chip { padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--line,#dde1e3); background: #fff; font-size: .85rem; min-height: 0; }
.cp-login-list { list-style: none; margin: .3rem 0; padding: 0; } .cp-login-list li { display: flex; gap: .5rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--line,#dde1e3); }
.cp-login-add { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: .5rem; margin-top: .5rem; } @media (max-width: 640px) { .cp-login-add { grid-template-columns: 1fr 1fr; } .cp-login-add input { grid-column: 1 / -1; } }
/* client → People: who can sign in */
.pl-list { list-style: none; margin: 0; padding: 0; }
.pl-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line, #dde1e3); }
.pl-list li:first-child { border-top: 0; }
.pl-list a { cursor: pointer; color: inherit; text-decoration: none; min-width: 0; }
.pl-switch { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; flex: none; position: relative; }
.pl-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pl-track { width: 38px; height: 22px; border-radius: 999px; background: #cfd4d7; position: relative; transition: background .15s; }
.pl-track i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.pl-switch.on .pl-track { background: var(--green, #3d8b3d); } .pl-switch.on .pl-track i { left: 19px; }
.cl-access { margin-bottom: .8rem; } .cl-access h3 { margin: 0 0 .2rem; }
.ph { position: relative; } .ph-hidden img { opacity: .45; } .ph-flag { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-style: normal; font-size: .7rem; padding: 1px 6px; border-radius: 6px; } .lb-hide { margin-left: .5rem; }
.older-inv { margin-top: 1rem; } .older-inv h3 { margin: 0 0 .2rem; }
/* View as: the "view only" bar is fixed above the app's own top bar, and everything sticky sits below both —
   before, the sticky bar and the fixed top bar fought over the same spot and the tabs shook while scrolling */
html.in-frame { --va-bar: 26px; }
html.in-frame .viewas-bar { position: fixed; top: 0; left: 0; right: 0; height: var(--va-bar); padding: 0 12px; display: flex; align-items: center; justify-content: center; z-index: 70; }
html.in-frame .topbar { top: var(--va-bar); }
html.in-frame .tabs { top: calc(var(--top-h) + var(--va-bar) + env(safe-area-inset-top, 0px)); }
html.in-frame .clockbanner { top: calc(var(--top-h) + var(--va-bar) + env(safe-area-inset-top, 0px)); }
html.in-frame .shell:has(.clockbanner) .tabs { top: calc(var(--top-h) + var(--va-bar) + 40px + env(safe-area-inset-top, 0px)); }
html.in-frame .main { margin-top: var(--va-bar); }
/* sticky tabs that scroll sideways jitter on iPhone with a fade mask: keep the fade off the sticky layer */
@media (max-width: 760px) { .project .tabs { -webkit-mask-image: none; mask-image: none; } }
/* View as on a phone: iPhone sometimes hands the swipe to the page behind the panel (which can't move) and the
   person's screen looks frozen. The page behind is locked and the swipe stays inside their screen. */
@media (max-width: 760px) { body.va-open { overflow: hidden; position: fixed; inset: 0; width: 100%; } }
.va-panel { overscroll-behavior: contain; }
.va-device { overscroll-behavior: contain; }
html.in-frame, html.in-frame body { overscroll-behavior-y: contain; }
.bill-offline { display: flex; gap: .4rem; align-items: center; margin: .2rem 0 .6rem; } .bill-offline input { width: 16px; height: 16px; min-height: 0; margin: 0; }
/* messages: photos and files */
.msg-files { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.msg-file-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .5rem; border-radius: 999px; background: #f1f2f3; font-size: .85rem; max-width: 100%; }
.msg-file-chip button { background: none; border: 0; padding: 0 .2rem; min-height: 0; cursor: pointer; color: #6b7378; }
.bubble .msg-file { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 10px; background: rgba(0,0,0,.05); color: inherit; text-decoration: none; word-break: break-word; }
.bubble.mine .msg-file { background: rgba(255,255,255,.18); }
.msg-file-ic { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 8px; background: #fff; color: #b3261e; font-weight: 700; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }
/* a client's Permits and Files (client page) */
.cp-permits h4, .cf-card h4 { margin: .9rem 0 .2rem; font-size: .9rem; }
.cpp-addr { margin-top: .4rem; }
.cpp-addr h4 { color: var(--muted, #5b6770); }
.cpp-open { text-align: left; padding: 0; }
.cpp-permit .permit-time { margin: .2rem 0 .6rem 1rem; }
.cpp-docs { border-top: 1px solid var(--line, #dde1e3); padding-top: .7rem; }
.cf-up { margin: .3rem 0 .5rem; align-items: center; }
.cf-up select { max-width: 100%; }
.cf-list li { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; padding: .35rem 0; }
.cf-name { text-align: left; padding: 0; overflow-wrap: anywhere; }
.cf-list li small { flex: 1 1 12rem; }
/* ± next to a price (the iPhone number pad has no minus) */
.sign-wrap { display: flex; gap: .25rem; align-items: stretch; }
.sign-wrap input { flex: 1 1 auto; min-width: 0; }
.sign-btn { flex: 0 0 auto; min-width: 2.2rem; padding: 0 .45rem; font-size: 1.1rem; font-weight: 700; line-height: 1; }
/* send window: the client's other emails on file, each with a tick */
.send-onfile { display: flex; flex-direction: column; gap: .35rem; }
.send-onfile label.check { align-items: flex-start; }
.send-onfile label.check span { display: flex; flex-direction: column; overflow-wrap: anywhere; }
/* budget card: the client's side, the typed budget form */
.bv-edit { margin-left: auto; }
.bv-client { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; background: var(--bg, #f7f7f5); }
.bv-bar i.warn { background: var(--amber, #c98a1b); }
.bv-form { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.bv-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.bv-form label { display: flex; flex-direction: column; gap: 3px; }
/* client purchases */
.cbuy .cardhead { display: flex; gap: 10px; align-items: baseline; }
.cbuy-list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
.cbuy-list li .grow { display: flex; flex-direction: column; align-items: flex-start; flex: 1 1 12rem; min-width: 0; }
.cbuy-list li .grow b, .cbuy-list li .grow small { text-align: left; }
.cbuy-add { display: flex; flex-direction: column; gap: 10px; border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; }
.cbuy-add label { display: flex; flex-direction: column; gap: 3px; }
/* Job board: a tile per budget block */
.jboard .stats { margin-bottom: 12px; }
.jb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.jb-tile { text-align: left; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; white-space: normal; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card, #fff);
  border-top: 5px solid #c9ced2; cursor: pointer; font: inherit; color: var(--ink); min-height: 150px; }
.jb-tile:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.jb-tile.s-done { border-top-color: #5b8c2a; } .jb-tile.s-going { border-top-color: #2f6fb5; } .jb-tile.s-late { border-top-color: #c0392b; } .jb-tile.s-next { border-top-color: #9aa3a8; }
.jb-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.jb-name { font-size: 16px; line-height: 1.25; }
.jb-inc { line-height: 1.3; margin-top: -2px; overflow-wrap: anywhere; }
.jb-top .badge { flex: 0 0 auto; }
.jb-line { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.jb-tile .bv-bar { height: 6px; }
.jb-need { margin-bottom: 12px; }
.jb-owner .list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
.jb-owner .list li.done b { text-decoration: line-through; color: var(--muted); }
.jb-owner label.check { align-items: flex-start; }
.jb-add { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; }
.jb-add label { display: flex; flex-direction: column; gap: 3px; }
.jb-budget { align-items: flex-end; margin-top: 8px; }
.jb-budget label { display: flex; flex-direction: column; gap: 3px; }
.jb-tasks li { display: flex; gap: 10px; justify-content: flex-start; text-align: left; }
.jb-tasks li .grow { display: flex; flex-direction: column; align-items: flex-start; text-align: left; flex: 1 1 auto; }
.jb-tasks li { align-items: center; }
.jb-owner .list li .grow, .jb-owner .list li label.check { flex: 1 1 auto; text-align: left; justify-content: flex-start; }
/* Admin → budget blocks */
/* Admin → budget blocks: one card row per block, works on a phone */
.bb-list { padding: 4px 12px; }
.bb-item { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bb-item.off .bb-name, .bb-item.off .bb-inc { opacity: .5; }
.bb-item .bb-name { font-weight: 700; min-width: 0; }
.bb-item .bb-inc, .bb-item .bb-count { grid-column: 2 / 4; min-width: 0; }
.bb-move { display: flex; gap: 2px; }
.bb-map { padding: 4px 12px; max-height: 480px; overflow: auto; }
.bb-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bb-row select { max-width: 240px; }
.bb-find { margin: 6px 0; max-width: 320px; }
.jb-delta b.ok { color: #3f7a1f; } .jb-delta b.bad { color: #c0392b; }
.jb-buys { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.jb-buys .list li { display: flex; gap: 10px; justify-content: flex-start; text-align: left; }
.cbuy-block select { margin-top: 4px; max-width: 260px; font-size: 14px; }
.cbuy-tag { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: var(--bg, #f1f2f0); border: 1px solid var(--line); }
.extra-box { border-color: #c98a1b; background: #fff8ec; }
.extra-box label.check { margin: 4px 0; }
.extra-box label.check { display: flex; align-items: flex-start; gap: 10px; text-align: left; }
.extra-box input[type="radio"] { width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px; margin: 2px 0 0; padding: 0; }
.held-credit ul { margin: 4px 0 0; padding-left: 18px; }
.pc-add { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px; }
.pc-add label { display: flex; flex-direction: column; gap: 3px; }
.pc-list li { display: flex; gap: 10px; align-items: center; justify-content: flex-start; text-align: left; flex-wrap: wrap; }
.pc-list li .grow { flex: 1 1 14rem; min-width: 0; display: block; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.pc-list li .badge { flex: 0 0 auto; width: auto; }
.pr-table label.pr-pick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pr-table label.pr-pick input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }
.pr-table tr.direct td { color: var(--muted); }
.inv-who { font-size: 17px; margin-top: 2px; }
.inv-who a { color: var(--ink); }

.bill-crew { display: flex; flex-direction: column; gap: 4px; background: #f0f5ff; border: 1px solid #3e7bfa; }
.bill-crew label { display: flex; gap: 6px; align-items: center; }
.bill-payer { margin-bottom: 8px; }

/* screen check fixes */
.bv-head { flex-wrap: wrap; }
@media (max-width: 760px) { .care-head > .grow { flex-basis: 100%; } }
/* iPad: TXT sits in the header (like the phone) — the floating button covered Admin / Account on the bottom bar */
@media (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  .txd-fab { display: none; }
  .hdr-txt { display: flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
  .hdr-txt svg { width: 20px; height: 20px; }
  .hdr-txt .tx-badge { top: -2px; right: -4px; }
  .txd { bottom: calc(var(--nav-total) + 12px); height: min(620px, calc(100vh - var(--nav-total) - var(--top-h) - 40px)); }
}
.new-sup-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.new-sup-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.new-sup-form label.check { flex-direction: row; align-items: center; }
/* Job board v2: the money per section, shortfall up front */
.jb-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 10px; }
.jb-sum > div { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.jb-sum > div:first-child { border-left: 0; }
.jb-sum b { font-size: 20px; } .jb-sum small { color: var(--muted); } .jb-sum span { font-size: 12px; }
.jb-sum.short { border-color: #e5484d; } .jb-sum .jb-gap b.bad { color: #c62a2f; } .jb-sum .jb-gap b.ok { color: #3f7a1f; }
.jb-warn { color: #a5361d; margin: 0 0 10px; }
.jb-tile.t-warn { border-top-color: #f0b429; } .jb-tile.t-bad { border-top-color: #c0392b; }
.jb-need { margin-top: 16px; }
.jb-money { margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.jb-money details, .jb-money > .jb-mrow { border-top: 1px solid var(--line); }
.jb-money > :first-child { border-top: 0; }
.jb-money summary { list-style: none; cursor: pointer; }
.jb-money summary::-webkit-details-marker { display: none; }
.jb-mrow { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.jb-money details > :not(summary) { padding: 0 12px 10px; }
.jb-total { background: var(--line2, #f3f5f6); font-size: 16px; }
.jb-sched { margin-top: 8px; }
@media (max-width: 760px) { .jb-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .jb-sum > div:nth-child(3) { border-left: 0; } .jb-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.jb-money .list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left; }
.jb-money .list li .grow { flex: 1 1 auto; text-align: left; }
.jb-pick-hint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.jb-more { display: flex; gap: 16px; flex-wrap: wrap; }
.jb-picks { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; margin: 8px 0; }
.jb-picks label.check { align-items: flex-start; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line2, #eef0f2); }
.jb-picks > label { flex: 0 0 auto; height: auto; min-height: 0; display: flex; }
.jb-picks label.check span { white-space: normal; line-height: 1.35; }
.jb-pick-bud { width: 110px; flex: 0 0 auto; text-align: right; }
.apperr-list li { display: block; padding: 0; }
.apperr-row { display: flex; width: 100%; gap: 12px; align-items: center; text-align: left; background: none; border: 0; border-radius: 0; padding: 10px 12px; }
.apperr-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.apperr-n { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.apperr-more { padding: 0 12px 12px; }
.apperr-more pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--line2, #f3f5f6); padding: 8px; border-radius: 6px; max-height: 240px; overflow: auto; }
.apperr-row { white-space: normal; height: auto; min-height: 0; align-items: flex-start; }
.apperr-row .grow { flex: 1 1 auto; } .apperr-row .grow small { display: block; }
.apperr-n { flex: 0 0 auto; text-align: right; } .apperr-n small { display: block; font-size: 11px; }
.exp-twin { background: #f0f5ff; border: 1px solid #3e7bfa; } .exp-twin label.check { align-items: flex-start; gap: 8px; }
.receipt-acts { display: flex; gap: 16px; justify-content: center; margin: 6px 0 10px; } .receipt-shot.has a { display: block; }

/* ---------- Dispatch (#/dispatch) and Your day (My work) — update 0141 ---------- */
.dp-bar { flex-wrap: wrap; }
.dp-day { font-size: 16px; }
.dp-bar input[type=date] { width: auto; }
.dp-send { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius); background: var(--panel); margin: 10px 0 14px; flex-wrap: wrap; }
.dp-send.ok { border-left-color: var(--green); }
.dp-send.late { border-left-color: var(--red); background: var(--red-soft); }
.dp-send b { display: block; font-size: 16px; }
.dp-send small { color: var(--muted); }
.dp-unassigned { margin-bottom: 14px; border-left: 4px solid var(--tatra-orange); }
.dp-axis, .dp-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 10px; align-items: center; }
.dp-axis { position: sticky; top: var(--top-h, 0); z-index: 2; background: var(--bg); padding: 4px 0; }
.dp-axis div { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.dp-axis i { font-style: normal; width: 0; overflow: visible; white-space: nowrap; }
.dp-group { margin: 14px 0 6px; }
.dp-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.dp-group.open h3 { color: var(--red); }
.dp-row { padding: 6px 0; border-top: 1px solid var(--line2); }
.dp-who { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: none; border: 0; padding: 4px 0; min-height: 0; white-space: normal; }
.dp-who b { font-size: 14px; }
.dp-who small { color: var(--muted); font-size: 12px; }
.dp-off { color: var(--violet); font-weight: 700; }
.dp-line { position: relative; height: 46px; background: repeating-linear-gradient(90deg, var(--line2) 0 1px, transparent 1px 10%); border-radius: 8px; background-color: var(--well, var(--grey-soft)); }
.dp-row.open .dp-line { box-shadow: inset 0 0 0 2px var(--red-soft); }
.dp-b, .dp-gap { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; padding: 2px 6px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; white-space: nowrap; border: 0; font-size: 12px; }
.dp-b b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dp-b small { font-size: 11px; opacity: .85; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dp-b.job { background: var(--blue-soft); color: var(--ink); border-left: 3px solid var(--blue); }
.dp-b.note { background: var(--grey-soft); color: var(--ink); border-left: 3px solid var(--muted); }
.dp-b.call { background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--tatra-orange); }
.dp-b.call.em { background: var(--red-soft); border-left-color: var(--red); }
.dp-b.care { background: var(--violet-soft); color: var(--ink); border-left: 3px solid var(--violet); }
.dp-b.offb { background: var(--violet-soft); color: var(--ink); }
.dp-b:disabled { opacity: 1; cursor: default; }
.dp-b.outside { outline: 2px dashed var(--red); outline-offset: -2px; }
.dp-b.outside small { opacity: 1; color: var(--red); font-weight: 600; }
.dp-gap { background: transparent; border: 1.5px dashed var(--field-line, var(--line)); color: var(--muted); align-items: center; }
.dp-gap:hover { border-color: var(--tatra-build); color: var(--tatra-build); }
.dp-gap span { font-size: 18px; font-weight: 700; }
.dp-people { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-people .chip input { display: none; }
.dp-what { margin: 6px 0 10px; }
.dp-jobs { display: grid; gap: 6px; max-height: 38vh; overflow: auto; margin-top: 6px; }
@media (max-width: 640px) {
  .dp-axis, .dp-row { grid-template-columns: 92px 1fr; gap: 6px; }
  .dp-b small { display: none; }
}

.yourday { border-left: 4px solid var(--tatra-build); }
.yourday.sick { border-left-color: var(--violet); }
.yd-go { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; margin: 4px 0 10px; color: #fff; border: 0; }
.yd-go small { font-size: 13px; opacity: .9; font-weight: 600; }
.yd-go b { font-size: 19px; }
.yd-list { list-style: none; margin: 0; padding: 0; }
.yd-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line2); }
.yd-list li.now { background: var(--green-soft); margin: 0 -8px; padding: 8px; border-radius: 8px; }
.yd-time { min-width: 86px; font-size: 13px; font-weight: 700; color: var(--muted); }
.yd-what { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.yd-what small { overflow: hidden; text-overflow: ellipsis; }
.yd-others { margin-top: 10px; }
.yd-others summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.yd-olist { display: grid; gap: 6px; margin-top: 6px; }
.yd-olist button { display: grid; grid-template-columns: 1fr auto; text-align: left; white-space: normal; }
.yd-olist button small { grid-column: 1; }
.yd-olist button span { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--tatra-build); font-weight: 700; }
.yd-sick { margin-top: 10px; color: var(--muted); font-size: 13px; }
.jp-plan { color: var(--tatra-build); font-weight: 700; }
.leave-pick { display: grid; gap: 8px; margin: 10px 0; }
.leave-pick button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; min-height: 60px; gap: 2px; }
.leave-pick b { font-size: 16px; }
.leave-pick small { color: var(--muted); }
.yd-go.yd-next { color: var(--ink); min-height: 52px; border: 1px solid var(--line); }
/* Your day: the scheduled job — name, then Navigate and Clock in side by side */
.yd-today { display: flex; flex-direction: column; gap: 2px; padding: 12px; margin: 4px 0 10px; border: 1px solid var(--line2); border-radius: var(--radius-ctl, 8px); background: var(--bg); }
.yd-today.onway { background: #eaf2ff; border-color: #9cc0f5; }
.yd-today-k { font-size: .78rem; font-weight: 700; color: var(--tatra-build); }
.yd-today.onway .yd-today-k { color: #1f6feb; }
.yd-today-n { font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.yd-today-acts { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 10px; max-width: 520px; }
.yd-today-acts > * { min-height: 52px; justify-content: center; white-space: normal; line-height: 1.15; text-align: center; min-width: 0; }
.yd-today-acts .cc-in { font-size: 1.1rem; }
.yd-today-acts > .ghost { white-space: nowrap; font-size: 16px; }
.clockcard .cc-other { width: 100%; justify-content: center; min-height: 48px; margin-top: 6px; white-space: normal; }
.yd-go.yd-next b { font-size: 16px; }
.cc-actions { grid-template-columns: 1fr 1fr; }
.cc-actions button { white-space: normal; line-height: 1.15; min-width: 0; font-size: 17px; }
/* pay & cost (update 0142) */
.ps-total .ps-pay { display: block; font-size: 13px; font-weight: 700; color: var(--green); margin-top: 4px; font-stretch: 100%; }
.payfields { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.payfields .seg { justify-self: start; }
.paycost { font-size: 20px; font-weight: 800; padding: 6px 0; }
.paycost input { font-size: 16px; font-weight: 400; }
.burden-def { margin-right: 8px; }
.burden-parts { display: grid; gap: 8px; margin: 10px 0; }
.burden-parts label { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--line2); padding-bottom: 8px; }
.burden-parts label > span:first-child { display: flex; flex-direction: column; }
.bp-in { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.bp-in input { width: 72px; text-align: right; }
.bp-total { display: flex; justify-content: space-between; font-size: 18px; padding-top: 4px; }
.est-fee { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.est-fee small { flex-basis: 100%; }
/* Reconcile → Cards (update 0145) */
.cf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.cf-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); }
.cf-card .cf-amt { font-size: 20px; font-weight: 800; }
.cf-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-list li > div { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.cf-list .cf-amt { white-space: nowrap; }
.cf-acts { display: flex; gap: 6px; }
.cf-list.done { opacity: .8; }
.cf-card.loose { border-style: dashed; }
.cf-who { margin-top: 4px; max-width: 280px; font-size: 13px; padding: 4px 6px; }
.cf-row { flex-wrap: wrap; }
.cf-file { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; padding: 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.cf-file label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.cf-go { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.forwhat { display: grid; gap: 8px; }
.forwhat.compact .catgrid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.cf-file .forwhat { grid-column: 1 / -1; }
/* Site access on the project (update 0146) */
.siteaccess { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius); background: var(--panel); }
.siteaccess .sa-h { font-weight: 800; }
.siteaccess .sa-items { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.siteaccess .sa-notes { flex-basis: 100%; margin: 0; white-space: pre-wrap; }
.siteaccess .sa-edit { margin-left: auto; }
.qb-send1 { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.qb-send1 small.bad { max-width: 320px; }
.ccal-sec { grid-column: 1 / -1; position: sticky; left: 0; padding: 10px 10px 4px; border-top: 2px solid var(--line); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
.office-talk { display: flex; flex-direction: column; gap: 8px; }
.office-talk .ot-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.office-talk .ot-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
/* job notes */
.jn-bar { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.jn-bar-h { display: flex; align-items: center; gap: 8px; }
.jn-note { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.jn-note.mine { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.jn-note.mine.new { border-color: var(--accent, #e8641b); box-shadow: 0 0 0 2px rgba(232, 100, 27, .12); }
.jn-body p { margin: 0; white-space: pre-wrap; font-size: 15.5px; }
.jn-body audio { width: 100%; max-width: 420px; height: 40px; }
.jn-photo { max-width: 220px; max-height: 160px; border-radius: 8px; display: block; margin-top: 4px; }
.jn-who { display: flex; flex-wrap: wrap; gap: 6px; }
.jn-p { font-size: 12.5px; padding: 2px 8px; border-radius: 99px; background: var(--bg, #f2f2f2); color: var(--muted); }
.jn-p.seen { color: var(--ink, #222); } .jn-p.done { background: #e3f3ea; color: #1e7b4c; }
.jn-acts { display: flex; gap: 8px; }
.jn-mine h3 small { font-weight: 400; margin-left: 6px; }
.jn-pop { display: flex; flex-direction: column; gap: 10px; }
.jn-quick { margin: 0 0 12px; } .jn-quick button { width: 100%; min-height: 52px; font-size: 16px; }
.jn-sheet { display: flex; flex-direction: column; gap: 10px; }
.jn-sheet h4 { margin: 4px 0 0; }
.jn-sheet textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; }
.jn-mic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jn-mic audio { flex: 1; min-width: 200px; }
.jn-rec { min-height: 64px; flex: 1; border-radius: 14px; border: 2px solid var(--accent, #e8641b); background: var(--panel); font: 700 18px var(--body, inherit); color: var(--ink, #222); display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.jn-rec.on { background: #c62828; border-color: #c62828; color: #fff; }
.jn-rec.on i { width: 12px; height: 12px; border-radius: 99px; background: #fff; animation: jnblink 1s infinite; }
@keyframes jnblink { 50% { opacity: .25; } }
.jn-foot { display: flex; align-items: center; gap: 8px; }
.jobpick.general { border-style: dashed; }
.gen-time { display: flex; flex-direction: column; gap: 6px; }
.gen-time .gt-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.gt-row { display: grid; grid-template-columns: minmax(110px, 160px) minmax(120px, 220px) 1fr; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.gt-row.now b::before { content: '● '; color: #2e7d32; }
.gt-why { font-size: 14.5px; }
@media (max-width: 640px) { .gt-row { grid-template-columns: 1fr; gap: 2px; } }

/* Compare & merge — the worker's entry, the emailed invoice and the card charge side by side */
.mg-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.mg-t th, .mg-t td { padding: 6px 8px; border-bottom: 1px solid var(--line, #e5e5e5); vertical-align: top; text-align: left; }
.mg-t thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #666); }
.mg-t thead th small { display: block; text-transform: none; letter-spacing: 0; }
.mg-t tbody th { font-weight: 600; white-space: nowrap; }
.mg-t tr.diff { background: #fff8e6; }
.mg-flag { display: block; color: #b26a00; font-weight: 500; font-size: 11px; }
.mg-pick { background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; text-align: left; cursor: pointer; font: inherit; color: inherit; max-width: 220px; white-space: normal; }
.mg-pick:hover { border-color: var(--line, #ccc); }
.mg-pick.on { border-color: var(--brand, #e8590c); background: #fff1e8; font-weight: 600; }
.mg-res { background: #f6f9ff; min-width: 190px; }
.mg-res input, .mg-res select, .mg-res textarea { width: 100%; }
.mg-files { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.mg-file { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: inherit; }
.mg-file img, .mg-pdf { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line, #ddd); }
.mg-pdf { display: grid; place-items: center; font-weight: 700; color: #b00; background: #fafafa; }
.mg-cands { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.mg-cand { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: #fff; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; }
.mg-cand small { display: block; }
.mg-go { color: var(--brand, #e8590c); font-weight: 600; white-space: nowrap; font-size: 13px; }
@media (max-width: 640px) {
  .mg-t, .mg-t tbody, .mg-t tr, .mg-t th, .mg-t td { display: block; }
  .mg-t thead { display: none; }
  .mg-t tbody tr { border: 1px solid var(--line, #ddd); border-radius: 10px; margin-bottom: 10px; padding: 6px 8px; }
  .mg-t tbody th, .mg-t td { border: 0; padding: 3px 0; }
  .mg-t td.mg-none { display: none; }
  .mg-t td.mg-src { display: inline-block; vertical-align: top; width: 49%; }
  .mg-t td[data-src]::before { content: attr(data-src); display: block; font-size: 11px; color: var(--muted, #666); text-transform: uppercase; }
  .mg-pick { max-width: none; }
  .mg-res { min-width: 0; padding: 6px !important; border-radius: 8px; margin-top: 4px; }
}

/* Expenses → Reconcile: field · emailed · card side by side */
.m3 h3 { margin: 18px 0 6px; }
.m3-row { display: grid; grid-template-columns: repeat(3, 1fr) 150px; gap: 8px; align-items: stretch; padding: 8px 0; border-bottom: 1px solid var(--line, #e5e5e5); }
.m3-row.done { opacity: .85; }
.m3-cell { display: flex; flex-direction: column; gap: 1px; text-align: left; background: #fff; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 6px 9px; font: inherit; color: inherit; min-width: 0; }
.m3-cell.none { align-items: center; justify-content: center; color: var(--muted, #999); border-style: dashed; background: transparent; }
button.m3-cell { cursor: pointer; align-items: flex-start; justify-content: flex-start; white-space: normal; width: 100%; }
.m3-cell small { white-space: normal; overflow-wrap: anywhere; }
.m3-cell.on { border-color: var(--brand, #e8590c); background: #fff1e8; box-shadow: 0 0 0 1px var(--brand, #e8590c); }
.m3-cell b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m3-k { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #777); }
.m3-amt { font-weight: 700; }
.m3-act { display: flex; flex-direction: column; gap: 4px; justify-content: center; align-items: flex-end; }
.m3-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m3-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m3-col h4 { margin: 0; }
.m3-bar { position: sticky; bottom: 70px; display: flex; gap: 8px; align-items: center; background: #1f1f1f; color: #fff; border-radius: 10px; padding: 8px 12px; margin-top: 10px; z-index: 5; }
@media (max-width: 760px) {
  .m3-row { grid-template-columns: 1fr 1fr; }
  .m3-row .m3-cell.none { display: none; }
  .m3-act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .m3-cols { grid-template-columns: 1fr; }
}
/* Expense "Where": suppliers from the Hub as you type */
.where-pick { position: relative; }
.where-ok { display: block; color: #2f7d32; font-size: 12px; margin-top: 2px; }
.where-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid var(--line, #ddd); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); overflow: hidden; }
.where-list button { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line, #eee); padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; }
.where-list button:hover { background: #fff6f0; }
.where-list button small { color: var(--muted, #777); font-size: 12px; }
.where-list button small.v { color: #8a4b00; font-weight: 600; }
.where-list button.add { color: var(--brand, #e8590c); font-weight: 600; }
.where-none { display: block; padding: 10px 12px; }
.mg-cats { margin: 4px 0 8px; }
.mg-other { width: 100%; margin-bottom: 8px; }
.mg-ign { margin: 8px 0; padding: 8px 10px; background: #fff4f2; border-radius: 8px; }
/* filed / ignored: greyed under what still needs filing (Field · Emailed · Card) */
.exp-row.filed, .bills-table tr.filed, .cf-list li.filed { opacity: .5; }
.exp-row.filed:hover, .bills-table tr.filed:hover, .cf-list li.filed:hover { opacity: .8; }
.m3-tofiled { color: #2f7d32; font-weight: 600; font-size: 12px; text-align: right; }

/* Job board: overhead & profit is margin, not a cost section */
.jb-tile.jb-margin { border-style: dashed; background: transparent; cursor: default; }
.jb-tile.jb-margin .badge { font-size: 11px; }
.bb-kind { font-size: 12px; padding: 2px 4px; min-height: 0; }
/* Import a proposal: Stan, destination, sections, CHECK lines */
.imp-src { align-items: center; }
.imp-reading { display: flex; align-items: center; gap: 8px; }
.imp-reading .spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand, #e8590c); border-radius: 50%; animation: impspin .8s linear infinite; }
@keyframes impspin { to { transform: rotate(360deg); } }
.imp-dest .seg { margin-bottom: 8px; }
.imp-repl { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.imp-sec li.imp-chk { background: #fff8e1; border-radius: 8px; padding: 6px; }
.imp-q { display: block; font-size: 13px; margin-top: 4px; }
.imp-q b { color: #b26a00; margin-right: 4px; }
.imp-need select { border-color: #e0a100; }
.imp-blocks { margin: 10px 0; padding-top: 8px; border-top: 1px solid var(--line2); }
.imp-blocks h4 { margin: 0 0 6px; }
.imp-brow { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 14px; }
.imp-blocks .check { margin-top: 8px; }
.imp-sec li { border-bottom: 1px solid var(--line2); }
.imp-sec li:last-child { border-bottom: 0; }
.imp-line { display: grid; grid-template-columns: 1fr; gap: 6px 12px; }
.imp-line .imp-desc, .imp-line .imp-q { grid-column: 1 / -1; }
.imp-line select { font-size: .9rem; padding: 6px 8px; min-height: 0; }
@media (min-width: 700px) { .imp-line { grid-template-columns: 1fr 1fr; } }
.imp-repl label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.imp-repl label.check input { flex: 0 0 auto; width: auto; height: auto; margin-top: 3px; }
.imp-split { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.imp-split input { max-width: 200px; }
.imp-blocks label.check { display: block; }
.imp-blocks label.check input { margin-right: 6px; }

/* Points log & review on a phone: each entry is a card — who and points on top, then the date, the reason in full, the rule or buttons */
@media (max-width: 700px) {
  .pts-tbl.pts-log, .pts-tbl.pts-log tbody { display: block; width: 100%; }
  .pts-tbl.pts-log tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "who pts" "date pts" "why why" "more more"; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
  .pts-tbl.pts-log td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  .pts-tbl.pts-log td:nth-child(1) { grid-area: date; font-size: 13px; color: var(--muted); }
  .pts-tbl.pts-log td:nth-child(2) { grid-area: who; }
  .pts-tbl.pts-log td:nth-child(3) { grid-area: pts; align-self: center; font-size: 1.1rem; }
  .pts-tbl.pts-log td:nth-child(4) { grid-area: why; margin-top: 4px; }
  .pts-tbl.pts-log td:nth-child(5) { grid-area: more; text-align: left; }
  .pts-tbl.pts-log td.pts-act button { margin: 6px 6px 0 0; }
}

/* ---------- fixed bars stay glued to the screen edges (iPhone / iPad Safari, home-screen app, Android) ----------
   On a swipe past the end of the page (rubber-band) or while Safari's toolbar slides in and out, iOS can leave a
   strip between the bottom bar and the bottom of the screen. Each bar now has a skirt in its own colour that
   reaches past the edge, so any gap shows the bar, never the page; the bars get their own layer so they don't
   lag a frame behind the scroll; and on iPhone/iPad the page itself no longer bounces (sheets and long lists
   inside it still scroll normally). Android keeps pull-to-refresh. */
.bottomnav { -webkit-transform: translate3d(0, var(--vv-stuck, 0px), 0); transform: translate3d(0, var(--vv-stuck, 0px), 0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
/* iOS 26: main.js sets --vv-stuck only while Safari leaves the screen shifted after the keyboard closes (else 0) */
.topbar { -webkit-transform: translate3d(0, var(--vv-stuck, 0px), 0); transform: translate3d(0, var(--vv-stuck, 0px), 0); }
.bottomnav::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: inherit; pointer-events: none; }
.topbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 120px; background: inherit; pointer-events: none; }
@supports (-webkit-touch-callout: none) {
  html, body { overscroll-behavior-y: none; }
}
/* iPad bar is see-through glass: the skirt is solid so the page never shows under it */
@media (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  .bottomnav::after { background: var(--panel); }
}

/* bottom bar: My work in line with the others (same size, so the bar stays even with or without My truck),
   picked out with a solid green pill behind a white icon */
@media (max-width: 760px), (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  /* My work: a green icon and label, no pill behind it; orange while pressed and while you're on it */
  .bottomnav a.bn-main { color: var(--tatra-build); }
  .bottomnav a.bn-main .bn-icon, .bottomnav a.bn-main.on .bn-icon { background: transparent; color: inherit; }
  .bottomnav a.bn-main.on, .bottomnav a.bn-main:active { color: var(--accent); background: transparent; }
  .bottomnav a.bn-main > span:last-child { font-weight: 800; }
}
}

/* ---------- big text (A+ / A++ and the phone's own text size): rows rearrange instead of squeezing ----------
   Widths below are in em, so they grow with the text: when a title and its date/time/button no longer fit side by
   side, the second part drops to its own line. Nothing is hidden; at normal size nothing changes. */
/* Your day: time on the left, the job beside it, Directions under the job — same shape at every text size */
.yd-list li { display: grid; grid-template-columns: minmax(4.6em, auto) minmax(0, 1fr); column-gap: 10px; row-gap: 6px; align-items: start; }
.yd-list li > .yd-time { padding-top: 2px; }
.yd-list li > .button { grid-column: 2; justify-self: start; }
/* today's CARE+ / service visits: time · what · Open job */
.tv-main { flex-wrap: wrap; }
.tv-what { flex: 1 1 9em; min-width: 0; }
/* points: +2 · reason · date */
.pts-list li { display: flex; flex-wrap: wrap; column-gap: 8px; }
.pts-list .pts-v { flex: 0 0 2.4em; }
.pts-list .pts-r { flex: 1 1 9em; min-width: 0; }
.pts-list .pts-d { margin-left: auto; }
/* messages: subject · time */
.thread-row { flex-wrap: wrap; row-gap: 2px; }
.thread-row .tr-main { flex: 1 1 13em; }
.thread-row .tr-end { margin-left: auto; }
/* my hours: ‹ dates › on one row, the totals two across when three don't fit */
.mypp .tx-period { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.mypp .tx-period > b { text-align: center; }
.mypp .tx-period > .small { grid-column: 1 / -1; justify-self: center; }
.mypp-tiles { grid-template-columns: repeat(auto-fit, minmax(5.6em, 1fr)); }
.mypp-tiles b { white-space: nowrap; }
/* A+ / A++: filter chips wrap onto a second line instead of running off the edge as a swipe row */
html[data-size="l"] .chips.scroll, html[data-size="xl"] .chips.scroll, html[data-size="l"] .fin-head .chips, html[data-size="xl"] .fin-head .chips { flex-wrap: wrap; overflow-x: visible; -webkit-mask-image: none; mask-image: none; }

/* Messages: a round button floating above the bottom bar, bottom right (phone and iPad); the desktop keeps it in
   the menu. Hidden while typing, while a sheet is open, and on screens with their own bar along the bottom. */
.msg-fab { display: none; }
@media (max-width: 760px), (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  .msg-fab { display: grid; place-items: center; position: fixed; z-index: 58; right: max(14px, env(safe-area-inset-right)); bottom: calc(var(--nav-total) + 14px);
    width: 58px; height: 58px; border-radius: 50%; background: #5b3fa0; color: #fff; box-shadow: 0 6px 16px rgba(20,26,31,.28); text-decoration: none; }
  .msg-fab:hover { text-decoration: none; }
  .msg-fab { transform: translate3d(0, var(--vv-stuck, 0px), 0); }   /* rides with the bottom bar (iOS 26 fix in main.js) */
  .msg-fab:active { transform: translate3d(0, var(--vv-stuck, 0px), 0) scale(.94); }
  .msg-fab .bn-icon { width: auto; height: auto; background: none !important; }
  .msg-fab .bn-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .msg-fab .nbadge { position: absolute; top: -4px; right: -4px; margin: 0; font-size: 12px; height: 20px; min-width: 20px; box-shadow: 0 0 0 2px var(--panel); }
  body.kb-open .msg-fab, body:has(.modal-bg, .sheet-bg, .sticky-save, .composer, .est-totals, .txd) .msg-fab { display: none; }
  /* room at the end of every page so the button never sits on the last thing */
  .main { padding-bottom: calc(var(--nav-total) + 92px); }
}
/* Reports: the number still to write is red */
a[href="#/reports"] .nbadge { background: var(--red); color: #fff; }
.mg-notmatch { color: var(--ink); border-color: var(--line); }

/* Expenses → Statements: a tile per house account / company card */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15em), 1fr)); gap: 10px; margin: 8px 0 18px; }
.st-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 108px; padding: 12px 14px; text-align: left; white-space: normal;
  background: var(--panel); border: 1px solid var(--line2); border-left: 4px solid var(--line); border-radius: var(--radius-ctl, 8px); line-height: 1.25; }
.st-tile.ok { border-left-color: var(--tatra-build); }
.st-tile.due { border-left-color: var(--tatra-orange, #f05710); }
.st-tile .st-k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-tile b { font-size: 1.05rem; overflow-wrap: anywhere; }
.st-tile small { color: var(--muted); font-weight: 500; }
.st-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.st-badges .badge { font-style: normal; }
.rc-fmt .seg { margin: 4px 0; flex-wrap: wrap; }
/* Emailed: what the Hub suggests about a bill (the office decides) */
.bill-sug { display: block; margin-top: 2px; font-size: .8rem; font-weight: 600; color: var(--amber, #94560a); }
.bill-sug.dup { color: var(--red); }

/* Admin → Finance → Overhead */
.oh-bar { flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.oh-bar label:not(.check) { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); font-weight: 600; gap: 2px; }
.oh-table th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; white-space: nowrap; }
.oh-table td.num, .oh-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.oh-table tfoot th, .oh-table tfoot td { border-top: 2px solid var(--ink); }
.oh-n { background: none; border: 0; padding: 2px 4px; min-height: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.oh-n:hover { background: var(--grey-soft); }
.oh-n.on { background: var(--green-soft); box-shadow: inset 0 0 0 1.5px var(--tatra-build); }
.oh-cell { margin-top: 14px; }
.overhead .table-wrap { overflow-x: auto; max-width: 100%; }
.oh-table { font-size: .82rem; }
.oh-table th, .oh-table td { padding: 6px 6px; }
.oh-table td:last-child, .oh-table th:last-child { background: var(--grey-soft); }
.cf-last { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 12px; }
.cf-skip { margin: 0; padding-left: 18px; font-size: .85rem; }
.cf-other summary { cursor: pointer; font-size: .9rem; margin-top: .4rem; }
.cf-og { display: flex; flex-direction: column; padding: .35rem 0; border-top: 1px solid var(--line, #e5e7eb); }
.cf-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0 .2rem; }
.cf-filter select, .cf-filter input { flex: 1 1 12rem; min-width: 0; }
.cf-sug { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; background: #eef6e6; border-radius: 8px; padding: .4rem .6rem; }
.cf-sug small { flex: 1 1 14rem; }
.cf-list li > div small { flex: none; }
.cf-list li > div.cf-sug { flex: 1 1 100%; flex-direction: row; align-items: center; }
.cf-list li > div.cf-sug small { flex: 1 1 12rem; }

/* Ava on the Today page — phones and tablets; on a wide screen the left rail shows the same */
.td-ava h3 { display: flex; align-items: center; gap: 8px; }
.td-ava .ava-dot { width: 24px; height: 24px; font-size: 13px; }
.td-ava-pend { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.td-ava-pend button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; white-space: normal; background: #fff4e5; border: 1px solid #f0c27a; border-radius: 10px; padding: 10px 12px; color: inherit; min-height: 0; }
.td-ava-pend b { color: #9a5b00; font-size: .8em; text-transform: uppercase; letter-spacing: .04em; }
.td-ava-pend span { font-weight: 600; overflow-wrap: anywhere; }
.td-ava-pend .ta-day { font-weight: 400; color: var(--muted); white-space: nowrap; }
.td-ava-pend i { font-style: normal; font-size: 13px; color: var(--muted); }
.td-ava-list { list-style: none; margin: 0; padding: 0; }
.td-ava-list li { border-bottom: 1px solid var(--line2); }
.td-ava-list li:last-child { border-bottom: 0; }
/* when (day over time, in a column that grows with the text size) · what (wraps under itself) */
.td-ava-list button { display: grid; grid-template-columns: minmax(5.4em, auto) minmax(0, 1fr); column-gap: 14px; width: 100%; text-align: left; white-space: normal;
  background: none; border: 0; border-radius: 0; padding: 10px 0; color: inherit; min-height: 0; align-items: start; font-size: inherit; }
.td-ava-list .ta-when { display: flex; flex-direction: column; line-height: 1.25; }
.td-ava-list .ta-when small { color: var(--muted); font-size: .8em; white-space: nowrap; }
.td-ava-list .ta-when b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-ava-list .ta-what { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; padding-top: .15em; }
@media (min-width: 1280px) { .td-ava { display: none; } }

/* ---------- marked-up copies of plan sheets ---------- */
.pv-ib.pv-copies { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; padding: 0 6px; }
.pv-ib.pv-copies small { font-size: 10px; line-height: 1; }
.pv-copies-pop { width: min(420px, calc(100vw - 16px)); max-height: calc(100vh - 140px); overflow: auto; }
.pv-copies-pop .cardhead { display: flex; align-items: center; gap: 8px; }
.copies { display: flex; flex-direction: column; gap: 8px; }
.copy-row { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--panel, #fff); border: 1px solid var(--line2, #e3e7ea); border-radius: 10px; }
.copy-thumb { flex: 0 0 auto; width: 96px; height: 66px; padding: 0; border: 1px solid var(--line2, #e3e7ea); border-radius: 6px; overflow: hidden; background: #fff; }
.copy-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.copy-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.copy-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.copies.compact .copy-thumb { width: 72px; height: 50px; }
.copy-people { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin: -4px 0 12px; padding: 6px; border: 1px solid var(--line2, #e3e7ea); border-radius: 8px; }
@media (max-width: 760px) { .copy-row { flex-wrap: wrap; } .copy-act { width: 100%; justify-content: flex-start; } }
.copy-row.new { border-color: var(--orange, #e0561c); box-shadow: 0 0 0 1px var(--orange, #e0561c) inset; }
.copy-from { color: var(--orange, #e0561c); font-weight: 600; }
.copy-share { position: relative; }
.copy-share > summary { list-style: none; cursor: pointer; }
.copy-share > summary::-webkit-details-marker { display: none; }
.copy-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; background: #fff; border: 1px solid var(--line2, #e3e7ea); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; }
.copy-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 9px 10px; color: var(--ink, #14191f); }
.copy-menu button:hover { background: var(--bg2, #f2f5f6); }
.copy-more { margin: 4px 0 12px; }
.copy-more > summary { cursor: pointer; color: var(--blue, #1c7ed6); margin-bottom: 8px; }
@media (max-width: 760px) { .copy-menu { left: 0; right: auto; } }
/* ---------- Back: one clear button at the top of every screen that isn't a main menu screen ---------- */
.backbar { margin: -6px 0 12px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 16px 0 8px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line2, #e3e7ea); box-shadow: 0 1px 3px rgba(20, 25, 31, .08);
  color: var(--ink, #14191f); font-weight: 600; font-size: .95rem; text-decoration: none; max-width: min(520px, 100%); transition: background .15s, box-shadow .15s; }
.back-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: var(--orange, #e0561c); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.back-btn:hover { background: var(--bg2, #f2f5f6); box-shadow: 0 2px 6px rgba(20, 25, 31, .12); }
.back-btn:active { transform: translateY(1px); }
@media (max-width: 760px) { .backbar { margin: -8px 0 10px; } .back-btn { min-height: 44px; font-size: 1rem; } }
@media print { .backbar { display: none; } }
/* plan viewer: big previous / next sheet buttons on the sides */
.pv-sidenav { position: absolute; z-index: 4; top: calc(50% - 28px); width: 48px; height: 56px; border: 1px solid var(--line2, #e3e7ea); padding: 0;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; color: var(--ink, #14191f); cursor: pointer; }
.pv-sidenav.prev { left: 0; border-left: 0; border-radius: 0 14px 14px 0; }
.pv-sidenav.next { right: 0; border-right: 0; border-radius: 14px 0 0 14px; }
.pv-sidenav:disabled { display: none; }
.pv-sidenav svg { width: 26px; height: 26px; fill: none; stroke: var(--orange, #e0561c); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
@media print { .pv-sidenav { display: none; } }
/* file window: previous / next file */
.file-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 12px; }
.file-nav.in-reader { display: inline-flex; margin: 0; gap: 0; }
.file-nav.in-reader .pv-ib { font-size: 28px; }
/* biggest text: tab switches (Week · Payroll totals · Pay period) wrap onto two rows instead of running off the screen */
html[data-size="xl"] .seg { flex-wrap: wrap; }
/* plan viewer: Delete (admin / office) sits at the end of the tools, in red, set apart */
.pv-tool.pv-del { color: var(--red, #c92a2a); border-left: 1px solid var(--line2); margin-left: 4px; }
.pv-tool.pv-del:hover { background: #fff0f0; }
/* plans: sheets with a scale wear a ruler, so the crew knows they can measure on them */
.sheet-thumb { position: relative; }
.scaled-badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 5px; border-radius: 999px;
  background: #e8f7ef; color: #146c43; border: 1px solid #a8dcc0; font-size: 12px; font-weight: 700; line-height: 1.2; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.scaled-badge svg, .scaled-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.scaled-ic { display: inline-flex; vertical-align: -3px; color: #146c43; margin-right: 4px; }
.pv-snapbtn { min-height: 0; margin-left: 8px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; font-size: 12px; font-weight: 600; color: var(--muted); }
.pv-snapbtn.on { color: #b83d0f; border-color: #f2b49c; background: #fff3ee; }

/* Today: tiles that open the who's-on-the-clock list, and the list itself (on = green, off = light orange) */
button.td-tile { font: inherit; text-align: left; white-space: normal; line-height: inherit; cursor: pointer; width: 100%; min-height: 0; align-items: flex-start; justify-content: flex-start; background: var(--panel); color: var(--ink); box-shadow: none; text-transform: none; letter-spacing: normal; font-weight: inherit; }
button.td-tile:hover { background: var(--panel); }
.td-rh { margin: 4px 0 6px; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.td-rh.go { color: var(--green); }
.td-rh.off { color: var(--amber); margin-top: 16px; }
.td-list.td-rl { display: flex; flex-direction: column; gap: 6px; }
.td-list.td-rl li { border-top: 0; padding: 9px 12px; border-radius: 10px; }
.td-list.td-rl li.on { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.td-list.td-rl li.off { background: var(--amber-soft); box-shadow: inset 3px 0 0 #e0a75a; }

/* CARE+ job: the Hub clock waits for the CARE+ app; expenses for the customer go there */
.care-lock { margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft, #faf7f2); }
.care-lock p { margin: 0 0 8px; }
.care-ask { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.ca-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.ca-row > span:first-child { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.ca-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.care-exp { display: block; text-align: left; margin-bottom: 10px; }
.care-exp .button { display: inline-block; margin-top: 8px; }

/* Payments: their own records (Money → Payments, and one page each) */
.pay-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pay-tools input[type=search] { flex: 1 1 220px; }
.pay-list a { display: flex; gap: 10px; align-items: center; justify-content: space-between; text-decoration: none; color: inherit; }
.pay-list .pl-main { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; min-width: 0; }
.pay-list .pl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.qb-dot { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.qb-dot.good { background: #e7f3ec; color: #1e7b4c; } .qb-dot.bad { background: #fde8e6; color: #b42318; } .qb-dot.warn { background: #fff4e0; color: #9a5b00; }
.pay-head { display: flex; flex-direction: column; gap: 4px; }
.pay-amt { font-size: 34px; line-height: 1.1; }
.qbo-line.good { color: #1e7b4c; } .qbo-line.warn { color: #9a5b00; }
.pay-inv { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; text-decoration: none; color: inherit; }
.pay-inv small { flex-basis: 100%; }
a.pay-row { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: none; color: inherit; }
.void-box h3 { margin-top: 0; }
.void-link { margin: 0 0 12px; }

/* Specs → Import quote */
.qi-files { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.qi-files button { display: flex; justify-content: space-between; gap: 10px; text-align: left; }
.qi-room .spec-head select { max-width: 55%; }
.qi-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; margin: 4px 0 8px; background: #fff4e6; border-left: 3px solid var(--brand, #e8590c); border-radius: 6px; }
.qi-ask input { flex: 1 1 200px; }
.qi-item { align-items: flex-start; padding: 5px 2px; border-top: 1px solid var(--line); }

/* ---------- My work on one screen (phones) ---------- */
body.on-mywork .clockbanner { display: none; }                 /* the clock card at the top says the same */
.clockcard.compact { padding: 12px 14px; margin-bottom: 10px; text-align: left; }
.clockcard.compact .cc-status { justify-content: flex-start; font-size: .9rem; }
.clockcard.compact .cc-job { font-size: .98rem; line-height: 1.2; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clockcard.compact .cc-addr { font-size: .88rem; margin-top: 1px; }
.cc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 6px; }
.cc-two > div { background: rgba(255,255,255,.65); border-radius: 8px; padding: 6px 10px; display: grid; }
.cc-two small { font-size: .74rem; color: var(--muted); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-two b { font-size: 1.25rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.clockcard.compact .cc-meta { font-size: .8rem; }
.clockcard.compact .cc-run, .clockcard.compact .cc-back { min-height: 36px; margin: 2px 0; font-size: .88rem; padding: 4px 10px; }
.clockcard.compact .cc-actions { margin-top: 6px; }
.clockcard.compact .cc-actions button { min-height: 44px; font-size: .92rem; line-height: 1.15; padding: 6px 10px; }
.clockcard.compact .cc-in { min-height: 52px; font-size: 1.15rem; width: 100%; }
.clockcard.compact:not(.on) .cc-status { margin-bottom: 8px; }
.clockcard.compact:not(.on) .cc-in, .clockcard.compact:not(.on) .cc-other { width: 100%; min-height: 56px; }
.cc-hours .cc-totals { justify-content: flex-start; margin: 0; }
.mywork .yourday { padding: 12px 14px; margin-bottom: 10px; }
.mywork .yourday .cardhead h3 { font-size: 1.05rem; margin: 0; }
.mywork .yd-list li { padding: 6px 0; gap: 8px; }
.mywork .yd-time { min-width: 0; width: 64px; flex: none; font-size: 12px; line-height: 1.2; }
.mywork .yd-what b { font-size: .98rem; line-height: 1.2; }
.mywork .yd-what small { font-size: .8rem; }
.mywork .yd-list .button.small { padding: 4px 10px; font-size: .85rem; min-height: 34px; flex: none; }
.mywork .yd-others summary { font-size: .95rem; padding: 4px 0; }
.mywork .pagehead { margin-bottom: 6px; }

.clockcard.compact { padding: 10px 12px; }
.clockcard.compact .cc-status { font-size: .82rem; }
.cc-two { margin: 6px 0 4px; } .cc-two > div { padding: 4px 8px; }
.cc-two small { font-size: .7rem; }
.mywork .pagehead h1 { font-size: 1.35rem; }
.mywork .yourday .cardhead small { font-size: .78rem; }
.mywork .yd-what b { font-size: .92rem; }
.yd-acts { display: flex; flex-direction: column; gap: 4px; flex: none; align-items: stretch; }
.yd-back { background: var(--tatra-build); color: #fff; border: 0; font-weight: 700; padding: 4px 10px; min-height: 34px; font-size: .85rem; }

/* Project → Timesheets */
.ts-range { flex-wrap: wrap; gap: 8px; }
.ts-dates input { width: auto; }
.ts-person .ts-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ts-table td { padding: 5px 6px; border-top: 1px solid var(--line, #e5e7eb); vertical-align: top; }
.ts-table .ts-d { white-space: nowrap; width: 1%; }
.ts-table td.num { white-space: nowrap; text-align: right; }
.ts-paper-wrap { overflow-x: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; background: #fff; }
.ts-paper { color: #111; background: #fff; padding: 24px; min-width: 560px; font-size: 13px; }
.ts-paper .ts-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; font-size: 12px; text-align: right; }
.ts-paper .ts-logo { width: 150px; height: auto; }
.ts-paper h2 { margin: 18px 0 6px; font-size: 20px; }
.ts-st { width: 100%; border-collapse: collapse; margin: 12px 0; page-break-inside: avoid; }
.ts-st th { text-align: left; background: #f1f3f6; padding: 6px 8px; font-size: 13px; }
.ts-st td { padding: 4px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.ts-st .num { text-align: right; white-space: nowrap; }
.ts-st .ts-note { font-size: 12px; color: #444; }
.ts-st .ts-sum td { border-bottom: 2px solid #111; }
.ts-paper .ts-total { text-align: right; font-size: 15px; margin-top: 10px; }
#print-root .ts-paper { min-width: 0; padding: 0; }
.ts-bill .cp-go .primary { white-space: normal; text-align: center; }
@media (max-width: 640px) { .ts-bill .cp-kv { grid-template-columns: minmax(0, 1fr) max-content; } .ts-person .ts-head .muted { font-size: .85rem; } }
.ts-table tr.ts-flags td { border-top: 0; padding-top: 0; }
.ts-flag { font-size: 13px; color: var(--muted); margin: 2px 0; }
.ts-flag.warn { color: #a15c00; }
.ts-flag.bad { color: #b42318; font-weight: 600; }
.ts-flag.info { color: #2f7a3a; }
.ts-flag .linkish { margin-left: 6px; }
.ts-flag-act { margin: 6px 0 4px; flex-wrap: wrap; }
tr.ts-flags.look td { background: #fff8eb; }
/* Project → Bill this job */
.bj-steps { display: flex; gap: 6px; margin: 4px 0 14px; overflow-x: auto; }
.bj-step { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: max-content; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line, #e5e7eb); background: var(--card, #fff); font-weight: 600; color: var(--muted); }
.bj-step i { font-style: normal; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #eef0f3; color: #333; font-size: 13px; }
.bj-step.on { border-color: var(--brand, #ea5a1f); color: var(--ink, #111); box-shadow: 0 0 0 1px var(--brand, #ea5a1f) inset; }
.bj-step.on i { background: var(--brand, #ea5a1f); color: #fff; }
.bj-step.done i { background: #2f7a3a; color: #fff; }
.bj-act { white-space: nowrap; text-align: right; }
.bj-act .check { display: inline-flex; gap: 4px; align-items: center; margin-right: 8px; }
.billjob tr.on td { background: #f1f9f2; }
.ts-annex { page-break-before: always; }
.ts-annex .ts-st { font-size: 12px; }
/* the open account menu scrolls on its own; the page behind it stays put (iPad) */
.dropdown:has(.acct) { max-height: calc(100dvh - 76px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (pointer: coarse) { html.acct-open, html.acct-open body { overflow: hidden; } }

/* where an invoice sits in its payment schedule (deposit, 2 of 3…) */
.q-sched { margin: 10px 0 4px; border: 1px solid #e3e6e8; border-radius: 6px; padding: 8px 12px; break-inside: avoid; }
.q-sched-what { margin: 0 0 6px; }
.q-sched-t { width: 100%; border-collapse: collapse; font-size: .9em; }
.q-sched-t td { padding: 3px 6px; border-top: 1px solid #eef0f2; }
.q-sched-t tr.on td { font-weight: 700; background: #fff4ec; }
.q-sched-s { color: #6b757c; text-align: right; white-space: nowrap; }

/* a PDF drawn on the page (bill review) */
.pdf-inline { height: 68vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #eef0f2; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pdf-inline > p { padding: 12px; margin: 0; }
.pdf-inline canvas { display: block; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
@media (max-width: 760px) { .pdf-inline { height: 50vh; } }
.bb-item .bb-tm { grid-column: 2 / 4; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.bb-item .bb-tm select, .bb-op select { max-width: 360px; min-width: 0; }
.bb-op { margin-bottom: 12px; }
.bb-rate { display: inline-flex; align-items: center; gap: 2px; }
.bb-rate input { width: 84px; }

/* closing a job + report cards */
.cj-bar { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin: 4px 0 12px; flex-wrap: wrap; }
.cj-list { list-style: none; padding: 0; margin: 0 0 14px; }
.cj-list li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; background: #f3f8f3; }
.cj-list li.todo { background: #fff6e8; }
.cj-list li.todo a { color: #8a4b00; }
.rcard { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--card, #fff); break-inside: avoid; }
.rcard header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.rcard header small { display: block; }
.rc-margin { text-align: right; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.rc-margin small { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); }
.rc-margin.good { color: #2f7a3a; } .rc-margin.ok { color: #a15c00; } .rc-margin.bad { color: #b42318; }
.rc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.rc-tiles > div { background: #f6f7f9; border-radius: 8px; padding: 8px 10px; }
.rc-tiles > div.bad b { color: #b42318; }
.rc-tiles small { display: block; }
.rc-tiles b { font-size: 1.15rem; }
.rc-tm { padding: 8px 10px; border-radius: 8px; margin: 0 0 8px; }
.rc-tm.good { background: #eef8ef; } .rc-tm.bad { background: #fdeeee; }
.rc-crew { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-crew th, .rc-crew td { padding: 4px 6px; border-top: 1px solid var(--line, #e5e7eb); text-align: left; }
.rc-crew .num { text-align: right; }
.rc-notes { white-space: pre-wrap; background: #f6f7f9; padding: 8px 10px; border-radius: 8px; }
.ts-add { display: flex; justify-content: flex-end; margin: -4px 0 6px; }
.ts-st-cell { white-space: nowrap; }

/* Clock in / switch / go to another job — one screen: how, the job (one line once picked), the section as buttons,
   and the big button pinned to the bottom of the sheet so nobody has to scroll for it */
.ck { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
.ck-step { display: flex; flex-direction: column; gap: 6px; }
.ck-k { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ck-loc { margin: 0; }
.ck-hint { margin: -4px 0 0; }
.ck-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ck-how button { min-height: 44px; padding: 6px 4px; font-size: .86rem; line-height: 1.15; white-space: normal; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.ck-how button.on, .ck-how.seg button.on { border: 2px solid var(--tatra-build); background: var(--tatra-build); color: #fff; font-weight: 700; }
.joblist.slim { max-height: 44vh; margin: 0; gap: 4px; }
.jobpick.slim { min-height: 48px; padding: 8px 12px; }
.jobpick.slim .jp-main { gap: 1px; }
.jobpick.slim .jp-main b { -webkit-line-clamp: 1; line-clamp: 1; }
.jobpick.slim .jp-main small { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobpick.slim .jp-dist { padding: 0 6px; font-size: .74rem; }
.jp-plan { flex: 0 0 auto; white-space: nowrap; font-size: .74rem; font-weight: 700; color: var(--tatra-build); padding: 0 6px; border-radius: 99px; background: var(--green-soft); }
.ck-picked { display: flex; gap: 8px; align-items: stretch; }
.ck-picked .jobpick { flex: 1 1 auto; min-width: 0; }
.ck-picked > .ghost { flex: none; }
.ck-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ck-chips .chip { min-height: 40px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: .9rem; white-space: nowrap; }
.ck-chips .chip.on { border: 2px solid var(--tatra-build); background: var(--green-soft); font-weight: 700; }
.ck-addnote { align-self: flex-start; font-size: .9rem; padding: 2px 0; }
.ck-foot { position: sticky; bottom: -20px; z-index: 2; display: grid; grid-template-columns: auto 1fr; gap: 8px; margin: 12px -20px -20px; padding: 10px 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line2); }
.ck-go { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 1.1rem; line-height: 1.15; white-space: normal; }
.ck-go small { font-size: .78rem; font-weight: 600; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ck-go:disabled { opacity: .5; }
@media (max-width: 760px) { .ck-foot { bottom: -12px; margin-bottom: -20px; } }

/* Your day: today's job as one compact strip, not a big tile */
.mywork .yd-today { padding: 8px 10px; margin: 2px 0 8px; gap: 0; }
.mywork .yd-today-n { font-size: 1rem; }
.mywork .yd-today-acts { margin-top: 6px; grid-template-columns: auto 1fr; }
.mywork .yd-today-acts > * { min-height: 44px; }
.mywork .yd-today-acts > .ghost { padding: 0 12px; font-size: .9rem; }
/* a job today: the clock card is just a slim "somewhere else?" link under Your day */
.clockcard.compact.other { padding: 0; border: 0; box-shadow: none; background: none; margin: -6px 0 10px; }
.clockcard.compact.other .cc-other { min-height: 44px; font-size: .92rem; color: var(--ink); border: 1px dashed var(--line); background: var(--panel); }
/* location off on the clock-in sheet: turn it on here, or the steps to keep it on */
.locfix { border: 1px solid #f0c36d; background: #fff8e6; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.lf-head { margin: 0; font-size: .92rem; line-height: 1.3; color: #7a4b00; }
.lf-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lf-acts .primary { min-height: 40px; }
.lf-steps p { margin: 0 0 4px; }
.lf-steps ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; line-height: 1.35; }
/* "Open directions in…" — asked once per phone */
.maps-pick { display: grid; gap: 8px; margin-top: 8px; }
.maps-pick button { min-height: 52px; font-size: 1.05rem; justify-content: center; }
/* a schedule payment billed on an invoice that isn't linked yet */
.link-inv { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.link-inv select { max-width: 16em; font-size: .85rem; }

/* Fleet → truck → Where was it? (the day's GPS trail) */
.trucktrail .tt-day { display: flex; align-items: center; gap: 6px; }
.trucktrail .tt-day input { width: auto; min-height: 38px; }
.tt-map { height: 320px; border-radius: 10px; margin: 8px 0 10px; border: 1px solid var(--line2); z-index: 0; }
.tt-pin { background: #fff; border: 2px solid #e8501e; border-radius: 50%; display: flex !important; align-items: center; justify-content: center; font-size: 12px; color: #e8501e; }
.tt-pin.job { border-color: #12557d; color: #12557d; }
.tt-flags { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.tt-flag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: .9rem; line-height: 1.3; background: #f2f6fa; }
.tt-flag.warn { background: #fff8e6; border: 1px solid #f0c36d; }
.tt-flag.bad { background: #fdeceb; border: 1px solid #f1a39b; }
.tt-list { list-style: none; margin: 0; padding: 0; }
.tt-list li { display: grid; grid-template-columns: 28px minmax(5.5em, auto) minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line2); }
.tt-list li.tt-drive { padding: 2px 0; border-top: 0; }
.tt-n { font-weight: 800; color: #e8501e; text-align: center; }
.tt-stop.job .tt-n { color: #12557d; }
.tt-when { font-variant-numeric: tabular-nums; font-size: .88rem; white-space: nowrap; }
.tt-what { display: flex; flex-direction: column; min-width: 0; }
.tt-clock { background: var(--green-soft); border-radius: 6px; }
.tt-clock.auto { background: #fdeceb; }
.te-flags .te-day { background: #eef4fb; color: #12557d; cursor: pointer; font-weight: 700; }
.persday .trucktrail { margin-top: 8px; }
/* Fleet map: phones of everyone on the clock (crew purple, subs teal) next to the trucks */
.map-phone b { display: inline-block; transform: translate(-50%, -50%); background: #6b3fa0; color: #fff; font: 600 11px var(--body); padding: 2px 7px; border-radius: 99px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.map-phone.sub b { background: #0f7f7a; }
.fleet-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }
.fleet-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.fleet-legend .lg.truck { background: var(--tatra-ink); }
.fleet-legend .lg.crew { background: #6b3fa0; border-radius: 99px; }
.fleet-legend .lg.sub { background: #0f7f7a; border-radius: 99px; }
/* Mail → a proposal PDF → new project */
.mail-att .imp-go { color: var(--tatra-build); font-weight: 700; }
.imp-signed { align-items: flex-start; margin-top: 8px; padding: 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--green-soft); }
.imp-signed span { display: flex; flex-direction: column; gap: 2px; }
/* send an estimate: the Hub page or the original proposal PDF */
.send-as { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); }
.q-pdf .q-pdfnote { margin: 0 0 8px; }
.q-pdf .q-sign { margin-top: 16px; }
.q-signedcopy { margin: 8px 0; }

/* Check the day: approve the day's hours right here */
.tt-approve { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line, #e5e5e5); border-radius: 10px; background: var(--soft, #f7f7f5); }
.tt-approve.done { justify-content: flex-start; color: var(--ok, #1f7a3a); border-color: transparent; background: none; padding: 4px 0; }

/* the client's account: credit (green) and owes (red) */
.acct-card .acct-sec { margin-top: 10px; }
.acct-card .acct-sec h4 { margin: 0 0 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.acct-card .acct-sec.good h4, .acct-card b.good, .stat.good b { color: var(--ok, #1f7a3a); }
.acct-card .acct-sec.bad h4, .acct-card b.bad { color: var(--bad, #b42318); }
.acct-card .acct-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line, #eee); }
.acct-card .acct-apply { display: flex; gap: 6px; align-items: center; }
.acct-card .acct-apply select { max-width: 220px; }

/* Products & services: the Hub's rows not found in QuickBooks */
.prod-lost .row { align-items: center; padding: 4px 0; }
.prod-lost select { max-width: 320px; }
