/* ---------------------------------------------------------------------------
   Zoning, part 1B: the review list and the change that floats over the map.

   Loaded on index.html only, after roster.css. Every rule of the new list
   lives here: zoning-list.js builds the nodes, zoning-map.js draws on the
   planner's own map, and neither carries a style of its own beyond the two
   places named at the foot of this file.

   THE RULES THIS FILE KEEPS (tools/test-zoning-list.js reads the source):

   1. Every colour is a token that theme.css sets for BOTH themes. No colour
      is written out here, so dark and light can never disagree.
   2. Nothing in the list or in a change moves, fades or slides. The list is
      redrawn on a timer and after every save, and a rule that plays again
      on each redraw would flicker for as long as the panel is open. A state
      changes at once.
   3. The floating change ends 84px above the foot of the map. The pill that
      counts what is waiting "To enter in Aspire" sits at 34px and is about
      36px tall, and it is the next step after an Approve: it is never
      covered, and no rule here names it.
   4. The planner's own collapse button hides the list the way it hides the
      planner's side panel, to give the map room on a small screen.
   5. A tick box and a Move button are 36px tall or more, for a finger.
   6. Meaning is never carried by colour alone: every dot, mark, badge and
      red cell has its words printed beside it by zoning-list.js. Two of the
      list's states share a colour (the theme has no blue), which is why.

   EVERY class name starts "zl-", the ones that only say a state included
   (zl-on, zl-primary, zl-badge-crew). The page's other stylesheets already
   own .crew, .day, .on, .new and .primary: a legend ring classed "crew" came
   out as a crew card. Ids start "zl" too, except the count inside the header
   button (zoningCount) and the button itself (zonesModeBtn), which is only
   made the count's anchor (position: relative, no move) on a narrow header.
--------------------------------------------------------------------------- */

/* ============================ the mode's frame ============================ */

/* The list takes the planner's left column. Column 1 is 330px before and
   after, so the map's box never changes size and the map is not resized.
   Row 1 is named too: the list is added after .mapwrap, and with a column
   alone the grid put it in a new second row and halved the map (review f2,
   measured in a browser). */
#zlSide {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  display: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
body.zoning-list .side { display: none; }
body.zoning-list #zlSide { display: block; }
/* Rule 4. Written after the line above and with more weight, so it wins. */
.shell.collapsed #zlSide,
body.zoning-list .shell.collapsed #zlSide { display: none; }

/* Read by a screen reader, not drawn (the live region, a table's caption). */
.zl-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* One focus ring for everything in the list and in a change. */
#zlSide :focus-visible,
#zlCard :focus-visible,
.zl-mapbar :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The heading, the title and the note take focus from the script, so a
   screen reader starts there. They are not controls and get no ring. */
#zlHead:focus, #zlCardTitle:focus { outline: none; }

/* ======================= the count on the header button =================== */

/* "⬡ Zoning · 4 to review". The header is the same green in both themes. */
#zoningCount b { font-weight: 800; }
/* A red day is waiting. The number sits on a solid red with the theme's own
   text colour for that red, so it reads on the green header and on the
   button's white "on" state alike, dark or light. */
#zoningCount.zl-red b {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--danger-on);
  text-align: center;
  line-height: 1.25;
}
/* A narrow header: "⬡ Zoning · 4". The full words stay in the button's label.
   The width is set in the browser pass (spec C.1); 1365px is the start. */
@media (max-width: 1365px) {
  .zl-count-more { display: none; }
}
/* Narrower still, where shell.css lets the header wrap (1160px and down),
   even " · 4" pushed it onto a second row and made the map 41px shorter
   (review f3, measured in a browser: 1067 to 1103px wide in the Sandbox).
   There the number sits on the button's corner like the bell's badge and
   takes no room in the row, so the header is the same with or without it.
   The " · " is not drawn (font-size 0); the button's label still says the
   full words. */
@media (max-width: 1160px) {
  #zonesModeBtn { position: relative; }
  #zoningCount { position: absolute; top: -7px; right: -6px; font-size: 0; line-height: 0; }
  #zoningCount b,
  #zoningCount.zl-red b {
    display: inline-block;
    min-width: 19px; height: 19px; padding: 0 5px;
    border: 2px solid var(--cc-dk); border-radius: 999px;
    background: var(--warn); color: var(--warn-on);
    font-size: 10px; font-weight: 900; line-height: 15px; text-align: center;
  }
  #zoningCount.zl-red b { background: var(--danger); color: var(--danger-on); }
}

/* ================================ the head ================================ */

.zl-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px;
}
#zlHead { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; }

/* ----------------------------- buttons and links -------------------------- */

