/* 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: 32px; height: 32px; flex: none; object-fit: contain; }
.gate .mark .brand-logo { width: 48px; height: 48px; }
.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: 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; }
}
.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: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 94vh; }
}

/* 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: -26px; }
.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; }

/* 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; }
