/* Premier HQ — "clear glass": bright, cool, legible. Data first, chrome last. */
:root {
  --paper: #f5f8f9;        /* the page: cool, like a clean pane in daylight */
  --surface: #ffffff;
  --ink: #142029;          /* squeegee rubber */
  --ink-2: #4a5a66;
  --ink-3: #7b8a95;
  --line: #dde5e9;
  --line-2: #c9d4da;
  --water: #0b6e78;        /* primary: clear water */
  --water-2: #0e8a96;
  --water-tint: #e3f2f4;
  --money: #9a5b00;        /* money owed / needs chasing */
  --money-tint: #fdf1de;
  --late: #b4232c;
  --late-tint: #fbe7e8;
  --good: #22764a;
  --good-tint: #e2f3ea;
  --focus: #0e8a96;
  --radius: 10px;
  --rail: 208px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f171d; --surface: #152029; --ink: #e8eef1; --ink-2: #b2c0c9; --ink-3: #82939e;
    --line: #233340; --line-2: #2e4150; --water: #4cc3cf; --water-2: #6fd3dd; --water-tint: #13343a;
    --money: #f0b45a; --money-tint: #3a2a12; --late: #ff7b82; --late-tint: #3d1a1d; --good: #6fd39c; --good-tint: #133525;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f171d; --surface: #152029; --ink: #e8eef1; --ink-2: #b2c0c9; --ink-3: #82939e;
  --line: #233340; --line-2: #2e4150; --water: #4cc3cf; --water-2: #6fd3dd; --water-tint: #13343a;
  --money: #f0b45a; --money-tint: #3a2a12; --late: #ff7b82; --late-tint: #3d1a1d; --good: #6fd39c; --good-tint: #133525;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--water); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.015em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- frame */
#app { min-height: 100vh; }
#app.authed { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.mark { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; padding: 0 8px; }
.mark:hover { text-decoration: none; }
.mark .brand-logo { width: 34px; height: 34px; flex: none; object-fit: contain; box-sizing: border-box; background: #fff; padding: 3px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.gate .mark .brand-logo { width: 56px; height: 56px; padding: 5px; border-radius: 14px; }
.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav a { color: var(--ink-2); padding: 7px 10px; border-radius: 8px; font-weight: 550; display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.nav a svg, .tabbar svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 4px; }
.nav-h:first-child { padding-top: 0; }
.nav a:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--water-tint); color: var(--water); }
.who { margin-top: auto; padding: 0 8px; font-size: 13px; color: var(--ink-3); }
.who strong { display: block; color: var(--ink-2); font-weight: 600; }
.who button { margin-top: 6px; }
main { padding: 32px 40px 80px; max-width: 1280px; width: 100%; outline: none; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin-top: 6px; color: var(--ink-2); max-width: 70ch; }
.crumb { font-size: 13px; margin-bottom: 8px; display: inline-block; }

/* ---------- controls */
button, .btn { font: inherit; font-size: 14px; font-weight: 600; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--water); text-decoration: none; }
button.primary { background: var(--water); border-color: var(--water); color: #fff; }
button.primary:hover { background: var(--water-2); }
button.link { border: 0; background: none; padding: 0; color: var(--water); font-weight: 600; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
textarea { width: 100%; resize: vertical; min-height: 90px; }
label { font-size: 13px; color: var(--ink-2); font-weight: 600; display: grid; gap: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type="search"] { flex: 1 1 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- tags */
.tag { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.water { background: var(--water-tint); color: var(--water); border-color: transparent; }
.tag.money { background: var(--money-tint); color: var(--money); border-color: transparent; }
.tag.late { background: var(--late-tint); color: var(--late); border-color: transparent; }
.tag.good { background: var(--good-tint); color: var(--good); border-color: transparent; }
.late-text { color: var(--late); font-weight: 600; }
.money-text { color: var(--money); font-weight: 650; }

/* ---------- tables: the main way data is shown */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.go { cursor: pointer; }
@media (hover: hover) { tbody tr.go:hover td { background: var(--paper); } }
td .sub { display: block; color: var(--ink-3); font-size: 13px; }
td.name a { color: var(--ink); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--ink-2); font-size: 13px; flex-wrap: wrap; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); }

/* ---------- Today page */
.head p.lede, .lede { color: var(--ink); margin: 0; font-family: var(--font-display); font-size: 34px; line-height: 1.18; font-weight: 600; letter-spacing: -0.02em; max-width: 26ch; }
.lede .v { color: var(--water); }
.lede-sub { margin-top: 10px; color: var(--ink-2); font-size: 16px; }

/* The 14-day strip: work value per day, drawn like a tide chart */
.tide { margin: 28px 0 34px; }
.tide-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 130px; border-bottom: 2px solid var(--ink); }
.tide-bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.tide-bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: var(--water); min-height: 2px; }
.tide-bar.weekend i { background: var(--line-2); }
.tide-bar.today i { background: var(--ink); }
.tide-bar:hover i, .tide-bar:focus-visible i { background: var(--water-2); }
.tide-bar b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.tide-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-3); text-align: center; }
.tide-days .wk { color: var(--ink); font-weight: 650; }
.tide-days em { font-style: normal; margin-right: 3px; }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.grid2 > .panel { margin-top: 0; }
.panel h2 { margin-bottom: 12px; }
.attn { display: grid; gap: 0; }
.attn a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.attn a:first-child { border-top: 0; padding-top: 0; }
.attn a:hover { text-decoration: none; }
.attn a:hover strong { color: var(--water); }
.attn strong { font-weight: 650; }
.attn .n { font-size: 22px; font-weight: 650; text-align: right; font-family: var(--font-display); }
.attn .why { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }
.bars-month { display: grid; gap: 6px; }
.bars-month div { display: grid; grid-template-columns: 64px 1fr 76px; gap: 10px; align-items: center; font-size: 13px; }
.bars-month span.track { height: 10px; background: var(--paper); border-radius: 6px; overflow: hidden; }
.bars-month span.track i { display: block; height: 100%; background: var(--water); border-radius: 6px; }

/* ---------- customer page */
.cust-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; margin-bottom: 22px; }
.cust-head .addr { font-size: 16px; color: var(--ink-2); margin-top: 6px; }
.cust-head .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cust-money { text-align: right; }
.cust-money .bal { font-size: 28px; font-weight: 650; font-family: var(--font-display); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.contact { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.contact dt { color: var(--ink-3); }
.contact dd { margin: 0; overflow-wrap: anywhere; }
.section { margin-top: 26px; }
.section > h2 { margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.section > h2 span { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; border-radius: 0; background: none; color: var(--ink-2); padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--water); }

/* ---------- checks */
.check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.check summary { list-style: none; display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 18px; cursor: pointer; align-items: center; }
.check summary::-webkit-details-marker { display: none; }
.check .count { font-size: 24px; font-weight: 650; font-family: var(--font-display); text-align: right; }
.check.money .count { color: var(--money); }
.check.warn .count { color: var(--late); }
.check.info .count { color: var(--ink-2); }
.check.zero .count { color: var(--good); }
.check strong, .check .why { display: block; }
.check .why { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.check[open] summary { border-bottom: 1px solid var(--line); }
.check .list { max-height: 360px; overflow: auto; }
.check .chev { color: var(--ink-3); font-size: 13px; }

/* ---------- login / setup */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate form { width: 100%; max-width: 380px; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.gate .mark { padding: 0; margin-bottom: 6px; }
.gate input { width: 100%; padding: 10px 12px; }
.error { color: var(--late); font-size: 14px; font-weight: 600; min-height: 1em; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
#toast.show { opacity: 1; }
.notice { background: var(--water-tint); color: var(--ink); border-radius: var(--radius); padding: 12px 16px; font-size: 14px; margin-bottom: 18px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-row label { flex: 1 1 180px; }
.stack { display: grid; gap: 12px; }
.loading { color: var(--ink-3); padding: 40px 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- tablet & phone */
@media (max-width: 980px) {
  .split, .grid2 { grid-template-columns: minmax(0, 1fr); }
  main { padding: 24px 22px 90px; }
}
@media (max-width: 760px) {
  #app.authed { display: block; }
  /* the full menu becomes a sheet that slides up from "More" */
  .rail { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; top: auto; height: auto; max-height: 82vh; border-right: 0; border-radius: 18px 18px 0 0;
          padding: 18px 14px calc(76px + env(safe-area-inset-bottom)); transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s;
          box-shadow: 0 -10px 40px rgba(0,0,0,.18); overflow-y: auto; display: block; }
  body.drawer-open .rail { transform: none; visibility: visible; transition: transform .22s ease; }
  .rail .nav { overflow: visible; margin: 0; padding: 0; }
  .rail .who { margin-top: 16px; }
  .rail .mark { display: none; }
  .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nav-h { display: none; }
  .nav a { flex-direction: column; gap: 4px; font-size: 12.5px; text-align: center; padding: 10px 4px; background: var(--paper); }
  .nav a svg { width: 22px; height: 22px; }
  .who { padding-top: 8px; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(8, 16, 22, .45); }
  .tabbar { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface);
            border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
            padding: 6px 2px; border: 0; background: none; border-radius: 10px; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--water); }
  .tabbar a:hover { text-decoration: none; }
  main { padding: 20px 16px 96px; }
  h1 { font-size: 25px; }
  .lede { font-size: 26px; }
  .tide-bars { height: 96px; gap: 3px; }
  .tide-days { gap: 3px; font-size: 10.5px; }
  .tide-bar b { display: none; }
  .tide-days em { display: block; margin: 0; }
  .cust-head { grid-template-columns: 1fr; }
  .cust-money { text-align: left; }
  .hide-sm { display: none; }
  table { font-size: 13.5px; }
  th, td { padding: 9px 10px; }
  .check summary { grid-template-columns: 46px 1fr; }
  .check .chev { display: none; }
  .cards-sm thead { display: none; }
  .cards-sm tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .cards-sm tbody tr:last-child { border-bottom: 0; }
  .cards-sm td { border: 0; padding: 0; }
  .cards-sm td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .cards-sm td.num { text-align: right; }
  .cards-sm td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: none; }
}
.check .chev .c, .check[open] .chev .o { display: none; }
.check[open] .chev .c { display: inline; }

.show-more { margin-top: 10px; }

/* ======================================================= planner (office) */
.section-tight { margin: 10px 0 14px; }
.btn.on { border-color: var(--water); color: var(--water); }
.week-grid table { table-layout: fixed; min-width: 760px; }
.week-grid th.is-today { color: var(--water); }
.week-grid th.lane { color: var(--ink); font-size: 13.5px; white-space: normal; width: 130px; position: static; }
.wk-cell { padding: 0; }
.wk-cell a { display: grid; gap: 1px; padding: 9px 10px; color: var(--ink); font-size: 13px; min-height: 64px; }
.wk-cell a:hover { background: var(--paper); text-decoration: none; }
.wk-cell strong { font-size: 14px; }
.wk-cell.on a { background: var(--water-tint); box-shadow: inset 0 0 0 2px var(--water); }
.wk-cell.empty-cell a { color: var(--ink-3); align-content: center; }
.board .head { margin-bottom: 12px; }
.board-table td { vertical-align: middle; }
.board-table tr.is-finished td { color: var(--ink-3); }
.board-table tr[draggable="true"] { cursor: grab; }
.board-table tr.dragging { opacity: .4; }
.board-table tr.drop td { box-shadow: inset 0 2px 0 var(--water); }
button.icon { padding: 3px 7px; font-size: 11px; line-height: 1; margin-left: 2px; }
.movebar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--ink); color: var(--paper); border-radius: var(--radius); }
.movebar label { color: var(--paper); }
.movebar #selcount { font-weight: 650; align-self: center; margin-right: 6px; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface); color: var(--ink); max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(10, 20, 28, .45); }
input.narrow { width: 72px; }

/* ======================================================= day sheet (workers) */
#app.worker { display: block; }
@media (min-width: 761px) { #app.worker .rail { display: none !important; } }   /* phones: the More menu still opens (log out) */
#app.worker main { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }
.day-head h1 { font-size: 24px; margin: 12px 0 2px; }
.day-switch { display: flex; gap: 6px; }
.progress { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; background: var(--good); }
.day-actions { margin: 14px 0; }
.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stop a { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.stop a:hover { text-decoration: none; }
@media (hover: hover) { .stop a:hover { border-color: var(--water); } }
.stop .no { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line-2); }
.stop .what { display: grid; gap: 2px; min-width: 0; }
.stop .what > span:not(.tags) { color: var(--ink-2); }
.stop .tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.stop.next a { border: 2px solid var(--water); }
.stop.next .no { background: var(--water); color: #fff; border-color: var(--water); }
.stop.done a, .stop.skipped a { opacity: .62; }
.stop.done .no { background: var(--good-tint); color: var(--good); border-color: transparent; }
.visit h1 { font-size: 26px; margin-top: 6px; }
.visit-addr { font-size: 18px; color: var(--ink-2); margin: 4px 0 14px; }
.visit-go { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.visit-go .btn.primary { grid-column: 1 / -1; }
.visit-go .btn { justify-content: center; padding: 12px; font-size: 15px; }
a.btn.primary { background: var(--water); color: #fff; border-color: var(--water); }
.visit-facts { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.photos img, .thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.thumbs img { width: 48px; height: 48px; }
.photo-btn { cursor: pointer; }
.visit-actions { display: grid; gap: 10px; margin-top: 18px; }
button.wide, .btn.wide { width: 100%; justify-content: center; padding: 13px; font-size: 16px; }
button.big { padding: 16px; font-size: 18px; }
.visit-actions .form-row > * { flex: 1; }
.timer { font-weight: 650; color: var(--water); }
.visit-state { font-weight: 650; font-size: 18px; }
.signup input, .signup select { width: 100%; padding: 11px 12px; font-size: 16px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); }
.check-row input { width: auto; }
.signup-card .head { margin-bottom: 10px; }
@media (max-width: 760px) {
  .nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; padding: 8px 10px; }
  .movebar { position: static; }
}

details > summary { cursor: pointer; }
details > summary > h2 { display: inline-flex; }

/* ======================================================= weeks ahead & time off */
.planner-tabs { margin-top: -6px; }
.off-cell a { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 6px, var(--surface) 6px, var(--surface) 12px); }
.off-cell.clash a { box-shadow: inset 0 0 0 2px var(--late); }
.quick-dates { display: inline-flex; gap: 6px; align-self: end; }
.movebar .chip { background: transparent; color: var(--paper); border-color: rgba(255,255,255,.4); }
.note-snip { color: var(--ink-2); font-style: italic; }
.cap-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 6px; }
.cap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lv { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lv.light, .cap-link.lv-light { background: var(--paper); }
.lv.ok, .cap-link.lv-ok { background: var(--water-tint); }
.lv.full, .cap-link.lv-full { background: var(--good-tint); }
.lv.over, .cap-link.lv-over { background: var(--late-tint); }
.lv.off, .cap-link.lv-off { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 4px, var(--line) 4px, var(--line) 8px); }
.lv { border: 1px solid var(--line-2); }
.cap-table { table-layout: fixed; min-width: 720px; }
.cap-cell { padding: 3px; }
.cap-cell a { display: grid; gap: 1px; padding: 8px 9px; border-radius: 8px; color: var(--ink); font-size: 12.5px; min-height: 54px; }
.cap-cell a:hover { text-decoration: none; box-shadow: inset 0 0 0 2px var(--water); }
.cap-cell strong { font-size: 15px; }
.cap-link.lv-over strong { color: var(--late); }
.notice.mine { display: block; color: var(--ink); font-weight: 600; }

/* ======================================================= money */
.owed-buckets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.owed-b { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--radius); }
.owed-b strong { font-size: 20px; font-family: var(--font-display); }
.owed-b.old strong { color: var(--late); }
.owed-b.on { border-color: var(--water); box-shadow: inset 0 0 0 1px var(--water); }
.match .m-pair { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.m-side { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.m-side .tag { justify-self: start; }
.m-arrow { align-self: center; text-align: center; color: var(--ink-3); font-size: 20px; }
.m-actions { margin-top: 12px; align-items: center; }
.m-actions .small { margin-right: auto; }
.find-results { display: grid; gap: 4px; margin-top: 6px; }
.find-hit { display: grid; text-align: left; gap: 0; padding: 8px 10px; }
ol.steps { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 4px; }
ul.plain { list-style: none; padding: 0; margin: 4px 0; }
#paypanel h2 { display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) {
  .owed-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match .m-pair { grid-template-columns: 1fr; }
  .m-arrow { display: none; }
}

/* ---------- billing */
.danger-text { color: var(--late); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 6px; color: var(--ink-soft, inherit); }
#dlg-bill { max-width: 520px; }
#dlg-bill details { margin: 4px 0; }
.billsel { width: 18px; height: 18px; }
#billbox .sub { display: block; }

/* ---------- texts */
pre.sms { white-space: pre-wrap; font-family: inherit; font-size: 14px; background: var(--water-tint); border-radius: 12px; padding: 12px 14px; margin: 8px 0 0; max-width: 420px; }
.msg-body { white-space: pre-wrap; max-width: 420px; }

/* ---------- timings */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--ink-soft, inherit); opacity: .8; }
.kpi strong { font-size: 22px; font-variant-numeric: tabular-nums; }
select.narrow { width: auto; min-width: 70px; }
.light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; background: var(--line-2); }
.light.green { background: #2e9d5b; } .light.amber { background: #e3a21a; } .light.red { background: #d2483c; } .light.grey { background: #9aa6ad; }
.pnew { width: 90px; text-align: right; }
.skip-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.skip-head .sub { display: block; }
.skip-actions { margin-top: 8px; }
.panel.is-finished { opacity: .75; }
.check-item .form-row { margin-top: 6px; } .check-item input.ck-note { margin-top: 6px; width: 100%; }
#dlg-fleet { max-height: 90vh; overflow: auto; }
.contact dd .sub { display: block; }

/* skip suggestions */
.advice { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--water); background: var(--water-tint); font-size: 14px; }
.advice.rebook { border-left-color: var(--good); background: var(--good-tint); }
.advice.call { border-left-color: var(--money); background: var(--money-tint); }
.advice.leave { border-left-color: var(--line-2); background: var(--paper); }
.advice .small-btn { padding: 6px 12px; font-size: 13px; margin-top: 2px; }

