/* Planner motion and bar (Ali, 30 Oct 2026; docs/redesign/planner-motion/PLAN.md, code planner/motion.js). The layer of flying
   copies (on the page body, so a redraw never cuts a flight short): clicks pass through it, and it is empty when nothing moves. */
.pl-fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.pl-fx-ghost { position: fixed; transform-origin: 0 0; will-change: transform, opacity; }
.pl-fx .pl-fx-shell { display: contents !important; } /* the page's own rules (grid, flex) must not lay out the empty parent copies */
.pl-fx-ghost .pl-fx-copy { margin: 0; width: 100%; height: 100%; box-sizing: border-box; box-shadow: 0 14px 30px rgba(13, 27, 42, 0.22); }
.pl-fx-ghost .face.pl-fx-copy, .pl-fx-ghost .face-pic.pl-fx-copy { box-shadow: none; border-radius: 50%; }
.pl-fx-ghost .pj.pl-fx-copy { background: #fff; border-radius: 10px; }
.pl-fx-slot { position: fixed; box-sizing: border-box; border: 2px dashed var(--link); border-radius: 10px; background: rgba(31, 95, 209, 0.06); }
.pl-fx-shock { position: fixed; box-sizing: border-box; border: 2px solid var(--link); border-radius: 50%; }

/* Batch 3: the first-click look. A picked job lifts, every crew says in a small tag how the job fits it, nothing fades or grows. */
.crew-fit { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font: 600 0.78rem/1.4 Barlow, system-ui, sans-serif; white-space: nowrap; overflow: visible; vertical-align: middle; }
.crew-fit.is-best { background: #E3F4EA; color: #12633A; max-width: 24ch; }
.crew-fit.is-near { background: #EEF3FC; color: #1F5FD1; }
.crew-fit.is-plain { background: #EDF0F4; color: #5A6677; }
.crew-fit.is-off { background: #FFF3D6; color: #7A4A06; }
.pl-page.is-picking .pl-crews .crew:hover { outline: 2px solid var(--link); outline-offset: 2px; }
.pl-page.is-picking .pl-crews .crew.is-best:hover { outline-width: 3px; }
.pl-crews .crew.is-crew-own { outline: 3px solid var(--link); outline-offset: 2px; }

/* Batch 4: every message is in the bar at the top; the notes box beside the photos is gone */
.pl-notes { display: none !important; }

/* Batch 5: the other jobs at the same branch. The list under the bar: one grid, nothing ticked, navy button (never amber). */
.pl-branch-list { position: fixed; left: 50%; transform: translateX(-50%); z-index: 70; width: min(620px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--ink); border-radius: 14px; box-shadow: 0 18px 44px rgba(13, 27, 42, 0.28); animation: pl-drop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: top center; }
@keyframes pl-drop { from { opacity: 0; transform: translateX(-50%) scale(0.96); } }
.pl-branch-list header { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px 6px; }
.pl-branch-list header b { font-size: 1.05rem; }
.pl-branch-list .pbl-tools { margin-left: auto; display: flex; gap: 12px; }
.pl-branch-list ul { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.pl-branch-list li label { display: grid; grid-template-columns: 20px 92px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line, #E1E6EC); cursor: pointer; }
.pl-branch-list li label:has(input:checked) { background: #EEF3FC; }
.pl-branch-list .pbl-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #5A6677); font-size: 0.85rem; }
.pl-branch-list footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line, #E1E6EC); background: #FAFBFC; border-radius: 0 0 14px 14px; }
@media (prefers-reduced-motion: reduce) { .pl-branch-list { animation: none; } }

/* Batch 6: the problems are in the bar and its list. The box beside the photos is gone: the photos get the full width. */
.pl-sticky.has-panel:not(.is-asking) { grid-template-columns: minmax(0, 1fr) !important; }
.pl-sticky.has-panel:not(.is-asking) > .pl-side { display: none; }
.pl-fixbadge { position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #E1251B; color: #fff; font: 700 0.75rem/18px Barlow, system-ui, sans-serif; text-align: center; border: 2px solid #fff; box-sizing: content-box; z-index: 1; }
.pl-fixbadge.is-warn { background: #D98A0B; }
#confirm .pl-fixbadge { position: static; display: inline-block; margin-left: 6px; border: 0; vertical-align: middle; }
#confirm.is-ready { background: #F5A524; border-color: #F5A524; color: #0D1B2A; }
#confirm.is-pulse { animation: pl-ready 1s ease-out 1; }
@keyframes pl-ready { 40% { box-shadow: 0 0 0 8px rgba(245, 165, 36, 0.35); } }
.pl-problem-list { position: fixed; left: 50%; transform: translateX(-50%); top: 120px; z-index: 70; width: min(640px, calc(100vw - 32px)); max-height: 50vh; overflow: auto; background: #fff; border: 1px solid var(--ink); border-radius: 14px; box-shadow: 0 18px 44px rgba(13, 27, 42, 0.28); animation: pl-drop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: top center; }
.pl-problem-list header { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px 4px; position: sticky; top: 0; background: #fff; z-index: 1; }
.pl-problem-list header b { font-size: 1.05rem; }
.pl-problem-list h4 { margin: 8px 16px 2px; font: 600 0.85rem 'Barlow Semi Condensed', system-ui, sans-serif; color: var(--muted, #5A6677); }
.pl-pl-row { display: grid; grid-template-columns: 10px 90px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 16px; border-top: 1px solid var(--line, #E1E6EC); max-height: 80px; overflow: hidden; transition: background 0.3s, max-height 0.2s ease-out, opacity 0.2s ease-out, padding 0.2s ease-out; }
.pl-pl-row > i { width: 9px; height: 9px; border-radius: 50%; background: #E1251B; }
.pl-pl-row.sev-warn > i, .pl-pl-row.sev-info > i { background: #D98A0B; }
.pl-pl-row b { font-size: 0.85rem; color: var(--muted, #5A6677); white-space: nowrap; }
.pl-pl-text { line-height: 1.3; }
.pl-pl-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pl-pl-row.is-fixed { background: #E8F6EE; }
.pl-pl-row.is-folding { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
.pl-pl-more { margin: 6px 16px 10px; }
.pl-pl-row[hidden] { display: none; }
.is-pointed { outline: 3px solid #E1251B; outline-offset: 2px; }
.is-pointed.is-pointed-warn { outline-color: #D98A0B; }
@media (prefers-reduced-motion: reduce) { .pl-problem-list, #confirm.is-pulse { animation: none; } .pl-pl-row { transition: none; } }

/* Batch 7: a job dragged onto a photo in the bar */
.pl-strip .face.is-over .face-pic { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 50%; }

/* Batch 8: removing. Remove Crew is always visible at the right end of the crew heading; the x buttons keep their look but get a bigger hit area. */
.pl-crews .crew-head { position: relative; }
.pl-crews .crew-head h3 { white-space: nowrap; flex: none; }
.crew-remove:hover, .crew-remove:focus-visible { color: #E1251B; border-color: #E1251B; }
.pj-move .icon-btn, [data-clear-transport] { position: relative; } /* the x on a photo is already positioned */
.crew .face-out::after, .pj-move .icon-btn::after, [data-clear-transport]::after { content: ""; position: absolute; inset: -7px; }
.pj-move .icon-btn + .icon-btn::after { inset: -7px -2px; }
.pl-crews .crew-face .face-out:hover { color: #E1251B; }
.crew-jobs .pj { position: relative; }
.crew-job-out { position: absolute; right: 8px; bottom: 6px; width: 24px; height: 24px; min-width: 0; min-height: 0; padding: 0; font-size: 0.7rem; color: var(--muted, #5A6677); opacity: 0; }
.pj:hover .crew-job-out, .crew-job-out:focus-visible { opacity: 1; }
.crew-job-out::after { content: ""; position: absolute; inset: -7px; }
.crew-job-out:hover, .crew-job-out:focus-visible { opacity: 1; color: #E1251B; }

/* Confirm messages are in the bar too: the strip of text under the toolbar is gone */
#pl-issues-slot { display: none; }

/* Batch 10: every question and form of the Planner (Place, Undo, Not in the Field, Please Confirm, Withdraw) opens as a panel under the top bar,
   not beside the photos. One question at a time. */
body > dialog.pl-ask[open] { position: fixed; left: 50%; transform: translateX(-50%); top: 124px; z-index: 75; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 160px); margin: 0; box-shadow: 0 18px 44px rgba(13, 27, 42, 0.28); animation: pl-drop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { body > dialog.pl-ask[open] { animation: none; } }

/* the small red ! on a photo is gone: a photo that is not faded is a person who is not in a crew yet (Ali, 1 Nov 2026) */
.face.is-missed .face-pic::after { content: none; }
.face.is-pointed { outline: none; }
/* the fit tag takes its own line under the crew name, full text (Ali, 1 Nov 2026) */
.pl-crews .crew-head { flex-wrap: wrap; }
.pl-crews .crew-head .crew-fit { order: 5; flex: 0 0 auto; max-width: 100%; margin: 4px 0 0; white-space: normal; border-radius: 10px; }
.pl-crews .crew-head::after { content: none; }
.crew-fit.is-best { max-width: 100%; }

/* Remove Crew: a small x on the corner of the crew card, only on hover (Ali, 1 Nov 2026) */
.pl-crews .crew { position: relative; }
.crew-remove { position: absolute; right: -7px; top: -7px; width: 20px; height: 20px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%; font-size: 0.65rem; line-height: 1; background: var(--surface, #fff); border: 1px solid var(--line, #E1E6EC); color: var(--muted, #5A6677); opacity: 0; pointer-events: none; transition: opacity 0.12s ease-out; z-index: 2; }
.crew-remove::after { content: ""; position: absolute; inset: -6px; }
.crew:hover > .crew-remove, .crew:focus-within > .crew-remove { opacity: 1; pointer-events: auto; }

/* The question panel in the new look (Ali, 1 Nov 2026): the same card as the lists, the question as a small tag, choices as pills */
body > dialog.pl-ask[open] { border: 1px solid var(--ink); border-radius: 14px; padding: 0; gap: 0; overflow: auto; }
.pl-ask > form { gap: 0; }
.pl-ask header { padding: 14px 18px 10px; border-bottom: 1px solid #E1E6EC; }
.pl-ask h2 { font: 700 1.12rem/1.2 'Barlow Semi Condensed', 'Barlow', sans-serif; }
.pl-ask .pl-ask-body { padding: 4px 18px 6px; }
.pl-ask .pq { display: grid; grid-template-columns: 96px 1fr; align-items: start; gap: 6px 14px; padding: 12px 0; border-top: 1px solid #E1E6EC; }
.pl-ask .pq:first-child { border-top: 0; }
.pl-ask .pq h3 { justify-self: start; padding: 2px 10px; border-radius: 999px; background: #EDF0F4; color: #0D1B2A; font: 600 0.78rem/1.4 'Barlow', sans-serif; }
.pl-ask .pq p { grid-column: 2; margin: 0; font-size: 0.92rem; color: #0D1B2A; }
.pl-ask .pq-opts { grid-column: 2; flex-basis: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.pl-ask .pq-opts .check { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid #E1E6EC; border-radius: 999px; background: #fff; cursor: pointer; font-size: 0.9rem; transition: border-color 0.12s ease-out, background 0.12s ease-out; }
.pl-ask .pq-opts .check:hover { border-color: #1F5FD1; }
.pl-ask .pq-opts .check:has(input:checked) { border-color: #1F5FD1; background: #EEF3FC; color: #1F5FD1; font-weight: 600; }
.pl-ask .pq-opts .check input { accent-color: #1F5FD1; margin: 0; }
.pl-ask footer { padding: 12px 18px 14px; border-top: 1px solid #E1E6EC; background: #F8F9FB; border-radius: 0 0 14px 14px; position: sticky; bottom: 0; }
.pl-ask .form-error:not(:empty) { margin: 0 18px 8px; }
@media (max-width: 600px) { .pl-ask .pq { grid-template-columns: 1fr; } .pl-ask .pq p, .pl-ask .pq-opts { grid-column: 1; } }
.pl-page .pj.is-selected, .pl-page .pl-pool .pj.is-selected.is-overdue, .pl-page .pl-pool .pj.is-selected.is-carried, .pl-page .pl-crews .crew-jobs .pj.is-selected.is-red-edge { background: var(--accent-soft); } /* a picked job looks the same whether it is late or not */
/* the Transport slot of the crew being answered in the bar lights up (Ali, 1 Nov 2026) */
.transport-slot.is-picking { border: 1px solid #1F5FD1; border-style: solid; background: #EEF3FC; color: #1F5FD1; box-shadow: 0 0 0 3px rgba(31, 95, 209, 0.18); }
