/* =========================================================================
   views/delivery.css — the work board after a lead is Closed: Projects on the
   admin (a Websites and a Content board), Jobs in the client portal
   (src/features/delivery/). Prefix dlv-.

   The lanes and cards are the shared kanban primitives (components.css
   .kanban / .kcol / .kcol-head / .kcard). Here: the board's horizontal scroll
   (it can hold more stages than fit), lanes that scroll their own cards, the
   fixed Closed and Done lanes, a stage's dot / rename field / menu, the
   "+ Add stage" lane with its suggestions, the card's innards (name, the job,
   days in this stage, the target date, "Move to…") and the drag states.
   ========================================================================= */

/* ---- the board: lanes side by side, the board scrolls sideways, each lane scrolls its own cards ---- */
#viewScroll > .dlv-board {
  height: 100%; min-height: 0;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: var(--space-5);
  overscroll-behavior-x: contain;
}
.dlv-board > .kcol {
  /* lanes share the board's whole width (owner, 25 Nov 2026: "why dont these stages stretch full width?"); past what
     fits at 256px each the board scrolls sideways as before */
  flex: 1 0 0; min-width: 256px;
  min-height: 0; max-height: 100%;
  border-radius: var(--radius-lg);
  gap: 0;
  padding: var(--space-2-5) var(--space-2-5) 0;
}
.dlv-cards {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-2);
  margin: 0 calc(-1 * var(--space-1));
  padding: var(--space-0-5) var(--space-1) var(--space-2-5);
  scrollbar-width: thin;
}
/* the empty first lane says what lands in it (the others stay a clean plane) */
.dlv-hint {
  margin: var(--space-1) var(--space-1) 0;
  font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-soft);
}

/* ---- the lane head: dot · name · count · menu ---- */
.dlv-col .kcol-head { height: 32px; gap: var(--space-2); padding: 0 var(--space-0-5) var(--space-1-5); margin: 0; }
.dlv-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--board-slate); }
.dlv-dot[data-c="blue"]   { background: var(--board-blue); }
.dlv-dot[data-c="violet"] { background: var(--board-violet); }
.dlv-dot[data-c="pink"]   { background: var(--board-pink); }
.dlv-dot[data-c="orange"] { background: var(--board-orange); }
.dlv-dot[data-c="amber"]  { background: var(--board-amber); }
.dlv-dot[data-c="teal"]   { background: var(--board-teal); }
.dlv-dot[data-c="green"]  { background: var(--board-green); }
/* Closed is the Leads board's Closed (the same green); Done is the finish line, a tick rather than a dot */
.dlv-col[data-lane="closed"] .dlv-dot { background: var(--stage-won); }
.dlv-done-ico { flex: none; display: inline-flex; color: var(--text-soft); }
.dlv-done-ico svg { width: 15px; height: 15px; }

.dlv-col .kcol-head .title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* a stage's name is a button: click to rename (Closed and Done are fixed) */
.dlv-title-btn {
  min-width: 0; max-width: 100%; padding: 2px var(--space-1); margin: 0 calc(-1 * var(--space-1));
  border: 0; background: none; border-radius: var(--radius-xs);
  font: inherit; font-size: var(--text-md); font-weight: var(--fw-semibold); color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text;
}
@media (hover: hover) and (pointer: fine) {
  .dlv-title-btn:hover { background: var(--surface-hover); }
}
.dlv-rename {
  flex: 1 1 auto; min-width: 0; height: var(--control-xs);
  padding: 0 var(--space-1-5); margin: 0 calc(-1 * var(--space-1));
  font-size: var(--text-md); font-weight: var(--fw-semibold); color: var(--text-strong);
}
.dlv-col .kcol-head .chip-count { margin-left: 0; }
.dlv-info { display: inline-flex; color: var(--text-soft); }
.dlv-info svg { width: 14px; height: 14px; }
/* the lane's ⋯: shown on hover / keyboard focus, always on touch (STYLE-GUIDE §6) */
.dlv-col-menu { margin-left: auto; }
.dlv-col .kcol-head .chip-count + .dlv-col-menu { margin-left: auto; }
@media (hover: hover) and (pointer: fine) {
  .dlv-col-menu { opacity: 0; }
  .dlv-col:hover .dlv-col-menu, .dlv-col-menu:focus-visible, .dlv-col-menu[aria-expanded="true"] { opacity: 1; }
}
/* a stage is dragged by its head (Closed and Done stay put) */
.dlv-col[data-lane="stage"] .kcol-head { cursor: grab; }
.dlv-col.is-col-dragging { opacity: 0.5; }
.dlv-col.is-col-drop-before { box-shadow: inset 3px 0 0 var(--gray-400); }
.dlv-col.is-col-drop-after  { box-shadow: inset -3px 0 0 var(--gray-400); }

/* ---- the card: name, the job, then days in this stage (+ the admin's target date, "Move to…") ---- */
.dlv-card { padding: var(--space-2-5) var(--space-3); cursor: pointer; }
.dlv-card-top { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dlv-card-top .proj-logo { flex: none; }
.dlv-name {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--text-md); font-weight: var(--fw-semibold); color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlv-job {
  margin-top: var(--space-1); font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlv-foot { display: flex; align-items: center; gap: var(--space-2); min-height: 22px; margin-top: var(--space-2); }

/* days in this stage: quiet until it's been sitting a week (amber), then a fortnight (red) */
.dlv-age { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dlv-age svg { width: 13px; height: 13px; }
.dlv-age.tone-pill { padding: 1px var(--space-2) 1px var(--space-1-5); font-size: var(--text-xs); }

/* the admin's target date: "Due in 4 days" / "Due today" / "2 days late". A button (it sets the date). */
.dlv-due {
  display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; height: 22px;
  padding: 0 var(--space-1-5); margin-left: calc(-1 * var(--space-1-5));
  border: 0; background: none; border-radius: var(--radius-xs);
  font: inherit; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-muted); white-space: nowrap;
}
.dlv-due svg { width: 13px; height: 13px; color: var(--text-soft); flex: none; }
.dlv-due.is-warn { color: var(--warning-700); }
.dlv-due.is-bad  { color: var(--danger-700); }
.dlv-due.is-warn svg, .dlv-due.is-bad svg { color: currentColor; }
.dlv-due.is-empty { color: var(--text-soft); }
/* touch: no hover to reveal it, so an unset date is just the calendar icon */
@media (hover: none) { .dlv-due.is-empty span { display: none; } }
@media (hover: hover) and (pointer: fine) {
  .dlv-due:hover { background: var(--surface-hover); }
  .dlv-due.is-empty { opacity: 0; }
  .dlv-card:hover .dlv-due.is-empty, .dlv-card:focus-within .dlv-due.is-empty { opacity: 1; }
}

/* a closed lead with no package yet (admin): which board it belongs on */
.dlv-pkg {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 22px;
  padding: 0 var(--space-1-5) 0 var(--space-2); margin-top: var(--space-1-5);
  border: 1px dashed var(--border-strong); background: none; border-radius: var(--radius-xs);
  font: inherit; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-muted);
}
.dlv-pkg svg { width: 13px; height: 13px; }
@media (hover: hover) and (pointer: fine) {
  .dlv-pkg:hover { border-style: solid; background: var(--surface-hover); color: var(--text); }
}

/* "Move to…": dragging is fiddly on a touch screen, so every card carries one, before the age chip. With a mouse it is
   an icon that shows on hover / keyboard focus, in the empty middle of the footer (no shift when it appears). */
.dlv-move {
  display: inline-flex; align-items: center; gap: var(--space-1); flex: none; height: 22px;
  margin-left: auto; padding: 0 var(--space-1-5);
  border: 0; background: none; border-radius: var(--radius-xs);
  font: inherit; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-muted);
}
.dlv-move svg { width: 13px; height: 13px; }
/* the arrow and "Move to…" where there's no hover (touch); ⋯ on a desktop card's hover: its menu also removes it */
.dlv-move-ico, .dlv-more-ico { display: inline-flex; }
.dlv-more-ico { display: none; }
.dlv-more-ico svg { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) {
  .dlv-move { width: 22px; padding: 0; justify-content: center; opacity: 0; }
  .dlv-move-label, .dlv-move-ico { display: none; }
  .dlv-more-ico { display: inline-flex; }
  .dlv-card:hover .dlv-move, .dlv-card:focus-within .dlv-move { opacity: 1; }
  .dlv-move:hover { background: var(--surface-hover); color: var(--text); }
}

