/* Stahla — the day plan board (plan 260929-ops-pm-fb-cycle26 P4; day-board.js). Classes only (the production CSP forbids inline
 * styles); the drag moves a row with two custom properties set through the CSSOM (--db-dx / --db-dy). Phone first (≤ 700 px: the
 * sections stack); wider: "Jobs to place" is a sticky left column and the people sit side by side (min 260 px each). */
.db-host{display:block}
.db{padding-bottom:24px}
.db-top{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.db-title{margin:0;font-size:20px}
.db-nav{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.db-nav .btn{min-width:40px;min-height:40px;padding:6px 10px}
.db-nav .chip{min-height:40px}
.db-nav .chip[aria-pressed="true"]{background:var(--navy,#01253a);color:#fff;border-color:var(--navy,#01253a)}
.db-day{font-weight:700;min-width:96px;text-align:center}
.db-date{min-height:40px;border:1px solid var(--line,#e3e7ea);border-radius:10px;padding:4px 8px;font-size:15px;max-width:160px}
.db-body-wrap.db-busy{opacity:.72}
.db-body-wrap.db-busy .btn,.db-body-wrap.db-busy button,.db-body-wrap.db-busy input,.db-body-wrap.db-busy select{pointer-events:none}

.db-banner{margin:0 0 10px;padding:10px 12px;border-radius:12px;background:#fff;border:1px solid var(--line,#e3e7ea);font-size:14px}
.db-banner--off{background:var(--yellow-bg,#fef5e0);color:var(--yellow,#8a6100);border-color:#f3dca5}
.db-banner--err{background:var(--red-bg,#fde8e8);color:var(--red,#a93226);border-color:#f3c3c0}
.db-banner--sheet{background:#f4f1fb;border-color:#d9d0f0}
/* review 1: a write whose answer was lost (or a publish the sheet has not confirmed) — "Check the last publish"; the phone's copy */
.db-banner--pending{background:var(--yellow-bg,#fef5e0);border-color:#f3dca5}
.db-copy-at .btn{margin-left:6px;min-height:36px}
.db-bh{margin:0 0 6px;font-weight:600}
.db-sheet{margin:0 0 8px;padding:8px 10px;background:#fff;border:1px solid var(--line,#e3e7ea);border-radius:8px;white-space:pre-wrap;
  word-break:break-word;font:13px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;max-height:220px;overflow:auto}
.db-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.db-acts .btn{min-height:44px}
.db-hint{margin:6px 0 0}

.db-grid{display:flex;flex-direction:column;gap:12px}
.db-people{display:flex;flex-direction:column;gap:12px}
.db-place,.db-person{background:#fff;border:1px solid var(--line,#e3e7ea);border-radius:14px;padding:10px 10px 8px}
.db-place{border-color:#c9d9ee;background:#f7faff}
.db-person--shop{background:#fbfbf7}
.db-h{margin:0 0 6px;font-size:15px;display:flex;align-items:center;gap:6px}
.db-count{background:#e8eef5;border-radius:999px;padding:1px 8px;font-size:12px;font-weight:700}
.db-empty{margin:4px 2px}
.db-ph{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:6px}
.db-name{font-weight:700;font-size:16px;min-width:64px}
.db-truck{min-height:40px;border:1px solid var(--line,#e3e7ea);border-radius:10px;padding:4px 6px;font-size:14px;max-width:170px;background:#fff}
.db-note{flex:1 1 140px;min-width:0;min-height:40px;border:1px solid var(--line,#e3e7ea);border-radius:10px;padding:4px 8px;font-size:14px}
.db-truck-ro,.db-note-ro{font-size:13px;color:var(--muted,#6b7682)}

.db-list{list-style:none;margin:0;padding:0;min-height:8px}
.db-line{display:flex;align-items:stretch;gap:4px;border-bottom:1px solid #f0f2f4;position:relative;background:#fff}
.db-line:last-child{border-bottom:0}
.db-line--done .db-text{text-decoration:line-through;color:var(--muted,#6b7682)}
.db-grip{flex:0 0 32px;display:flex;align-items:center;justify-content:center;color:#9aa3ad;font-size:18px;cursor:grab;
  touch-action:none;user-select:none;-webkit-user-select:none}
.db-grip--off{cursor:default}
.db-body{appearance:none;flex:1 1 auto;min-width:0;min-height:44px;text-align:left;background:none;border:0;padding:6px 2px;font:inherit;
  color:inherit;display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;position:relative}
/* fb28 (row 497): the "⋯" of a line that has a menu — the line's button draws it last, with no class; it sits at the button's right
   edge, in the middle of the row whatever the text wraps to, and the button keeps room for it */
.db-body:has(> span[aria-hidden="true"]){padding-right:26px}
.db-body > span[aria-hidden="true"]{position:absolute;right:0;top:50%;transform:translateY(-50%);width:24px;text-align:center;font-size:20px;
  font-weight:800;line-height:1;color:var(--muted,#6b7682)}
.db-text{min-width:0;overflow-wrap:anywhere}
.db-jno{color:var(--muted,#6b7682);font-size:12px}
.db-kind{font-size:11px;font-weight:800;border-radius:6px;padding:1px 6px;background:#eef1f4;color:#34414d;text-transform:uppercase}
.db-kind--set,.db-kind--pickup{background:#d2e5fb;color:#1f4f86}
.db-kind--service{background:#fdeeb0;color:#6d5000}
.db-stop,.db-with,.db-jtruck,.db-by{font-size:12px;color:var(--muted,#6b7682)}
.db-stop{font-weight:700;color:#1f4f86}
.db-warn{font-size:12px;color:var(--red,#a93226);font-weight:600}
/* fb27 P4: a line that stands for a task (put on the day from the desktop's Tasks panel) — its done is the task's; cancelled: no tick */
.db-task{font-size:11px;font-weight:800;border-radius:6px;padding:1px 6px;background:#e3f4ee;color:#00664f;text-transform:uppercase}
.db-task--off{background:#f1f3f5;color:#6b7682}
/* fb27 P4 review round 1 (P4B-R2): a cancelled task's line in the phone's readers (pm.js My day + Today's To Do) — struck, muted */
.md-bnote.md-task-off .md-bt,.dl-l.dl-task-off{text-decoration:line-through;color:#6b7682}
.db-state{font-size:12px;border-radius:6px;padding:1px 6px;background:var(--yellow-bg,#fef5e0);color:var(--yellow,#8a6100)}
.db-state--failed,.db-state--conflict{background:var(--red-bg,#fde8e8);color:var(--red,#a93226)}
/* fb27 P1: a line of the drop queue — "to save" (waiting, a quiet outline) and "saving…" (on its way, the teal of the drop marker) */
.db-state--q{background:#fff;border:1px dashed #9aa3ad;color:#34414d}
.db-state--q.db-state--saving{border-style:solid;border-color:var(--teal,#00a27e);color:#00664f}
/* review round 1 (C27-P1-02): saved, its board read failed — kept under the person until a board is applied */
.db-state--q.db-state--saved{border-style:solid;border-color:#9aa3ad;color:#34414d}
/* fb28 (row 497): the tick box says what it is — the word "Done" inside its label, under the box (the label keeps its 44 px, so a
   line's text loses no width to it) */
.db-tick{flex:0 0 44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:11px;font-weight:700;
  line-height:1.1;color:var(--muted,#6b7682);white-space:nowrap}
.db-tick-in{width:22px;height:22px}
.db-edit-in{flex:1 1 auto;min-width:0;min-height:36px;font-size:15px;border:1px solid var(--teal,#00a27e);border-radius:8px;padding:4px 8px}
.db-suggest{font-size:12px;min-height:32px;border-color:#9ec3ee;color:#1f4f86}
.db-add{padding:6px 2px 2px 32px}
.db-add-in{width:100%;min-height:40px;border:1px dashed #c5ccd3;border-radius:10px;padding:6px 10px;font-size:15px;background:#fff}
/* fb28 (F2-hint): the board's boxes show where the typing goes — the add box reads like a button until it has the focus */
.db-add-in:focus-visible,.db-edit-in:focus-visible,.db-note:focus-visible,.db-truck:focus-visible,.db-helper-in:focus-visible,.db-date:focus-visible{
  outline:2px solid var(--teal,#00a27e);outline-offset:1px;border-style:solid;border-color:var(--teal,#00a27e)}
.db-helper{align-self:flex-start;min-height:44px}
.db-helper-add{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.db-helper-in{flex:1 1 180px;min-width:0;min-height:44px;border:1px solid var(--line,#e3e7ea);border-radius:10px;padding:6px 10px;font-size:15px}
.db-line > .db-suggest{align-self:center;flex:0 0 auto}
.db-also{margin:12px 0 0;font-size:14px}
.db-also ul{margin:6px 0 0;padding-left:18px}

.db-foot{position:sticky;bottom:0;z-index:5;margin-top:14px;padding:10px 12px;background:#fff;border:1px solid var(--line,#e3e7ea);
  border-radius:14px;box-shadow:0 -4px 14px rgba(1,37,58,.08)}
.db-status{margin:0 0 2px;font-weight:600;font-size:14px}
.db-live{margin:0 0 8px}
.db-why{margin:6px 0 0}
/* fb27 P1: the queue's line in the footer — "N to save · Save now", "Saving 3 of 14…", and what could not be saved (OK takes it away) */
.db-q{margin:0 0 6px}
.db-q-line{margin:0;font-size:14px;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.db-q-line .btn,.db-q-failed .btn{min-height:36px;padding:4px 10px}
.db-q-failed{margin:4px 0 0;font-size:13px;color:var(--red,#a93226);display:flex;flex-wrap:wrap;align-items:center;gap:6px}

/* fb27 P2 (design §6, plan §9.2 V24): the phone board — the head in TWO rows (‹ Back · the title · the date chip / ‹ the day › ·
   Today · Tomorrow) and the footer in ONE line (the state — a tap shows the details — and Publish). The desktop is unchanged: the date
   chip's wrapper and the one-line state are not drawn there */
.db-date-chip{display:contents}
.db-date-ic{display:none}
.db-foot-sum,.db-foot-pub,.db-foot-said{display:none}
@media (max-width:600px){
  /* six columns: ‹ | (Back's rest) | the day / the title | › | Today | Tomorrow / the date chip — Back spans the first two, the day the
     second and third, so neither the day nor the title is squeezed by the other row */
  .db-top{display:grid;grid-template-columns:36px auto minmax(0,1fr) auto auto auto;column-gap:5px;row-gap:6px;align-items:center;margin-bottom:8px}
  .db-nav{display:contents}
  .db-back{grid-row:1;grid-column:1/3;justify-self:start;min-height:44px}
  .db-title{grid-row:1;grid-column:3/6;min-width:0;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .db-date-chip{grid-row:1;grid-column:6;justify-self:end;position:relative;display:inline-flex;align-items:center;justify-content:center;
    min-width:44px;min-height:40px;padding:0 10px;border:1px solid var(--line,#e3e7ea);border-radius:999px;background:#fff;font-size:17px}
  .db-date-ic{display:inline}
  .db-date-chip .db-date{position:absolute;top:0;left:0;width:100%;height:100%;max-width:none;min-height:0;margin:0;padding:0;border:0;opacity:0}
  .db-prev{grid-row:2;grid-column:1;justify-self:start}
  .db-day{grid-row:2;grid-column:2/4;min-width:0;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .db-nav .db-prev,.db-nav .db-next{min-width:36px;padding-left:6px;padding-right:6px}
  .db-next{grid-row:2;grid-column:4}
  .db-today{grid-row:2;grid-column:5}
  .db-tomorrow{grid-row:2;grid-column:6;justify-self:end}
  .db-nav .db-today,.db-nav .db-tomorrow{padding-left:10px;padding-right:10px}
  /* fb28 (row 496): a phone zooms the page in when a focused box, select or date is drawn under 16 px, and stays zoomed — the board's
     six are 16 px at phone width (wider screens keep their sizes) */
  .db-note,.db-truck,.db-add-in,.db-edit-in,.db-helper-in,.db-date{font-size:16px}
  /* three columns: the state (or the queue's line) | the details toggle while the queue's line shows | Publish */
  .db-foot{display:grid;grid-template-columns:minmax(0,1fr) auto auto;column-gap:6px;align-items:center;margin-top:10px;padding:4px 6px 4px 10px}
  .db-foot > .db-acts .btn{min-height:44px;padding:0 10px}
  .db-foot-sum{grid-row:1;grid-column:1/3;display:flex;align-items:center;gap:6px;min-width:0;min-height:44px;margin:0;padding:0;border:0;
    background:none;color:inherit;font:inherit;font-size:14px;font-weight:600;text-align:left;cursor:pointer}
  .db-foot-sum-t{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .db-foot-sum-i{flex:0 0 auto;color:var(--muted,#6b7682)}
  .db-foot > .db-acts{grid-row:1;grid-column:3;flex-wrap:nowrap}
  .db-foot .db-undo{display:none}
  .db-foot .db-status,.db-foot > .db-q,.db-foot .db-live,.db-foot .db-why,.db-foot .db-foot-pub,.db-foot .db-foot-said{display:none;grid-column:1/-1}
  .db-foot-pub,.db-foot-said{margin:0;font-size:13px}
  /* the queue's line takes the state's place while something is to save or saving; the toggle stays (its arrow only) */
  .db-foot--q .db-foot-sum{grid-column:2;justify-content:center;min-width:26px}
  .db-foot--q .db-foot-sum-t{display:none}
  .db-foot--q > .db-q{display:block;grid-row:1;grid-column:1;min-width:0;margin:0}
  .db-foot--q .db-q-line{flex-wrap:nowrap;white-space:nowrap;overflow:hidden}
  .db-foot--q .db-q-line .btn{padding:4px 8px;font-size:14px}
  .db-foot--q .db-q-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .db-foot--q .db-q-line .btn{flex:0 0 auto}
  .db-foot--open .db-q-t{white-space:normal}
  .db-foot--q .db-q-failed{display:none}
  /* the details: the state's whole words (the line itself, wrapped), the jobs not saved (OK), the team line, why Publish waits, Undo */
  .db-foot--open .db-foot-sum-t,.db-foot--open .db-q-line{white-space:normal}
  .db-foot--open .db-q-line{flex-wrap:wrap}
  .db-foot--open > .db-q,.db-foot--open .db-live,.db-foot--open .db-why,.db-foot--open .db-foot-pub:not(:empty),.db-foot--open .db-foot-said:not(:empty){display:block}
  .db-foot--open .db-q-failed{display:flex}
  .db-foot--open .db-undo{display:inline-flex}
  .db-foot--open > .db-acts{grid-row:auto;grid-column:1/-1;flex-wrap:wrap}
}

/* the drag: the row follows the finger (it stays in its list); the marker shows where it will land */
.db-drag-on{user-select:none;-webkit-user-select:none}
.db-dragging{transform:translate(var(--db-dx,0px),var(--db-dy,0px));z-index:30;box-shadow:0 8px 22px rgba(1,37,58,.22);border-radius:10px;
  pointer-events:none;opacity:.95}
.db-drop{height:6px;margin:2px 0;border-radius:3px;background:var(--teal,#00a27e);list-style:none}

/* the tap sheet */
.db-scrim{position:fixed;inset:0;background:rgba(1,37,58,.35);z-index:60}
.db-pop{position:fixed;left:0;right:0;bottom:0;z-index:61;background:#fff;border-radius:18px 18px 0 0;padding:14px 14px 18px;
  max-height:80vh;overflow:auto;box-shadow:0 -8px 26px rgba(1,37,58,.25)}
.db-pop-h{margin:0 0 10px;font-weight:700;overflow-wrap:anywhere}
.db-pop-h2{margin:12px 0 6px;font-weight:600;font-size:14px}
.db-pop-acts,.db-pop-who{display:flex;flex-wrap:wrap;gap:8px}
.db-pop .btn{min-height:44px}
.db-pop-x{margin-top:12px;width:100%}

@media (min-width:701px){
  .db-top{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between}
  .db-grid{display:grid;grid-template-columns:minmax(260px,320px) 1fr;align-items:start}
  .db-place{position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto}
  .db-people{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));align-items:start}
  .db-helper,.db-helper-add{grid-column:1/-1;justify-self:start}
  .db-pop{left:50%;right:auto;bottom:auto;top:18%;width:420px;margin-left:-210px;border-radius:18px}
}

/* fb29 BOARD (R29-DAY-BOARD): the person's whole crew day, under their list — the calendar's crew footer words */
.db-crewday{margin:4px 0 0;font-size:12px;line-height:1.35;color:var(--muted,#6b7682);overflow-wrap:anywhere}

/* fb31 T-36 (R31-36 "one touch rule"): on a touch device every text box, select and textarea is at least 16 px, so iOS does not
   zoom the page in when one takes focus. !important because the per-class sizes (.db-note, .cf input, .modal-field textarea,
   .lg-input, .jn-input, the date chips …) are all more specific than an element selector. Never maximum-scale / user-scalable. */
@media (pointer:coarse){
  input:is(:not([type]),[type=text],[type=search],[type=email],[type=tel],[type=url],[type=number],[type=password],[type=date],[type=time],[type=datetime-local],[type=month],[type=week]),select,textarea{font-size:max(16px,1em)!important}
}
