/* P5-85A ONE-BOARD SCHEDULE (R-1012-37). House look: tokens.css + storm-look.css;
   type floor 18 px; no colour literal here - a GF's colour arrives in the payload
   and is set inline by schedule-board.js; everything else is a token. */
#sb-main { margin: 0; }
.sb { color: var(--c-text); background: var(--c-bg); font-size: 18px; line-height: 1.2; }
.sb *, .sb *::before { box-sizing: border-box; }
.sb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 16px 10px; border-bottom: 2px solid var(--c-rule); }
.sb-top h1 { font-size: 26px; margin: 0; font-weight: 700; }
.sb-range { color: var(--c-border); font-size: 20px; white-space: nowrap; }
.sb-btn { min-height: var(--tap); width: auto; margin: 0; white-space: nowrap; border: 2px solid var(--c-border); border-radius: 12px;
  padding: 8px 14px; font-size: 18px; color: var(--c-text); background: var(--c-bg); }
/* P5-94C: the ‹ › step pair at the zoom row's right end, 56 px square */
.sb-step { min-width: 56px; min-height: 56px; padding: 0; font-size: 26px; font-weight: 700; }
/* P5-111 item 5 (R-1012-40): measured 29 x 56 on the phone - the pair never shrinks under 56 x 56 */
.sb-zrow .sb-step { flex: 0 0 56px; width: 56px; height: 56px; }
.sb-step[data-sb-nav="-1"] { margin-left: auto; }
.sb-btn[aria-pressed="true"] { background: var(--c-chosen-bg); color: var(--c-chosen-text); border-color: var(--c-chosen-bg); font-weight: 700; }
.sb-sp { flex: 1; }
.sb-sample { font-size: 18px; color: var(--c-alert-text); background: var(--c-alert-bg); border-radius: 8px; padding: 4px 10px; font-weight: 700; }

.sb-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 10px 16px 12px; border-bottom: 1px solid var(--c-rule); }
.sb-lt { color: var(--c-border); }
.sb-lg { display: flex; align-items: center; gap: 8px; }
.sb-lgn b { display: block; font-size: 18px; }
.sb-lgn small { display: block; font-size: 18px; color: var(--c-border); font-weight: 400; }
.sb-sw { width: 40px; height: 26px; border-radius: 13px; border: 2px solid var(--c-bg); outline: 2px solid var(--c-border); }
.sb-break { flex-basis: 100%; height: 0; }
.sb-key { display: flex; align-items: center; gap: 8px; color: var(--c-border); }
.sb-k-hol { width: 46px; height: 26px; border-radius: 13px; border: 3px solid var(--c-text); background: linear-gradient(90deg, var(--c-bg) 0 50%, var(--c-text) 50%); }
.sb-k-tl { width: 4px; height: 28px; background: var(--c-text); }
.sb-k-st, .sb-wx { background: repeating-linear-gradient(45deg, var(--c-text) 0 4px, transparent 4px 10px); }
.sb-k-st { width: 26px; height: 28px; border: 1px solid var(--c-text); opacity: .75; }
.sb-k-op { width: 40px; height: 26px; border: 2px dashed var(--c-border); border-radius: 6px; }

.sb-wrap { position: relative; }
.sb-board { position: relative; overflow: hidden; }
.sb-tray { position: absolute; left: 0; top: 0; bottom: 0; width: 64px; z-index: 10; background: var(--c-bg); border-right: 2px solid var(--c-rule);
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 8px; overflow: hidden; }
.sb-tray-open { min-height: var(--tap); width: 46px; margin: 0; font-size: 22px; border: 2px solid var(--c-border); border-radius: 10px;
  color: var(--c-text); background: var(--c-bg); padding: 0; }