/* Done: the finish line. Its cards show the day they got there, never a stale colour. */
.dlv-col[data-lane="done"] .dlv-name { color: var(--text-muted); }
.dlv-older {
  align-self: flex-start; margin: var(--space-1) 0 0; padding: var(--space-1) var(--space-1-5);
  border: 0; background: none; border-radius: var(--radius-xs);
  font: inherit; font-size: var(--text-sm); color: var(--text-soft);
}
@media (hover: hover) and (pointer: fine) {
  .dlv-older:hover { background: var(--surface-hover); color: var(--text); }
}

/* ---- a board with no stages yet: "Set up stages" (the shared empty state) in place of its lanes ---- */

/* ---- the Stages sheet (the toolbar's gear): Closed and Done fixed, the board's stages between them ---- */
.dlv-stg-help { margin-bottom: var(--space-4); }
.dlv-stg { display: block; }
/* one list: Closed on top, the stages, Done at the bottom, divided by hairlines (Attio / Linear) */
.dlv-stg-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.dlv-stg-card > * + * { border-top: 1px solid var(--border-faint); }
.dlv-stg-list > .dlv-stg-row + .dlv-stg-row { border-top: 1px solid var(--border-faint); }
.dlv-stg-list { display: flex; flex-direction: column; gap: 0; }
.dlv-stg-list:empty { display: none; }
.dlv-stg-fixed {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-lg);
  padding: 0 var(--space-3); background: var(--surface-sunk); font-size: var(--text-sm);
}
.dlv-stg-fixed .dlv-done-ico svg { width: 14px; height: 14px; }
.dlv-stg-label { font-weight: var(--fw-semibold); color: var(--text); }
.dlv-stg-note { color: var(--text-soft); }
.dlv-stg-fixed .dlv-stg-count { margin-left: auto; }
.dlv-stg-row { min-height: var(--control-lg); padding: 0 var(--space-2) 0 var(--space-1); gap: var(--space-1); border: 0; border-radius: 0; box-shadow: none; background: var(--surface); }
.dlv-stg-row .drag-handle { margin-right: 0; }
.dlv-stg-color { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--radius-sm); background: none; }
.dlv-stg-color .dlv-dot { width: 10px; height: 10px; }
@media (hover: hover) and (pointer: fine) {
  .dlv-stg-color:hover { background: var(--surface-hover); }
}
.dlv-stg-name {
  flex: 1; min-width: 0; height: 30px; padding: 0 var(--space-1-5); border-radius: var(--radius-sm);
  font: inherit; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text); background: transparent;
}
.dlv-stg-name:focus { outline: none; background: var(--surface); box-shadow: var(--ring-primary); }
.dlv-stg-count { flex: none; min-width: 20px; text-align: center; font-size: var(--text-xs); color: var(--text-soft); font-variant-numeric: tabular-nums; }
/* touch screens: finger-sized rows (as components.css floors the app's own controls there) */
@media (pointer: coarse) {
  .dlv-stg-row { min-height: var(--control-lg); }
  .dlv-stg-row .drag-handle, .dlv-stg-color { width: var(--control-md); height: var(--control-md); }
  .dlv-stg-name { height: var(--control-md); }
}
.dlv-stg .dlv-suggest { padding: var(--space-3); }
/* "Add a stage": a quiet row in the board's own dashed style; the button shows once there is a name to add */
.dlv-stg-add { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-lg); margin-top: var(--space-3); padding: 0 var(--space-2) 0 var(--space-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-soft); }
.dlv-stg-add > svg { width: 14px; height: 14px; flex: none; }
.dlv-stg-add .field-bare { flex: 1; min-width: 0; height: var(--control-md); font-size: var(--text-sm); }
.dlv-stg-add .field-bare:placeholder-shown + button { display: none; }
.dlv-stg-add:focus-within { border-style: solid; border-color: var(--border-strong); background: var(--surface); }
/* an empty board's one-click suggestions (in the Stages sheet) */
.dlv-suggest { display: flex; flex-direction: column; gap: var(--space-2); }
.dlv-suggest-cap { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); }
.dlv-suggest-list { display: flex; flex-wrap: wrap; gap: var(--space-1-5); }
.dlv-chip {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 28px;
  padding: 0 var(--space-2-5) 0 var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); box-shadow: var(--shadow-xs);
  font: inherit; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text);
}
.dlv-chip svg { width: 14px; height: 14px; color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) {
  .dlv-chip:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
}
.dlv-chip:active { box-shadow: var(--press-inset); }
.dlv-suggest-all { align-self: flex-start; margin-top: var(--space-1); }

/* ---- the stage menu's colour row ---- */
.dlv-swatches { display: flex; flex-wrap: wrap; gap: var(--space-1-5); padding: var(--space-1-5) var(--space-2) var(--space-2); }
.dlv-swatch {
  position: relative; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none;
  display: inline-grid; place-items: center;
}
.dlv-swatch .dlv-dot { width: 14px; height: 14px; }
.dlv-swatch[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--text-strong); }
@media (hover: hover) and (pointer: fine) {
  .dlv-swatch:hover { background: var(--surface-hover); }
}
.dlv-menu-sep { height: 1px; margin: var(--space-1) 0; background: var(--border-faint); }
.dlv-menu-cap { padding: var(--space-1-5) var(--space-2) 0; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); }

