/* Move a stop / Swap crews dialogs (moves-ui.js). Uses the theme tokens so it
   reads in both light and dark; fallbacks are the light values. */
.mv-back {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: start center;
  /* Charcoal, not the old green-black (v195, palette B). */
  padding: 6vh 16px 16px; background: rgba(17, 19, 27, .55); overflow: auto;
}
.mv-back[hidden] { display: none; }
.mv-dialog {
  width: min(720px, 100%); border-radius: 14px; border: 1px solid var(--line, #d7e3dc);
  background: var(--panel, #fff); color: var(--ink, #12251b);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35); font-size: 14px;
}
.mv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line, #d7e3dc);
}
.mv-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.mv-x {
  border: 0; background: transparent; color: var(--muted, #5b7366); font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.mv-x:hover { background: var(--panel-2, #f3f7f5); }
.mv-body { padding: 14px 18px 18px; }
.mv-intro { line-height: 1.45; }
.mv-sub { display: block; color: var(--muted, #5b7366); font-size: 13px; margin-top: 2px; }
.mv-controls { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 13px; color: var(--muted, #5b7366); }
.mv-seg { display: inline-flex; border: 1px solid var(--line, #d7e3dc); border-radius: 8px; overflow: hidden; }
.mv-seg button {
  border: 0; background: var(--panel-2, #f3f7f5); color: var(--ink, #12251b);
  padding: 5px 12px; font: inherit; font-weight: 700; cursor: pointer;
}
.mv-seg button + button { border-left: 1px solid var(--line, #d7e3dc); }
.mv-seg button.on { background: var(--primary, #0b5a3c); color: var(--primary-on, #fff); }
.mv-out h3 {
  margin: 16px 0 6px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted, #5b7366);
}
.mv-note { margin: 6px 0; color: var(--muted, #5b7366); font-size: 13px; line-height: 1.45; }
.mv-bad {
  margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4;
  border: 1px solid var(--danger-line, #e0b4b4); background: var(--danger-bg, rgba(197, 57, 57, .1));
  color: var(--danger-ink, #9c2b2b);
}
/* Plain and advisory notes (v195): "Nowhere fits" and "No way to make room"
   are not broken rules, so they are not red. */
.mv-plain {
  margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4;
  border: 1px solid var(--line, #d7e3dc); background: var(--panel-2, #f3f7f5); color: var(--ink, #12251b);
}
.mv-caution {
  margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4;
  border: 1px solid var(--warn-ink, #805300); background: var(--warn-bg, rgba(181, 119, 5, .12)); color: var(--warn-ink, #805300);
}
.mv-good {
  margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--ok-bg);
}
.mv-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 5px 0;
  border: 1px solid var(--line, #d7e3dc); border-radius: 10px; background: var(--panel-2, #f3f7f5);
}
.mv-row.best { border-color: var(--cc-lt, #3f9e6d); }
.mv-main { flex: 1; min-width: 0; }
.mv-main b { display: block; }
.mv-meta { display: block; color: var(--muted, #5b7366); font-size: 12.5px; line-height: 1.4; }
.mv-btn {
  flex: none; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--line, #d7e3dc);
  background: var(--panel, #fff); color: var(--ink, #12251b); font: inherit; font-weight: 700; cursor: pointer;
}
.mv-btn:hover { border-color: var(--line-2, #b9cdc2); }
.mv-btn.go { background: var(--primary, #0b5a3c); border-color: var(--primary, #0b5a3c); color: var(--primary-on, #fff); }
.mv-btn.warn { border-color: var(--warn-ink, #805300); color: var(--warn-ink, #805300); }
.mv-btn:disabled { opacity: .5; cursor: default; }
/* A swap that would put a day past 8 hours is refused, not offered "anyway"
   (Arian, 2026-10-16). Kept readable rather than faded — it says why. */
.mv-btn.refused:disabled {
  opacity: 1; cursor: not-allowed; white-space: normal; text-align: left;
  border-color: var(--danger-line, #e0b4b4); background: var(--danger-bg, rgba(197, 57, 57, .1));
  color: var(--danger-ink, #9c2b2b);
}
/* …except a swap refused because a day is LOCKED inside 8 hours (v190): the
   same readable greyed button, not red — a lock is not a broken rule. */
.mv-btn.refused.locked:disabled {
  border-color: var(--line-2, #b9cdc2); background: var(--panel-2, #f3f7f5); color: var(--ink, #12251b);
}
.mv-chain { margin: 0 0 8px 12px; }
.mv-chain .mv-btn { margin-top: 8px; }
.mv-list { margin: 6px 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.mv-more { margin-top: 12px; font-size: 13px; color: var(--muted, #5b7366); }
.mv-more summary { cursor: pointer; }
.mv-hours { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.mv-hours th, .mv-hours td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line, #d7e3dc); }
.mv-hours th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #5b7366); }
.mv-hours td.chg { font-weight: 800; background: var(--ok-bg); }
.mv-hours td.over { color: var(--danger-ink, #9c2b2b); background: var(--danger-bg, rgba(197, 57, 57, .1)); }
/* Inside the day's grace period (a last resort): amber, not red. */
.mv-hours td.grace { color: var(--warn-ink, #805300); background: var(--warn-bg, rgba(181, 119, 5, .12)); }
.mv-grace { color: var(--warn-ink, #805300); font-weight: 600; }
.mv-hours td.off { color: var(--muted, #5b7366); }
.mv-swapctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.mv-swapctl select {
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line, #d7e3dc);
  background: var(--panel-2, #f3f7f5); color: var(--ink, #12251b); font: inherit;
}
/* The sentence under the four boxes: what the swap means, or why it cannot be
   done (2026-10-15). Red only for the refusals. */
.mv-said { margin: 0 0 8px; }
.mv-said.bad { color: var(--danger-ink, #9c2b2b); }
/* The planner's stop rows and header get a small action button each. */
.stop-move {
  margin-left: 6px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line, #d7e3dc);
  background: transparent; color: inherit; font: inherit; font-size: 11.5px; cursor: pointer;
}
.stop-move:hover { background: var(--chip, rgba(0, 0, 0, .06)); }

/* Undo for the last move or swap — bottom of the screen, clear of the dialogs,
   and a row above where the pages put their own short-lived toasts. */
.mv-undo {
  position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 3900;
  display: flex; align-items: center; gap: 12px; max-width: min(720px, calc(100vw - 32px));
  padding: 10px 12px 10px 16px; border-radius: 12px;
  background: var(--ink, #12251b); color: var(--panel, #fff);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35); font-size: 14px;
}
.mv-undo[hidden] { display: none; }
/* ⚠️ THE BAR'S WORDS WRAP, THEY ARE NEVER CUT (audit 2026-11-03, medium
   ENG-4 / B1, review). They were one line with an ellipsis, so "RouteLogic
   also moved 3 other stops when it saved: …" was cut on a desktop (the
   names and "Undo puts them back too" never showed) and hidden whole on a
   narrow window or after Make room's long label. Now they wrap, and the
   save's sentence is a line of its own under what was done. It names at
   most three stops, so the bar stays a few lines at most. The bar is as
   wide as its words up to its cap (width: max-content): pinned at left 50%
   it would otherwise shrink to half the screen once its words may wrap. */
.mv-undo { width: max-content; }
.mv-undo-text { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.mv-undo-also { display: block; margin-top: 3px; opacity: .85; }
.mv-undo-btn {
  border: 0; border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 800; cursor: pointer;
  background: var(--accent, #2fb36b); color: var(--accent-on, #06140e); flex: none;
}
.mv-undo-x { border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; font-size: 14px; flex: none; }
.mv-undo-x:hover { opacity: 1; }

/* A crew-day the office holds past 8 hours (v189): a person's decision, said
   in red wherever it shows, and the "Put it here anyway…" form that makes one. */
.mv-held { color: var(--danger-ink, #a3271b); font-weight: 600; }
/* …and one the office has LOCKED inside 8 hours (v190): said, not red. */
.mv-locked { color: var(--ink, inherit); font-weight: 600; }
.mv-hold-form { text-align: left; margin-top: 6px; }
.mv-hold-say { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; }
.mv-hold-label { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 700; }

/* "Make room" as numbered steps (#5, 2026-10-17): which property, from which
   crew-day, to where, with its address and the hours of the day it lands on. */
.mv-plan { margin: 6px 0 4px; }
.mv-plan-head { margin: 4px 0 6px; font-size: 13px; font-weight: 700; }
.mv-steps { margin: 0; padding-left: 22px; font-size: 13px; line-height: 1.45; }
.mv-step { margin: 0 0 8px; padding-left: 2px; }
.mv-step-who b { font-weight: 800; }
.mv-step-addr { display: block; color: var(--muted, #5b7366); font-size: 12px; }
.mv-step-move { margin-top: 1px; }
.mv-step-hours { color: var(--muted, #5b7366); font-size: 12px; font-variant-numeric: tabular-nums; }
.mv-step-hours.bad { color: var(--danger, #c0392b); font-weight: 700; }
.mv-step-hours.grace { color: var(--warn-ink, #805300); font-weight: 700; }