.zl-btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 700; line-height: 1.2;
  cursor: pointer;
}
.zl-btn:hover { background: var(--panel-3); }
.zl-btn.zl-primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.zl-btn.zl-primary:hover { background: var(--accent); filter: brightness(1.08); }
.zl-btn.zl-danger { background: var(--danger); color: var(--danger-on); border-color: var(--danger); }
.zl-btn.zl-danger:hover { background: var(--danger); filter: brightness(1.08); }
.zl-btn.zl-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.zl-btn.zl-ghost:hover { background: var(--panel-2); color: var(--ink); }
.zl-btn.zl-small { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.zl-btn:disabled,
.zl-btn[aria-disabled="true"] { opacity: .5; cursor: default; filter: none; }
.zl-btn.zl-primary:disabled { background: var(--panel-3); color: var(--muted); border-color: var(--line-2); opacity: 1; }

/* A real link ("Open the list", "Open the Data editor"). */
.zl-link { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.zl-link:hover { color: var(--ink); }

/* --------------------------------- the tabs ------------------------------- */

.zl-tabs {
  display: flex; gap: 2px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.zl-tab {
  appearance: none;
  flex: 1 1 auto;
  min-height: 36px;
  padding: 7px 6px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.zl-tab:hover { color: var(--ink); background: var(--panel-2); }
.zl-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.zl-tab-n {
  display: inline-block; min-width: 18px; margin-left: 5px; padding: 1px 5px;
  border-radius: 999px; background: var(--chip); color: var(--ink);
  font-size: 11px; font-weight: 800; text-align: center;
}
.zl-tab-n.zl-red { background: var(--danger); color: var(--danger-on); }
.zl-panel[hidden] { display: none; }

/* --------------------- words above and around the rows -------------------- */

/* What just happened (Approved, Undone, Rejected, Kept), with its Undo. It
   takes focus, so it shows where the words are. */
#zlNote {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  background: var(--ok-bg);
}
#zlNote:empty, #zlNote[hidden] { display: none; }
#zlNote:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
#zlNote.zl-bad { border-left-color: var(--danger); background: var(--danger-bg); }
.zl-note-line { margin: 0 0 6px; }
.zl-note-line:last-child { margin-bottom: 0; }
.zl-note-line.zl-strong { font-weight: 800; }
.zl-note-line.zl-soft { color: var(--muted); font-size: 12px; }
.zl-note-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }

/* The list cannot run right now (saving, planning, not stored). */
.zl-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-weight: 600;
}
.zl-banner.zl-bad { background: var(--danger-bg); color: var(--danger-ink); }

/* A holiday is 0 to 21 days away. Not a change, and not in the count. */
.zl-holiday {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.zl-holiday-text { flex: 1 1 150px; min-width: 0; }

.zl-empty { margin: 4px 0 12px; color: var(--muted); }

/* ================================ list rows =============================== */

.zl-rows { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }

/* One change waiting. The whole row is the button. */
.zl-row {
  appearance: none;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: 9px; row-gap: 2px;
  width: 100%;
  min-height: 36px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.zl-row:hover { border-color: var(--line-2); background: var(--panel-3); }
/* The one that is open over the map. */
.zl-row.zl-on,
.zl-row[aria-current="true"] { border-color: var(--accent); background: var(--panel-3); }
.zl-row.zl-red { border-left: 4px solid var(--danger); }
.zl-row:disabled { opacity: .55; cursor: default; }

/* The dot is decoration: the status is printed in .zl-row-status. */
.zl-dot {
  grid-column: 1; grid-row: 1;
  align-self: start;
  width: 10px; height: 10px; margin-top: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--muted);
}
.zl-dot.zl-dot-muted { background: var(--muted); }                                     /* Not checked yet */
.zl-dot.zl-dot-ready { background: var(--accent); }                                    /* Ready to approve */
.zl-dot.zl-dot-ok { background: var(--warn); }                                      /* Needs your OK */
.zl-dot.zl-dot-ring { background: transparent; border-color: var(--line-2); }         /* Nothing to approve, Add details first */
.zl-dot.zl-dot-keep { background: transparent; border-color: var(--accent); }         /* Check and keep */
.zl-dot.zl-dot-red { background: var(--danger); }                                    /* a red day */

.zl-row-title  { grid-column: 2; font-weight: 800; overflow-wrap: anywhere; }
.zl-row-line   { grid-column: 2; color: var(--muted); overflow-wrap: anywhere; }
.zl-row-status { grid-column: 2; font-size: 12px; font-weight: 700; color: var(--muted-2); }
.zl-row-red    { color: var(--danger-ink); font-weight: 800; }                  /* the words "Red day" */

/* A fold: "Set aside (3)", "To enter in Aspire: 4 lines", a crew's names. */
.zl-fold {
  appearance: none;
  display: flex; align-items: center; gap: 7px;
  width: 100%;
  min-height: 36px;
  padding: 6px 2px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.zl-fold:hover { color: var(--accent); }
.zl-fold::before { content: "\25B8"; flex: none; width: 12px; color: var(--muted); }
.zl-fold[aria-expanded="true"]::before { content: "\25BE"; }
.zl-fold-body { margin: 0 0 10px; padding: 2px 0 0 19px; }
.zl-fold-body[hidden] { display: none; }

/* Set aside: greyed, with its reason and a way back. */
.zl-set-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.zl-set-row:last-child { border-bottom: 0; }
.zl-set-text { flex: 1 1 150px; min-width: 0; }
.zl-set-title { display: block; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.zl-set-state { display: block; font-size: 12px; }
.zl-set-still { color: var(--danger-ink); font-weight: 700; }

/* Done: what was approved or fixed, newest first. */
.zl-done-row {
  margin: 0 0 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.zl-done-row.zl-undone { color: var(--muted); }
.zl-done-title { margin: 0; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.zl-done-meta  { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.zl-done-state { font-weight: 800; color: var(--ink); }
.zl-done-row.zl-undone .zl-done-state { color: var(--muted); }
.zl-done-acts  { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
/* Why there is no Undo button. Words in place of a dead button. */
.zl-done-why   { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.zl-done-busy  { margin: 8px 0 0; font-weight: 700; }                           /* Checking…, Saving… */
.zl-done-row .zl-fold { margin-top: 8px; }

/* Missing details. */
.zl-miss-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.zl-miss-row:last-child { border-bottom: 0; }
.zl-miss-name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.zl-miss-what { display: block; color: var(--warn-ink); font-size: 12.5px; }

.zl-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ==================== the change, floating over the map =================== */

/* Rule 3: bottom 84px. The slot the planner's own right-hand panels use. */
#zlCard {
  position: absolute;
  right: 18px; top: 18px; bottom: 84px;
  z-index: 9;
  width: min(420px, calc(100% - 300px));
  display: flex; flex-direction: column;
  min-height: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 13px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}
#zlCard[hidden] { display: none; }

/* While a change is open the planner's own panels step aside. Not
   display:none: the planner measures that box when it frames a route. */
body.zoning-card #mapPanels { visibility: hidden; pointer-events: none; }
/* The map's zoom buttons and the search box stay clear of the change. */
body.zoning-card .mapwrap .maplibregl-ctrl-top-right { right: calc(min(420px, 100% - 300px) + 28px); }
body.zoning-card .mapwrap .mapsearch { width: min(340px, calc(100% - min(420px, 100% - 300px) - 76px)); }
/* A narrow window with the list showing: the crew's own card (320px from the
   left) would sit half under the change, with its close button covered. It
   comes back when the change closes or the list is collapsed. */
@media (max-width: 1130px) {
  body.zoning-card .shell:not(.collapsed) .crewpop { display: none; }
}

.zl-card-head {
  flex: none;
  position: relative;
  padding: 13px 44px 10px 15px;
  border-bottom: 1px solid var(--line);
}
#zlCardTitle { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.zl-card-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.zl-close {
  appearance: none;
  position: absolute; top: 7px; right: 7px;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-size: 18px; line-height: 1;
  cursor: pointer;
}
.zl-close:hover { background: var(--panel-3); }

.zl-card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 15px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* The buttons stay at the foot of the change while its body scrolls. */
.zl-card-foot {
  flex: none;
  padding: 10px 15px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.zl-acts { display: flex; flex-wrap: wrap; gap: 8px; }
/* Why Approve is off, in words. */
.zl-card-why { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.zl-card-why:empty { display: none; }
.zl-card-why .zl-btn { margin-left: 6px; }

/* "The book changed, so RouteLogic prepared this again at 9:42." */
.zl-notice {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-weight: 600;
}

/* The plan line and its notes. */
.zl-plan { margin: 0 0 4px; font-weight: 700; }
.zl-plan-note { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }

/* A part of the change: its heading, a hint under it. */
.zl-sec { margin: 14px 0 0; }
.zl-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
.zl-sec-title {
  margin: 0;
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.zl-sec-hint { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }

/* Checking… The words are painted before the page blocks; nothing spins. */
.zl-checking { margin: 6px 0 0; }
.zl-checking-word { margin: 0; font-size: 15px; font-weight: 800; }
.zl-checking-line { margin: 4px 0 0; color: var(--muted); }
/* The numbers from the last check, while a new one runs. */
.zl-old { opacity: .5; }

/* Nothing to approve, details missing, or the check could not run. */
.zl-nothing {
  margin: 6px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.zl-nothing p { margin: 0 0 6px; }
.zl-nothing p:last-child { margin-bottom: 0; }
.zl-nothing .zl-lead { font-weight: 800; }
.zl-nothing.zl-bad { border-color: var(--danger); background: var(--danger-bg); }
.zl-stuck { margin: 6px 0 0; padding-left: 18px; }
.zl-stuck li { margin: 0 0 3px; }

/* -------------------------------- the checks ------------------------------ */

.zl-checks { margin: 10px 0 0; padding: 0; list-style: none; }
.zl-check {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.zl-check:last-child { border-bottom: 0; }
/* The mark is decoration. The word after it says the same thing. */
.zl-check-mark { font-weight: 900; text-align: center; color: var(--muted); }
.zl-check-word { font-weight: 800; margin-right: 5px; }
.zl-check.zl-pass .zl-check-mark, .zl-check.zl-pass .zl-check-word { color: var(--accent); }
.zl-check.zl-look .zl-check-mark, .zl-check.zl-look .zl-check-word { color: var(--warn-ink); }
.zl-check.zl-fail .zl-check-mark, .zl-check.zl-fail .zl-check-word { color: var(--danger-ink); }
.zl-check.zl-fail { background: var(--danger-bg); margin: 0 -6px; padding-left: 6px; padding-right: 6px; border-radius: 6px; }
/* Report changes: "This is already saved." */
.zl-saved { margin: 6px 0 0; font-weight: 700; color: var(--muted); }

/* ------------------------------ hours per day ----------------------------- */

.zl-hours {
  width: 100%;
  margin: 4px 0 6px;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.zl-hours th, .zl-hours td {
  padding: 5px 5px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.zl-hours thead th { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.zl-hours tbody th { font-weight: 700; white-space: nowrap; }
/* A day this change alters: "7h05 → 7h20", outlined. */
.zl-hours td.zl-chg { font-weight: 800; outline: 1.5px solid var(--accent); outline-offset: -2px; background: var(--ok-bg); }
/* Past the limit after the change. The words "past the limit" are printed
   under the time (.zl-cell-note); the red is not the only sign. */
.zl-hours td.zl-over { color: var(--danger-ink); background: var(--danger-bg); outline-color: var(--danger); }
.zl-hours td.zl-held { color: var(--warn-ink); }
.zl-hours td.zl-none { color: var(--faint); }
.zl-cell-note { display: block; font-size: 10.5px; font-weight: 700; line-height: 1.2; }
.zl-cell-add  { display: block; font-size: 10.5px; font-weight: 600; line-height: 1.2; color: var(--muted); }
.zl-hours-foot { margin: 0 0 3px; font-size: 12.5px; }
.zl-hours-foot.zl-soft { color: var(--muted); font-size: 12px; }

/* ---------------------------------- rows ---------------------------------- */

.zl-ops { margin: 0; padding: 0; list-style: none; }

/* "Crew 7 · Tuesday 6h40 → 7h10": a button that shows that day on the map. */
.zl-group-head {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 36px;
  margin: 10px 0 2px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: var(--chip);
  color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.zl-group-head:hover { background: var(--panel-3); }
/* A heading that is words only ("Also changed in this save", "Fixed at 9:42"). */
.zl-group-title { margin: 12px 0 2px; font-size: 12.5px; font-weight: 800; }

.zl-op {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: start;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.zl-op:last-child { border-bottom: 0; }
.zl-op-main { grid-column: 2; min-width: 0; }
/* A row with no tick box keeps its words in line with the others. */
.zl-op.zl-plain { grid-template-columns: minmax(0, 1fr) auto; }
.zl-op.zl-plain .zl-op-main { grid-column: 1; }
/* Left out of the check, still listed. The tag "Left out" says so in words. */
.zl-op.zl-out .zl-op-main { opacity: .55; }

/* Rule 5. The label is the 36px target; the box sits inside it. */
.zl-tick {
  grid-column: 1;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px;
  min-height: 36px;
  margin: -4px 0 0 -8px;
  cursor: pointer;
}
.zl-tick input[type="checkbox"] {
  width: 20px; height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.zl-tick input[type="checkbox"]:disabled { cursor: default; }

.zl-op-name { font-weight: 700; overflow-wrap: anywhere; }
.zl-op-move { display: block; font-variant-numeric: tabular-nums; }             /* Crew 2 Fri → Crew 2 Wed */
.zl-op-meta { display: block; font-size: 12px; color: var(--muted); }           /* 45 min · once a week */
.zl-op-why  { display: block; font-size: 12px; color: var(--muted); }
.zl-op-now  { display: block; font-size: 12px; font-weight: 700; color: var(--warn-ink); }   /* Now on Crew 9 Thu. */
.zl-op-lock { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }       /* It can't be left out. */

/* Rule 5 again. */
.zl-move {
  appearance: none;
  grid-column: -2 / -1;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.zl-move:hover { background: var(--chip); }
.zl-move:disabled { opacity: .5; cursor: default; }

/* What kind of row. The word is the badge; the colour only groups them. */
.zl-badge {
  display: inline-block;
  margin: 0 5px 2px 0;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 800; line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
}
.zl-badge.zl-badge-new { background: var(--ok-bg);     color: var(--accent);     border-color: var(--accent); }   /* New */
.zl-badge.zl-badge-day { background: var(--warn-bg);   color: var(--warn-ink); }                                  /* Day change */
.zl-badge.zl-badge-crew { background: var(--warn);      color: var(--warn-on); }                                   /* Crew change */
.zl-badge.zl-badge-off { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger); }   /* Comes off */

/* Other area, Fixed day, Makes room for …, Also changes day, Left out. */
.zl-tag {
  display: inline-block;
  margin: 0 5px 2px 0;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--chip);
  color: var(--ink);
  font-size: 10.5px; font-weight: 700; line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
}
.zl-tag.zl-tag-warn { border-color: var(--warn); color: var(--warn-ink); background: var(--warn-bg); }
.zl-tag.zl-tag-out { border-style: dashed; color: var(--muted); background: transparent; }

.zl-more { margin: 8px 0 0; }                                                   /* Show all 74, and 3 more */

/* A workbook import: one line per crew, each opens to its names. */
.zl-names { margin: 0; padding-left: 18px; color: var(--muted); }
.zl-names li { margin: 0 0 2px; overflow-wrap: anywhere; }

/* ------------------------------- Aspire lines ----------------------------- */

.zl-aspire { margin: 0; padding: 0; list-style: none; }
.zl-aspire li { padding: 5px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.zl-aspire li:last-child { border-bottom: 0; }
.zl-aspire b { font-weight: 700; }
.zl-aspire-foot { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ====================== on the map: banner and legend ===================== */

/* "Preview · nothing is changed yet", Show before, Show on map, the day
   buttons and the ring legend. Bottom left, above the planner's own legend,
   and never under the change. */
.zl-mapbar {
  position: absolute;
  left: 14px; bottom: 60px;
  z-index: 8;
  max-width: calc(100% - min(420px, 100% - 300px) - 50px);
  padding: 9px 12px;
  border: 1.5px solid var(--warn);
  border-radius: 11px;
  background: var(--glass);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  line-height: 1.4;
}
.zl-mapbar[hidden] { display: none; }
/* Already saved: this is the routes as they are, not a preview. */
.zl-mapbar.zl-mapbar-saved { border-color: var(--accent); }
/* "Before": the map is showing the routes as they are now. */
.zl-mapbar.zl-mapbar-before { border-color: var(--line-2); }
.zl-mapbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.zl-mapbar-row + .zl-mapbar-row { margin-top: 7px; }
.zl-mapbar-text { font-weight: 800; }
.zl-mapbar-days { color: var(--muted); }

.zl-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  margin: 8px 0 0; padding: 7px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 11.5px;
  color: var(--muted);
}
.zl-legend[hidden] { display: none; }
.zl-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* The swatches. zoning-list.js sets each one's colour from the map's own
   theme (ZoningMap.colours()), so the legend and the rings are one colour;
   the tokens below are what shows until it has. */
.zl-ring {
  display: inline-block; flex: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--muted);
  background: transparent;
}
.zl-ring.zl-ring-new { border-color: var(--accent); }                                  /* New */
.zl-ring.zl-ring-crew { border-color: var(--warn); border-width: 3.5px; }               /* Changes crew: thick */
.zl-ring.zl-ring-day { border-color: var(--warn); border-width: 1.5px; }               /* Changes day: thin */
.zl-ring.zl-ring-off { border-color: var(--danger); }                                  /* Comes off */
.zl-line {
  display: inline-block; flex: none;
  width: 24px; height: 0;
  border-top: 3px solid var(--muted);
}
.zl-line.zl-line-old { border-top-color: var(--faint); }                               /* Old route */
.zl-line.zl-line-link { border-top-style: dashed; border-top-color: var(--accent); }    /* Where new work lands */