/* ---- "Move to…": the lane list (a popover on desktop, the shared FilterSheet on a phone) ---- */
.dlv-move-menu { min-width: 232px; }
.dlv-move-menu .filter-opt { gap: var(--space-2-5); }
.dlv-move-menu .filter-opt > span:first-child { display: inline-flex; align-items: center; gap: var(--space-2-5); min-width: 0; }
/* the dots and Done's tick share one 14px slot, so every label starts in line */
.dlv-move-menu .dlv-dot { margin: 0 3px; }
.dlv-move-menu .dlv-done-ico svg { width: 14px; height: 14px; }

/* ---- drag and drop (the Leads board's states, components.css + leads.css) ---- */
.dlv-board .kcard.is-dragging { opacity: 0.9; cursor: grabbing; box-shadow: var(--shadow-lg); transform: rotate(-1.4deg) scale(1.02); }
.dlv-board .kcol.drag-over { box-shadow: inset 0 0 0 2px var(--gray-400); background: var(--surface-hover-strong); }
@media (prefers-reduced-motion: reduce) {
  .dlv-board .kcard.is-dragging { transform: none; opacity: 0.55; }
}

/* ---- phones: one lane at a time (the Leads board's layout), lanes as tall as the screen ---- */
@media (max-width: 640px) {
  #viewScroll > .dlv-board {
    scroll-snap-type: x mandatory;
    scroll-padding-inline: max(var(--space-4), var(--safe-left));
    padding: var(--space-3) max(var(--space-4), var(--safe-left)) 0;
    gap: var(--space-3);
  }
  .dlv-board > .kcol { flex: 0 0 84%; min-width: 0; max-width: none; scroll-snap-align: start; }
  .dlv-board > .kcol { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  /* room after Done, so the last lane scrolls clear of the edge */
  .dlv-board::after { content: ""; flex: 0 0 max(var(--space-1), calc(var(--safe-right) - var(--space-3))); }
  .dlv-card { padding: var(--space-3); }
  .dlv-name { font-size: var(--text-base); }
  .dlv-foot { min-height: 28px; }
  /* a real button at the card's right edge, under the thumb; the age moves to the middle */
  .dlv-foot .dlv-age { margin-left: auto; }
  .dlv-move { order: 3; height: 30px; margin-left: var(--space-1); padding: 0 var(--space-2-5); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--btn-shadow); color: var(--btn-fg); border-radius: var(--radius-sm); }
}

/* ---- the admin's board switch: Websites / Content, each with its open count (quiet text, §1c) ---- */
.dlv-seg-count { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); font-variant-numeric: tabular-nums; }
.dlv-boardseg button.active .dlv-seg-count { color: var(--text-muted); }
.dlv-dot--closed { background: var(--stage-won); }
.dlv-pkg-menu { min-width: 220px; }
.dlv-card.is-menu-open .dlv-move { opacity: 1; background: var(--surface-hover); }

/* ---- the admin's target date: the house date picker in a popover, Clear under it ---- */
.dlv-datepop { position: fixed; z-index: calc(var(--z-popover) + 2); width: 280px; padding: var(--space-2); }
.dlv-datepop .cal-area, .dlv-datepop .cal-area--date { min-height: 0; }
.dlv-datepop-foot { display: flex; justify-content: flex-end; padding: var(--space-1) 0 0; border-top: 1px solid var(--border-faint); margin-top: var(--space-1-5); }

/* ---- loading and a failed load ---- */
.dlv-card--skel { cursor: default; box-shadow: none; display: flex; flex-direction: column; gap: var(--space-2); }
.dlv-board > .dlv-error { flex: 1 1 auto; align-self: center; }

/* ---- "+ Add client" / "+ Add job" at the foot of Closed (the Leads board's Add Lead button) and its picker ---- */
.dlv-add-card { flex: none; height: var(--control-md); margin-top: var(--space-0-5); }
.dlv-pick-menu { width: 300px; padding: var(--space-1); display: flex; flex-direction: column; }
.dlv-pick-search { display: flex; align-items: center; gap: var(--space-2); height: var(--control-md); padding: 0 var(--space-2-5); margin-bottom: var(--space-1); border-bottom: 1px solid var(--border-faint); }
.dlv-pick-search svg { width: 15px; height: 15px; color: var(--text-soft); flex: none; }
.dlv-pick-search input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: none; font: inherit; font-size: var(--text-sm); color: var(--text); }
.dlv-pick-search input::placeholder { color: var(--text-placeholder); }
.dlv-pick-search:focus-within { border-bottom-color: var(--border-strong); }   /* (the bare field's one focus cue) */
.dlv-pick-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; }
.dlv-pick-list .filter-opt { height: auto; min-height: var(--control-md); padding-top: var(--space-1-5); padding-bottom: var(--space-1-5); }
.dlv-pick-list .filter-opt[hidden] { display: none; }
.dlv-pick-row { display: flex; align-items: center; gap: var(--space-2-5); min-width: 0; }
.dlv-pick-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.dlv-pick-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-pick-sub { font-size: var(--text-xs); color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* "New customer" under the list: a job typed in for someone who isn't a lead yet */
.dlv-pick-foot { margin-top: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--border-faint); }
.dlv-pick-foot .filter-opt { color: var(--text-strong); }
.dlv-pick-foot svg { width: 14px; height: 14px; color: var(--text-muted); }
.dlv-newjob-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 640px) { .dlv-newjob-pair { grid-template-columns: 1fr; } }
.dlv-pick-empty { margin: 0; padding: var(--space-3) var(--space-2-5); font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-soft); }
@media (max-width: 640px) {
  .dlv-pick-menu { width: auto; }
  .dlv-pick-list { max-height: 50dvh; }
}