.tabbar, .scrim { display: none; }
@media (max-width: 760px) { .tabbar:not([hidden]) { display: grid; } .scrim:not([hidden]) { display: block; } }

/* ---------- stat tiles with a trend line */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 10px; display: grid; gap: 2px; color: var(--ink); }
a.tile:hover { border-color: var(--water); text-decoration: none; }
.tile span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tile strong { font-family: var(--font-display); font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
.tile small { font-size: 12.5px; color: var(--ink-3); }
.tile small .up { color: var(--good); font-weight: 650; }
.tile small .down { color: var(--late); font-weight: 650; }
.tile .spark { width: 100%; height: 32px; margin-top: 4px; }
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--ink-3); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11.5px; font-family: var(--font); }
.chart .bar { fill: var(--water); }
.chart .bar.now { fill: var(--ink); }
.chart .bar.dim { fill: var(--line-2); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit.link { cursor: pointer; }
.chart .hit.on, .chart .hit:focus-visible { fill: var(--ink); fill-opacity: .05; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.s1, .spark .s1 { stroke: var(--water); }
.line.s2 { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.line.s3 { stroke: var(--money); }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.s1 { fill: var(--water); }
.chart .dot.s2 { fill: var(--ink-3); }
.chart .dot.s3 { fill: var(--money); }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.ctip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12.5px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ctip b { margin-left: 6px; font-weight: 700; }
.ctip .k { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.ctip .k.s1 { background: var(--water-2); }
.ctip .k.s2 { background: var(--ink-3); }
.ctip .k.s3 { background: var(--money); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.s1 { background: var(--water); }
.legend i.s2 { background: var(--ink-3); }
.legend i.s3 { background: var(--money); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-head .small { color: var(--ink-3); }
.charts2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 24px; }
@media (max-width: 980px) { .charts2 { grid-template-columns: 1fr; } }

/* ---------- maps */
.pmap { position: relative; overflow: hidden; background: #e8eef1; border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; user-select: none; cursor: grab; height: 420px; }
.pmap:active { cursor: grabbing; }
.pmap.tall { height: min(68vh, 680px); }
.pmap.short { height: 260px; }
.pm-tiles img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.pm-tiles img.off { visibility: hidden; }
.pm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pm-lines path { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 2.5; stroke-dasharray: 6 5; stroke-linejoin: round; }
.pm-pins { position: absolute; left: 0; top: 0; }
.pm-pin { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--water); box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: pointer; }
.pm-pin.num { left: -12px; top: -12px; width: 24px; height: 24px; font-size: 11px; font-weight: 700; color: #fff; display: grid; place-items: center; line-height: 1; }
.pm-pin.sel { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 2; }
.pm-pin.v1 { background: #2a78d6; } .pm-pin.v2 { background: #eb6834; } .pm-pin.v3 { background: #1baf7a; } .pm-pin.v0 { background: #7b8a95; }
.pm-pin.late { background: var(--late); } .pm-pin.week { background: #d98a00; } .pm-pin.later { background: var(--water); } .pm-pin.none { background: #7b8a95; }
.pm-pin.done { background: var(--good); } .pm-pin.skipped { background: var(--late); }
.pm-home { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 4px; background: var(--ink); border: 2px solid #fff; transform-origin: center; }
.pm-pop { position: absolute; z-index: 4; min-width: 180px; max-width: 260px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: default; }
.pm-pop strong { display: block; font-size: 14px; }
.pm-pop .sub { color: var(--ink-3); display: block; }
.pm-zoom { position: absolute; right: 10px; top: 10px; display: grid; z-index: 3; }
.pm-zoom button { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; border-radius: 0; }
.pm-zoom button:first-child { border-radius: 8px 8px 0 0; }
.pm-zoom button:last-child { border-radius: 0 0 8px 8px; border-top: 0; }
.pm-attr { position: absolute; right: 0; bottom: 0; font-size: 10.5px; color: #444; background: rgba(255,255,255,.8); padding: 1px 6px; border-radius: 6px 0 0 0; z-index: 3; }
.pm-attr a { color: inherit; text-decoration: underline; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.map-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.map-legend i.v1 { background: #2a78d6; } .map-legend i.v2 { background: #eb6834; } .map-legend i.v3 { background: #1baf7a; } .map-legend i.v0 { background: #7b8a95; }
.map-legend i.late { background: var(--late); } .map-legend i.week { background: #d98a00; } .map-legend i.later { background: var(--water); } .map-legend i.none { background: #7b8a95; }
.map-legend i.done { background: var(--good); } .map-legend i.skipped { background: var(--late); }
/* maps stay bright in dark mode: only the frame and the credit go dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pmap { background: #1a2329; } 
  :root:not([data-theme="light"]) .pm-pin.v1 { background: #3987e5; } :root:not([data-theme="light"]) .pm-pin.v2 { background: #d95926; } :root:not([data-theme="light"]) .pm-pin.v3 { background: #199e70; } }
:root[data-theme="dark"] .pmap { background: #1a2329; }
.map-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.map-side { display: grid; gap: 12px; }
.map-side .panel { padding: 14px 16px; }
@media (max-width: 980px) { .map-page { grid-template-columns: 1fr; } .pmap.tall { height: 60vh; } }
.kpis-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis-mini span { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpis-mini strong { font-family: var(--font-display); font-size: 22px; }
.pc-list { display: grid; gap: 6px; margin-top: 8px; }
.pc-list li { display: flex; justify-content: space-between; gap: 10px; }
.pc-list li span:last-child { color: var(--ink-2); }

.charts2 > .panel { margin: 0; }

/* stat tile mini charts */
.tile .mini { margin-top: 6px; }
.tile .mini .bar { fill: var(--water); fill-opacity: .55; }
.tile .mini .bar.now { fill-opacity: 1; }
.tile em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

/* Today: the week */
.lede-hi { font-family: var(--font-display); font-size: 30px; font-weight: 650; letter-spacing: -0.015em; }
.week { padding: 18px 20px 16px; margin-bottom: 4px; }
.week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.week-head h2 span { font-size: 14px; color: var(--ink-3); font-weight: 600; margin-left: 6px; }
.week-sum { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.week-sum strong { color: var(--water); font-size: 18px; }
.week-nav { display: flex; gap: 6px; }
.week-nav button { min-width: 38px; justify-content: center; font-size: 16px; }
.wk-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; }
.wk-day { display: grid; grid-template-rows: auto 120px auto auto; gap: 4px; text-align: center; color: var(--ink); border-radius: 10px; padding: 6px 4px 8px; }
.wk-day:hover { background: var(--paper); text-decoration: none; }
.wk-col { display: flex; align-items: flex-end; justify-content: center; border-bottom: 2px solid var(--line-2); }
.wk-col > i { display: block; width: min(56px, 80%); background: var(--water); border-radius: 6px 6px 0 0; }
.wk-day.past .wk-col > i { background: var(--line-2); }
.wk-day.today .wk-col > i { background: var(--ink); }
.wk-day.today .wk-n { color: var(--water); }
.wk-v { font-size: 12.5px; font-weight: 650; color: var(--ink-2); min-height: 18px; }
.wk-n { font-size: 13px; font-weight: 650; }
.wk-j { font-size: 12px; color: var(--ink-3); }
.pm-pin.faded { opacity: .45; }
@media (max-width: 760px) {
  .lede-hi { font-size: 24px; }
  .wk-bars { gap: 3px; }
  .wk-day { grid-template-rows: auto 90px auto auto; padding: 4px 0; }
  .wk-v { font-size: 10px; }
  .wk-n, .wk-j { font-size: 11px; }
}

/* ---------- Done / Payment box */
dialog.paybox { padding: 0; border: 0; border-radius: 16px; width: min(520px, 96vw); max-height: 92vh; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.paybox::backdrop { background: rgba(8, 16, 22, .5); }
.paybox-in { display: grid; gap: 14px; padding: 0 18px 18px; }
.pay-head { display: flex; gap: 12px; align-items: flex-start; background: var(--ink); color: var(--paper); margin: 0 -18px; padding: 16px 18px; border-radius: 16px 16px 0 0; }
.pay-head strong { display: block; font-size: 17px; }
.pay-head span { font-size: 13px; opacity: .8; }
.pay-x { background: none; border: 0; color: inherit; font-size: 18px; padding: 2px 6px; }
.pay-trial { font-size: 13px; background: var(--water-tint); color: var(--ink-2); padding: 8px 10px; border-radius: 8px; }
.pay-price { font-size: 13px; }
.pay-price.front { color: var(--money); }
.money-in { display: flex; align-items: center; gap: 6px; font-size: 28px; font-weight: 700; color: var(--ink); }
.money-in input { font-size: 28px; font-weight: 700; width: 9ch; padding: 4px 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; justify-content: center; font-size: 13.5px; padding: 10px 4px; background: var(--surface); color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.pay-pane { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.payopt { display: grid; grid-template-columns: auto 30px 1fr; gap: 12px; align-items: center; padding: 12px 14px; font-size: 15px; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); cursor: pointer; }
.payopt:last-child { border-bottom: 0; }
.payopt:has(input:checked) { background: var(--water-tint); }
.payopt.off { opacity: .5; cursor: default; }
.payopt input { width: 20px; height: 20px; accent-color: var(--water); }
.payopt .sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.pi { width: 30px; height: 30px; border-radius: 7px; background: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--ink); }
.pi.gocardless { background: #f1f252; color: #1c1b18; } .pi.gocardless::after { content: "G"; }
.pi.stripe { background: #635bff; color: #fff; } .pi.stripe::after { content: "S"; }
.pi.visit::after { content: "1"; } .pi.total::after { content: "Σ"; }
.pi.cash::after { content: "£"; } .pi.cheque::after { content: "✎"; } .pi.transfer::after { content: "⇄"; } .pi.card::after { content: "▭"; } .pi.other::after { content: "•"; }
.pay-ref { padding: 10px 14px 14px; }
.pay-pane[data-pane="later"] { padding: 12px 14px; }
#pay-go { min-height: 52px; }
@media (max-width: 760px) {
  dialog.paybox { width: calc(100vw - 24px); max-width: calc(100vw - 24px); margin: auto; border-radius: 16px; max-height: 90vh; }
}

/* Today: window round against break-even */
.health { margin-bottom: 18px; border-left: 5px solid var(--line-2); }
.health.green { border-left-color: var(--good); } .health.amber { border-left-color: #d98a00; } .health.red { border-left-color: var(--late); }
.health-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.health-big { margin-top: 4px; font-size: 15px; }
.health-big strong { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.01em; margin-right: 4px; }
.light-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; }
.light-pill i { width: 12px; height: 12px; border-radius: 50%; }
.light-pill.green { background: var(--good-tint); color: var(--good); } .light-pill.green i { background: var(--good); }
.light-pill.amber { background: var(--money-tint); color: var(--money); } .light-pill.amber i { background: #d98a00; }
.light-pill.red { background: var(--late-tint); color: var(--late); } .light-pill.red i { background: var(--late); }
.be-bar { position: relative; height: 14px; background: var(--paper); border-radius: 999px; margin: 30px 0 10px; border: 1px solid var(--line); }
.be-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--water); }
.health.red .be-fill { background: var(--late); } .health.amber .be-fill { background: #d98a00; } .health.green .be-fill { background: var(--good); }
.be-mark { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--ink); }
.be-mark span { position: absolute; bottom: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.health-gap { font-weight: 700; font-size: 15px; }
.health-gap.green { color: var(--good); } .health-gap.amber { color: var(--money); } .health-gap.red { color: var(--late); }
.health-advice { margin-top: 4px; color: var(--ink-2); max-width: 90ch; }
.health-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.health-stats span { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.health-stats strong { font-family: var(--font-display); font-size: 20px; }
.health-stats small { display: block; font-size: 12px; color: var(--ink-3); }
.health-stats small.up { color: var(--good); } .health-stats small.down { color: var(--late); }
.health-edit { display: flex; align-items: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.money-in.small-in { font-size: 15px; } .money-in.small-in input { font-size: 15px; width: 10ch; font-weight: 600; }
.wk-day.picked { background: var(--water-tint); outline: 2px solid var(--water); }
.wk-pick { color: var(--ink-2); margin-top: 6px; }
@media (max-width: 980px) { .health-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.be-mark.r span { transform: translateX(-100%); right: auto; left: 2px; }
.health-more { margin-top: 12px; }
.health-more summary { color: var(--water); cursor: pointer; font-weight: 600; }

/* day sheet: done jobs drop into their own section; map shorter on phones */
.done-list summary { cursor: pointer; list-style: none; }
.done-list summary::-webkit-details-marker { display: none; }
.done-list summary h2::before { content: "▸ "; color: var(--ink-3); }
.done-list[open] summary h2::before { content: "▾ "; }
.done-list .stops { margin-top: 10px; }
@media (max-width: 760px) { #daymap .pmap { height: 240px; } }
.done-list summary h2 span { margin-left: 8px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.seg.seg2 { grid-template-columns: repeat(2, 1fr); }

/* v0.9.1: re-cleans, gained & lost, records, worker app options */
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 760px) { .grid3, .tiles.three { grid-template-columns: minmax(0, 1fr); } }
.scroll-y { max-height: 420px; overflow-y: auto; }
fieldset.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
fieldset.checks legend { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
@media (max-width: 520px) { fieldset.checks { grid-template-columns: minmax(0, 1fr); } }
.stop .since { color: var(--ink-3); }
.stop .since.over { color: var(--late); font-weight: 600; }
.included { background: var(--paper); border-left: 3px solid var(--water); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.pay-photo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.pay-photo img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.small-btn { padding: 6px 12px; font-size: 13px; }
.cust-money .small-btn { margin-left: 6px; }
button.late-bg, button.primary.late-bg { background: var(--late); border-color: var(--late); color: #fff; }
#dlg-opt h3 { margin: 6px 0 -4px; font-size: 15px; }
.opt-stop { padding: 8px 12px 12px; }
i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: #7b8a95; }
i.dot.v1 { background: #2a78d6; } i.dot.v2 { background: #eb6834; } i.dot.v3 { background: #1baf7a; }
.wk-vans { margin: 4px 0 8px; }
#wk-list h3 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 16px; margin: 14px 0 6px; }
.payopt.plain { grid-template-columns: auto 1fr; }

/* ---- customer page (v0.9.3) */
.cp-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: start; margin: 6px 0 18px; }
.cp-id { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.cp-avatar { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-size: 21px; font-weight: 650; letter-spacing: .02em; color: var(--water); background: var(--water-tint); }
.cp-hero.is-gone .cp-avatar { color: var(--ink-3); background: var(--line); }
.cp-hero h1 { font-size: 30px; letter-spacing: -.01em; }
.cp-addr { margin: 2px 0 8px; color: var(--ink-2); }
.cp-bal { text-align: right; display: grid; }
.cp-bal span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cp-bal strong { font-family: var(--font-display); font-size: 30px; font-weight: 650; line-height: 1.1; }
.cp-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-left: 72px; }
.cp-actions .btn, .cp-actions button { padding: 7px 14px; }
.cp-actions .cp-stop { color: var(--late); margin-left: auto; }
.cp-facts { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; }
.cp-facts > div { flex: 1 1 150px; padding: 14px 18px; display: grid; gap: 1px; border-left: 1px solid var(--line); min-width: 0; }
.cp-facts > div:first-child { border-left: 0; }
.cp-facts span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cp-facts strong { font-family: var(--font-display); font-size: 19px; font-weight: 650; }
.cp-facts small { font-size: 12.5px; color: var(--ink-3); }
.cp-beat { flex: 2 1 260px !important; }
.cp-beat ol { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; gap: 5px; align-items: center; }
.cp-beat li { width: 16px; height: 16px; border-radius: 50%; background: var(--good); flex: none; }
.cp-beat li.skipped { background: var(--money); }
.cp-beat li.planned { background: transparent; box-shadow: inset 0 0 0 2px var(--water); }
.cp-beat small i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 4px 0 8px; background: var(--good); }
.cp-beat small i:first-child { margin-left: 0; }
.cp-beat small i.skipped { background: var(--money); } .cp-beat small i.planned { background: transparent; box-shadow: inset 0 0 0 1.5px var(--water); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cp-side { display: grid; gap: 16px; }
.cp-side .panel { margin: 0; }
.cp-main .tabs { margin-bottom: 14px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--water); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.job.is-off { border-left-color: var(--line-2); opacity: .85; }
.job h3 { font-size: 17px; }
.job-sub { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.job-flags { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.job-price { text-align: right; display: grid; align-content: start; }
.job-price strong { font-family: var(--font-display); font-size: 22px; font-weight: 650; }
.job-price span { font-size: 12.5px; color: var(--ink-3); }
.job-dates { grid-column: 1 / -1; display: flex; gap: 28px; margin: 6px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.job-dates dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.job-dates dd { margin: 0; font-size: 14px; }
.job-acts { grid-column: 1 / -1; display: flex; gap: 16px; justify-content: flex-end; margin-top: 2px; flex-wrap: wrap; }
.empty-note { padding: 18px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0 9px 18px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--paper); }
.timeline li.skipped::before { background: var(--money); }
.timeline li.price::before { background: var(--water); }
.timeline time { font-size: 13.5px; color: var(--ink-2); padding-top: 1px; }
.timeline .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 980px) { .cp-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .cp-hero { grid-template-columns: minmax(0, 1fr); }
  .cp-hero h1 { font-size: 24px; }
  .cp-avatar { width: 44px; height: 44px; font-size: 17px; border-radius: 12px; }
  .cp-bal { text-align: left; grid-row: 2; display: flex; gap: 10px; align-items: baseline; }
  .cp-bal strong { font-size: 22px; }
  .cp-actions { padding-left: 0; }
  .cp-actions .btn, .cp-actions button { flex: 1 1 auto; justify-content: center; }
  .cp-actions .cp-stop { margin-left: 0; }
  .cp-facts > div { flex: 1 1 45%; border-left: 0; border-top: 1px solid var(--line); }
  .cp-facts > div:nth-child(-n+2) { border-top: 0; }
  .job-acts { margin-top: 4px; justify-content: flex-start; }
  .timeline li { grid-template-columns: minmax(0, 1fr) auto; }
  .timeline time { grid-column: 1 / -1; padding: 0; }
}
button.link.late-text, .link.late-text { color: var(--late); }
.cp-side .pmap.short { height: 200px; }
.cp-pane h2 span { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 8px; }
.cp-pane > .panel { margin-top: 0; }

/* ---- day sheet: one visit (v0.9.4) */
.vp { display: grid; gap: 14px; }
.vp-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; align-items: flex-start; }
.vp-title h1 { font-size: 28px; letter-spacing: -.01em; }
.vp-addr { font-size: 17px; color: var(--ink-2); margin: 3px 0 8px; }
.vp-job { text-align: right; display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--water-tint); }
.vp-job strong { font-size: 15px; }
.vp-job span { font-family: var(--font-display); font-size: 20px; font-weight: 650; color: var(--water); }
.vp-go { display: flex; flex-wrap: wrap; gap: 8px; }
.vp-go .btn, .vp-go button { justify-content: center; padding: 11px 16px; font-size: 15px; }
.vp-go .vp-dir { flex: 1 1 220px; font-size: 16px; }
.vp-go .vp-dir span { font-size: 12.5px; font-weight: 500; opacity: .8; margin-left: 6px; }
.vp-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.vp-main { display: grid; gap: 14px; }
.vp-side .pmap { height: 340px; border-radius: 12px; }
.vp-notes { display: grid; gap: 0; border-radius: 12px; overflow: hidden; border: 1px solid #ecd9a6; background: #fff8e6; }
.vp-notes > div { padding: 12px 16px; border-top: 1px solid #f0e2bb; }
.vp-notes > div:first-child { border-top: 0; }
.vp-notes h2 { font-size: 13px; font-weight: 650; color: #8a6200; margin-bottom: 2px; }
.vp-notes p { margin: 0; font-size: 15.5px; white-space: pre-line; color: #3b2e0a; }
.vp-notes .incl { background: var(--surface); }
.vp-notes .incl h2 { color: var(--water); }
.vp-notes .incl p { color: var(--ink); }
:root[data-theme="dark"] .vp-notes { background: #2a2414; border-color: #4a3d17; }
:root[data-theme="dark"] .vp-notes > div { border-color: #4a3d17; } :root[data-theme="dark"] .vp-notes p { color: #f1e3bf; } :root[data-theme="dark"] .vp-notes h2 { color: #e2b84f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vp-notes { background: #2a2414; border-color: #4a3d17; }
  :root:not([data-theme="light"]) .vp-notes > div { border-color: #4a3d17; } :root:not([data-theme="light"]) .vp-notes p { color: #f1e3bf; } :root:not([data-theme="light"]) .vp-notes h2 { color: #e2b84f; } }
.vp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.vp-card h2 { font-size: 13px; font-weight: 650; color: var(--ink-3); }
.vp-last { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.vp-last p { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.vp-last p strong { font-size: 18px; font-family: var(--font-display); }
.vp-last details { grid-column: 1 / -1; }
.vp-beat { list-style: none; margin: 0; padding: 0; display: flex; gap: 5px; }
.vp-beat li { width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--good); }
.vp-last .vp-beat { grid-column: 2; grid-row: 1; }
.vp-last .vp-usual { grid-column: 1 / -1; }
.vp-beat li.skipped { background: var(--money); }
.vp-photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vp-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.vp-photos select { width: auto; }
.vp-bar { position: sticky; bottom: 12px; z-index: 20; display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(8, 30, 40, .14); }
.vp-timer { font-size: 14px; color: var(--water); text-align: center; }
.vp-acts { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.vp-acts button { justify-content: center; padding: 14px 10px; font-size: 16px; }
.vp-acts .big { font-size: 19px; }
.vp-skip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.vp-state { margin: 0; font-weight: 650; font-size: 17px; text-align: center; }
.vp.is-done .vp-head h1::after { content: " ✓"; color: var(--good); }
@media (max-width: 980px) { .vp-body { grid-template-columns: minmax(0, 1fr); } .vp-side { order: -1; } .vp-side .pmap { height: 180px; } }
@media (max-width: 760px) {
  .vp-title h1 { font-size: 24px; }
  .vp-job { text-align: left; width: 100%; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .vp-go .btn, .vp-go button { flex: 1 1 20%; padding: 11px 6px; }
  .vp-go .vp-dir { flex-basis: 100%; }
  .vp-bar { bottom: calc(64px + env(safe-area-inset-bottom)); border-radius: 14px; }
  .vp-acts { grid-template-columns: 1fr 1fr; } .vp-acts .big { grid-column: 1 / -1; }
}
#app.worker .vp-body { grid-template-columns: minmax(0, 1fr); }
#app.worker .vp-side { order: -1; }
#app.worker .vp-side .pmap { height: 220px; }
@media (max-width: 760px) {
  .vp-job { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; }
  .vp-job span { font-size: 17px; white-space: nowrap; }
  .vp-bar { padding: 8px; gap: 6px; }
  .vp-timer { font-size: 13px; }
  .vp-acts button { padding: 11px 8px; font-size: 15px; }
  .vp-acts .big { font-size: 18px; padding: 13px; }
  #app.worker .vp-side .pmap, .vp-side .pmap { height: 170px; }
}
code.key { font-size: 16px; letter-spacing: .06em; background: var(--water-tint); padding: 2px 8px; border-radius: 6px; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 18px; font-size: 17px; }
ol.steps { padding-left: 20px; display: grid; gap: 6px; }
#offline-bar { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: 10px; max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 20px rgba(8, 30, 40, .18); }
#offline-bar.off { background: #3b2e0a; color: #ffe7a3; }
#offline-bar.sending { background: var(--water); color: #fff; }

/* day sheet: hold a stop and slide it */
#todo-stops .stop a { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#todo-stops .stop.lifted { position: fixed; z-index: 50; pointer-events: none; margin: 0; }
#todo-stops .stop.lifted a { box-shadow: 0 12px 28px rgba(0, 0, 0, .22); border-color: var(--water); transform: scale(1.02); }
.stop-ph { border: 2px dashed var(--water); border-radius: 12px; background: color-mix(in srgb, var(--water) 8%, transparent); list-style: none; }
body.dragging-stop { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.drag-hint { margin: 0 0 6px; }
@media (hover: hover) { #todo-stops .stop a { cursor: grab; } }

/* Settings → Your business */
.biz { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 24px; align-items: start; }
.biz-logo { display: grid; gap: 10px; }
.biz-tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.biz-tile { width: 84px; height: 84px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--line); }
.biz-tile img { width: 64px; height: 64px; object-fit: contain; }
.biz-tile.light { background: #fff; }
.biz-tile.dark { background: #161e24; border-color: #161e24; }
.biz-tile.phone { background: linear-gradient(160deg, #3b6ea8, #23395c); border: 0; grid-template-rows: 1fr auto; padding: 8px 0 6px; }
.biz-tile.phone img { width: 52px; height: 52px; border-radius: 12px; }
.biz-tile.phone span { color: #fff; font-size: 10px; }
.biz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.biz-grid label { display: grid; gap: 4px; }
.biz-grid .wide { grid-column: 1 / -1; }
.biz-form { display: grid; gap: 10px; }
#biz-new { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
#biz-new[hidden] { display: none; }
@media (max-width: 760px) { .biz { grid-template-columns: 1fr; } .biz-grid { grid-template-columns: 1fr; } }
.vp-pricebits { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; align-items: baseline; font-size: 13px; }
.vp-pricebits em { font-style: normal; font-weight: 600; color: var(--money, var(--late)); }
@media (max-width: 760px) {
  .vp-job { flex-wrap: wrap; }
  .vp-pricebits { flex-basis: 100%; justify-content: space-between; }
}

/* edit customer / job */
.editbox .paybox-in { gap: 12px; }
.editbox label { display: grid; gap: 4px; }
.editbox .form-row > label { flex: 1 1 140px; }
.ed-prop { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; margin: 0; }
.ed-prop legend { font-weight: 650; padding: 0 4px; }
.ed-scope[hidden] { display: none; }
.vp-edit { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 0; }
.job-changed { grid-column: 1 / -1; margin: 0; }
.panel h2 .link { font-size: 14px; font-weight: 600; margin-left: 8px; }

/* job notes: red bubbles so they're not missed */
.tag.note { white-space: normal; text-align: left; font-weight: 700; }
.stop .tags .tag.note { font-size: 12.5px; }
.vp-jobnotes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vp-jobnotes .tag.note { font-size: 15px; padding: 5px 12px; }
.vp-edit a { font-weight: 600; }

/* phone: the map waits for a tap before it moves */
.pmap.locked { touch-action: pan-x pan-y; cursor: default; }
.pm-lock { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: rgba(20, 32, 41, .78); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; display: none; white-space: nowrap; }
.pmap.locked .pm-lock { display: block; }
.pmap.locked.mouse .pm-lock { display: none; }
.pmap.locked.mouse:hover .pm-lock { display: block; }

/* day sheet: the week along the top */
.week-strip { display: flex; align-items: stretch; gap: 4px; margin-top: 4px; }
.wk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; flex: 1; }
.week-strip .wk-day, .week-strip .wk-arrow { display: grid; place-items: center; gap: 0; padding: 6px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); min-width: 0; }
.week-strip .wk-day span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.week-strip .wk-day strong { font-size: 17px; color: var(--ink); }
.week-strip .wk-day.today { border-color: var(--water); }
.week-strip .wk-day.today span { color: var(--water); font-weight: 700; }
.week-strip .wk-day.on { background: var(--water); border-color: var(--water); }
.week-strip .wk-day.on span, .week-strip .wk-day.on strong { color: #fff; }
.week-strip .wk-day:disabled, .week-strip .wk-arrow:disabled { opacity: .35; }
.wk-arrow { width: 34px; font-size: 20px; flex: none; }
.wk-today { margin-top: 6px; }
.vp-bar.vp-look { display: block; }
/* phone: log out at the top of the More menu */
@media (max-width: 760px) { .rail .who { order: -1; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); } }
.week-strip .wk-day, .week-strip .wk-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 54px; min-height: 0; padding: 0; line-height: 1.1; overflow: hidden; }
.week-strip .wk-day span, .week-strip .wk-day strong { display: block; line-height: 1.1; }

/* when the app can't start */
.rescue { max-width: 420px; margin: 18vh auto 0; text-align: center; display: grid; gap: 8px; padding: 0 16px; }
.rescue button { width: 100%; justify-content: center; }
.day-title { display: flex; align-items: center; gap: 8px; }
.day-refresh { font-size: 18px; padding: 2px 9px; margin-left: auto; }

/* map: street / satellite switch */
.pm-layer { position: absolute; top: 10px; left: 10px; z-index: 4; padding: 6px 12px; font-size: 13px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.pmap.is-sat .pm-layer { background: #fff; color: #13232b; }
.pm-attr a { color: inherit; text-decoration: underline; }
.biz-maps { order: 3; grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.biz-maps h3 { margin: 0; }

/* Today: week bars split like Squeegee's, with a hover box */
:root { --st-done: #3fae6a; --st-skip: #f2b01e; --st-miss: #e5484d; --st-todo: #5b8def; }
.wk-col { position: relative; }
.wk-col > i { display: flex; flex-direction: column-reverse; overflow: hidden; }
.wk-day.past .wk-col > i, .wk-day.today .wk-col > i { background: var(--line-2); }
.wk-col b { display: block; width: 100%; flex: none; }
.wk-col b.done, .wk-key i.done, .wk-tip i.done { background: var(--st-done); }
.wk-col b.skipped, .wk-key i.skipped, .wk-tip i.skipped { background: var(--st-skip); }
.wk-col b.missed, .wk-key i.missed, .wk-tip i.missed { background: var(--st-miss); }
.wk-col b.todo, .wk-key i.todo, .wk-tip i.todo { background: var(--st-todo); }
.wk-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 0; color: var(--ink-2); }
.wk-key span, .wk-tip li { display: inline-flex; align-items: center; gap: 6px; }
.wk-key i, .wk-tip li i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.wk-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20; min-width: 190px;
  background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 13px; text-align: left; line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0,0,0,.25); pointer-events: none; white-space: nowrap; }
.wk-tip ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.wk-tip li { justify-content: flex-start; }
.wk-tip li span { flex: 1; opacity: .85; margin-right: 10px; }
.wk-tip-vans { border-top: 1px solid rgba(255,255,255,.2); padding-top: 6px !important; }
@media (hover: hover) { .wk-day:hover .wk-tip, .wk-day:focus-visible .wk-tip { display: block; } }
.wk-day:first-child .wk-tip { left: 0; transform: none; }
.wk-day:last-child .wk-tip, .wk-day:nth-last-child(2) .wk-tip { left: auto; right: 0; transform: none; }

/* Today: the figures under the greeting */
.lede-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lede-stats .ls { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 500; }
.lede-stats .ls strong { font-family: var(--font-display); font-size: 17px; color: var(--ink); font-weight: 700; }
.ls-year { cursor: pointer; }
.ls-year em { font-style: normal; font-size: 12.5px; font-weight: 700; }
.ls-year em:not(:empty)::before { content: "·"; margin: 0 6px 0 0; color: var(--ink-3); }
.ls-year.green { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.ls-year.green strong, .ls-year.green em { color: var(--good); }
.ls-year.amber { border-color: #d98a00; background: color-mix(in srgb, #d98a00 12%, var(--surface)); }
.ls-year.amber strong, .ls-year.amber em { color: #d98a00; }
.ls-year.red { border-color: var(--late); background: color-mix(in srgb, var(--late) 10%, var(--surface)); }
.ls-year.red strong, .ls-year.red em { color: var(--late); }
.head .lede-stats + * { margin-top: 0; }

/* Planner week: same look as the Today page */
.pl-week { margin-top: 4px; }
.pl-grid { margin-top: 14px; border: 0; }
.pl-grid table { table-layout: fixed; min-width: 860px; border-collapse: separate; border-spacing: 6px; margin: -6px; width: calc(100% + 12px); }
.pl-grid th, .pl-grid td { border: 0; background: none; padding: 0; vertical-align: top; }
.pl-corner { width: 150px; }
.pl-day { text-align: center; padding: 6px 0 !important; border-radius: 10px; }
.pl-day span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.pl-day strong { display: block; font-family: var(--font-display); font-size: 20px; color: var(--ink); line-height: 1.15; }
.pl-day small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.pl-day.is-today { background: var(--water); }
.pl-day.is-today span, .pl-day.is-today strong, .pl-day.is-today small { color: #fff; }
.pl-day.past strong { color: var(--ink-2); }
.pl-lane { text-align: left; vertical-align: middle !important; padding-right: 6px !important; }
.pl-lane { display: table-cell; }
.pl-lane > * { vertical-align: middle; }
.pl-lane i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.pl-lane i.dot.v0 { background: #7b8a95; }
.pc a { overflow: hidden; min-width: 0; }
@media (max-width: 760px) {
  .pl-corner { width: 92px; }
  .pl-grid table { min-width: 940px; }
  .pl-lane span { font-size: 12.5px; white-space: normal; overflow-wrap: anywhere; }
  .pc-top { flex-wrap: wrap; }
  .pc-top em { margin-left: 0; width: 100%; }
  .pl-lane i.dot { display: block; margin: 0 0 4px; }
  .pl-week .week-head { gap: 10px; }
}
.pl-lane span { display: inline-block; font-weight: 700; font-size: 14px; color: var(--ink); }
.pl-lane small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.pc a { display: grid; gap: 4px; padding: 10px 11px; min-height: 92px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); align-content: start; }
.pc a:hover { border-color: var(--water); text-decoration: none; }
.pc.on a { border-color: var(--water); box-shadow: 0 0 0 2px var(--water); background: var(--water-tint); }
.pc-top { display: flex; align-items: baseline; gap: 4px; font-size: 13px; color: var(--ink-2); }
.pc-top strong { font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.pc-top em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--ink); font-size: 14px; }
.pc-cap { display: block; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pc-cap i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.pc-cap.full i { background: #d98a00; } .pc-cap.over i { background: var(--late); }
.pc-meta { font-size: 12px; color: var(--ink-3); }
.pc-status { display: flex; height: 6px; border-radius: 99px; overflow: hidden; gap: 2px; margin-top: auto; }
.pc-status b { display: block; min-width: 4px; }
.pc-status b.done { background: var(--st-done); } .pc-status b.skipped { background: var(--st-skip); }
.pc-status b.missed { background: var(--st-miss); } .pc-status b.todo { background: var(--st-todo); }
.pc.empty a { border-style: dashed; background: none; color: var(--ink-3); place-content: center; text-align: center; }
.pc.off a { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 6px, var(--surface) 6px, var(--surface) 12px); }
.pc-off { font-weight: 700; }
.pc.off.clash a { border-color: var(--late); box-shadow: inset 0 0 0 1px var(--late); }
.week-sum a.on { text-decoration: underline; }

/* Payment set-up: find a customer's GoCardless/Stripe record */
.find-payer { display: block; margin-top: 8px; }
.good-text { color: var(--st-done); font-weight: 600; }
tr.payer-row > td { background: var(--surface-2, rgba(127,127,127,.06)); padding: 12px 14px; }
.payer-box { display: grid; gap: 10px; }
.payer-box label { display: grid; gap: 4px; max-width: 420px; }
.payer-list, .payer-search { display: grid; gap: 8px; }
.payer-hit { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px;
  border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 10px; background: var(--surface, transparent); }
.payer-hit .sub { display: block; }
.payer-hit .sub.good-text { color: var(--st-done); }
.payer-hit .sub.money-text { color: var(--money); }
.payer-hit button { flex: none; }
tr.done-row { opacity: .6; }

/* Today: your tasks */
.tasks h2 span { color: var(--ink-3); font-weight: 600; font-size: .8em; margin-left: 6px; }
.tk-list { display: grid; gap: 8px; }
.tk { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: inherit; text-decoration: none; }
a.tk:hover { border-color: var(--line-2); }
details.tk { display: block; }
details.tk > summary { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; list-style: none; }
details.tk > summary::-webkit-details-marker { display: none; }
.tk-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--st-todo); }
.tk-bad .tk-dot { background: var(--st-miss); }
.tk-money .tk-dot { background: var(--st-skip); }
.tk-dot.good { background: var(--st-done); }
.tk-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tk-names { font-size: 14px; }
.tk-why { font-size: 13px; color: var(--ink-3); }
.tk-n { flex: none; min-width: 28px; padding: 2px 8px; border-radius: 999px; text-align: center; font-weight: 700; font-size: 14px;
  background: var(--line); }
.tk-bad .tk-n { background: color-mix(in srgb, var(--st-miss) 20%, transparent); color: var(--st-miss); }
.tk-money .tk-n { background: color-mix(in srgb, var(--st-skip) 22%, transparent); }
.tk-notes { list-style: none; margin: 10px 0 10px 22px; padding: 0; display: grid; gap: 8px; }
.tk-note { display: block; font-size: 14px; }
details.tk .small-btn { margin-left: 22px; }
.tasks-clear { display: flex; gap: 10px; align-items: center; }
.tasks-clear .tk-dot { margin-top: 0; }

/* side menu: + Add customer */
.nav-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 16px); margin: 6px 8px 10px;
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--water); background: var(--water); color: #fff; font-weight: 650; cursor: pointer; }
.nav-add span { font-size: 18px; line-height: 1; }
.nav-add:hover { filter: brightness(1.08); }

/* Planner on a phone: one row per day, the vans side by side, no sideways scrolling */
.pl-phone { display: none; }
@media (max-width: 760px) {
  .pl-grid { display: none; }
  .pl-phone { display: grid; gap: 12px; margin-top: 12px; }
  .pp-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; }
  .pp-head strong { font-family: var(--font-display); font-size: 17px; }
  .pp-head span { font-size: 13px; color: var(--ink-3); }
  .pp-day.is-today .pp-head strong { color: var(--water); }
  .pp-day.past .pp-head strong { color: var(--ink-2); }
  .pp-lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .pp-lanes .pc a { min-height: 0; }
  .pp-lane { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pp-lane i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .pp-lane i.dot.v0 { background: #7b8a95; }
}
.pp-lane i.dot.v1 { background: #2a78d6; } .pp-lane i.dot.v2 { background: #eb6834; } .pp-lane i.dot.v3 { background: #1baf7a; }
@media (max-width: 760px) {
  .pp-lanes { grid-template-columns: repeat(var(--lanes, 3), minmax(0, 1fr)); }
  .pp-lanes > .pc { display: block; min-width: 0; width: auto; }
  .pp-lanes > .pc a { padding: 8px 9px; }
  .pp-lanes > .pc.empty a { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; }
  .pp-lanes > .pc.empty a > span:last-child { font-size: 13px; }
}
@media (max-width: 760px) { .pp-lanes > .pc > a { width: 100%; height: 100%; box-sizing: border-box; } }
@media (max-width: 760px) { .pp-lanes > .pc.empty { padding: 0; margin: 0; max-width: none; text-align: left; } }

.pc-split { display: block; font-size: 11.5px; color: var(--ink-3); }

/* back button at the top of every page */
.backrow { margin: -6px 0 10px; }
.backbtn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.backbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.backbtn:hover { border-color: var(--water); }
.backrow + .crumb { display: none; }   /* the Back button does the same job */

/* Start day / Finish day bar on the day sheet */
.daylog { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; }
.daylog.dl-on { border-color: var(--good, #2e7d32); }
.daylog.dl-done { opacity: .85; }
.daylog .dl-type { display: inline-flex; gap: 6px; align-items: center; }
.daylog .dl-type[hidden] { display: none; }

/* loading bar across the top: shows while the app opens or checks for a new version */
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .25s; overflow: hidden; }
.loadbar.on { opacity: 1; }
.loadbar i { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--water, #0b6e78); border-radius: 2px; animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { 0% { left: -35%; } 100% { left: 100%; } }
/* the splash: logo and message in the middle of the screen */
.loadbar .splash { position: fixed; inset: 0; z-index: -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px; background: var(--paper, #f5f8f9); text-align: center; }
.loadbar .splash img { width: 160px; height: 160px; object-fit: contain; box-sizing: border-box; background: #fff; padding: 14px; border-radius: 28px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.loadbar .splash span { font-size: 16px; font-weight: 600; color: var(--ink-2, #4a5a66); }
.loadbar.on { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .loadbar i { animation: none; width: 100%; opacity: .6; } }

/* customer portal messages (office side) */
.preqs { list-style: none; margin: 0; padding: 0; }
.preq { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.preq:first-child { border-top: 0; }
.preq .sub { display: block; color: var(--ink-3); font-size: 13px; }
.preq .note-snip { margin: 6px 0 0; }
.preq button { flex: none; }

/* account type in the customer edit box */
.seg-pick { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 8px; }
.seg-pick label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.seg-pick input { margin: 0; }
.seg-pick label:has(input:checked) { background: var(--water-tint); color: var(--water); }
.ed-comm[hidden] { display: none; }
.tag.comm { background: var(--water-tint); color: var(--water); }
.cp-bal small { font-size: 12.5px; color: var(--ink-3); }

/* a customer with several places (a business's sites, a family member's house) */
.site-group { margin: 0 0 14px; }
.site-h { display: flex; flex-direction: column; gap: 1px; margin: 14px 0 8px; font-size: 15px; }
.site-h span::before { content: "📍 "; }
.site-h small { font-weight: 400; font-size: 13px; color: var(--ink-3); }
.vp-site { margin: 0; }
.site-acts { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 0; font-size: 14px; }
.ed-del { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ed-del[open] { display: grid; }
.ed-del summary { cursor: pointer; }
tfoot tr.totals td { font-weight: 700; border-top: 2px solid var(--line-2); background: var(--paper); }
.st-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.st-row .sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }

/* Reports */
.rp-period { flex-wrap: wrap; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--water); text-decoration: none; }
.kpi > span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.kpi > strong { font-family: var(--font-display); font-size: 26px; font-weight: 650; line-height: 1.15; }
.kpi-ch { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kpi-ch.up { color: var(--good); }
.kpi-ch.down { color: var(--late); }
.kpi-prev { font-size: 12.5px; color: var(--ink-3); }
.rp-big { margin: 0 0 10px; }
.rp-big strong { font-family: var(--font-display); font-size: 28px; font-weight: 650; margin-right: 6px; }
.agebars { display: grid; gap: 8px; }
.agebar { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 10px; font-size: 14px; }
.agebar i { display: block; height: 10px; border-radius: 6px; background: var(--water); min-width: 2px; }
.agebar i.ab2 { background: #d98a00; } .agebar i.ab3, .agebar i.ab4 { background: var(--late); }
.agebar strong { text-align: right; }
.nextweeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.nw { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; }
.nw:hover { border-color: var(--water); text-decoration: none; }
.nw > span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.nw > strong { font-size: 20px; }
.nw small { font-size: 12.5px; color: var(--ink-3); }
.nw-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 4px; }
.nw-bar i { display: block; height: 100%; background: var(--good); }
.nw-bar i.high { background: #d98a00; } .nw-bar i.over { background: var(--late); }

/* Today */
.home-head { align-items: flex-end; }
.home-head .muted { margin: 2px 0 0; }
.home-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 6px 0 18px; }
@media (max-width: 900px) { .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi strong small { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.kpi.light-green { border-left: 5px solid var(--good); }
.kpi.light-amber { border-left: 5px solid #d98a00; }
.kpi.light-red { border-left: 5px solid var(--late); }
.tasks .tk-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tasks details.tk[open] { grid-column: 1 / -1; }
.tk { border-left-width: 4px; }
.tk-bad { border-left-color: var(--st-miss); }
.tk-money { border-left-color: var(--st-skip); }
.tk-info { border-left-color: var(--water); }
.tk-rows { list-style: none; margin: 10px 0 4px 22px; padding: 0; display: grid; gap: 0; }
.tk-rows li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.tk-rows li:first-child { border-top: 0; }
.tk-r { font-size: 14px; }
.tk-r .faint { display: block; font-size: 12.5px; }
.tk-acts { display: flex; gap: 6px; }
.attn2 { display: grid; gap: 8px; }
.attn2 a { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.attn2 a:hover { border-color: var(--water); text-decoration: none; }
.a-n { flex: none; min-width: 46px; text-align: center; font-family: var(--font-display); font-size: 22px; font-weight: 650; color: var(--money); }
.a-main { display: grid; gap: 1px; }
.a-main span { font-size: 13px; color: var(--ink-3); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-grid a { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.stat-grid a:hover { border-color: var(--water); text-decoration: none; }
.stat-grid strong { font-family: var(--font-display); font-size: 20px; font-weight: 650; }
.stat-grid span { font-size: 12.5px; color: var(--ink-3); }
.stat-grid a.warn strong { color: var(--money); }
.kpi-ch.amber { color: #d98a00; }
.mk-wrap { overflow-x: auto; }
.mk-grid th, .mk-grid td { padding: 6px 8px; }
.mk-in { width: 84px; text-align: right; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.mk-in.saved { border-color: var(--good); }
.yr { align-self: center; font-size: 18px; padding: 0 6px; }
.be-tab .be-name { width: 100%; min-width: 160px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.be-tab .money-in input { width: 90px; text-align: right; }

/* Today: this month so far — the "by today" mark sits below the bar so it doesn't clash with break-even */
.pace .be-bar { margin: 30px 0 30px; }
.pace .be-mark.today { background: var(--ink-3); }
.pace .be-mark.today span { bottom: auto; top: calc(100% + 2px); color: var(--ink-3); }
.pace .be-mark.today.r span { transform: translateX(-100%); }

/* Today: tasks behind a bell with a red count */
.home-acts { display: flex; align-items: center; gap: 10px; }
.bell { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell.on { border-color: var(--water); color: var(--water); }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #e5383b; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--paper); }
#home-tasks { margin-bottom: 18px; }
#home-week { margin-bottom: 18px; }

/* week nav: ‹ This week › — the middle names the week on screen */
.week-nav { align-items: center; }
.week-nav .wk-here { min-width: 118px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.week-nav .wk-here.is-now { opacity: 1; cursor: default; color: var(--ink); }
.week-nav .wk-here:not(.is-now) { color: var(--water); }
.week-head > div:first-child { flex: 1 1 260px; min-width: 0; }
.week-head .week-nav { flex: 0 0 auto; }

/* a red / amber / green line down the left of any card with a status, like "This month so far" */
.rag-green, .rag-amber, .rag-red { border-left: 5px solid var(--line-2); }
.rag-green { border-left-color: var(--good) !important; }
.rag-amber { border-left-color: #d98a00 !important; }
.rag-red { border-left-color: var(--late) !important; }
.rag-block { padding-left: 14px; }
tr.rag-row > td:first-child { box-shadow: inset 5px 0 0 var(--line-2); }
tr.rag-row.red > td:first-child { box-shadow: inset 5px 0 0 var(--late); }
tr.rag-row.amber > td:first-child { box-shadow: inset 5px 0 0 #d98a00; }
tr.rag-row.green > td:first-child { box-shadow: inset 5px 0 0 var(--good); }

/* Vans & kit overview: each van card opens the Vans tab */
a.van-card { display: block; color: inherit; text-decoration: none; }
a.van-card:hover { border-color: var(--water); }
a.van-card .van-open { display: block; margin-top: 8px; color: var(--water); font-weight: 600; }

/* van check: monthly maintenance */
details.monthly > summary { cursor: pointer; padding: 4px 0; }
.mc-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mc-row .mc-note { grid-column: 1 / -1; }
.mseg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.mseg label { display: inline-flex; align-items: center; gap: 0; padding: 7px 12px; font-size: 14px; cursor: pointer; }
.mseg label + label { border-left: 1px solid var(--line-2); }
.mseg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mseg label:has(input:checked) { background: var(--water); color: #fff; font-weight: 650; }
.mseg label:has(input[value=Attention]:checked) { background: #d98a00; }
.mseg label:has(input[value=Fixed]:checked) { background: var(--good); }
.mseg label { padding: 7px 10px; }
.vc-due { margin-bottom: 12px; }
#vc-due { display: block; margin: 12px 0; }
#vc-due .notice { display: block; position: static; margin: 0; padding: 10px 14px; border-radius: 12px; line-height: 1.4; }
/* the box header: dark teal in both themes, not a light strip in dark mode */
.pay-head { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.pay-head .pay-x { color: var(--ink); background: transparent; }

/* first cleans and hazards */
.tag.first { background: #6d28d9; color: #fff; }
.first-text { color: #7c3aed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .first-text { color: #c4b5fd; } }
:root[data-theme="dark"] .first-text { color: #c4b5fd; }
.vp-first { margin: 8px 0 4px; padding: 8px 12px; border-radius: 10px; background: rgba(124, 58, 237, .14); border-left: 4px solid #7c3aed; }
.vp-hazards { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.wk-first, .pl-first { display: inline-block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: #7c3aed; }
/* new job form */
.kind-pick { flex-wrap: wrap; border-radius: 14px; }
.ed-lines .lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ln-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.ln-row .ln-on { width: 20px; height: 20px; margin: 0; }
.ln-row.is-off .ln-svc, .ln-row.is-off .money-in { opacity: .45; text-decoration: line-through; }
.ln-row .money-in input { width: 8ch; }
.ed-hz { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ed-hz legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.hz-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--late-tint); border-color: var(--late); color: var(--late); font-weight: 650; }
.chip-check input { margin: 0; }
.ed-sugg { background: var(--water-tint); padding: 8px 12px; border-radius: 10px; margin: 0; }
.da-kind { display: grid; gap: 8px; }
.da-kind button.payopt { text-align: left; width: 100%; cursor: pointer; }
.hz-picks label.chip-check { display: inline-flex; flex-direction: row; align-items: center; width: auto; margin: 0; }
.hz-picks label.chip-check input { width: auto; height: auto; flex: none; }
.kind-pick label { display: inline-flex; flex-direction: row; align-items: center; width: auto; }
.kind-pick label input { width: auto; flex: none; }

/* customer page: Active / Inactive switch */
.cp-status { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.cp-status button { border: 0; border-radius: 0; padding: 6px 14px; font-size: 13.5px; font-weight: 600; background: transparent; color: var(--ink-2); }
.cp-status button + button { border-left: 1px solid var(--line-2); }
.cp-status button.on.act { background: var(--good); color: #fff; }
.cp-status button.on.inact { background: var(--late); color: #fff; }
.cp-left { display: block; margin-top: 4px; }

/* Reports: round value by how often stays a table on phones (4 short columns fit) */
.freq-tab { width: 100%; }
@media (max-width: 600px) { .freq-tab th, .freq-tab td { padding: 8px 6px; font-size: 14px; } .freq-tab td.name { white-space: nowrap; } }

.cp-owe-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.cp-owe-acts button { font-size: 13.5px; padding: 7px 12px; }

.wo-note { border-left: 5px solid var(--late); background: var(--late-tint); }
.wo-note .wo-line { display: block; margin-top: 4px; }
.cp-owe-acts .wo-btn { color: var(--late); border-color: var(--late); }
.cp-owe-acts .wo-btn:hover { background: var(--late-tint); }

/* chasing */
.ch-dots { display: inline-flex; gap: 3px; }
.ch-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.ch-dots i.on { background: var(--late); }
.ch-steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.ch-steps > li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ch-steps > li .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--paper); border: 1px solid var(--line-2); }
.ch-steps > li > div { flex: 1; min-width: 0; }
.ch-steps > li .sub { display: block; }
.ch-steps > li.done { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good); }
.ch-steps > li.done .n { background: var(--good); color: #fff; border-color: var(--good); }
.ch-steps > li.now { border-color: var(--late); box-shadow: inset 4px 0 0 var(--late); }
.ch-steps > li.now.wait { border-color: #d98a00; box-shadow: inset 4px 0 0 #d98a00; }
.ch-act { display: grid; gap: 8px; margin-top: 6px; }
.ch-act label { display: grid; gap: 4px; }
.ch-msg textarea { width: 100%; box-sizing: border-box; font: inherit; }
.ch-court { padding: 10px 12px; border-radius: 10px; background: var(--paper); }
.ch-peek { margin-top: 4px; }
.ch-peek summary { cursor: pointer; color: var(--water); font-size: 14px; font-weight: 600; }
.ch-peek[open] summary { margin-bottom: 6px; }
.ch-quote { white-space: pre-wrap; padding: 10px 12px; border-radius: 10px; background: var(--paper); border-left: 3px solid var(--line-2); margin: 6px 0; }
.ch-log li { padding: 3px 0; }
.letter { background: #fff; color: #111; max-width: 760px; margin: 16px auto; padding: 48px 56px; box-shadow: 0 1px 6px rgba(0,0,0,.15); font: 15px/1.5 Georgia, "Times New Roman", serif; }
.letter p, .letter ul { margin: 0 0 10px; }
.letter h2 { font-size: 19px; margin: 22px 0 10px; }
.lt-head { display: flex; justify-content: space-between; gap: 16px; }
.lt-date { white-space: nowrap; }
.lt-to { margin: 28px 0 8px; }
.lt-stmt { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 14px; }
.lt-stmt th, .lt-stmt td { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; }
.lt-stmt .num { text-align: right; }
.lt-stmt tfoot td { border-bottom: 0; }
.lt-sign { margin-top: 36px; }
@media (max-width: 640px) { .letter { padding: 24px 18px; font-size: 14px; } .lt-head { flex-direction: column; } }
@media print {
  #rail, #tabbar, #scrim, #toast, .no-print, .backrow { display: none !important; }
  #app { display: block !important; }
  body, main#view { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .letter { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 20mm; }
}

.sh-svc { border: 0; padding: 0; margin: 0; }
.sh-svc legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.sh-svc .chip-check:has(input:checked) { background: var(--water-tint); border-color: var(--water); color: var(--water); }

/* rain days */
.rain-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rain-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); font-size: 12px; color: var(--ink-2); }
.rain-day strong { font-size: 13px; color: var(--ink); }
.rain-day.wet { border-color: var(--water); background: var(--water-tint); }
.rain-day.maybe { border-color: var(--water); border-style: dashed; }
.rain-note.maybe { border-left-style: dashed; }
.rain-day.on { box-shadow: 0 0 0 2px var(--ink); }
.rain-cust { border-top: 1px solid var(--line); padding: 10px 0; }
.rain-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rain-job { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0 0 4px; justify-content: space-between; }
label.rain-job { justify-content: flex-start; cursor: pointer; }
.rain-job .sub { display: block; }
.rain-fill { display: grid; gap: 6px; margin: 8px 0; }
.rain-fill .pc-cap { display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rain-fill .pc-cap i { display: block; height: 100%; background: var(--water); }
.rain-fill .pc-cap.over i { background: var(--late); }
.rain-note { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-left: 5px solid var(--water); }
.rain-msg { border-top: 1px solid var(--line); padding: 10px 0; }
.rain-msg textarea { width: 100%; box-sizing: border-box; font: inherit; }
@media (max-width: 640px) { .rain-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.sh-what { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.sh-what legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.sh-more summary { cursor: pointer; color: var(--water); font-size: 14px; font-weight: 600; }
.sh-more[open] summary { margin-bottom: 6px; }

#ed-lines.mode-job .ln-each { display: none; }
.ln-each { display: inline-flex; gap: 6px; align-items: center; }
.ln-qty { width: 4ch; }
.ed-jobprice .money-in input { width: 10ch; }

.bill-lines { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.bill-lines th, .bill-lines td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.bill-lines .num { text-align: right; }
/* price each service: the service name gets its own full-width line, then quantity × rate = line total underneath (always, so long names show in full) */
#ed-lines.mode-services .ln-row { grid-template-columns: auto 1fr auto; grid-template-areas: "chk svc del" ". each ."; row-gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#ed-lines.mode-services .ln-on { grid-area: chk; } #ed-lines.mode-services .ln-svc { grid-area: svc; min-width: 0; }
#ed-lines.mode-services .ln-del { grid-area: del; } #ed-lines.mode-services .ln-each { grid-area: each; flex-wrap: wrap; }
.ln-row .money-in input.ln-qty { width: 6ch; }
/* the job editor has service lines side by side, so it gets more room on a computer */
@media (min-width: 700px) { dialog#dlg-job { max-width: 640px; width: min(640px, 96vw); } }
.ln-total { font-weight: 700; margin: 4px 0 10px; } .ln-total:empty { display: none; }
.ln-sum { font-weight: 700; min-width: 7ch; }
.ln-sum:empty { display: none; }
.ln-sum::before { content: "= "; font-weight: 400; color: var(--muted); }

.ln-pick { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px; margin: 4px 0 10px; background: var(--surface); }
.ln-pick input { width: 100%; box-sizing: border-box; }
.ln-pick ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.ln-pick li button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.ln-pick li button:hover, .ln-pick li button:focus { background: var(--water-tint); }
.ln-pick li button .faint { white-space: nowrap; font-size: 13px; }

/* Quotes */
.head-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.kpi.wide { grid-column: span 2; }
@media (max-width: 520px) { .kpi.wide { grid-column: auto; } }
.chip span { opacity: .7; font-weight: 600; margin-left: 2px; }
.q-sec { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; }
.q-sec legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.q-sec[data-sec="free"] legend { color: var(--good); }
.q-line { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.q-line:last-child { border-bottom: 0; }
.ql-nums { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ql-nums .money-in.small-in input { width: 8ch; }
.ql-nums .ql-qty { width: 5ch !important; }
.ql-free { font-weight: 700; color: var(--good); }
.ql-first { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.ql-first .money-in input { width: 8ch; }
.q-total { font-size: 16px; margin: 4px 0; }
.q-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.q-table .q-subh td { font-weight: 700; font-size: 13px; color: var(--ink-3); background: var(--surface-2, transparent); }
.q-time { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.q-time time { font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.q-book { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; }
.q-book legend { font-weight: 700; padding: 0 4px; }
.q-mini li { padding: 4px 0; }
.q-mini .small { display: block; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.pick-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.pick-list button:hover, .pick-list button:focus { background: var(--water-tint); }
.pre { white-space: pre-wrap; }
.q-book .check-row, .q-book legend label, #dlg-qans fieldset .check-row { display: flex; flex-direction: row; gap: 8px; align-items: center; font-weight: 600; }
.q-book .check-row input, #dlg-qans fieldset .check-row input { width: auto; margin: 0; }
.q-book ul { margin: 4px 0 8px; padding: 0; }
.qb-when { align-items: center; margin: 4px 0; }
.editbox .ql-deal-row { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
.editbox .ql-deal-row[hidden] { display: none; }
.editbox .ql-deal-row input { width: auto; margin: 0; }
.q-deal { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
dialog.q-prev { width: min(460px, 96vw); max-width: 460px; }
.q-frame { width: 100%; height: min(70vh, 720px); border: 1px solid var(--line); border-radius: 12px; background: #f4f7f8; }

/* price list, the home, website enquiries */
.pl-grid input { width: 5.2em; }
.pl-grid th { white-space: nowrap; }
.pl-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px solid var(--line); }
.pl-mini li:first-child { border-top: 0; }
.pl-hint { background: var(--paper, transparent); border-left: 3px solid var(--water, #2f9be8); padding: 6px 10px; margin: 4px 0 8px; }
.pl-link code { word-break: break-all; }
.enq header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.enq header .sub { display: block; }
.enq p { margin: 6px 0 0; }
.enq-msg { white-space: pre-wrap; font-style: italic; }
.enq-acts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 10px !important; }
.enq-list { display: grid; gap: 12px; }
[data-sub][hidden], [data-house][hidden] { display: none !important; }
.pl-grid { width: auto; min-width: 0; }
.pl-grid th, .pl-grid td, .pl-grid th.num, .pl-grid td.num { text-align: left; padding: 4px 10px 4px 0; vertical-align: middle; }
.pl-grid tbody th { font-weight: 600; padding-right: 14px; }
.pl-grid .money-in input { width: 4.6em !important; min-width: 0; }

/* Leads: its own area */
.leads-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 18px; padding: 8px 10px; border-radius: 14px; background: var(--water); }
.leads-nav .leads-brand { color: #fff; font-weight: 700; margin-right: 10px; letter-spacing: .01em; }
.leads-nav a { color: #e7f6f7; text-decoration: none; padding: 6px 11px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.leads-nav a:hover { background: rgba(255,255,255,.12); }
.leads-nav a.on { background: #fff; color: var(--water); }
.lead-board { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 120px; }
.board-col h3 { font-size: 13px; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 6px; }
.board-col h3 span { color: var(--ink-3, #7b8a95); }
.lead-card { display: grid; gap: 2px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; text-decoration: none; color: inherit; background: var(--paper); }
.lead-card:hover { border-color: var(--water); }
.lead-card .tag { justify-self: start; margin-top: 2px; }
.needs li { padding: 5px 0; border-top: 1px solid var(--line); }
.needs li:first-child { border-top: 0; }
#ld-days { width: auto; display: inline-block; padding: 2px 6px; }
.flow-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.flow-try { position: sticky; top: 12px; }
@media (max-width: 980px) { .flow-grid { grid-template-columns: 1fr; } .flow-try { position: static; } }
.msg-edit { padding: 10px 0; border-top: 1px solid var(--line); }
.msg-edit:first-of-type { border-top: 0; }
.msg-edit label { display: grid; gap: 3px; }
.msg-edit textarea { font-size: 14px; }
.kb-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: start; padding: 6px 0; }
@media (max-width: 640px) { .kb-row { grid-template-columns: 1fr auto; } .kb-row textarea { grid-column: 1; } }
.rules li { margin: 3px 0; }
.chip-radio { display: inline-block; }
.chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-radio span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-radio input:checked + span { background: var(--ink, #142029); color: #fff; border-color: var(--ink, #142029); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--water); outline-offset: 2px; }
.try .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--paper); max-height: 70vh; overflow-y: auto; }
.bubble { max-width: 86%; padding: 8px 11px; border-radius: 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.4; }
.bubble.sam { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.them { align-self: flex-end; background: #dcf4dd; color: #142029; border-bottom-right-radius: 4px; }
.bubble.later { border-style: dashed; }
.bubble .when { display: block; font-size: 12px; font-weight: 700; color: var(--water); margin-bottom: 3px; }
.chat-note { margin: 4px 0 0; }
.fu-list li { padding: 7px 0; border-top: 1px solid var(--line); }
.fu-list li:first-child { border-top: 0; }
.fu-list input { display: inline-block; width: 4.5em; padding: 3px 6px; }
.fu-list input[type=time] { width: 7.5em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble.sam { background: var(--surface); } }
:root[data-theme="dark"] .bubble.sam { background: var(--surface); }
.try-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; } .try-pick fieldset { border: 0; padding: 0; margin: 0; }
.qf-sw { display: flex; padding: 6px 0; border-top: 1px solid var(--line); }
.qf-sw:first-of-type { border-top: 0; }
.qf-svc { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; padding: 6px 0; }
@media (max-width: 640px) { .qf-svc { grid-template-columns: auto 1fr auto; } .qf-svc [data-sinfo] { grid-column: 1 / -1; grid-row: 2; } }
.qf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.qf-prev { position: sticky; top: 10px; display: grid; gap: 8px; }
.qf-steps { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.qf-steps .chip { padding: 4px 9px; font-size: 12px; }
.qf-phone { border: 8px solid #10181d; border-radius: 30px; overflow: hidden; background: #fff; height: min(78vh, 760px); box-shadow: 0 10px 26px rgba(0,0,0,.16); }
.qf-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.qf-savebar { position: sticky; bottom: 0; background: var(--paper); padding: 10px 0; margin-bottom: 0; z-index: 3; }
@media (max-width: 1100px) { .qf-grid { grid-template-columns: 1fr; } .qf-prev { position: static; } .qf-phone { height: 640px; max-width: 400px; } }
.pv-note { color: #9a5b00; font-weight: 600; }
.qf-step h3 { margin: 0 0 4px; font-size: 16px; }
.qf-q { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.qf-q:first-of-type { border-top: 0; }
.qf-qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qf-ask { font-size: 14px; font-weight: 600; }
.qf-field { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.qf-field > span { font-size: 13px; color: var(--ink-soft, #4a5a66); padding-top: 8px; }
.qf-field textarea { min-height: 0; font-size: 14px; }
.qf-field .link { grid-column: 2; justify-self: start; }
@media (max-width: 700px) { .qf-field { grid-template-columns: 1fr; } .qf-field > span { padding-top: 0; } .qf-field .link { grid-column: 1; } }
.qf-q.off .qf-field { opacity: .45; }
#dlg-edel .check-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; }
#dlg-edel .check-row input { margin-top: 3px; }
.enq header { justify-content: flex-start; }
.enq .enq-main { flex: 1; }
.enq-tick { padding-top: 2px; }
.enq-tick input { width: 18px; height: 18px; }
.enq-bulk { position: sticky; top: 8px; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.fu-card { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.fu-card:first-of-type { border-top: 0; }
.fu-card header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fu-card.soon { opacity: .75; }
.fu-text { font-size: 14px; }
.fu-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.ed-endjob{margin-top:16px;text-align:center}
.da-parts{margin:10px 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.da-parts .lbl{font-weight:600;margin:0 0 6px}
.dp-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:6px 0;border-top:1px solid var(--line)}
.dp-row:first-of-type{border-top:0}
.da-parts .dp-name{flex:1 1 180px;display:flex;flex-direction:row;gap:8px;align-items:center;margin:0;font-weight:500}
.da-parts .dp-name input{width:auto;margin:0}
.dp-qty{width:64px}
.tag.visit-note{background:var(--water-tint);color:var(--water);border:1px solid var(--water);font-weight:700}
.vp-visitnote{margin:10px 0;padding:10px 12px;border-radius:10px;background:var(--water-tint);border:1px solid var(--water);color:inherit}
.vp-visitnote strong{color:var(--water)}
.vp-usual{margin-top:6px}
.vp-usual summary{cursor:pointer;color:var(--muted, #6b7c85)}
.vp-jobnotes.faded{opacity:.7}
.cp-extras{margin:10px 0}
.cp-tobook{margin:0 0 14px}
.cp-tobook .site-h small{display:block;font-weight:400}
.job.is-tobook{border-color:var(--money, #c98a00);border-width:2px}
.job.is-tobook .job-acts .small-btn{margin-right:12px}
.extra-card .extra-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.extra-card .job-acts{display:flex;gap:16px;flex-wrap:wrap;justify-content:flex-end;margin:8px 0 0}
.movebar.actbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:5;
  padding:10px 12px;margin:0 0 10px;border-radius:var(--radius, 12px);background:var(--surface);color:inherit;border:1px solid var(--line);box-shadow:0 6px 18px rgba(0,0,0,.18)}
.actbar .act-btns{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.actbar .act-btns button.link{background:none;border:0;padding:6px}
.act-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}
.act-tiles.two{grid-template-columns:1fr 1fr}
.act-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:92px;padding:12px;border:1px solid var(--line);border-radius:12px;background:transparent;color:inherit;cursor:pointer;text-align:center}
.act-tile:hover{border-color:var(--water)}
.act-tile span{font-size:.85em;opacity:.75}
.act-tile.pick{cursor:default;margin:0}
.act-tile.pick input{max-width:170px}
.act-future{display:flex;flex-direction:row;gap:12px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.act-future span{display:flex;flex-direction:column;gap:4px}
.act-list{display:flex;flex-direction:column;gap:6px;margin-top:10px;max-height:55vh;overflow:auto}
.act-row{text-align:left;padding:12px;border:1px solid var(--line);border-radius:10px;background:transparent;color:inherit;cursor:pointer}
.act-row:hover{border-color:var(--water)}
@media (max-width:520px){.act-tiles{grid-template-columns:1fr 1fr}}
.act-future input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:0 0 auto;width:46px;height:26px;margin:2px 0 0;border-radius:13px;background:var(--line-2, #9aa8b0);position:relative;cursor:pointer;transition:background .15s}
.act-future input[type=checkbox]::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:left .15s}
.act-future input[type=checkbox]:checked{background:var(--water)}
.act-future input[type=checkbox]:checked::after{left:23px}
.stop .no.pickable{cursor:pointer;position:relative}
.stop .no.pickable:hover{border-color:var(--water)}
.stop.picked .no{background:var(--water);color:#fff;border-color:var(--water);font-size:0}
.stop.picked .no::after{content:"✓";font-size:16px}
.stop.picked > a{outline:2px solid var(--water);outline-offset:-2px;border-radius:12px}

/* rounds: every round in an area shares a colour, and each area has its own (36: soft, solid and bold-edged) */
.tag.rc-0{background:hsla(210,70%,50%,.14);color:hsl(210,60%,32%);border:1px solid hsla(210,60%,45%,.35)}
.tag.rc-1{background:hsla(30,70%,50%,.14);color:hsl(30,60%,32%);border:1px solid hsla(30,60%,45%,.35)}
.tag.rc-2{background:hsla(300,70%,50%,.14);color:hsl(300,60%,32%);border:1px solid hsla(300,60%,45%,.35)}
.tag.rc-3{background:hsla(120,70%,50%,.14);color:hsl(120,60%,32%);border:1px solid hsla(120,60%,45%,.35)}
.tag.rc-4{background:hsla(240,70%,50%,.14);color:hsl(240,60%,32%);border:1px solid hsla(240,60%,45%,.35)}
.tag.rc-5{background:hsla(60,70%,50%,.14);color:hsl(60,60%,32%);border:1px solid hsla(60,60%,45%,.35)}
.tag.rc-6{background:hsla(330,70%,50%,.14);color:hsl(330,60%,32%);border:1px solid hsla(330,60%,45%,.35)}
.tag.rc-7{background:hsla(150,70%,50%,.14);color:hsl(150,60%,32%);border:1px solid hsla(150,60%,45%,.35)}
.tag.rc-8{background:hsla(270,70%,50%,.14);color:hsl(270,60%,32%);border:1px solid hsla(270,60%,45%,.35)}
.tag.rc-9{background:hsla(90,70%,50%,.14);color:hsl(90,60%,32%);border:1px solid hsla(90,60%,45%,.35)}
.tag.rc-10{background:hsla(0,70%,50%,.14);color:hsl(0,60%,32%);border:1px solid hsla(0,60%,45%,.35)}
.tag.rc-11{background:hsla(180,70%,50%,.14);color:hsl(180,60%,32%);border:1px solid hsla(180,60%,45%,.35)}
.tag.rc-12{background:hsl(225,58%,40%);color:#fff;border:1px solid hsl(225,58%,32%)}
.tag.rc-13{background:hsl(45,58%,40%);color:#fff;border:1px solid hsl(45,58%,32%)}
.tag.rc-14{background:hsl(315,58%,40%);color:#fff;border:1px solid hsl(315,58%,32%)}
.tag.rc-15{background:hsl(135,58%,40%);color:#fff;border:1px solid hsl(135,58%,32%)}
.tag.rc-16{background:hsl(255,58%,40%);color:#fff;border:1px solid hsl(255,58%,32%)}
.tag.rc-17{background:hsl(75,58%,40%);color:#fff;border:1px solid hsl(75,58%,32%)}
.tag.rc-18{background:hsl(345,58%,40%);color:#fff;border:1px solid hsl(345,58%,32%)}
.tag.rc-19{background:hsl(165,58%,40%);color:#fff;border:1px solid hsl(165,58%,32%)}
.tag.rc-20{background:hsl(285,58%,40%);color:#fff;border:1px solid hsl(285,58%,32%)}
.tag.rc-21{background:hsl(105,58%,40%);color:#fff;border:1px solid hsl(105,58%,32%)}
.tag.rc-22{background:hsl(15,58%,40%);color:#fff;border:1px solid hsl(15,58%,32%)}
.tag.rc-23{background:hsl(195,58%,40%);color:#fff;border:1px solid hsl(195,58%,32%)}
.tag.rc-24{background:hsla(195,75%,55%,.3);color:hsl(195,70%,22%);border:2px solid hsl(195,60%,45%)}
.tag.rc-25{background:hsla(15,75%,55%,.3);color:hsl(15,70%,22%);border:2px solid hsl(15,60%,45%)}
.tag.rc-26{background:hsla(285,75%,55%,.3);color:hsl(285,70%,22%);border:2px solid hsl(285,60%,45%)}
.tag.rc-27{background:hsla(105,75%,55%,.3);color:hsl(105,70%,22%);border:2px solid hsl(105,60%,45%)}
.tag.rc-28{background:hsla(225,75%,55%,.3);color:hsl(225,70%,22%);border:2px solid hsl(225,60%,45%)}
.tag.rc-29{background:hsla(45,75%,55%,.3);color:hsl(45,70%,22%);border:2px solid hsl(45,60%,45%)}
.tag.rc-30{background:hsla(315,75%,55%,.3);color:hsl(315,70%,22%);border:2px solid hsl(315,60%,45%)}
.tag.rc-31{background:hsla(135,75%,55%,.3);color:hsl(135,70%,22%);border:2px solid hsl(135,60%,45%)}
.tag.rc-32{background:hsla(255,75%,55%,.3);color:hsl(255,70%,22%);border:2px solid hsl(255,60%,45%)}
.tag.rc-33{background:hsla(75,75%,55%,.3);color:hsl(75,70%,22%);border:2px solid hsl(75,60%,45%)}
.tag.rc-34{background:hsla(345,75%,55%,.3);color:hsl(345,70%,22%);border:2px solid hsl(345,60%,45%)}
.tag.rc-35{background:hsla(165,75%,55%,.3);color:hsl(165,70%,22%);border:2px solid hsl(165,60%,45%)}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .tag.rc-0{background:hsla(210,70%,55%,.18);color:hsl(210,75%,74%);border-color:hsla(210,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-1{background:hsla(30,70%,55%,.18);color:hsl(30,75%,74%);border-color:hsla(30,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-2{background:hsla(300,70%,55%,.18);color:hsl(300,75%,74%);border-color:hsla(300,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-3{background:hsla(120,70%,55%,.18);color:hsl(120,75%,74%);border-color:hsla(120,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-4{background:hsla(240,70%,55%,.18);color:hsl(240,75%,74%);border-color:hsla(240,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-5{background:hsla(60,70%,55%,.18);color:hsl(60,75%,74%);border-color:hsla(60,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-6{background:hsla(330,70%,55%,.18);color:hsl(330,75%,74%);border-color:hsla(330,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-7{background:hsla(150,70%,55%,.18);color:hsl(150,75%,74%);border-color:hsla(150,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-8{background:hsla(270,70%,55%,.18);color:hsl(270,75%,74%);border-color:hsla(270,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-9{background:hsla(90,70%,55%,.18);color:hsl(90,75%,74%);border-color:hsla(90,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-10{background:hsla(0,70%,55%,.18);color:hsl(0,75%,74%);border-color:hsla(0,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-11{background:hsla(180,70%,55%,.18);color:hsl(180,75%,74%);border-color:hsla(180,70%,60%,.4)}
:root:not([data-theme="light"]) .tag.rc-12{background:hsl(225,50%,40%);color:#fff;border-color:hsl(225,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-13{background:hsl(45,50%,40%);color:#fff;border-color:hsl(45,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-14{background:hsl(315,50%,40%);color:#fff;border-color:hsl(315,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-15{background:hsl(135,50%,40%);color:#fff;border-color:hsl(135,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-16{background:hsl(255,50%,40%);color:#fff;border-color:hsl(255,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-17{background:hsl(75,50%,40%);color:#fff;border-color:hsl(75,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-18{background:hsl(345,50%,40%);color:#fff;border-color:hsl(345,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-19{background:hsl(165,50%,40%);color:#fff;border-color:hsl(165,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-20{background:hsl(285,50%,40%);color:#fff;border-color:hsl(285,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-21{background:hsl(105,50%,40%);color:#fff;border-color:hsl(105,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-22{background:hsl(15,50%,40%);color:#fff;border-color:hsl(15,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-23{background:hsl(195,50%,40%);color:#fff;border-color:hsl(195,55%,55%)}
:root:not([data-theme="light"]) .tag.rc-24{background:hsla(195,70%,50%,.32);color:hsl(195,80%,84%);border:2px solid hsl(195,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-25{background:hsla(15,70%,50%,.32);color:hsl(15,80%,84%);border:2px solid hsl(15,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-26{background:hsla(285,70%,50%,.32);color:hsl(285,80%,84%);border:2px solid hsl(285,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-27{background:hsla(105,70%,50%,.32);color:hsl(105,80%,84%);border:2px solid hsl(105,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-28{background:hsla(225,70%,50%,.32);color:hsl(225,80%,84%);border:2px solid hsl(225,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-29{background:hsla(45,70%,50%,.32);color:hsl(45,80%,84%);border:2px solid hsl(45,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-30{background:hsla(315,70%,50%,.32);color:hsl(315,80%,84%);border:2px solid hsl(315,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-31{background:hsla(135,70%,50%,.32);color:hsl(135,80%,84%);border:2px solid hsl(135,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-32{background:hsla(255,70%,50%,.32);color:hsl(255,80%,84%);border:2px solid hsl(255,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-33{background:hsla(75,70%,50%,.32);color:hsl(75,80%,84%);border:2px solid hsl(75,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-34{background:hsla(345,70%,50%,.32);color:hsl(345,80%,84%);border:2px solid hsl(345,65%,58%)}
:root:not([data-theme="light"]) .tag.rc-35{background:hsla(165,70%,50%,.32);color:hsl(165,80%,84%);border:2px solid hsl(165,65%,58%)}
}
:root[data-theme="dark"] .tag.rc-0{background:hsla(210,70%,55%,.18);color:hsl(210,75%,74%);border-color:hsla(210,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-1{background:hsla(30,70%,55%,.18);color:hsl(30,75%,74%);border-color:hsla(30,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-2{background:hsla(300,70%,55%,.18);color:hsl(300,75%,74%);border-color:hsla(300,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-3{background:hsla(120,70%,55%,.18);color:hsl(120,75%,74%);border-color:hsla(120,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-4{background:hsla(240,70%,55%,.18);color:hsl(240,75%,74%);border-color:hsla(240,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-5{background:hsla(60,70%,55%,.18);color:hsl(60,75%,74%);border-color:hsla(60,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-6{background:hsla(330,70%,55%,.18);color:hsl(330,75%,74%);border-color:hsla(330,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-7{background:hsla(150,70%,55%,.18);color:hsl(150,75%,74%);border-color:hsla(150,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-8{background:hsla(270,70%,55%,.18);color:hsl(270,75%,74%);border-color:hsla(270,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-9{background:hsla(90,70%,55%,.18);color:hsl(90,75%,74%);border-color:hsla(90,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-10{background:hsla(0,70%,55%,.18);color:hsl(0,75%,74%);border-color:hsla(0,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-11{background:hsla(180,70%,55%,.18);color:hsl(180,75%,74%);border-color:hsla(180,70%,60%,.4)}
:root[data-theme="dark"] .tag.rc-12{background:hsl(225,50%,40%);color:#fff;border-color:hsl(225,55%,55%)}
:root[data-theme="dark"] .tag.rc-13{background:hsl(45,50%,40%);color:#fff;border-color:hsl(45,55%,55%)}
:root[data-theme="dark"] .tag.rc-14{background:hsl(315,50%,40%);color:#fff;border-color:hsl(315,55%,55%)}
:root[data-theme="dark"] .tag.rc-15{background:hsl(135,50%,40%);color:#fff;border-color:hsl(135,55%,55%)}
:root[data-theme="dark"] .tag.rc-16{background:hsl(255,50%,40%);color:#fff;border-color:hsl(255,55%,55%)}
:root[data-theme="dark"] .tag.rc-17{background:hsl(75,50%,40%);color:#fff;border-color:hsl(75,55%,55%)}
:root[data-theme="dark"] .tag.rc-18{background:hsl(345,50%,40%);color:#fff;border-color:hsl(345,55%,55%)}
:root[data-theme="dark"] .tag.rc-19{background:hsl(165,50%,40%);color:#fff;border-color:hsl(165,55%,55%)}
:root[data-theme="dark"] .tag.rc-20{background:hsl(285,50%,40%);color:#fff;border-color:hsl(285,55%,55%)}
:root[data-theme="dark"] .tag.rc-21{background:hsl(105,50%,40%);color:#fff;border-color:hsl(105,55%,55%)}
:root[data-theme="dark"] .tag.rc-22{background:hsl(15,50%,40%);color:#fff;border-color:hsl(15,55%,55%)}
:root[data-theme="dark"] .tag.rc-23{background:hsl(195,50%,40%);color:#fff;border-color:hsl(195,55%,55%)}
:root[data-theme="dark"] .tag.rc-24{background:hsla(195,70%,50%,.32);color:hsl(195,80%,84%);border:2px solid hsl(195,65%,58%)}
:root[data-theme="dark"] .tag.rc-25{background:hsla(15,70%,50%,.32);color:hsl(15,80%,84%);border:2px solid hsl(15,65%,58%)}
:root[data-theme="dark"] .tag.rc-26{background:hsla(285,70%,50%,.32);color:hsl(285,80%,84%);border:2px solid hsl(285,65%,58%)}
:root[data-theme="dark"] .tag.rc-27{background:hsla(105,70%,50%,.32);color:hsl(105,80%,84%);border:2px solid hsl(105,65%,58%)}
:root[data-theme="dark"] .tag.rc-28{background:hsla(225,70%,50%,.32);color:hsl(225,80%,84%);border:2px solid hsl(225,65%,58%)}
:root[data-theme="dark"] .tag.rc-29{background:hsla(45,70%,50%,.32);color:hsl(45,80%,84%);border:2px solid hsl(45,65%,58%)}
:root[data-theme="dark"] .tag.rc-30{background:hsla(315,70%,50%,.32);color:hsl(315,80%,84%);border:2px solid hsl(315,65%,58%)}
:root[data-theme="dark"] .tag.rc-31{background:hsla(135,70%,50%,.32);color:hsl(135,80%,84%);border:2px solid hsl(135,65%,58%)}
:root[data-theme="dark"] .tag.rc-32{background:hsla(255,70%,50%,.32);color:hsl(255,80%,84%);border:2px solid hsl(255,65%,58%)}
:root[data-theme="dark"] .tag.rc-33{background:hsla(75,70%,50%,.32);color:hsl(75,80%,84%);border:2px solid hsl(75,65%,58%)}
:root[data-theme="dark"] .tag.rc-34{background:hsla(345,70%,50%,.32);color:hsl(345,80%,84%);border:2px solid hsl(345,65%,58%)}
:root[data-theme="dark"] .tag.rc-35{background:hsla(165,70%,50%,.32);color:hsl(165,80%,84%);border:2px solid hsl(165,65%,58%)}
.rc-pick .tag.rc-used{opacity:.45}
.round-link{text-decoration:none}
.rc-picks{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.rc-pick{display:inline-flex;flex-direction:row;margin:0;cursor:pointer}
.rc-pick input{position:absolute;opacity:0;width:1px;height:1px}
.rc-pick .tag{padding:6px 10px;font-size:13px}
.rc-pick input:checked + .tag{outline:2px solid var(--ink);outline-offset:2px}
.rc-pick input:focus-visible + .tag{outline:2px dashed var(--water);outline-offset:2px}
/* one-off jobs on the map: square pins, so they stand out from the round */
.pm-pin.oneoff{border-radius:4px !important}
.map-legend i.oneoff{border-radius:2px}
.pc-list li{padding:0}
.pc-row{display:flex;justify-content:space-between;width:100%;gap:10px;padding:5px 6px;margin:0 -6px;border:0;border-radius:8px;background:none;color:inherit;font:inherit;cursor:pointer;text-align:left}
.pc-row:hover{background:var(--water-tint)}
.pc-list{max-height:420px;overflow:auto}
.pc-people{max-height:460px;overflow:auto}
.pc-people li a{display:block;padding:6px 0;border-bottom:1px solid var(--line);text-decoration:none;color:inherit}
.pc-people .sub{display:block}
.xp-items input[data-f=name]{min-width:180px}
.xp-items .money-in input,.xp-bands input{width:78px}
.xp-bands td{padding:4px 6px}
.xt-out li{padding:4px 0}
.xq-list{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.xq-row{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;padding:8px 10px;border:1px solid var(--line);border-radius:10px}
.xq-row .check-row{margin:0;flex:1 1 200px}
.xq-row .xq-price,.xq-row .xq-panes{width:80px}
.xp-bands input{width:104px}
.xq-row .check-row{display:flex;flex-direction:row;align-items:center;gap:8px}
.xq-row .check-row input{width:auto;margin:0}

/* ---- phones: every page fits the screen, nothing slides side to side ----
   Sections never grow wider than the screen because of a wide table or long label inside them
   (wide tables scroll inside their own box instead), long tags and addresses wrap, and boxes you
   type in are 16px so an iPhone doesn't zoom in (the zoom is what makes a page slide about). */
html, body { max-width: 100%; overflow-x: hidden; }
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }
.panel, .card, .stack > *, .split > *, .grid2 > *, .form-row > *, section, article, fieldset, form, main, #view { min-width: 0; }
.panel, .card, section, article { max-width: 100%; }
.tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
p, h1, h2, h3, li, label, .sub, dd, dt { overflow-wrap: anywhere; }
img, video, canvas, iframe { max-width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .form-row { flex-wrap: wrap; }
  .form-row > label, .form-row > * { flex: 1 1 100%; }
  .money-in input { max-width: 100%; }
  .xp-items, .xp-bands { min-width: 0; }
}
.wk-no { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-right: 6px; border-radius: 10px; background: var(--line); color: var(--ink-2); font-size: 12px; font-weight: 700; vertical-align: 1px; }

/* customer page tabs: Overview · Money · Quotes · Messages · History */
.cp-tabs { scrollbar-width: none; }
.cp-tabs button { white-space: nowrap; }
.tab-n { font-style: normal; font-size: 12px; font-weight: 700; margin-left: 5px; color: var(--ink-3); }
.tab-n:empty { display: none; }
.tab-n.money { color: var(--money); }
@media (max-width: 980px) { .cp-body.not-overview .cp-side { display: none; } }   /* phones: contact and notes live on Overview */
.cp-hfilter { margin-bottom: 12px; }
.timeline li.change::before { background: var(--ink-3); }
.timeline li.complaint::before { background: var(--late, #c0392b); }
.timeline li.photo::before { background: var(--water); }
.cp-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cp-msg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.cp-msg.in { border-left: 3px solid var(--water); }
.cp-msg-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cp-msg p { margin: 2px 0; }
.cp-msg-s { font-weight: 600; }
.cp-msg-b { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.cp-msg details summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
.cp-enq { padding: 10px 12px; margin-bottom: 8px; }
.cp-enq p { margin: 2px 0; }
.enq-hit { box-shadow: 0 0 0 2px var(--water); }
@media (max-width: 760px) { .cp-tabs { gap: 0; } .cp-tabs button { padding: 8px 9px; font-size: 15px; } .tab-n { margin-left: 3px; } }

/* tapping a button quickly (like + on a counter) mustn't zoom the page on a phone */
html, body, button, a, input, select, textarea, label, [role="button"] { touch-action: manipulation; }
.tk-lead { border-color: color-mix(in srgb, var(--water) 45%, var(--line)); }
.tk-lead .tk-dot { background: var(--water); }
.tk-group { margin: 6px 0 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tk-group:first-child { margin-top: 0; }
.tag.at-time { background: color-mix(in srgb, var(--water) 18%, transparent); color: var(--ink); font-weight: 700; }
.vp-time { margin: 6px 0; font-size: 16px; }
.muted-row td { color: var(--ink-2); } .closed-day { border-left: 3px solid var(--money); }
.vp-log { margin-top: 10px; } .vp-log ol { margin: 6px 0 0; display: grid; gap: 4px; }
.cb-list { display: grid; gap: 10px; }
.cb header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cb p { margin: 6px 0; }
.bh-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.bh-list li > span { display: grid; min-width: 0; }
.bh-work { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; flex: none; }
.bh-work input { width: 20px; height: 20px; }
.bh-list li.is-worked strong { color: var(--good); }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0; }
.ref-grid figure { margin: 0; }
.ref-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.ref-grid figcaption { font-size: 13px; color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; }
.nearby-days .chip { display: grid; text-align: left; } .nearby-days .chip span { font-weight: 400; font-size: 12px; opacity: .8; }
.hol-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hol-list li > div { display: grid; min-width: 0; }
.hol-nums { text-align: right; justify-items: end; }
.off-item { padding: 12px 0; border-top: 1px solid var(--line); }
.off-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.off-van { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, rgba(127,127,127,.08)); }
.off-plan { display: grid; gap: 8px; }
.off-cover-l { display: grid; gap: 4px; padding-left: 4px; } .off-cover { max-width: 260px; }
.pc-short { display: block; font-size: 11.5px; color: var(--money); }

/* the office TV: #/tv, full screen */
#app.tv-mode .rail, #app.tv-mode .tabbar { display: none !important; }
#app.tv-mode { display: block; }
#app.tv-mode main { margin: 0; max-width: none; width: 100%; padding: 20px 28px; }
.tv { display: grid; gap: 18px; min-height: calc(100vh - 40px); }
.tv-head { display: flex; align-items: center; gap: 20px; }
.tv-head h1 { margin: 0; font-size: clamp(22px, 2.4vw, 36px); }
.tv-clock { margin-left: auto; font-size: clamp(28px, 3.2vw, 52px); font-weight: 800; font-variant-numeric: tabular-nums; }
.tv-exit { font-size: 13px; color: var(--ink-3); }
.tv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tv-kpis > * { padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; }
.tv-kpis span { color: var(--ink-3); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.tv-kpis strong { font-size: clamp(26px, 2.6vw, 44px); line-height: 1.1; }
.tv-kpis small { color: var(--ink-2); }
.tv-kpis .tv-waiting { border-color: var(--money); }
.tv-body { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.6fr); gap: 18px; }
@media (max-width: 900px) { .tv-body { grid-template-columns: minmax(0, 1fr); } }
.tv-vans { display: grid; gap: 14px; align-content: start; }
.tv-van, .tv-feed { padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.tv-van h2, .tv-feed h2 { margin: 0 0 8px; font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.tv-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.tv-bar i { display: block; height: 100%; } .tv-bar .done { background: var(--good); } .tv-bar .skipped { background: var(--money); }
.tv-nums { font-size: 17px; margin: 8px 0 4px; }
.tv-feed ol { display: grid; gap: 6px; font-size: 14px; }
.tv-map .pmap { height: min(70vh, 720px); border-radius: 16px; }
.pm-pin.tv-van-pin { left: -11px; top: -11px; width: 22px; height: 22px; background: #111; border: 3px solid #fff; }
.tv-feed ol { list-style: none; padding: 0; margin: 0; }
.week-jump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.jump-date { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.jump-date input { width: auto; }
a.tv-card, a.tv-van { color: inherit; text-decoration: none; display: block; }
.tv-kpis a.tv-card { display: grid; }
a.tv-card:hover, a.tv-van:hover { border-color: var(--water); }
.tv-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tv-links a { color: var(--ink); font-weight: 600; }
.tv-links a:hover { color: var(--water); }
/* van icons on the maps */
.pm-pin.pm-icon { width: 58px; height: 36px; left: -29px; top: -30px; border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; overflow: visible; z-index: 3; }
.pm-pin.pm-icon .van-ico { width: 58px; height: 35px; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.pm-tag { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff; background: #142029; padding: 1px 7px; border-radius: 9px; pointer-events: none; }
.van-col { display: inline-flex; align-items: center; gap: 8px; } .van-col .van-ico { width: 54px; height: 32px; }
@media (max-width: 760px) { .tv-kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .tv-kpis > .tv-waiting { grid-column: 1 / -1; } .tv-map .pmap { height: 60vh; } }

/* round builder (test) */
.rb-form { display: grid; gap: 12px; }
.rb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.rb-grid label { margin: 0; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--water); border-radius: 50%; vertical-align: -2px; animation: rbspin .8s linear infinite; }
@keyframes rbspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.rb-cmp td strong { font-weight: 700; }
.rb-moves { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.rb-moves > div { position: relative; padding: 10px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 2px; overflow: hidden; }
.rb-moves strong { font-size: 20px; }
.rb-moves span { font-size: 12px; color: var(--muted); }
.rb-moves i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--water); }
@media (max-width: 640px) { .rb-moves { grid-template-columns: repeat(2, 1fr); } }
.rb-cal { display: grid; grid-template-columns: 70px repeat(5, minmax(0, 1fr)); gap: 6px; }
.rb-wd { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.rb-wk { font-size: 12px; font-weight: 700; color: var(--muted); align-self: center; }
.rb-day { position: relative; display: grid; gap: 2px; align-content: start; text-align: left; padding: 8px 8px 12px; min-height: 92px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; overflow: hidden; cursor: pointer; }
.rb-day strong { font-size: 13px; line-height: 1.25; }
.rb-day span { color: var(--muted); }
.rb-day em { font-style: normal; font-weight: 700; color: var(--late); }
.rb-day.overflow { border-style: dashed; }
.rb-day.long { border-color: var(--late); }
.rb-day.spare { cursor: default; background: transparent; border-style: dashed; place-content: center; text-align: center; }
.rb-day:hover:not(.spare) { border-color: var(--water); }
.rb-fill { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--water); }
.rb-day.long .rb-fill { background: var(--late); }
@media (max-width: 760px) {
  .rb-cal { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .rb-cal .rb-wk { grid-column: 1 / -1; margin-top: 6px; }
  .rb-cal > div:first-child { display: none; }
  .rb-day { min-height: 70px; padding: 6px 5px 10px; font-size: 11px; }
  .rb-day strong { font-size: 11px; }
  .rb-day span:last-of-type { display: none; }
}
dialog.paybox.rb-dlg { width: min(880px, 96vw); max-width: 96vw; }
.rb-dlg .pmap { height: 340px; }
.rb-cyc-h { margin: 0 0 -8px; }
.rb-cycles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px 12px; color: var(--muted); }
.rb-cycles b { color: var(--ink); margin-right: 4px; }
.rb-how p { margin: 0 0 8px; }

/* round builder sections: one colour per weekday */
.sec0 { --sec: #2a78d6; } .sec1 { --sec: #eb6834; } .sec2 { --sec: #1baf7a; } .sec3 { --sec: #8a5cd6; } .sec4 { --sec: #d6a100; }
.pm-lines .pm-shape { fill: var(--sec); stroke: var(--sec); stroke-width: 2; fill-opacity: .14; stroke-opacity: .8; }
.pm-pin.secdot { width: 10px; height: 10px; left: -5px; top: -5px; border-width: 1.5px; background: var(--sec); }
.rb-secmap.pmap, .rb-secmap .pmap { height: min(72vh, 640px); }
.rb-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--sec); vertical-align: -1px; margin-right: 6px; }
.rb-sec td .sub { display: block; }
.rb-day.sec-edge { box-shadow: inset 4px 0 0 var(--sec); }
@media (max-width: 760px) { .rb-secmap.pmap, .rb-secmap .pmap { height: 380px; } }

/* round tidy */
.rt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); }
.rt-legend i, .rt-from-to i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.rt-legend strong { color: var(--ink); margin-right: 4px; }
.pm-pin.rt-dot { width: 11px; height: 11px; left: -5.5px; top: -5.5px; border-width: 1.5px; }
.pm-pin.rt-flag { width: 16px; height: 16px; left: -8px; top: -8px; border: 3px solid #111; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.4); z-index: 1; }
.rt-list { display: grid; gap: 10px; }
.rt-move { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.rt-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rt-top a { color: var(--ink); text-decoration: none; }
.rt-from-to { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14px; }
.rt-from-to .sub { display: block; font-size: 12px; color: var(--muted); margin-left: 17px; }
.rt-arrow { color: var(--muted); font-size: 18px; }
.rt-actions { display: flex; gap: 8px; }
.tag.rt-warn { background: #fff1d6; color: #8a5a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.rt-warn { background: #3a2c10; color: #f3c76b; } }
:root[data-theme="dark"] .tag.rt-warn { background: #3a2c10; color: #f3c76b; }
@media (max-width: 640px) { .rt-from-to { grid-template-columns: 1fr; } .rt-arrow { display: none; } }
.seg button.faded:not(.on) { opacity: .55; }
.pay-why { margin: 8px 4px 0; }

/* morning checks on Today (while testing alongside Squeegee) */
details.mc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; background: var(--surface); }
details.mc > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
details.mc > summary::-webkit-details-marker { display: none; }
.mc-n { margin-left: auto; font-weight: 600; font-size: 13px; }
.mc-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.mc-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.mc-list a { color: var(--ink); text-decoration: none; display: grid; gap: 2px; }
.mc-tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.mc-list li.is-done .mc-tick { background: var(--good); border-color: var(--good); color: #fff; }
.mc-list li.is-done strong { color: var(--muted); }
.mc-last { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .mc-list li { grid-template-columns: 22px minmax(0, 1fr); } .mc-last { grid-column: 2; } }
.sq-reports li > span:nth-child(2) { display: grid; gap: 2px; }
.sq-reports .tk-why { display: block; font-size: 13px; color: var(--muted); }

/* the Owed page */
.owed-tools { align-items: center; gap: 12px; }
.owed-tools input[type=search] { min-width: 240px; flex: 0 1 320px; }
.owed-list { display: grid; }
.owed-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.owed-row:first-child { border-top: 0; }
.owed-who { display: grid; gap: 3px; min-width: 0; }
.owed-who > a { color: var(--ink); text-decoration: none; }
.owed-who .sub { font-size: 13px; color: var(--muted); }
.owed-who .sub.late-text { color: var(--late); } .owed-who .sub.good-text { color: var(--good); }
.owed-amt { text-align: right; display: grid; gap: 4px; justify-items: end; }
.owed-amt strong { font-size: 17px; }
.owed-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; max-width: 330px; }
.owed-acts .btn.small-btn { text-decoration: none; }
@media (max-width: 760px) {
  .owed-row { grid-template-columns: minmax(0, 1fr) auto; }
  .owed-acts { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}

/* offer preview: a text bubble and the email in a frame */
.up-seg { margin: 4px 0 12px; max-width: 240px; grid-template-columns: 1fr 1fr; }
.up-who { display: flex; align-items: center; gap: 8px; }
.up-who select { min-width: 200px; }
.up-bubble { max-width: 340px; padding: 12px 14px; border-radius: 18px 18px 18px 4px; background: #e9eef1; color: #142029; font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.up-frame { width: 100%; max-width: 620px; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #f4f7f8; display: block; }
@media (max-width: 640px) { .up-frame { height: 560px; } }
