/* Today Status, the new look (Ali, 27 Oct 2026, Idea A): crew chips with progress, counts as small dots, work and break time stacked, a zone tag on every job,
   a map with the counts on it and crew cards with a progress bar, a compact Not Updated list without calling. Loads after planner.css. */
.tdy-chip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font: 700 0.82rem var(--font-c); flex: none; }

/* counts: four small dots instead of a tile row */
.tiles.ts-tiles { display: flex; flex-wrap: wrap; gap: 6px 22px; max-width: none; background: none; border: 0; border-radius: 0; overflow: visible; margin: 0 0 8px; padding: 0 2px; }
.tiles.ts-tiles .tile { display: flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 0; box-shadow: none; background: none; }
.tiles.ts-tiles .tile::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--d, #2F6FD0); flex: none; }
.tiles.ts-tiles .tile:nth-child(2) { --d: #1E9E57; }
.tiles.ts-tiles .tile:nth-child(3) { --d: #E1251B; }
.tiles.ts-tiles .tile span { order: 1; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.tiles.ts-tiles .tile b { order: 2; font: 700 1.05rem var(--font-c); letter-spacing: 0; margin-left: 2px; }
.tiles.ts-tiles .tile-alert b { color: #E1251B; }
.tiles.ts-tiles .tile::before { order: 0; }

/* List | Map switch as one soft pill */
.ts-date .seg { display: inline-flex; gap: 2px; padding: 3px; border: 0; border-radius: 10px; background: var(--sunken); }
.ts-date .seg button { border: 0; border-radius: 8px; padding: 5px 16px; background: transparent; color: var(--muted); font-weight: 600; }
.ts-date .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(13, 27, 42, 0.12); }

/* the timeline: crew head with progress, name column with stacked times, boxes with a zone tag */
.tl-gtitle { align-items: center; gap: 8px; padding: 10px 14px 2px; }
.tl-gtitle b { font: 700 1rem var(--font-c); }
.tl-gprog { margin-left: auto; font: 600 0.8rem var(--font-c); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-gprog b { font: inherit; color: var(--ink); }
.tl-person { grid-template-columns: 24px minmax(0, 1fr) auto; }
.tl-wk { display: grid; text-align: right; line-height: 1.15; justify-items: end; }
.tl-wk .tl-brk { font-size: 0.72rem; color: var(--muted); }
.tl-people-grid .tl-box { border-radius: 8px; border-top-width: 3px; }
.tl-planned { border-style: dashed; border-top-style: solid; }
.tl-zone { display: flex; align-items: center; gap: 5px; margin-top: 1px; font: 600 0.68rem var(--font-c); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-zone i { width: 7px; height: 7px; border-radius: 50%; background: var(--z); flex: none; }
.tl-people-grid { --crew-w: 290px; }
@media (min-width: 821px) { .tl-people-grid { --rh: 80px; } } /* four lines (number, branch, status, zone) fit in a one-person box */
.tv-title { display: flex; align-items: center; gap: 6px; }

/* Not Updated: two quiet cards across, no calling */
.ts-sub { margin: 14px 0 8px; }
.ts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ts-row { flex-wrap: nowrap; padding: 8px 12px; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ts-row.ts-not_updated { background: var(--surface); border-color: var(--line); }
.ts-row .ts-status { flex: none; }
.ts-row a { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ts-row .ts-people { width: auto; margin-left: auto; flex-wrap: nowrap; }
.ts-row .ts-person { font-weight: 500; font-size: 0.84rem; white-space: nowrap; }

/* the one job a crew card shows on a phone (hidden on computers, where the full job list is shown) */
.tm-cur { display: none; font-size: 0.86rem; line-height: 1.3; margin-top: 2px; }

/* map: counts on the map, crew cards with a progress bar */
.tm-kpi { position: absolute; top: 12px; left: 58px; z-index: 800; max-width: calc(100% - 200px); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; box-shadow: 0 1px 3px rgba(13, 27, 42, 0.1); }
.tm-kpi .tiles.ts-tiles { margin: 0; padding: 0; }
.tm-card-head { align-items: center; gap: 8px; justify-content: flex-start; }
.tm-card-head b { font: 700 1.02rem var(--font-c); }
.tm-card-head .tm-count { margin-left: auto; font-weight: 600; white-space: nowrap; }
.tm-bar { display: flex; gap: 3px; margin: 9px 0 6px; }
.tm-bar i { flex: 1; height: 6px; border-radius: 3px; background: #DDE3EA; }
.tm-bar i.is-done { background: #1E9E57; }
.tm-bar i.is-live { background: var(--c); }
.tm-people { gap: 0; }
.tm-people > * + * { margin-left: -6px; }

@media (max-width: 820px) {
  /* Map on a phone: the map fills the screen, the counts float on it, the crew cards swipe along the bottom (Ali, 27 Oct 2026, Map B) */
  .tm { position: relative; display: block; }
  .tm-box { display: block; }
  .tm-kpi { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 800; max-width: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 3px rgba(13, 27, 42, 0.1); padding: 6px 10px; }
  .tm .leaflet-control-zoom { display: none; }
  .tm .leaflet-top.leaflet-right { top: 44px; right: 2px; }
  .tm .leaflet-top.leaflet-right .leaflet-control { margin: 0 6px 0 0; }
  .tm-side { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 800; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; max-height: none !important; padding: 0 8px 2px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tm-side .tm-sec, .tm-side .tm-plan { display: none; }
  .tm-side .tm-card { flex: none; width: 240px; scroll-snap-align: start; box-shadow: 0 1px 3px rgba(13, 27, 42, 0.12); }
  .tm-cur { display: block; }
  .tm-kpi { padding: 5px 10px; }
  .tm-kpi .tiles.ts-tiles { display: flex; flex-wrap: nowrap; gap: 0 7px; overflow: hidden; }
  .tm-kpi .tiles.ts-tiles .tile { display: flex; align-items: center; gap: 5px; }
  .tm-kpi .tiles.ts-tiles .tile { gap: 4px; white-space: nowrap; }
  .tm-kpi .tiles.ts-tiles .tile span { font-size: 0.62rem; overflow: visible; }
  .tm-kpi .tiles.ts-tiles .tile::before { width: 6px; height: 6px; }
  .tm-kpi .tiles.ts-tiles .tile b { font-size: 0.95rem; margin: 0; }
  /* slim crew cards: one line of crew, a thin bar, one line of job (the map keeps the screen) */
  .tm-side .tm-card { width: 215px; padding: 6px 10px; }
  .tm-side .tm-card-head { gap: 6px; }
  .tm-side .tm-card-head b { font-size: 0.92rem; white-space: nowrap; }
  .tm-side .tm-count { font-size: 0.72rem; }
  .tm-side .tm-bar { margin: 5px 0 4px; }
  .tm-side .tm-bar i { height: 4px; }
  .tm-cur { margin-top: 0; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tm-cur br { display: none; }
  .tm-cur .muted { display: inline; margin-left: 4px; }
  /* the job card is a slim strip just above the crew cards */
  .tm-job { top: auto; bottom: 100px; left: 8px; right: 8px; width: auto; z-index: 900; }
  .tm-job .pj-top { margin-bottom: 2px; }
  .tm-job .pj { position: relative; display: grid; gap: 2px; line-height: 1.25; }
  .tm-job .tm-job-state { padding-right: 104px; min-height: 30px; display: flex; align-items: center; }
  .tm-job .tm-job-people { position: absolute; right: 10px; bottom: 6px; margin: 0; }
  .tm-job .tm-job-people .btn { height: 30px; padding: 0 12px; }
  .tm-job .pj { padding: 6px 10px; }
  .tm-job .pj-line, .tm-job .tm-job-people .av { display: none; }
  .tm-job-state { font-size: 0.78rem; }
  .tm .tm-home { font-size: 0.64rem; line-height: 1; padding: 4px 8px; border-radius: 8px; box-shadow: 0 1px 2px rgba(13, 27, 42, 0.12); }
  .ts-date { gap: 6px; }
  .ts-date input[type="date"] { min-width: 0; }
  .ts-date .seg { margin-left: auto; }
  .ts-date .seg button { padding: 5px 12px; }
  .tv-title { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
  .tv-title b { font-size: 0.78rem; white-space: nowrap; }
  .tiles.ts-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 6px; }
  .tiles.ts-tiles .tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "d s" "b b"; column-gap: 5px; align-items: center; }
  .tiles.ts-tiles .tile::before { grid-area: d; }
  .tiles.ts-tiles .tile span { grid-area: s; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tiles.ts-tiles .tile b { grid-area: b; font-size: 1.3rem; margin: 0; }
  .ts-list { grid-template-columns: minmax(0, 1fr); }
  .ts-row { flex-wrap: wrap; }
  .ts-row .ts-people { flex-wrap: wrap; width: 100%; margin-left: 0; }
  .tl-people-grid { --crew-w: 168px; }
}

/* Motion (Ali, 27 Oct 2026, motion review; one curve, --ease-out in base.css). Today Status is opened a few times a day: a short glide in, once per opening (class tdy-enter on the page,
   set in today.js and removed after 0.9 s, so a live refresh never replays it). Only opacity and transform. A pressed button gives a small push back. */
@keyframes tdy-fade { from { opacity: 0; } }
@keyframes tdy-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes tdy-pop { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.tm-card { transition: transform 140ms var(--ease-out), border-color 150ms ease; }
.tm-job { transform-origin: left bottom; }
.tl-group:nth-child(1), .ts-row:nth-child(1) { --i: 0; } .tl-group:nth-child(2), .ts-row:nth-child(2) { --i: 1; } .tl-group:nth-child(3), .ts-row:nth-child(3) { --i: 2; }
.tl-group:nth-child(4), .ts-row:nth-child(4) { --i: 3; } .tl-group:nth-child(5), .ts-row:nth-child(5) { --i: 4; } .tl-group:nth-child(n+6), .ts-row:nth-child(n+6) { --i: 5; }
@media (prefers-reduced-motion: no-preference) {
  .tdy-enter .ts-tiles .tile { animation: tdy-fade 200ms var(--ease-out) both; }
  .tdy-enter .tl-group, .tdy-enter .ts-row { animation: tdy-rise 240ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
  .tdy-enter #tm-host .tm-box { animation: tdy-fade 240ms var(--ease-out) both; }
  .tdy-enter .tm-side { animation: tdy-fade 240ms var(--ease-out) 60ms both; }
  .tm-job:not([hidden]) { animation: tdy-pop 160ms var(--ease-out); }
  .ts-date .seg button:active, .tm-card:active, .tm-home:active { transform: scale(0.97); transition: transform 100ms var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) {
  .tdy-enter .tl-group, .tdy-enter .ts-row, .tdy-enter #tm-host .tm-box, .tdy-enter .tm-side { animation: tdy-fade 160ms ease both; }
  .tm-job:not([hidden]) { animation: tdy-fade 120ms ease; }
}
@media (hover: hover) and (pointer: fine) { .tm-card:hover { border-color: var(--line-strong); } }
@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .tm-job { transform-origin: left top; }
  .tdy-enter .tm-side { animation: tdy-rise 260ms var(--ease-out) 80ms both; }
}