.sb-tray-cnt { font-size: 18px; font-weight: 700; writing-mode: vertical-rl; transform: rotate(180deg); color: var(--c-border); white-space: nowrap; }
.sb-chip { writing-mode: vertical-rl; transform: rotate(180deg); border: 2px dashed var(--c-border); border-radius: 22px; padding: 12px 6px;
  font-size: 18px; font-weight: 700; background: var(--c-bg); color: var(--c-text); width: auto; min-height: 0; margin: 0; }
.sb-tray--open { width: 260px; align-items: stretch; padding: 8px 10px; box-shadow: 8px 0 24px var(--c-bg); overflow-y: auto; }
.sb-tray--open .sb-tray-cnt { writing-mode: horizontal-tb; transform: none; }
.sb-tbub { display: block; width: 100%; text-align: left; min-height: var(--tap); margin: 0 0 8px; border: 2px solid var(--c-border); border-radius: 22px;
  padding: 7px 14px; background: var(--c-bg); color: var(--c-text); }
.sb-tbub b { display: block; font-size: 18px; }
.sb-tbub small { display: block; font-size: 18px; color: var(--c-border); font-weight: 400; }
.sb-tbub--unset small { color: var(--c-accent); }

.sb-wh { position: absolute; top: 0; height: 60px; font-size: 18px; text-align: center; padding-top: 6px; border-left: 1px solid var(--c-rule); }
.sb-wh small { display: block; font-size: 18px; color: var(--c-border); }
.sb-wh--lab { text-align: left; padding-left: 14px; color: var(--c-border); border-left: 0; }
.sb-wh.sb-o { color: var(--c-border); }
.sb-colbg { position: absolute; top: 60px; bottom: 0; border-left: 1px solid var(--c-rule); }
.sb-colbg.sb-o { border-left: 1px dashed var(--c-border); opacity: .6; }
.sb-openlab { position: absolute; top: 68px; font-size: 18px; color: var(--c-border); text-align: center; padding-top: 10px; }
.sb-row { position: absolute; right: 0; border-top: 1px solid var(--c-rule); }
.sb-row--first { border-top: 2px solid var(--c-border); }
.sb-lab { position: absolute; left: 0; top: 0; height: 100%; padding: 7px 10px 0 14px; background: var(--c-bg); }
.sb-lab b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-lab span { display: block; font-size: 18px; color: var(--c-border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-lab i { position: absolute; left: 0; top: 6px; bottom: 6px; width: 6px; border-radius: 3px; }

/* a bubble: the GF's colour, black words on it (the sketch), hollow front for the overlap days */
.sb-bub { position: absolute; height: 56px; min-height: 0; margin: 0; border-radius: 28px; border: 3px solid; color: var(--c-on-accent);
  padding: 4px 10px 0; white-space: nowrap; overflow: hidden; text-align: left; cursor: pointer; z-index: 3; }
.sb-bub b, .sb-bub span { position: relative; display: table; font-size: 18px; padding: 0 4px; margin-left: -4px; border-radius: 4px; color: var(--c-on-accent); }
.sb-bub b { font-weight: 800; }
.sb-bub span { font-weight: 500; }
/* past 12 GFs: the second ring - outline in the GF colour, dark words on the page colour */
.sb-bub--ring b, .sb-bub--ring span { background: transparent !important; color: var(--c-text); }
/* p5-85l defect 4: a bubble narrower than its label - tight padding, the name trimmed with … in JS, hours tag kept */
.sb-bub--min { padding-right: 4px; border-radius: 14px; }
.sb-zrow { display: flex; flex-wrap: nowrap; gap: 8px; }
/* p5-85e defect 4: the drop target cell lights up while a ghost is over it */
.drop-cell { background: var(--c-chosen-bg); opacity: .35; outline: 3px solid var(--c-chosen-bg); border-radius: 6px; }
.lifted { opacity: .4; }
.sb-today { position: absolute; top: 56px; bottom: 0; width: 4px; background: var(--c-text); z-index: 5; pointer-events: none; }
.sb-todaylab { position: absolute; z-index: 6; background: var(--c-alert-bg); color: var(--c-alert-text); font-weight: 700; font-size: 18px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
/* p5-85e defect 3: the stripe sits BEHIND the bubbles (z 2 < bubble z 3), full column height */
.sb-wx { position: absolute; top: 60px; bottom: 0; z-index: 2; opacity: .7; border-left: 1px solid var(--c-text); border-right: 1px solid var(--c-text); pointer-events: none; }
.sb-wxlab { position: absolute; z-index: 6; background: var(--c-bg); color: var(--c-text); border: 2px solid var(--c-text); font-size: 18px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }

.sb-foot { padding: 10px 16px 14px; color: var(--c-border); font-size: 18px; border-top: 1px solid var(--c-rule); }
.sb-foot p { margin: 0 0 6px; }
.sb-assumed b { color: var(--c-text); }
.sb-as { display: inline-block; background: var(--c-alert-bg); color: var(--c-alert-text); border-radius: 6px; padding: 0 6px; font-weight: 700; margin: 2px 4px 2px 0; }

/* phone (390): the two-row crop per GF, "starts MM/DD ›" for later jobs, no drag */
.sb--phone .sb-top { padding: 10px 12px 8px; gap: 8px; }
.sb--phone .sb-range { font-size: 18px; white-space: normal; }
.sb--phone .sb-legend { padding: 8px 12px; gap: 8px 14px; }
/* P5-95: the p5-85e folded legend is gone - the phone draws the desk's GF chips (schedule-board.js sbLegendHtml) */
.sb--phone .sb-zrow { width: 100%; gap: 6px; }
.sb--phone .sb-zrow .sb-btn { padding: 8px 10px; }
.sb--phone .sb-zrow .sb-step { padding: 0; }
/* P5-111 item 5: on the phone the zoom row may take a second line so nothing in it is squeezed */
.sb--phone .sb-zrow { flex-wrap: wrap; }
.sb--phone .sb-wh small { display: none; }
.sb--phone .sb-lab { padding: 6px 4px 0 10px; }
.sb--phone .sb-bub { height: 50px; border-radius: 25px; }
.sb--phone .sb-bub span { display: none; }
/* P5-111 item 3 (R-1012-40): a short phone bubble gives its name two lines (18 px floor kept) before the … ;
   the whole name is in the card on tap */
.sb--phone .sb-bub { white-space: normal; padding-top: 2px; }
.sb--phone .sb-bub b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; line-height: 20px; max-height: 40px; overflow-wrap: anywhere; }
.sb-later { padding: 6px 12px; border-top: 1px solid var(--c-rule); }
.sb-starts { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap); margin: 0 0 6px; text-align: left;
  border: 2px solid var(--c-border); border-radius: 12px; background: var(--c-bg); color: var(--c-text); padding: 6px 10px; }
.sb-starts i { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.sb-starts b { flex: 1; font-size: 18px; }
.sb-starts span { font-size: 18px; color: var(--c-accent); }
.sb-ptray { padding: 6px 12px; }
.sb-ptray-h { font-size: 18px; color: var(--c-border); margin: 6px 0; }

#sb-wait { display: flex; align-items: center; padding: 16px; font-weight: 700; }
.sb-wait-spin { display: inline-block; width: 28px; height: 28px; flex: none; margin-right: 8px;
  background: url(img/hurricane-512.png) center / contain no-repeat; animation: sb-hspin 1.5s linear infinite; }
@keyframes sb-hspin { to { transform: rotate(360deg); } }
#sb-wait[hidden], #sb-refused[hidden], #sb-fallback[hidden] { display: none; }
#sb-fallback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--c-bg); border-top: 3px solid var(--c-accent); padding: 14px 16px 18px; }
#sb-fallback h2 { margin: 0 0 6px; font-size: 24px; }

/* P5-85g production days on / off (web/schedule-board-days.js): an off day greys */
.sbd-off { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none;
  background: var(--c-border); opacity: .38; }
.sb-wh[data-sbd-week] { cursor: pointer; }
.sb-wh.sbd-head-off { opacity: 0.55; }
.sbd-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 18px; font-weight: 700;
  background: var(--c-border); color: var(--c-bg); }
#sbd-chips, #sbd-undo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--c-bg);
  border-top: 3px solid var(--c-accent); padding: 12px 16px 16px; }