/* ---- a card's value chip, and the job details sheet (click a card) ---- */
.dlv-value { flex: none; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dlv-det-stage { flex: none; height: 28px; padding: 0 var(--space-2) 0 var(--space-2-5); gap: var(--space-1-5); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--btn-shadow, var(--shadow-xs)); font: inherit; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text); cursor: pointer; }
.dlv-det-stage svg { width: 14px; height: 14px; color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .dlv-det-stage:hover { background: var(--surface-hover); } }
.dlv-det-stage[aria-expanded="true"] { box-shadow: var(--press-inset); }
/* the tab strip is the shared .segmented (as the lead drawer's); its gap below */
/* the top, by weight: the job and its stage, the value (the biggest thing here), then one quiet line */
.dlv-det-top { display: flex; flex-direction: column; gap: var(--space-1-5); margin-bottom: var(--space-6); }
.dlv-det-headstage { margin-left: auto; display: inline-flex; }
.dlv-det-title { width: 100%; height: 36px; margin-left: calc(-1 * var(--space-1-5)); padding: 0 var(--space-1-5); border-radius: var(--radius-sm); font-size: var(--text-2xl); font-weight: var(--fw-semibold); line-height: var(--leading-tight); color: var(--text-strong); }
.dlv-det-title::placeholder { color: var(--text-placeholder); }
@media (hover: hover) and (pointer: fine) { .dlv-det-title:hover { background: var(--surface-hover); } }
/* while typing it keeps the hover's grey fill and no ring (owner's call): the fill is what shows it's in focus */
.dlv-det-title:focus, .dlv-det-title:focus-visible { outline: none; box-shadow: none; background: var(--surface-hover); }
.dlv-det-value { display: flex; align-items: baseline; gap: var(--space-0-5); cursor: text; }
.dlv-det-value > span { font-size: var(--text-lg); font-weight: var(--fw-medium); color: var(--text-soft); }
.dlv-det-value .field-bare { flex: 1; min-width: 0; height: 30px; padding: 0; font-size: var(--text-lg); font-weight: var(--fw-medium); line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; background: none; box-shadow: none; }
.dlv-det-value .field-bare::placeholder { color: var(--text-placeholder); font-weight: var(--fw-medium); }
.dlv-det-meta { font-size: var(--text-sm); color: var(--text-soft); }
.dlv-tabs { margin-bottom: var(--space-5); }
.dlv-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1-5); }
.dlv-tabs button svg { width: 15px; height: 15px; }
/* tabs */
.dlv-det-cap { margin: 0 0 var(--space-1-5); font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-soft); }
.dlv-det-cap label { font: inherit; color: inherit; }
.dlv-det-cap + .dlv-props { margin-bottom: var(--space-5); }
.dlv-drop { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-6) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: none; font: inherit; font-size: var(--text-sm); color: var(--text-soft); cursor: pointer; }
.dlv-drop svg { width: 18px; height: 18px; }
.dlv-drop-main { color: var(--text-muted); font-weight: var(--fw-medium); }
.dlv-drop-main u { text-underline-offset: 3px; }
.dlv-drop-sub { margin-top: calc(-1 * var(--space-1)); font-size: var(--text-xs); color: var(--text-soft); }
.dlv-drop.is-compact { flex-direction: row; justify-content: center; padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.dlv-drop.is-compact svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .dlv-drop:hover { background: var(--surface-hover); color: var(--text-muted); } }
/* the contact list: label left, value right, hairline rows */
.dlv-props { margin: 0; }
.dlv-prop { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: var(--space-3); min-height: 38px; border-bottom: 1px solid var(--border-faint); }
.dlv-props .dlv-prop:first-child { border-top: 1px solid var(--border-faint); }
.dlv-prop dt { font-size: var(--text-sm); color: var(--text-soft); }
.dlv-prop-input { flex: 1; min-width: 0; }
.dlv-prop dd { margin: 0; min-width: 0; display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); color: var(--text); overflow-wrap: anywhere; }
.dlv-prop-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .dlv-prop-link:hover { text-decoration-color: currentColor; } }
.dlv-money { display: flex; align-items: center; width: 100%; color: var(--text-soft); }
.dlv-money .field-bare { margin-left: 0; font-variant-numeric: tabular-nums; color: var(--text); }
.dlv-det-drawer.is-dropping .dlv-det-drop, .dlv-det-drawer.is-dropping [data-det-drop] { outline: 2px dashed var(--text-soft); outline-offset: var(--space-1); border-radius: var(--radius-md); }
.dlv-files { list-style: none; margin: 0; padding: 0; }
.dlv-file { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: var(--space-1) 0; border-bottom: 1px solid var(--border); }
.dlv-file:last-child { border-bottom: 0; }
.dlv-file-ico { flex: none; display: inline-flex; color: var(--text-soft); }
.dlv-file-ico svg { width: 16px; height: 16px; }
.dlv-file-name { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font: inherit; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-file-meta { flex: none; font-size: var(--text-xs); color: var(--text-soft); white-space: nowrap; }
.dlv-file.is-uploading { opacity: .7; }
@media (hover: hover) and (pointer: fine) { .dlv-file-name:hover { text-decoration: underline; } }

/* ---- the empty board: Closed and Done as they are, one placeholder lane between them with the prompt in its middle ---- */
.dlv-board > .dlv-col--ghost { position: relative; overflow: hidden; border: 1px dashed var(--border-strong); background: transparent; }
.dlv-col--ghost .kcol-head .title { color: var(--text-soft); font-weight: var(--fw-medium); }
/* the texture fades out behind the words, so the prompt sits on clean space */
.dlv-col--ghost::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--border) 9px 10px);
  -webkit-mask-image: radial-gradient(ellipse 70% 38% at 50% 50%, transparent 40%, #000 100%); mask-image: radial-gradient(ellipse 70% 38% at 50% 50%, transparent 40%, #000 100%); }
.dlv-setup-prompt { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(100% - var(--space-8)); max-width: 260px; text-align: center; }
.dlv-setup-title { margin: 0; font-size: var(--text-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.dlv-setup-desc { margin: var(--space-1) 0 var(--space-4); font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-muted); }
.dlv-setup-cta { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.dlv-setup-alt { padding: var(--space-1) var(--space-2); border: 0; background: none; border-radius: var(--radius-xs); font: inherit; font-size: var(--text-sm); color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .dlv-setup-alt:hover { color: var(--text); text-decoration: underline; } }
.dlv-setup-alt:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 1px; }

/* ---- the job sheet is wider on desktop: the job on the left, its contact details always on the right ---- */
@media (min-width: 641px) { .dlv-det-drawer { --dw-w: clamp(720px, 66vw, 960px); } }
.dlv-det-grid { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: var(--space-8); align-items: start; }
.dlv-det-side { padding-left: var(--space-6); border-left: 1px solid var(--border-faint); }
.dlv-det-side .dlv-prop { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label label" "value value"; min-height: 0; gap: 0; padding: var(--space-2) 0; border: 0; }
.dlv-det-side .dlv-props .dlv-prop:first-child { border: 0; }
.dlv-det-side .dlv-prop dt { grid-area: label; font-size: var(--text-xs); }
.dlv-det-side .dlv-prop dd { grid-area: value; gap: var(--space-1-5); }
.dlv-det-side .dlv-prop dt { margin-bottom: var(--space-1); }
@media (max-width: 900px) {
  .dlv-det-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .dlv-det-side { padding-left: 0; border-left: 0; border-top: 1px solid var(--border-faint); padding-top: var(--space-4); }
}
/* the divider between the job and its contact runs the full height of the sheet: the body drops its own top and bottom
   padding and the two columns carry it instead, stretching to the sheet's height */
.dlv-det-drawer .drawer-body { padding-top: 0; padding-bottom: 0; }
.dlv-det-grid { flex: 1 1 auto; align-items: stretch; }
.dlv-det-main { padding: var(--space-4) 0 var(--space-5); min-width: 0; }
.dlv-det-side { padding-top: var(--space-4); padding-bottom: var(--space-5); }
@media (max-width: 900px) { .dlv-det-side { padding-bottom: var(--space-5); } }

/* Book a time: the contact's own action, the full width of the column under its fields */
/* (the lead drawer's Schedule Consultation height: 46px, base text, 18px icon) */
.dlv-det-book { width: 100%; height: 46px; margin-top: var(--space-4); padding: 0 var(--space-3); justify-content: center; font-size: var(--text-base); line-height: 1; }
.dlv-det-book svg { width: 18px; height: 18px; }
/* the job's bookings, under its contact in the right column */
.dlv-det-schedule { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border-faint); }
.dlv-det-sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.dlv-det-sec-head .dlv-det-cap { margin: 0; }
.dlv-evs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dlv-ev { display: flex; align-items: flex-start; gap: var(--space-2-5); padding: var(--space-2-5) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.dlv-ev.is-past { background: var(--surface-sunk); }
.dlv-ev.is-past .dlv-ev-title { color: var(--text-muted); }
.dlv-ev-ico { flex: none; display: inline-flex; margin-top: 2px; color: var(--text-soft); }
.dlv-ev-ico svg { width: 14px; height: 14px; }
.dlv-ev-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dlv-ev-title { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-ev-when { font-size: var(--text-xs); color: var(--text-soft); }
.dlv-ev-empty { margin: 0; font-size: var(--text-sm); color: var(--text-soft); }

/* the contact rows: icon, the value as a link (call / email / Maps), a pencil to correct it on hover or focus */
.dlv-crows { display: flex; flex-direction: column; }
.dlv-crow { display: flex; align-items: center; gap: var(--space-2-5); min-height: 36px; }
.dlv-crow-ico { flex: none; display: inline-flex; color: var(--text-soft); }
.dlv-crow-ico svg { width: 15px; height: 15px; }
.dlv-crow-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-1); }
.dlv-crow-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); color: var(--primary-text); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .dlv-crow-link:hover { text-decoration: underline; text-underline-offset: 3px; } }
.dlv-crow-text { font-size: var(--text-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-crow-edit { flex: none; margin-left: auto; opacity: 0; }
.dlv-crow:hover .dlv-crow-edit, .dlv-crow:focus-within .dlv-crow-edit { opacity: 1; }
@media (hover: none) { .dlv-crow-edit { opacity: 1; } }
.dlv-crow-add { padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-sm); color: var(--text-soft); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .dlv-crow-add:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; } }
.dlv-crow-input { flex: 1; min-width: 0; }
.dlv-crow-text.dlv-crow-name { font-weight: var(--fw-medium); color: var(--text-strong); }

