/* LeanFlow Sequence - Standard Work card builder (builder.js). Tokens come from /public/css/light.css.
   Every rule starts with .sb so the pane rules in sequence.css (.pane p ...) do not override it. */

.sb { container-type: inline-size; font-family: var(--font-sans); color: var(--navy-ink); }
.sb [hidden] { display: none !important; }
.sb .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.sb .sb-lead { margin: 0 0 10px; font-size: 14.5px; line-height: 1.45; font-weight: 500; color: var(--navy); }
.sb .sb-head { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); line-height: 1.3; }

.sb .sb-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 640px) {
  .sb .sb-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
}

/* ----- Icons ----- */
.sb .sb-ic {
  flex: none; width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #FFFFFF;
}
.sb .sb-ic.hand { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-border); }
.sb .sb-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb .sb-ic.sm { width: 18px; height: 18px; border-radius: 5px; }
.sb .sb-ic.sm svg { width: 12px; height: 12px; }

/* ----- Cards (tray and steps) ----- */
.sb .sb-card {
  font: inherit; color: var(--navy); text-align: left;
  background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 1px 2px rgba(12, 23, 68, 0.05);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.sb .sb-text { display: flex; flex-direction: column; min-width: 0; }
.sb .sb-label { font-size: 13.5px; font-weight: 600; line-height: 1.25; color: var(--navy); }
.sb .sb-meta { font-size: 12px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 1px; }

.sb .sb-tray { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sb .sb-trayitem { display: flex; min-width: 0; }
.sb .sb-traycard {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; min-height: 46px; cursor: grab;
}
.sb .sb-traycard:hover { border-color: var(--navy); }
.sb .sb-traydone { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); background: var(--paper); border-radius: 8px; padding: 8px 10px; }
.sb .sb-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.sb .sb-key > span { display: inline-flex; align-items: center; gap: 5px; }
.sb .sb-key .sb-key-note { flex-basis: 100%; }

.sb .sb-slots { list-style: none; margin: 0; padding: 0; }
.sb .sb-slot { margin: 0 0 5px; border-radius: 9px; }
.sb .sb-empty {
  display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 6px 10px;
  border: 1.5px dashed var(--line-strong); border-radius: 8px; background: rgba(255, 255, 255, 0.6);
  font-size: 13.5px; font-weight: 600; color: var(--faint);
}
.sb .sb-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #FFFFFF; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sb .sb-empty .sb-num { background: var(--paper); color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); }

.sb .sb-placed { display: flex; align-items: stretch; min-height: 46px; overflow: hidden; }
.sb .sb-handle {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 4px 6px; background: var(--paper); border-right: 1px solid var(--line);
  cursor: grab; touch-action: none;
}
.sb.sb-ro .sb-handle { cursor: default; touch-action: auto; }
.sb .sb-grip { display: block; width: 10px; height: 14px; }
.sb .sb-grip svg { display: block; width: 10px; height: 14px; fill: var(--faint); }
.sb .sb-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  font: inherit; color: inherit; text-align: left; background: none; border: 0; border-radius: 0;
  padding: 6px 8px; cursor: pointer;
}
.sb.sb-ro .sb-main { cursor: default; }
.sb button.sb-main:hover { background: #FBFAF7; }
.sb .sb-moves { flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.sb .sb-move {
  flex: 1; width: 34px; min-height: 24px; display: flex; align-items: center; justify-content: center;
  font: inherit; color: var(--muted); background: #FFFFFF; border: 0; padding: 0; cursor: pointer;
}
.sb .sb-move + .sb-move { border-top: 1px solid var(--line); }
.sb .sb-move:hover:not(:disabled) { background: var(--paper); color: var(--navy); }
.sb .sb-move:disabled { opacity: 0.3; cursor: default; }
.sb .sb-move svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.sb .sb-repeat { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.sb .sb-repeat .sb-ic { background: var(--paper); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ----- Light flags on a step, once all six are placed ----- */
.sb .sb-flags { display: flex; flex-wrap: wrap; gap: 3px 4px; margin-top: 3px; }
.sb .sb-flag { font-size: 11.5px; font-weight: 600; line-height: 1.3; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.sb .sb-flag.skipped { color: var(--muted); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); white-space: normal; }
.sb .sb-flag.ready { color: var(--navy); background: #E8EEFB; box-shadow: inset 0 0 0 1px #C9D5F2; }
.sb .sb-flag.gw { color: #713F12; background: #FEF9C3; box-shadow: inset 0 0 0 1px #FDE68A; }
.sb .sb-flag.ow { color: var(--muted); background: #EEF0F5; }

/* ----- Focus, drag ----- */
.sb button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; position: relative; z-index: 1; }
.sb .sb-main:focus-visible, .sb .sb-move:focus-visible { outline-offset: -3px; }
.sb .sb-dragging { opacity: 0.35; }
.sb.sb-is-dragging .sb-traycard, .sb.sb-is-dragging .sb-main, .sb.sb-is-dragging .sb-handle { cursor: grabbing; }
.sb .sb-slot.sb-over { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.sb .sb-slot.sb-over .sb-empty { border-color: var(--accent); color: var(--accent-strong); }
.sb .sb-traywrap.sb-over { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); border-radius: 10px; }
.sb-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; margin: 0; pointer-events: none;
  display: flex; align-items: stretch; gap: 8px;
  font-family: var(--font-sans); color: var(--navy);
  background: #FFFFFF; border: 1px solid var(--navy); border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 28px rgba(12, 23, 68, 0.22);
  opacity: 0.96;
}
/* the ghost is outside .sb, so it carries its own copy of the card styles */
.sb-ghost.sb-traycard { align-items: center; padding: 7px 9px; }
.sb-ghost .sb-ic { flex: none; width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: #0C1744; color: #FFFFFF; }
.sb-ghost .sb-ic.hand { background: #FFF1E6; color: #C2410C; }
.sb-ghost .sb-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-ghost .sb-text { display: flex; flex-direction: column; min-width: 0; }
.sb-ghost .sb-label { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.sb-ghost .sb-meta { font-size: 12px; color: #5B6480; }
.sb-ghost .sb-handle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 6px; background: #F7F6F2; }
.sb-ghost .sb-num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #0C1744; color: #FFFFFF; font-size: 11.5px; font-weight: 700; }
.sb-ghost .sb-grip svg { display: block; width: 10px; height: 14px; fill: #8A91A8; }
.sb-ghost .sb-main { flex: 1; display: flex; align-items: center; gap: 8px; padding: 6px 8px; font: inherit; color: inherit; background: none; border: 0; text-align: left; }
.sb-ghost .sb-moves, .sb-ghost .sb-flags { display: none; }

/* ----- Chart and facts ----- */
.sb .sb-chart { margin-top: 12px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 10px; }
.sb .sb-chart-head { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--muted); }
.sb .sb-gantt { display: block; width: 100%; height: 124px; }
@container (min-width: 480px) { .sb .sb-gantt { height: 144px; } }

/* one row under the chart when it fits; items never break inside, so on a phone they wrap whole */
.sb-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; list-style: none; margin: 6px 0 0; padding: 0; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.sb-legend li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sb-legend .sb-sw-parts { display: inline-flex; border-radius: 2px; overflow: hidden; }
.sb-legend .sb-sw-parts i { display: block; width: 4px; height: 10px; }
.sb-legend .sb-sw-walk {
  display: inline-block; width: 16px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'%3E%3Cpath d='M1 4q2-3 4 0t4 0 4 0 2-1' fill='none' stroke='%235B6480' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
}
.sb-legend .sb-sw-ow { display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: #E9ECF3; box-shadow: inset 0 0 0 1px #D5DAE5; }
.sb-legend .sb-sw-skip { display: inline-block; width: 10px; text-align: center; font-weight: 700; color: #8A91A8; line-height: 1; }
.sb-legend .sb-sw-gw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: #FACC15; }

.sb .sb-chart-note { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: #B91C1C; }
.sb .sb-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 0; }
.sb .sb-facts div { background: var(--paper); border-radius: 8px; padding: 5px 8px; min-width: 0; }
.sb .sb-facts dt { font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.sb .sb-facts dd { margin: 1px 0 0; font-size: 15px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.sb .sb-facts.on dd { color: var(--navy); }

@media (prefers-reduced-motion: no-preference) {
  .sb .sb-slot { transition: box-shadow 0.12s ease, background-color 0.12s ease; }
}