#sbd-chips[hidden], #sbd-undo[hidden], #sbd-wait[hidden] { display: none; }
#sbd-undo { display: flex; align-items: center; gap: 12px; font-weight: 700; }
#sbd-wait { position: fixed; top: 8px; right: 8px; z-index: 22; display: flex; align-items: center; margin: 0; }
.sbd-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sbd-chip { min-width: 72px; min-height: 48px; font-size: 18px; font-weight: 700; border: 2px solid var(--c-accent);
  border-radius: 8px; background: var(--c-bg); color: inherit; }
.sbd-chip--off { background: var(--c-bg); border-style: dashed; border-color: var(--c-border); color: var(--c-border); opacity: .7; }
/* P5-85I customer picker (schedule-board-customer.js): the row at the very top; phone = chips scroll sideways */
.sbc { display: flex; align-items: center; gap: 10px 14px; padding: 12px 16px 10px; border-bottom: 2px solid var(--c-rule); color: var(--c-text); background: var(--c-bg); font-size: 18px; }
.sbc-lt { font-weight: 700; font-size: 20px; white-space: nowrap; }
/* p5-85l defect 3: one line on every width; the row scrolls sideways */
.sbc-chips { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; min-width: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.sbc-chips .sbc-chip { flex: 0 0 auto; }
.sbc-chip { min-height: var(--tap); width: auto; margin: 0; white-space: nowrap; border: 2px solid var(--c-border); border-radius: 22px;
  padding: 8px 16px; font-size: 18px; color: var(--c-text); background: var(--c-bg); }
.sbc-chip--empty { border-style: dashed; color: var(--c-border); }
.sbc-chip[aria-pressed="true"] { background: var(--c-chosen-bg); color: var(--c-chosen-text); border-color: var(--c-chosen-bg); border-style: solid; font-weight: 700; }
.sbc--phone { padding: 10px 12px 8px; }
.sbc--phone .sbc-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.sbc--phone .sbc-chip { scroll-snap-align: start; flex: 0 0 auto; }
/* P5-113 United SO / WO / Circuit work: three native dropdowns side by side; the active one has the pressed look */
.sbc-sel { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.sbc-sel select { min-height: 44px; max-width: 260px; margin: 0; padding: 6px 12px; font-size: 18px;
  color: var(--c-text); background: var(--c-bg); border: 2px solid var(--c-border); border-radius: 22px; }
.sbc-sel--on select { background: var(--c-chosen-bg); color: var(--c-chosen-text); border-color: var(--c-chosen-bg); font-weight: 700; }
.sbc--phone .sbc-sel select { max-width: 200px; }
.sbc-mark { outline: 4px solid var(--c-accent); outline-offset: 2px; }
/* P5-111 item 1 (R-1012-40): at desk widths every customer chip shows - the row wraps to a second line;
   the phone (.sbc--phone, <= 600) keeps its one sideways-scrolling line */
.sbc:not(.sbc--phone) .sbc-chips { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; }

/* P5-85j a job's own days (web/schedule-board-jobdays.js): Days zoom draws each placed bubble as
   day segments; a grey segment = no work that day = the GF colour at 30% (the page colour at 70% over it) */
.sbj-seg { position: absolute; top: -3px; bottom: -3px; margin-left: -3px; z-index: 0; border-right: 1px dashed var(--c-border); }
.sbj-seg--off { background: var(--c-bg); opacity: .7; }
.sb-bub b, .sb-bub span { z-index: 1; }
#sbj-undo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--c-bg); padding: 12px 16px;
  border-top: 3px solid var(--c-border); display: flex; align-items: center; gap: 12px; font-weight: 700; }
#sbj-wait { position: fixed; top: 8px; right: 8px; z-index: 22; display: flex; align-items: center; margin: 0; }
#sbj-undo[hidden], #sbj-wait[hidden] { display: none; }

/* P5-85K week expand (web/schedule-board-weekexpand.js): one tapped week opens into its days */
.sb[data-zoom="quarter"] .sb-wh:not(.sb-wh--lab), .sb[data-zoom="weeks"] .sb-wh:not(.sb-wh--lab) { cursor: pointer; }
.wx-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; }
.wx-band { position: absolute; top: 0; height: 24px; margin: 0; padding: 0; border: 0; border-bottom: 2px solid var(--c-accent);
  background: var(--c-bg); color: var(--c-accent); font-size: 18px; line-height: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.wx-dh { position: absolute; top: 24px; height: 36px; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--c-rule);
  background: var(--c-bg); color: inherit; font-size: 18px; font-weight: 700; line-height: 18px; overflow: hidden; }