/* the job's to-dos (the lead drawer's list, styles from lead-drawer.css), and the line saying they're in Tasks too */
.dlv-todos .dw-todos { margin-top: var(--space-2); }
.dlv-todo-note { display: flex; align-items: center; gap: var(--space-1-5); margin: var(--space-4) 0 0; font-size: var(--text-xs); color: var(--text-soft); }
.dlv-todo-note svg { width: 13px; height: 13px; flex: none; }

/* the job's Activity: each entry's mark is neutral, a move takes its stage's colour (the board's --board-* dots) */
.dlv-tl-icon { background: var(--surface-2); color: var(--text-muted); }
.dlv-tl-icon[data-c="closed"] { background: color-mix(in srgb, var(--stage-won) 14%, var(--surface)); color: var(--stage-won); }
.dlv-tl-icon[data-c="blue"] { background: color-mix(in srgb, var(--board-blue) 14%, var(--surface)); color: var(--board-blue); }
.dlv-tl-icon[data-c="violet"] { background: color-mix(in srgb, var(--board-violet) 14%, var(--surface)); color: var(--board-violet); }
.dlv-tl-icon[data-c="amber"] { background: color-mix(in srgb, var(--board-amber) 14%, var(--surface)); color: var(--board-amber); }
.dlv-tl-icon[data-c="teal"] { background: color-mix(in srgb, var(--board-teal) 14%, var(--surface)); color: var(--board-teal); }
.dlv-tl-icon[data-c="pink"] { background: color-mix(in srgb, var(--board-pink) 14%, var(--surface)); color: var(--board-pink); }
.dlv-tl-icon[data-c="orange"] { background: color-mix(in srgb, var(--board-orange) 14%, var(--surface)); color: var(--board-orange); }
.dlv-tl-icon[data-c="slate"] { background: color-mix(in srgb, var(--board-slate) 14%, var(--surface)); color: var(--board-slate); }
.dlv-tl-icon[data-c="green"] { background: color-mix(in srgb, var(--board-green) 14%, var(--surface)); color: var(--board-green); }

/* the job's dates: start → finish under its value (each opens the shared date picker), and on its card */
.dlv-det-dates { display: flex; align-items: center; gap: var(--space-1); margin-top: var(--space-1); color: var(--text-soft); }
.dlv-det-dates > svg { width: 14px; height: 14px; margin-right: var(--space-0-5); }
.dlv-date-btn { height: 26px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text); cursor: pointer; }
.dlv-date-btn.is-empty { color: var(--text-soft); font-weight: var(--fw-regular); }
@media (hover: hover) and (pointer: fine) { .dlv-date-btn:hover { background: var(--surface-hover); } }
.dlv-date-sep { font-size: var(--text-sm); color: var(--text-placeholder); }
.dlv-dates { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-muted); white-space: nowrap; }
.dlv-dates svg { width: 12px; height: 12px; color: var(--text-soft); }

