/* Team page (#/team) + "Day routes" overlay (public/js/dayroutes.js, opened from the Month board). Mobile first. */

/* ---------- Month board: tappable dates ---------- */
.board td.date .dr-open { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; font: inherit; color: inherit; }
.board td.date .dr-open:hover:not(:disabled) { background: var(--brand-3); }
.board td.date .dr-open:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.board td.date .dr-open:disabled { cursor: default; }
.board td.date .dr-ic { display: inline-flex; vertical-align: -2px; margin-left: 5px; color: var(--brand); }

/* ---------- Day routes overlay ---------- */
html.dr-open { overflow: hidden; }
.dr-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10, 20, 17, .45); display: flex; }
.dr-panel { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
@media (min-width: 900px) { .dr-overlay { padding: 18px; } .dr-panel { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); } }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 58px; }
.dr-head .spacer { flex: 1; }
.dr-titles { min-width: 0; }
.dr-titles h2 { margin: 0; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-sub { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-close { font-size: 18px; min-width: 40px; }
.dr-body { flex: 1; overflow: auto; padding: 14px 16px 24px; overscroll-behavior: contain; }
.dr-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .dr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .dr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .dr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dr-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; min-width: 0; color: var(--ink); }
.dr-card:hover { border-color: var(--brand-2); box-shadow: var(--shadow); }
.dr-card:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.dr-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dr-card-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; }
.dr-mini { border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); aspect-ratio: 320 / 190; background: var(--surface-2); }
.dr-svg { display: block; width: 100%; height: 100%; }
.dr-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.dr-times { font-size: 13px; }
.dr-late { color: var(--bad); font-weight: 700; }
.dr-off { grid-column: 1 / -1; margin: 0; font-size: 14px; }
.dr-empty { grid-column: 1 / -1; }
.dr-big .dr-bigtop:empty { display: none; }
.dr-techs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dr-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink); }
.dr-chip.on { background: var(--brand-3); border-color: var(--brand-2); }
.dr-chip:focus-visible { outline: 2px solid var(--brand-2); }
.dr-bigwrap { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dr-bigmap.mapbox { height: 46vh; min-height: 260px; isolation: isolate; }
@media (min-width: 1000px) { .dr-bigwrap { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); align-items: start; } .dr-bigmap.mapbox { height: calc(100vh - 170px); } .dr-bigside { max-height: calc(100vh - 170px); overflow: auto; } }
.dr-actions { margin-bottom: 8px; }
.dr-stops { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dr-stop { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line-2); }
.dr-stop:last-child { border-bottom: 0; }
.dr-stop.done .dr-stop-main b, .dr-stop.skipped .dr-stop-main b { color: var(--ink-3); }
.dr-num { flex: none; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.dr-stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dr-stop-main small { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Team page ---------- */
.tm-demo { display: inline-flex; align-items: center; gap: 6px; }
.tm-tiles .tile .k { display: flex; align-items: center; gap: 4px; }
.tm-tile-link { text-decoration: none; color: var(--ink); }
.tm-tile-link:hover { border-color: var(--brand-2); }
.tm-layout { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .tm-layout { grid-template-columns: minmax(0, 1fr) 360px; } .tm-feed { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; } }
.tm-maincol { min-width: 0; }
.tm-cardhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tm-cardhead h2 { margin: 0; }
.tm-cardhead .spacer { flex: 1; }
.tm-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tm-map.mapbox { height: 420px; isolation: isolate; }
@media (max-width: 1000px) { .tm-map.mapbox { height: 320px; } }
.tm-h { margin: 18px 0 10px; display: flex; align-items: center; gap: 6px; }
.tm-crew { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .tm-crew { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tm-tech { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tm-tech-main { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; color: var(--ink); border-radius: 8px; }
.tm-tech-main:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; }
.tm-tech-head { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.tm-tech-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-pct { font-weight: 800; font-size: 1.2rem; }
.tm-bar { display: flex; height: 12px; background: var(--line-2); border-radius: 12px; overflow: hidden; }
.tm-bar i { display: block; height: 100%; }
.tm-bar i.sk { background: var(--warn); }
.tm-bar i.ms { background: var(--bad); }
.tm-line { font-size: 14px; }
.tm-bad { color: var(--bad); font-weight: 700; }
.tm-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-badges a.badge { text-decoration: none; }
.tm-acts { margin-top: auto; }
.tm-feed h2 { margin-top: 0; }
.tm-feedlist { list-style: none; margin: 0; padding: 0; }
.tm-feedlist li { border-bottom: 1px solid var(--line-2); }
.tm-feedlist li:last-child { border-bottom: 0; }
.tm-ev { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 4px; cursor: pointer; color: var(--ink); font-size: 14px; }
.tm-ev:hover { background: var(--surface-2); }
.tm-ev:focus-visible { outline: 2px solid var(--brand-2); }
.tm-ev .dot { margin-top: 5px; }
.tm-ev-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tm-note { color: var(--ink-2); font-style: italic; }
.tm-skip { color: var(--warn); font-weight: 600; }
/* drawer */
.tm-drawer-back { position: fixed; inset: 0; z-index: 50; background: rgba(10, 20, 17, .4); display: flex; justify-content: flex-end; }
.tm-drawer { width: min(560px, 100vw); height: 100%; background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tm-drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tm-drawer-head h2 { margin: 0; font-size: 1.15rem; }
.tm-drawer-head .spacer { flex: 1; }
.tm-drawer-acts { padding: 10px 16px 0; }
.tm-drawer-sum { padding: 6px 16px 0; margin: 0; font-size: 14px; }
.tm-drawer-body { flex: 1; overflow: auto; padding: 10px 16px 30px; overscroll-behavior: contain; }
.tm-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.tm-day.today { border-color: var(--brand-2); }
.tm-day > summary { cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; list-style-position: inside; }
.tm-day-date { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.tm-day-sum { font-size: 13px; }
.tm-day-acts { padding: 0 12px 8px; align-items: center; }
.tm-visits { list-style: none; margin: 0; padding: 0 12px 6px; }
.tm-visit { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.tm-vnum { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.tm-visit.done .tm-vnum { background: var(--good-bg); color: var(--good); }
.tm-visit.skipped .tm-vnum { background: var(--warn-bg); color: var(--warn); }
.tm-visit.missed .tm-vnum { background: var(--bad-bg); color: var(--bad); }
.tm-vmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tm-vtop { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tm-notes { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.tm-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tm-photo { all: unset; cursor: pointer; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); width: 72px; height: 54px; }
.tm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-photo:focus-visible { outline: 2px solid var(--brand-2); }
.tm-photo-big { max-width: 100%; height: auto; display: block; border-radius: 8px; image-rendering: auto; min-width: 240px; }
/* month board: long text in the side cards (e.g. swap requests) must not stretch the one-column layout on phones */
.board-wrap > * { min-width: 0; }
.tm-crew > .card { margin: 0; }
.tm-day-info { font-size: 13px; }
.tm-feed > .btn { margin-top: 8px; }