.wx-dh small { display: block; font-size: 18px; color: var(--c-border); }
.wx-dh--off { background: var(--c-bg); border-style: dashed; color: var(--c-border); }
.wx-dh--off small { color: var(--c-border); font-weight: 800; }
.wx-dh[aria-disabled="true"] { cursor: default; }
.wx-off { position: absolute; top: 60px; pointer-events: none; background: var(--c-border); opacity: .38; }
.wx-seg { position: absolute; height: 56px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent;
  border-right: 1px solid var(--c-bg); }
.wx-seg--off { background: var(--c-border); opacity: .78; }
/* P5-111 item 2 (R-1012-40): the open week's day chips over a bubble never cover its name. The house button look
   (storm-look.css "button": black fill, 2 px edge, glow; tokens.css button[aria-pressed]: the chosen fill) out-ranked
   .wx-seg and painted an opaque chip over the words. A day chip is see-through; an off day is a dashed edge and a
   grey bar along the bubble's foot, under the words */
.wx-layer .wx-seg, .wx-layer .wx-seg[aria-pressed="true"] { background: transparent; color: inherit; border: 0;
  border-right: 1px dashed var(--c-bg); border-radius: 6px; box-shadow: none; opacity: 1; }
.wx-layer .wx-seg.wx-seg--off { background: transparent; border: 2px dashed var(--c-bg); box-shadow: inset 0 -8px 0 var(--c-border); }
.wx-layer .wx-band, .wx-layer .wx-dh { box-shadow: none; min-height: 0; }
.sb--phone { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* P5-111B (JD 10/13 8:37 PM walk row 36; p5-104 left a 12 px page scroll at 1280x800, "tray chips run below the dock"):
   p5-104's chain (web/dead-space.css) is flex 1 0 auto - it only grows, so the grid's drawn height (inline, rows + 56)
   pushed the body past 100dvh. At desk widths the page is exactly 100vh (its padding = the dock reserve), the chain may
   shrink, and the grid scrolls inside .sb-wrap; the grid still grows to the dock (p5-104 kept); the tray ends at the
   dock and its chips scroll inside it, not the page; phone unchanged */
@media (min-width: 900px) {
  body.sched-board { height: 100vh; height: 100dvh; }
  body.sched-board > #sb-main:not([hidden]) { flex: 1 1 0; min-height: 0; }
  body.sched-board #sb-main > .sb:not(.sb--phone) { flex: 1 1 0; min-height: 0; }
  body.sched-board .sb:not(.sb--phone) > .sb-wrap { flex: 1 1 0; min-height: 0; overflow: auto; }
  body.sched-board .sb:not(.sb--phone) > .sb-wrap > .sb-tray { overflow-x: hidden; overflow-y: auto; }
}