/* ---- a job's files: cards with the photo itself or the file's kind, big and clear ---- */
.dlv-fgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.dlv-fcard { position: relative; min-width: 0; }
.dlv-fcard-open { display: flex; flex-direction: column; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); text-align: left; font: inherit; cursor: pointer; overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .dlv-fcard-open:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); } }
.dlv-fcard-face { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-sunk); overflow: hidden; }
.dlv-fcard.is-uploading .dlv-fcard-face { border: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.dlv-fcard-face img { width: 100%; height: 100%; object-fit: cover; }
.dlv-fcard-kind { display: flex; flex-direction: column; align-items: center; gap: var(--space-1-5); color: var(--text-soft); font-size: var(--text-xs); font-weight: var(--fw-semibold); letter-spacing: .02em; }
.dlv-fcard-kind svg { width: 28px; height: 28px; stroke-width: 1.5; }
.dlv-fcard-kind[data-k="pdf"] { color: var(--danger-600); }
.dlv-fcard-kind[data-k="sheet"] { color: var(--success-600); }
.dlv-fcard-kind[data-k="doc"] { color: var(--info-600); }
.dlv-fcard-text { display: flex; flex-direction: column; gap: 1px; padding: var(--space-2) var(--space-2-5); min-width: 0; }
.dlv-fcard-name { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-fcard-meta { font-size: var(--text-xs); color: var(--text-soft); }
.dlv-fcard-del { position: absolute; top: var(--space-1-5); right: var(--space-1-5); background: var(--surface); box-shadow: var(--shadow-xs); opacity: 0; }
.dlv-fcard:hover .dlv-fcard-del, .dlv-fcard:focus-within .dlv-fcard-del { opacity: 1; }
@media (hover: none) { .dlv-fcard-del { opacity: 1; } }
.dlv-drop.is-compact { margin-bottom: var(--space-3); }

/* the viewer: the file large on a dark stage, its name and Download above, previous / next at the sides */
.dlv-viewer { position: fixed; inset: 0; z-index: var(--z-lightbox); display: flex; flex-direction: column; background: color-mix(in srgb, var(--overlay-dark) 94%, transparent); color: #fff; }
.dlv-viewer-bar { display: flex; align-items: center; gap: var(--space-3); height: 56px; padding: 0 var(--space-4) 0 var(--space-5); }
.dlv-viewer-names { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dlv-viewer-name { font-size: var(--text-md); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-viewer-meta, .dlv-viewer-count { font-size: var(--text-xs); color: rgba(255, 255, 255, .6); white-space: nowrap; }
.dlv-viewer-dl svg { width: 14px; height: 14px; }
.dlv-viewer-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: none; color: #fff; cursor: pointer; }
.dlv-viewer-x svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .dlv-viewer-x:hover { background: rgba(255, 255, 255, .1); } }
.dlv-viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: var(--space-2) var(--space-12) var(--space-6); }
.dlv-viewer-stage img, .dlv-viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); }
.dlv-viewer-stage iframe { width: min(100%, 960px); height: 100%; border: 0; border-radius: var(--radius-md); background: #fff; }
.dlv-viewer-none { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); color: rgba(255, 255, 255, .75); font-size: var(--text-sm); }
.dlv-viewer-none > svg { width: 40px; height: 40px; stroke-width: 1.5; }
.dlv-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.dlv-viewer-nav svg { width: 20px; height: 20px; }
.dlv-viewer-nav.is-prev { left: var(--space-4); }
.dlv-viewer-nav.is-next { right: var(--space-4); }
.dlv-viewer-nav[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .dlv-viewer-nav:hover { background: rgba(255, 255, 255, .2); } }
@media (max-width: 640px) { .dlv-viewer-stage { padding: var(--space-2); } .dlv-viewer-nav { top: auto; bottom: var(--space-4); transform: none; } }

/* the calendar's New Event as a job's Schedule: "Runs over several days" and its last day */
.ne-days { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
.ne-days-text { display: flex; flex-direction: column; gap: 2px; }
.ne-days-title { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text-strong); }
.ne-days-sub { font-size: var(--text-xs); color: var(--text-soft); }
.ne-lastday { margin-top: var(--space-3); }
.ne-lastday .nc-select svg { width: 15px; height: 15px; color: var(--text-soft); }

/* "Add job": the short form before a job is made (who it's for, then title, value, dates and details) */
.dlv-newjob { display: flex; flex-direction: column; gap: var(--space-4); }
.dlv-newjob-who { display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-2-5) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunk); }
.dlv-newjob-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-muted); }
.dlv-newjob-name { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.dlv-newjob-sub { margin-left: auto; font-size: var(--text-xs); color: var(--text-soft); }
.dlv-newjob-money { position: relative; }
.dlv-newjob-money > span { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-soft); pointer-events: none; }
.dlv-newjob-money .input { padding-left: var(--space-6); font-variant-numeric: tabular-nums; }
.dlv-newjob-dates { display: flex; align-items: center; gap: var(--space-2); }
.dlv-newjob-dates .nc-select { flex: 1; min-width: 0; }
.dlv-newjob-dates .nc-select svg { width: 15px; height: 15px; color: var(--text-soft); }

/* a PDF's card: its first page, drawn by the browser's own viewer in a frame 3x the card and scaled down (the frame takes
   no clicks: the card opens the viewer), with a small PDF badge */
.dlv-fcard-pdf { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface); }
.dlv-fcard-pdf iframe { position: absolute; top: 0; left: 0; width: 300%; height: 300%; border: 0; transform: scale(calc(1 / 3)); transform-origin: 0 0; pointer-events: none; background: var(--surface); }
.dlv-fcard-badge { position: absolute; left: var(--space-1-5); bottom: var(--space-1-5); padding: 1px var(--space-1-5); border-radius: var(--radius-xs); background: var(--danger-600); color: #fff; font-size: var(--text-3xs); font-weight: var(--fw-semibold); letter-spacing: .02em; }

/* ---- "How Jobs work": the portal's first-visit intro (features/delivery/jobsIntro.js), prefix jbi- ----
   A Modal: a mini Jobs board on a sunk band (a window with the Jobs bar and its gear; Closed, the three suggested
   stages and Done on --surface-lane with a card each, the real board's tokens at a smaller size), then a title and one
   line, then the footer tray with the step dots, Back and Next. Step 1 lays the empty board's "Your stages" lane over
   the stages' place and plays Add suggested stages; the moving card (.jbi-hero) sits over the lanes' second row and is
   moved by transforms only. Without motion (prefers-reduced-motion) each step shows where it ends up. */
.modal-shell.jbi-modal { width: min(640px, calc(100vw - 32px)); }   /* owner, 25 Nov 2026: "a tad bigger" (twice) */
.modal-shell.jbi-modal .modal-body { padding: 0; }
.jbi { position: relative; }
/* the band's top strip: what this is on the left, the close on the right, both centred on the strip (a phone's close is
   the 44px touch size: it still fits) */
.jbi-eyebrow { position: absolute; top: var(--space-6); left: var(--space-6); transform: translateY(-50%); font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-soft); }
.jbi-x { position: absolute; top: calc(var(--space-6) - 14px); right: var(--space-4); z-index: 1; }
@media (pointer: coarse) { .jbi-x { top: calc(var(--space-6) - 22px); right: var(--space-2); } }

.jbi-stage { padding: var(--space-12) var(--space-6) 0; background: var(--surface-sunk); border-bottom: 1px solid var(--border); overflow: hidden; }
.jbi-window {
  border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface); box-shadow: var(--shadow-sm);
  padding: 0 var(--space-2) var(--space-3);
}
.jbi-bar { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 var(--space-1); }
.jbi-bar-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.jbi-gear { display: inline-flex; padding: var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-muted); transition: box-shadow var(--dur) var(--ease), color var(--dur) var(--ease); }
.jbi-gear svg { width: 12px; height: 12px; }

