/* Dispatch Board — ✨ Plan day (js/planner.js). Every class here starts with .plan- so nothing reaches the rest of the
   board; everything else in the drawer (.kpi-card, .req-chip, .assist-box, .btn, .table-wrap, .view-bar) is the app's own.
   Colours come from the theme variables, so it follows the accent and light/dark like every other screen. */

.plan-run { margin-bottom: 12px; flex-wrap: wrap; }
.plan-run .plan-tune { margin-left: auto; }

.plan-kpis { margin: 4px 0 2px; }
.plan-saved { margin: 2px 0 10px; color: var(--ink-muted); }

.plan-views { margin: 6px 0 10px; display: flex; align-items: center; gap: 6px; }
.plan-views .spacer { flex: 1; }

.plan-table { border: 1px solid var(--border); border-radius: 8px; }
.plan-table td { vertical-align: top; }
.plan-table td:nth-child(2) { min-width: 118px; }
.plan-table td:nth-child(3) { min-width: 116px; }
.plan-table .plan-driver { border: 1px solid var(--border-strong); border-radius: var(--ctl-radius, 8px); padding: 4px 8px; font: inherit; font-size: var(--fs-md); background: var(--surface-2); color: var(--ink); max-width: 100%; }
.plan-why-cell { max-width: 400px; font-size: var(--fs-md); }
.plan-why-cell .req-chip { margin: 3px 4px 0 0; }

/* "Why not Joe?" — the next best drivers and what each would cost. */
.plan-link { background: none; border: none; padding: 2px 0 0; margin: 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; text-align: left; }
.plan-link:hover { text-decoration: underline; }
.plan-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.plan-alts { margin-top: 6px; border-left: 2px solid var(--border-strong); padding-left: 9px; display: flex; flex-direction: column; gap: 5px; }
.plan-alt { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.plan-alt strong { font-size: var(--fs-md); }
.plan-alt .hint { flex: 1; min-width: 140px; }

/* The pin: this driver stays, plan the rest around it. */
.plan-pin { line-height: 1; padding: 4px 8px; }
.plan-pin.on { background: var(--accent-soft); border-color: var(--accent); }
tr.plan-pinned { background: var(--accent-soft); }

/* By driver: the chain for the day, with the gaps between moves. */
.plan-chain { margin-bottom: 10px; }
.plan-stop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 2px; border-top: 1px solid var(--border); }
.plan-stop:first-of-type { border-top: none; }
.plan-stop.new .load-id { color: var(--accent); }
.plan-stop .hint { flex: 1; min-width: 180px; }
.plan-leg { font-size: 12px; color: var(--ink-faint); padding: 3px 2px 3px 14px; border-left: 2px dashed var(--border-strong); margin-left: 10px; }

.plan-left { margin-top: 10px; padding: 9px 11px; border: 1px solid var(--border); border-left: 3px solid var(--status-risk); border-radius: 8px; background: var(--surface-2); }
.plan-left strong { display: block; font-size: var(--fs-md); margin-bottom: 3px; }

.plan-apply { margin-top: 10px; }

@media (max-width: 720px) {
  .plan-why-cell { max-width: none; }
  .plan-run .plan-tune { margin-left: 0; }
}