.jbi-board {
  --jbi-pad: var(--space-2); --jbi-gap: var(--space-2); --jbi-head: 20px; --jbi-card: 46px;
  /* one lane over: the hero's own width, the two lane paddings and the gap between lanes */
  --jbi-step: calc(100% + 2 * var(--jbi-pad) + var(--jbi-gap));
  position: relative;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--jbi-gap);
}
.jbi-lane {
  display: flex; flex-direction: column; gap: var(--jbi-gap); min-width: 0;
  padding: var(--jbi-pad); border-radius: var(--radius-sm); background: var(--surface-lane);
}
.jbi-head { display: flex; align-items: center; gap: var(--space-1); height: var(--jbi-head); min-width: 0; padding: 0 var(--space-0-5); font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--text-strong); white-space: nowrap; }
.jbi-head-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.jbi-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--board-slate); }
.jbi-dot[data-c="blue"]   { background: var(--board-blue); }
.jbi-dot[data-c="violet"] { background: var(--board-violet); }
.jbi-dot[data-c="amber"]  { background: var(--board-amber); }
.jbi-dot.is-closed { background: var(--stage-won); }
.jbi-done-ico { flex: none; display: inline-flex; color: var(--text-soft); }
.jbi-done-ico svg { width: 12px; height: 12px; }

.jbi-card {
  box-sizing: border-box; height: var(--jbi-card); min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 0 var(--space-2); border-radius: var(--radius-xs);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.jbi-name { font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jbi-job { font-size: var(--text-3xs); color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jbi-slot { flex: none; height: var(--jbi-card); }
.jbi-add { display: inline-flex; align-items: center; gap: 3px; padding: 0 var(--space-0-5); font-size: var(--text-3xs); font-weight: var(--fw-medium); color: var(--text-soft); white-space: nowrap; }
.jbi-add svg { width: 10px; height: 10px; flex: none; }

/* the empty board's "Your stages" lane (as .dlv-col--ghost), over the three stages' columns */
.jbi-ghost {
  position: absolute; top: 0; bottom: 0;
  left: calc((100% - 4 * var(--jbi-gap)) / 5 + var(--jbi-gap));
  width: calc((100% - 4 * var(--jbi-gap)) * 3 / 5 + 2 * var(--jbi-gap));
  box-sizing: border-box; padding: var(--jbi-pad);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  visibility: hidden; opacity: 0;
}
.jbi-ghost .jbi-head { color: var(--text-soft); font-weight: var(--fw-medium); }
.jbi-prompt { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: var(--space-1-5); white-space: nowrap; }
.jbi-prompt-title { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-strong); }
.jbi-suggest {
  position: relative; display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2-5);
  border: 1px solid var(--btn-primary-border); border-radius: var(--radius-xs); background: var(--btn-primary-bg); color: var(--btn-primary-fg);
  font-size: var(--text-2xs); font-weight: var(--fw-semibold);
}
.jbi-alt { font-size: var(--text-3xs); color: var(--text-muted); }

/* the moving card, over the first lane's empty slot; --jbi-step moves it a lane at a time */
.jbi-hero {
  position: absolute; z-index: 1;
  top: calc(var(--jbi-pad) + var(--jbi-head) + var(--jbi-card) + 2 * var(--jbi-gap)); left: var(--jbi-pad);
  width: calc((100% - 4 * var(--jbi-gap)) / 5 - 2 * var(--jbi-pad));
  will-change: transform, opacity;
}
.jbi-card.is-hero { box-shadow: var(--shadow-md); }
.jbi-tick {
  position: absolute; top: -6px; right: -6px;
  display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--success-600); color: var(--text-invert); box-shadow: 0 0 0 2px var(--surface-lane);
  opacity: 0; transform: scale(0);
}
.jbi-tick svg { width: 10px; height: 10px; stroke-width: 3; }
.jbi-pointer { position: absolute; width: 16px; height: 16px; opacity: 0; fill: var(--text-strong); stroke: var(--surface); stroke-width: 1; stroke-linejoin: round; pointer-events: none; }
.jbi-pointer.is-carry { right: 12%; bottom: -10px; }
.jbi-pointer.is-click { right: var(--space-2); bottom: -10px; }

/* where each step leaves the board (what reduced motion shows, and where each loop comes to rest) */
.jbi[data-step="1"] .jbi-hero { opacity: 0; }
.jbi[data-step="1"] .jbi-lane.is-stage .jbi-card { visibility: hidden; }   /* stages just added are empty */
.jbi[data-step="1"] .jbi-gear { color: var(--text-strong); box-shadow: var(--ring-primary); }   /* where they're changed later */
.jbi[data-step="2"] .jbi-hero { transform: translateX(0); }
.jbi[data-step="3"] .jbi-hero { transform: translateX(calc(3 * var(--jbi-step))); }
.jbi[data-step="4"] .jbi-hero { transform: translateX(calc(4 * var(--jbi-step))); }
.jbi[data-step="4"] .jbi-tick { opacity: 1; transform: scale(1); }

.jbi-copy { padding: var(--space-6) var(--space-7) var(--space-7); }
.jbi-title { margin: 0; font-size: var(--text-xl); font-weight: var(--fw-semibold); line-height: var(--leading-snug); color: var(--text-strong); }
.jbi-text { margin: var(--space-2) 0 0; min-height: calc(2 * var(--leading-normal) * 1em); font-size: var(--text-md); line-height: var(--leading-normal); color: var(--text-muted); }   /* (two lines kept: the dialog doesn't jump between steps) */
.jbi-inline-ico { display: inline-flex; vertical-align: -2px; color: var(--text-strong); }
.jbi-inline-ico svg { width: 14px; height: 14px; }

.jbi-foot { flex: 1; display: flex; align-items: center; gap: var(--space-2); }
.jbi-foot .spacer { flex: 1; }
.jbi-foot .btn[hidden] { display: none; }
.jbi-dots { display: flex; align-items: center; }
/* each dot is a 20px target around a 6px mark; the step you're on is a short bar */
.jbi-dot-btn { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-full); background: none; cursor: pointer; }
.jbi-dot-btn::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--border-strong); transition: width var(--dur) var(--ease), background var(--dur) var(--ease); }
.jbi-dot-btn.is-on::before { width: 16px; background: var(--text-strong); }
.jbi-dot-btn.is-on { width: 26px; }
@media (hover: hover) and (pointer: fine) {
  .jbi-dot-btn:not(.is-on):hover::before { background: var(--text-soft); }
}
.jbi-dot-btn:focus-visible { outline: none; box-shadow: var(--ring-primary); }

/* the loops: only with motion allowed */
@media (prefers-reduced-motion: no-preference) {
  .jbi[data-step="1"] .jbi-ghost { animation: jbi-ghost 5.6s var(--ease) infinite; }
  .jbi[data-step="1"] .jbi-pointer.is-click { animation: jbi-click 5.6s var(--ease) infinite; }
  .jbi[data-step="1"] .jbi-suggest { animation: jbi-press 5.6s var(--ease) infinite; }
  .jbi[data-step="1"] .jbi-lane[data-n="1"] { animation: jbi-lane-1 5.6s var(--ease-spring-ish) infinite; }
  .jbi[data-step="1"] .jbi-lane[data-n="2"] { animation: jbi-lane-2 5.6s var(--ease-spring-ish) infinite; }
  .jbi[data-step="1"] .jbi-lane[data-n="3"] { animation: jbi-lane-3 5.6s var(--ease-spring-ish) infinite; }
  .jbi[data-step="1"] .jbi-gear { animation: jbi-gear 5.6s var(--ease) infinite; }
  .jbi[data-step="2"] .jbi-hero { animation: jbi-drop 3.6s var(--ease-spring-ish) infinite; }
  .jbi[data-step="3"] .jbi-hero { animation: jbi-carry-3 6s var(--ease) infinite; }
  .jbi[data-step="3"] .jbi-pointer.is-carry { animation: jbi-pointer-3 6s var(--ease) infinite; }
  .jbi[data-step="4"] .jbi-hero { animation: jbi-carry-4 4.2s var(--ease) infinite; }
  .jbi[data-step="4"] .jbi-pointer.is-carry { animation: jbi-pointer-4 4.2s var(--ease) infinite; }
  .jbi[data-step="4"] .jbi-tick { animation: jbi-tick 4.2s var(--ease) infinite; }
  .jbi-copy > * { animation: jbi-in var(--dur-slow) var(--ease-enter) both; }
}
/* step 1: the empty lane, the pointer presses Add suggested stages, the lane gives way to the stages one by one, the gear lights */
@keyframes jbi-ghost {
  0%, 32%   { visibility: visible; opacity: 1; }
  38%, 94%  { visibility: visible; opacity: 0; }
  100%      { visibility: visible; opacity: 1; }
}
@keyframes jbi-click {
  0%        { opacity: 0; transform: translate(36px, 30px); }
  6%        { opacity: 1; transform: translate(36px, 30px); }
  22%       { transform: translate(0, 0); }
  26%       { transform: translate(0, 0) scale(0.85); }
  30%       { opacity: 1; transform: translate(0, 0) scale(1); }
  36%, 100% { opacity: 0; transform: translate(0, 0); }
}
@keyframes jbi-press {
  0%, 24%, 30%, 100% { transform: scale(1); }
  27%                { transform: scale(0.94); }
}
@keyframes jbi-lane-1 { 0%, 38% { opacity: 0; transform: translateY(6px) scale(0.94); } 46%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
@keyframes jbi-lane-2 { 0%, 45% { opacity: 0; transform: translateY(6px) scale(0.94); } 53%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
@keyframes jbi-lane-3 { 0%, 52% { opacity: 0; transform: translateY(6px) scale(0.94); } 60%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
@keyframes jbi-gear {
  0%, 64%, 96%, 100% { box-shadow: 0 0 0 0 transparent; color: var(--text-muted); }
  70%, 90%           { box-shadow: var(--ring-primary); color: var(--text-strong); }
}
/* step 2: a job drops into Closed */
@keyframes jbi-drop {
  0%        { opacity: 0; transform: translateY(-26px) scale(0.96); }
  8%        { opacity: 1; }
  24%       { transform: translateY(0) scale(1); }
  86%       { opacity: 1; transform: translateY(0); }
  96%, 100% { opacity: 0; transform: translateY(0); }
}
/* step 3: picked up in Closed (a lift and a tilt), carried a stage at a time with a pause in each, put down in the last */
@keyframes jbi-carry-3 {
  0%        { opacity: 0; transform: translateX(0); }
  5%        { opacity: 1; transform: translateX(0); }
  10%       { transform: translateX(0) translateY(-3px) rotate(-3deg); }
  26%, 32%  { transform: translateX(var(--jbi-step)) translateY(-3px) rotate(-3deg); }
  48%, 54%  { transform: translateX(calc(2 * var(--jbi-step))) translateY(-3px) rotate(-3deg); }
  70%       { transform: translateX(calc(3 * var(--jbi-step))) translateY(-3px) rotate(-3deg); }
  76%       { transform: translateX(calc(3 * var(--jbi-step))) translateY(0) rotate(0); }
  92%       { opacity: 1; transform: translateX(calc(3 * var(--jbi-step))); }
  98%, 100% { opacity: 0; transform: translateX(calc(3 * var(--jbi-step))); }
}
@keyframes jbi-pointer-3 { 0%, 6% { opacity: 0; } 10%, 76% { opacity: 1; } 82%, 100% { opacity: 0; } }
/* step 4: from the last stage on to Done, then the tick */
@keyframes jbi-carry-4 {
  0%        { opacity: 0; transform: translateX(calc(3 * var(--jbi-step))); }
  8%        { opacity: 1; transform: translateX(calc(3 * var(--jbi-step))); }
  18%       { transform: translateX(calc(3 * var(--jbi-step))) translateY(-3px) rotate(-3deg); }
  50%       { transform: translateX(calc(4 * var(--jbi-step))) translateY(-3px) rotate(-3deg); }
  58%       { transform: translateX(calc(4 * var(--jbi-step))) translateY(0) rotate(0); }
  88%       { opacity: 1; transform: translateX(calc(4 * var(--jbi-step))); }
  96%, 100% { opacity: 0; transform: translateX(calc(4 * var(--jbi-step))); }
}
@keyframes jbi-pointer-4 { 0%, 10% { opacity: 0; } 15%, 58% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes jbi-tick {
  0%, 58%   { opacity: 0; transform: scale(0); }
  66%       { opacity: 1; transform: scale(1.2); }
  72%, 88%  { opacity: 1; transform: scale(1); }
  96%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes jbi-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* a phone: the dialog is the screen's width less the gutters, so the mini board's lanes tighten, their dots and the
   cards' second line go, and the words step down a size */
@media (max-width: 640px) {
  .jbi-stage { padding: var(--space-12) var(--space-3) 0; }
  .jbi-eyebrow { left: var(--space-4); }
  .jbi-window { padding: 0 var(--space-1-5) var(--space-2); }
  .jbi-board { --jbi-pad: var(--space-1); --jbi-gap: var(--space-1); --jbi-head: 24px; --jbi-card: 28px; }
  /* a two-word stage name ("In progress") takes two lines rather than an ellipsis */
  .jbi-head { align-items: flex-start; white-space: normal; line-height: 1.2; }
  .jbi-head-name { overflow-wrap: anywhere; }
  .jbi-text { min-height: calc(3 * var(--leading-normal) * 1em); }
  .jbi-head, .jbi-name, .jbi-prompt-title, .jbi-suggest { font-size: var(--text-3xs); }
  .jbi-lane .jbi-dot, .jbi-done-ico, .jbi-job { display: none; }
  .jbi-card { padding: 0 var(--space-1-5); }
  .jbi-suggest { height: 22px; padding: 0 var(--space-2); }
  .jbi-copy { padding: var(--space-4) var(--space-5) var(--space-5); }
  .jbi-title { font-size: var(--text-lg); }
}
