/* The journey builder — report 141, the design handoff's A1–A6.
 *
 * EVERY RULE HERE IS UNDER `.jb-`, and nothing here restyles a shared
 * component: the builder's pages use the app shell (rail, header) as it is,
 * and draw their own content to `planning/design/journeys-handoff/`. The
 * values are the README's tokens, named once below.
 */

:root {
  /* ALIASES OF THE SHARED TOKENS — report 190. This block used to hold its
     own copy of the handoff's hex table, so a colour here could drift from
     the same colour in `components.css`, and did: the meta grey (#5F7085),
     the faint grey (#7A8899), the glyph (#A8A093) and the input edge
     (#B6AFA3) are the four values `redesign-2026-09.md` §3 retires for
     failing contrast, and they were still drawn here. Every name now points
     at the shared token, so a colour or a face means the same on every
     screen. The names stay so no rule below had to move. */
  --jb-paper: var(--page-bg);
  --jb-surface: var(--card-bg);
  --jb-subtle: var(--rail-bg);
  --jb-hover: var(--tint-bg);
  --jb-chip: var(--chip-bg);
  --jb-border: var(--line);
  --jb-divider: var(--line-2);
  --jb-input: var(--line-input);
  --jb-btn-border: var(--line-3);
  --jb-ink: var(--ink-1);
  --jb-body2: var(--ink-2);
  --jb-text2: var(--ink-3);
  --jb-meta: var(--ink-4);
  --jb-faint: var(--ink-4);
  --jb-glyph: var(--muted-ink);
  --jb-copper: var(--copper-cta);
  --jb-copper-hover: var(--accent-hi);
  --jb-warn-bg: var(--warn-bg);
  --jb-warn-fg: var(--warn-fg);
  --jb-ok: var(--green-deep);
  --jb-ok-bg: var(--ok-bg);
  --jb-ok-dark: var(--ok-fg);
  --jb-firm-bg: var(--wait-bg);
  --jb-firm-fg: var(--wait-fg);
  --jb-firm-fg2: var(--wait-fg-2);
  --jb-red: var(--alert-fg);
  --jb-red-bg: var(--alert-bg);
  --jb-red-border: var(--alert-dot);
  --jb-red-dark: var(--alert-fg);
  --jb-changed-bg: #FDF3E7;
  --jb-selected-bg: var(--select-bg);
  --jb-shadow: var(--shadow-shell);
  --jb-dialog-shadow: var(--shadow-dialog);
  --jb-overlay: var(--overlay);
  --jb-sans: var(--font-sans);
  --jb-mono: var(--font-sans);
}

.jb { font-family: var(--jb-sans); color: var(--jb-ink);
      -webkit-font-smoothing: antialiased; }
/* ZERO SPECIFICITY, so every `.jb-*` class below wins over these resets. */
:where(.jb) *, :where(.jb) *::before, :where(.jb) *::after {
  box-sizing: border-box; }
:where(.jb) a { color: var(--accent); text-decoration: none; }   /* the link ink, report 190 */
:where(.jb) a:hover { color: var(--jb-copper-hover);
                      text-decoration: underline; }
:where(.jb) :where(button, input, textarea, select) { font: inherit;
                                                      color: inherit; }
.jb-mono { font-variant-numeric: tabular-nums; }
.jb-hidden, .jb [hidden] { display: none !important; }
.jb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden;
         clip: rect(0 0 0 0); white-space: nowrap; }

/* ── The page ─────────────────────────────────────────────────────── */

.jb-page { width: 100%; padding: 40px 48px 56px; flex: 1; }
.jb-head { display: flex; align-items: flex-end; gap: 16px;
           margin-bottom: 26px; flex-wrap: wrap; }
.jb-head__text { flex: 1; min-width: 0; }
.jb-back { display: inline-block; margin: 0 0 12px; font-size: var(--fs-meta);
           font-weight: 500; }
.jb a.jb-back, .jb .jb-back { color: var(--jb-meta); }
.jb a.jb-back:hover { color: var(--jb-copper); text-decoration: none; }
.jb-title { margin: 0 0 6px; font-size: var(--fs-page-title); font-weight: 600;
            letter-spacing: -0.02em; line-height: 1.15; }
.jb-title--solo { margin-bottom: 30px; }
.jb-sub { margin: 0; font-size: var(--fs-body); color: var(--jb-meta);
          line-height: 1.5; }
.jb-lede { margin: 0 0 24px; font-size: var(--fs-body); color: var(--jb-text2);
           line-height: 1.55; }

/* ── Buttons ──────────────────────────────────────────────────────── */

/* Size, weight, edge and the disabled look are the shared `--btn-*`
   tokens since report 190 — the same button as `.ui-btn` and `.jr-btn`. */
.jb-btn { display: inline-flex; align-items: center; justify-content: center;
          gap: 8px; min-height: var(--btn-min-h);
          padding: var(--btn-pad-y) var(--btn-pad-x); border-radius: var(--radius-sm);
          font-size: var(--btn-fs); font-weight: var(--btn-weight); line-height: 1.2;
          border: 1px solid transparent; cursor: pointer;
          text-decoration: none; white-space: nowrap;
          transition: background 140ms ease, border-color 140ms ease; }
.jb .jb-btn:hover { text-decoration: none; }
.jb-btn--primary { background: var(--primary); color: var(--on-primary);
                   border-color: var(--primary); }
.jb a.jb-btn--primary, .jb a.jb-btn--primary:hover { color: var(--on-anchor); }
.jb-btn--primary:hover:not(:disabled) { background: var(--primary-press); border-color: var(--primary-press); }
.jb-btn--secondary { background: var(--jb-surface); color: var(--jb-ink);
                     border-color: var(--btn-edge); }
.jb a.jb-btn--secondary, .jb a.jb-btn--secondary:hover { color: var(--jb-ink); }
.jb-btn--secondary:hover:not(:disabled) { background: var(--jb-hover); }
.jb-btn--sm { min-height: 0; padding: 8px 14px; font-size: var(--btn-fs); }
.jb-btn--lg { padding: 13px 22px; font-size: var(--fs-body); }
.jb-btn--block { display: flex; width: 100%; }
.jb-btn:disabled, .jb-btn:disabled:hover { opacity: 1; background: var(--btn-off-bg); color: var(--btn-off-fg); border-color: var(--btn-off-edge); cursor: not-allowed; }
.jb-textbtn { background: none; border: 0; padding: 0; cursor: pointer;
              font-size: var(--fs-ui); font-weight: 500; color: var(--jb-copper); }
.jb-textbtn:hover { color: var(--jb-copper-hover); }
.jb-textbtn--danger { color: var(--jb-red); font-size: var(--fs-meta); }
.jb-textbtn--danger:hover { color: var(--jb-red-dark); }
.jb-textbtn--quiet { color: var(--jb-text2); font-size: var(--fs-meta); }

/* ── Chips ────────────────────────────────────────────────────────── */

/* The shared pill, report 190 (components.css §1 `--pill-*`). */
.jb-chip { display: inline-block; white-space: nowrap;
           padding: var(--pill-pad-y) var(--pill-pad-x); border-radius: var(--radius-pill);
  font-size: var(--pill-fs); font-weight: var(--pill-weight); line-height: var(--pill-lh); }
.jb-chip--live { background: var(--jb-ok-bg); color: var(--jb-ok); }
.jb-chip--draft, .jb-chip--warn { background: var(--jb-warn-bg);
                                  color: var(--jb-warn-fg); }
.jb-chip--broker { background: var(--jb-firm-bg); color: var(--jb-firm-fg); }
.jb-chip--team { background: var(--jb-chip); color: var(--jb-text2); }
.jb-chip--retired { background: var(--jb-chip); color: var(--jb-meta); }
.jb-chip--alert { background: var(--jb-red-bg); color: var(--jb-red-dark); }
.jb-tag { font-size: var(--fs-micro); font-weight: 600; padding: 2px 8px;
          border-radius: var(--radius-pill); line-height: 1.4; }
.jb-tag--new { background: var(--jb-ok); color: var(--on-anchor); }
.jb-tag--changed { background: var(--jb-copper); color: var(--on-anchor); }
.jb-tag--fix { background: var(--jb-red-bg); color: var(--jb-red-dark); }

/* ── A1: the table of journey types ───────────────────────────────── */

.jb-table { background: var(--jb-surface); border: 1px solid var(--jb-border);
            border-radius: var(--radius-lg); overflow: hidden; }
.jb-table__head, .jb-table__row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 120px 150px 150px 200px;
  gap: 16px; align-items: center; padding: 16px 22px; }
.jb-table__head { padding-top: 12px; padding-bottom: 12px;
                  background: var(--jb-subtle);
                  border-bottom: 1px solid var(--jb-divider);
                  font-size: var(--fs-label); font-weight: 600; color: var(--jb-meta); }
.jb-table__row { border-top: 1px solid var(--jb-divider); cursor: pointer;
                 transition: background 140ms ease; color: var(--jb-ink); }
.jb-table__row:first-of-type { border-top: 0; }
.jb .jb-table__row { color: var(--jb-ink); }
.jb .jb-table__row:hover { background: var(--jb-hover);
                           text-decoration: none; color: var(--jb-ink); }
.jb-table__name { display: flex; flex-direction: column; gap: 3px;
                  min-width: 0; }
.jb-table__name b { font-size: var(--fs-body); font-weight: 500; }
.jb-table__name span { font-size: var(--fs-meta); color: var(--jb-meta); }
.jb-table__count { font-variant-numeric: tabular-nums; font-size: var(--fs-ui); }
.jb-table__count--none { color: var(--jb-glyph); }
.jb-table__acts { font-size: var(--fs-ui); color: var(--jb-text2); }
.jb-table__changed { font-size: var(--fs-meta); color: var(--jb-meta); }
.jb-table__label { display: none; }

.jb-empty { max-width: 620px; margin: 40px auto 0; text-align: center; }
.jb-empty h2 { margin: 0 0 10px; font-size: var(--fs-heading); font-weight: 600; }
.jb-empty p { margin: 0 0 24px; font-size: var(--fs-body); line-height: 1.6;
              color: var(--jb-text2); }
.jb-empty__actions { display: flex; justify-content: center; gap: 10px;
                     flex-wrap: wrap; }
.jb-empty .jb-btn { padding: 12px 20px; font-size: var(--fs-body); }

/* ── A2: create by describing ─────────────────────────────────────── */

.jb-new { display: grid; grid-template-columns: minmax(0, 1fr) 360px;
          gap: 36px; align-items: start; }
.jb-field { display: flex; flex-direction: column; gap: 7px;
            margin: 0 0 18px; font-size: var(--fs-meta); font-weight: 500;
            color: var(--jb-text2); }
.jb-input { font-size: var(--fs-section); color: var(--jb-ink); padding: 12px 14px;
            border: 1px solid var(--jb-input); border-radius: var(--radius-sm);
            background: var(--jb-surface); width: 100%; font-weight: 400; }
.jb-input:focus, .jb-textarea:focus, .jb-select:focus {
  outline: 2px solid var(--jb-ink); outline-offset: 1px; }
.jb-textarea { font-size: var(--fs-body); line-height: 1.6; color: var(--jb-ink);
               padding: 14px 16px; border: 1.5px solid var(--jb-ink);
               border-radius: var(--radius); background: var(--jb-surface);
               resize: vertical; width: 100%; font-weight: 400; }
.jb-attach { display: flex; align-items: center; gap: 14px;
             padding: 14px 16px; border: 1px dashed var(--jb-input);
             border-radius: var(--radius); background: var(--jb-surface);
             margin: 0 0 22px; }
.jb-attach__tag { width: 34px; height: 42px; flex: none; border-radius: var(--radius-xs);
                  background: var(--jb-chip); font-variant-numeric: tabular-nums;
                  font-size: var(--fs-micro); color: var(--jb-text2); display: flex;
                  align-items: center; justify-content: center; }
.jb-attach__text { flex: 1; display: flex; flex-direction: column; gap: 2px;
                   min-width: 0; }
.jb-attach__text b { font-size: var(--fs-ui); font-weight: 500; }
.jb-attach__text span { font-size: var(--fs-meta); color: var(--jb-meta); }
.jb-attach input[type=file] { font-size: var(--fs-meta); color: var(--jb-text2);
                              max-width: 100%; }
.jb-card { background: var(--jb-surface); border: 1px solid var(--jb-border);
           border-radius: var(--radius-lg); padding: 22px; }
.jb-card h2 { margin: 0 0 14px; font-size: var(--fs-section); font-weight: 600; }
.jb-card ol { margin: 0; padding-left: 20px; display: flex;
              flex-direction: column; gap: 12px; font-size: var(--fs-ui);
              line-height: 1.55; color: var(--jb-body2); }
.jb-new__aside { margin-top: 90px; }
.jb-who { display: flex; gap: 4px; padding: 4px; background: var(--jb-chip);
          border-radius: var(--radius-sm); margin: 0 0 18px; }
.jb-busy[aria-busy=true] { opacity: 0.7; }

/* ── A3: the editor ───────────────────────────────────────────────── */

.jb-editor { display: flex; flex-direction: column; flex: 1; min-width: 0;
             background: var(--jb-paper); }
/* Report 147 (B9): what the broker calls it, under the type's own name. */
.jb-brokername { display: flex; align-items: center; gap: 8px; margin-top: 8px;
                 flex-wrap: wrap; }
.jb-brokername > span { font-size: var(--fs-meta); color: var(--ink-4); }
.jb-brokername input { font: inherit; font-size: var(--fs-body); color: var(--jb-ink);
                       min-height: 40px; padding: 0 12px; border: 1px solid var(--jb-input);
                       border-radius: var(--radius-sm); background: var(--jb-surface);
                       width: 280px; max-width: 100%; }
.jb-brokername input::placeholder { color: var(--jb-faint); }
.jb-brokername b { font-size: var(--fs-body); font-weight: 600; }
.jb-tabs { display: flex; gap: 4px; padding: 0 32px;
           background: var(--jb-surface);
           border-bottom: 1px solid var(--jb-border); overflow-x: auto; }
.jb-tab { padding: 13px 14px; font-size: var(--fs-ui); font-weight: 400;
          color: var(--jb-text2); border-bottom: 2px solid transparent;
          white-space: nowrap; }
.jb a.jb-tab { color: var(--jb-text2); }
.jb a.jb-tab:hover { color: var(--jb-ink); text-decoration: none; }
.jb a.jb-tab[aria-selected=true] { font-weight: 600; color: var(--jb-ink);
                                   border-bottom-color: var(--jb-ink); }
.jb-listcol { padding: 24px 32px 32px; min-width: 0; }
.jb-listcol__head { display: flex; align-items: center; gap: 12px;
                    margin-bottom: 14px; }
.jb-listcol__head p { margin: 0; font-size: var(--fs-ui); color: var(--jb-text2);
                      line-height: 1.5; }
.jb-listcol__head .jb-textbtn { margin-left: auto; white-space: nowrap; }

.jb-list { background: var(--jb-surface); border: 1px solid var(--jb-border);
           border-radius: var(--radius-lg); overflow: hidden; margin: 0; padding: 0;
           list-style: none; }
.jb-row { display: flex; align-items: flex-start; gap: 12px;
          padding: 13px 18px 13px 12px;
          border-top: 1px solid var(--jb-divider);
          background: var(--jb-surface); color: var(--jb-ink);
          transition: background 140ms ease; }
.jb-list > li:first-child > .jb-row, .jb-list > .jb-row:first-child {
  border-top: 0; }
.jb a.jb-row { color: var(--jb-ink); }
.jb a.jb-row:hover { background: var(--jb-hover); text-decoration: none;
                     color: var(--jb-ink); }
.jb-row.is-selected, .jb a.jb-row.is-selected:hover {
  background: var(--jb-selected-bg); box-shadow: inset 3px 0 0 var(--jb-ink); }
.jb-row--added { background: var(--jb-ok-bg); }
.jb-row--changed { background: var(--jb-changed-bg); }
.jb-row__grip { width: 16px; flex: none; color: var(--jb-btn-border);
                font-size: var(--fs-meta); line-height: 22px; text-align: center;
                cursor: grab; user-select: none; letter-spacing: -2px; }
.jb-row__n { font-variant-numeric: tabular-nums; font-size: var(--fs-label);
             color: var(--jb-faint); width: 20px; flex: none;
             line-height: 22px; }
.jb-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column;
                gap: 4px; }
.jb-row__title { display: flex; align-items: center; gap: 8px;
                 flex-wrap: wrap; font-size: var(--fs-body); font-weight: 500;
                 line-height: 22px; }
.jb-row__meta { font-size: var(--fs-meta); color: var(--jb-meta); }
.jb-row__cond { font-size: var(--fs-meta); font-style: italic;
                color: var(--jb-copper); }
.jb-row .jb-chip { flex: none; }
.jb-row.is-dragging { opacity: 0.5; }
.jb-row.is-drop-before { box-shadow: inset 0 3px 0 var(--jb-copper); }

.jb-detail { display: flex; flex-direction: column; gap: 20px; }
.jb-detail__top { display: flex; align-items: center; gap: 10px; }
.jb-detail__top .jb-mono { font-size: var(--fs-label); color: var(--jb-faint); }
.jb-detail__top .jb-textbtn--danger { margin-left: auto; }
.jb-lbl { display: flex; flex-direction: column; gap: 6px;
          font-size: var(--fs-meta); font-weight: 500; color: var(--jb-text2); }
.jb-group { display: flex; flex-direction: column; gap: 7px; }
.jb-group__label { font-size: var(--fs-meta); font-weight: 500;
                   color: var(--jb-text2); }
.jb-group__hint { font-size: var(--fs-meta); color: var(--jb-meta);
                  line-height: 1.45; }
.jb-name { font-size: var(--fs-section); font-weight: 500; color: var(--jb-ink);
           padding: 11px 13px; border: 1px solid var(--jb-input);
           border-radius: var(--radius-sm); width: 100%; background: var(--jb-surface); }
.jb-select, .jb-text { font-size: var(--fs-body); color: var(--jb-ink);
                       padding: 11px 13px; border: 1px solid var(--jb-input);
                       border-radius: var(--radius-sm); width: 100%;
                       background: var(--jb-surface); font-weight: 400; }
.jb-area { font-size: var(--fs-ui); line-height: 1.55; color: var(--jb-ink);
           padding: 11px 13px; border: 1px solid var(--jb-input);
           border-radius: var(--radius-sm); resize: vertical; width: 100%;
           background: var(--jb-surface); font-weight: 400; }

.jb-seg { display: flex; gap: 4px; padding: 4px; background: var(--jb-chip);
          border-radius: var(--radius-sm); }
.jb-seg label { flex: 1; position: relative; cursor: pointer; margin: 0; }
.jb-seg input { position: absolute; opacity: 0; pointer-events: none; }
.jb-seg span { display: block; text-align: center; padding: 8px 0;
               border-radius: var(--radius-inner); font-size: var(--fs-ui); color: var(--jb-text2); }
.jb-seg input:checked + span { background: var(--jb-surface); font-weight: 500;
                               color: var(--jb-ink); }
.jb-seg input:focus-visible + span { outline: 2px solid var(--jb-ink); }

.jb-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jb-pill { display: inline-flex; align-items: center; gap: 6px;
           padding: 6px 11px; border-radius: var(--radius-pill);
           background: var(--jb-chip); font-size: var(--fs-meta); cursor: pointer; }
.jb-pill input { position: absolute; opacity: 0; pointer-events: none; }
.jb-pill__x { color: var(--jb-text2); font-size: var(--fs-label); }
.jb-pill.is-off { display: none; }
.jb-pill-add { appearance: none; -webkit-appearance: none; width: auto;
  field-sizing: content;
               padding: 6px 11px;
               border-radius: var(--radius-pill); border: 1px dashed var(--jb-input);
               background: var(--jb-surface); font-size: var(--fs-meta);
               color: var(--jb-text2); cursor: pointer; max-width: 100%; }

.jb-rule { padding: 13px 14px; border: 1px solid var(--jb-border);
           border-radius: var(--radius); background: var(--jb-subtle); display: flex;
           flex-direction: column; gap: 9px; font-size: var(--fs-body); }
.jb-rule__line { display: flex; flex-wrap: wrap; align-items: center;
                 gap: 7px; }
.jb-pillsel { appearance: none; -webkit-appearance: none; width: auto;
  field-sizing: content;
              padding: 5px 24px 5px 10px; border-radius: var(--radius-inner);
              background: var(--jb-surface)
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%231A2547'/%3E%3C/svg%3E")
                no-repeat right 9px center;
              border: 1px solid var(--jb-btn-border); font-weight: 500;
              font-size: var(--fs-body); color: var(--jb-ink); max-width: 100%;
              cursor: pointer; }
.jb-pilltext { padding: 5px 10px; border-radius: var(--radius-inner);
               background: var(--jb-surface);
               border: 1px solid var(--jb-btn-border); font-weight: 500;
               font-size: var(--fs-body); width: 12em; max-width: 100%; }
.jb-rule__x { background: none; border: 0; color: var(--jb-text2);
              cursor: pointer; font-size: var(--fs-ui); padding: 2px 4px; }
.jb-rule__raw { font-size: var(--fs-ui); color: var(--jb-text2); line-height: 1.5; }

.jb-radios { display: flex; flex-direction: column; gap: 8px; }
.jb-radio { display: flex; align-items: center; gap: 10px; font-size: var(--fs-ui);
            cursor: pointer; color: var(--jb-ink); font-weight: 400; }
.jb-radio input { appearance: none; -webkit-appearance: none; width: 18px;
                  height: 18px; flex: none; border-radius: var(--radius-pill); margin: 0;
                  border: 1.5px solid var(--jb-input); background: var(--card-bg);
                  cursor: pointer; }
.jb-radio input:checked { border: 6px solid var(--jb-ink); }
.jb-radio input:focus-visible { outline: 2px solid var(--jb-copper);
                                outline-offset: 2px; }
.jb-check { display: flex; align-items: center; gap: 10px; font-size: var(--fs-ui);
            cursor: pointer; font-weight: 400; color: var(--jb-ink); }
.jb-check input { width: 17px; height: 17px; margin: 0;
                  accent-color: var(--jb-ink); }

.jb-timing { padding: 13px 14px; border: 1px solid var(--jb-border);
             border-radius: var(--radius); display: flex; flex-direction: column;
             gap: 9px; font-size: var(--fs-ui); line-height: 1.5; }
.jb-timing__line { display: flex; flex-wrap: wrap; align-items: baseline;
                   gap: 0 5px; }
.jb-num { width: 3.4em; font-weight: 600; font-size: var(--fs-ui);
          color: var(--jb-ink); border: 0;
          border-bottom: 1px dashed var(--jb-input); background: transparent;
          padding: 0 2px; text-align: center; }
.jb-num--wide { width: 5.5em; }
.jb-num:focus { outline: none; border-bottom: 1.5px solid var(--jb-ink); }
.jb-inline-sel { appearance: none; -webkit-appearance: none; border: 0;
                 width: auto; field-sizing: content;
                 border-bottom: 1px dashed var(--jb-input);
                 background: transparent; font-weight: 600; font-size: var(--fs-ui);
                 color: var(--jb-ink); padding: 0 2px; cursor: pointer;
                 max-width: 100%; }
.jb-timing__hint { font-size: var(--fs-meta); color: var(--jb-meta); }

.jb-problems { margin: 0; padding: 12px 14px; border-radius: var(--radius);
               background: var(--jb-red-bg); color: var(--jb-red-dark);
               font-size: var(--fs-meta); line-height: 1.5; list-style: none;
               display: flex; flex-direction: column; gap: 6px; }
/* REPORT 183: teams with nobody or no lead. A warning, so the warn colours
   rather than the red of a problem that blocks. */
.jb-staffing { padding: 12px 14px; border-radius: var(--radius); font-size: var(--fs-meta);
               line-height: 1.5; background: var(--jb-warn-bg);
               color: var(--jb-warn-fg); }
.jb-staffing p { margin: 0; }
.jb-staffing ul { margin: 6px 0; padding-left: 18px; }
.jb-staffing a { color: inherit; }
.jb-table__name span.jb-table__warn { color: var(--jb-warn-fg); }
.jb-sub-list { display: flex; flex-direction: column; gap: 10px; }
.jb-subitem { border: 1px solid var(--jb-border); border-radius: var(--radius);
              padding: 12px 14px; display: flex; flex-direction: column;
              gap: 10px; background: var(--jb-subtle); }
.jb-subitem__row { display: flex; gap: 10px; align-items: center;
                   flex-wrap: wrap; }
.jb-subitem__row > * { flex: 1; min-width: 8em; }
.jb-subitem .jb-text, .jb-subitem .jb-select { font-size: var(--fs-ui);
                                               padding: 9px 11px; }

.jb-assist { position: sticky; bottom: 0; z-index: 3; display: flex;
             align-items: center; gap: 12px; padding: 14px 32px;
             background: var(--jb-surface);
             border-top: 1px solid var(--jb-border); }
.jb-assist b { font-size: var(--fs-ui); font-weight: 500; }
.jb-assist input { flex: 1; min-width: 0; padding: 11px 14px;
                   border: 1px solid var(--jb-input); border-radius: var(--radius-sm);
                   font-size: var(--fs-ui); color: var(--jb-ink);
                   background: var(--jb-surface); }
.jb-assist input::placeholder { color: var(--jb-faint); }
.jb-assist__problem { margin: 0; padding: 10px 32px; font-size: var(--fs-meta);
                      background: var(--jb-warn-bg); color: var(--jb-warn-fg); }

/* The other tabs: one sheet, the design's 700px card */
.jb-sheet { max-width: 760px; background: var(--jb-surface);
            border: 1px solid var(--jb-border); border-radius: var(--radius-lg);
            padding: 28px; margin: 24px 32px 32px; }
.jb-sheet h2 { margin: 0 0 6px; font-size: var(--fs-section); font-weight: 600; }
.jb-sheet__intro { margin: 0 0 16px; font-size: var(--fs-ui); color: var(--jb-text2);
                   line-height: 1.55; }
.jb-sheet__add { margin-top: 12px; }
.jb-box { border: 1px solid var(--jb-border); border-radius: var(--radius);
          overflow: hidden; margin-bottom: 8px; }
.jb-item { border-top: 1px solid var(--jb-divider); }
.jb-item:first-child { border-top: 0; }
.jb-item > summary { list-style: none; display: flex; align-items: center;
                     gap: 14px; padding: 14px 16px; cursor: pointer;
                     transition: background 140ms ease; }
.jb-item > summary::-webkit-details-marker { display: none; }
.jb-item > summary:hover { background: var(--jb-hover); }
.jb-item__grip { color: var(--jb-btn-border); letter-spacing: -2px; }
.jb-item__text { flex: 1; display: flex; flex-direction: column; gap: 2px;
                 min-width: 0; }
.jb-item__text b { font-size: var(--fs-body); font-weight: 500; }
.jb-item__text span { font-size: var(--fs-meta); color: var(--jb-meta);
                      line-height: 1.5; }
.jb-item__side { font-size: var(--fs-meta); color: var(--jb-text2); }
.jb-item__body { padding: 4px 16px 18px; display: flex;
                 flex-direction: column; gap: 16px; }
.jb-item--cp > summary { flex-direction: column; align-items: stretch;
                         gap: 7px; padding: 13px 16px; }
.jb-welcome { padding: 16px 18px; border: 1px solid var(--jb-input);
              border-radius: var(--radius); font-size: var(--fs-body); line-height: 1.6;
              display: flex; flex-direction: column; gap: 8px; }
.jb-welcome__subject { border: 0; padding: 0; font-weight: 600;
                       font-size: var(--fs-body); width: 100%; background: none; }
.jb-welcome__body { border: 0; padding: 0; color: var(--jb-body2);
                    font-size: var(--fs-body); line-height: 1.6; width: 100%;
                    resize: vertical; background: none; }
.jb-welcome__subject:focus, .jb-welcome__body:focus {
  outline: 1px dashed var(--jb-input); outline-offset: 3px; }
.jb-note { margin: 10px 0 0; font-size: var(--fs-meta); color: var(--jb-meta);
           line-height: 1.5; }
.jb-note b { font-weight: 600; color: var(--jb-body2); }
/* Report 160. The welcome's merge field, drawn as A3's pill. */
.jb-merge { padding: 1px 7px; border-radius: var(--radius-inner); background: var(--chip-bg);
            font-weight: 500; }
.jb-merge--add { border: 0; font: inherit; font-size: var(--fs-meta);
                 color: var(--jb-body2); cursor: pointer; margin-right: 6px; }
.jb-merge--add:hover { background: var(--line); }
.jb-merge-preview { margin: 10px 0 0; font-size: var(--fs-ui); font-weight: 600;
                    line-height: 1.6; }
.jb-rem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
          gap: 16px; padding: 14px 16px; border-top: 1px solid var(--jb-divider);
          font-size: var(--fs-ui); line-height: 1.5; }
.jb-rem:first-child { border-top: 0; }
.jb-rem b { font-weight: 500; font-size: var(--fs-body); display: block; }
.jb-rem span { color: var(--jb-meta); font-size: var(--fs-meta); }
.jb-rem__none { color: var(--jb-faint); }

/* The read-only layout of a published version */
fieldset.jb-frozen { border: 0; margin: 0; padding: 0; min-width: 0; }

/* REPORT 192 (review [45]). READ-ONLY LOOKS READ-ONLY. The firm reads the
   journey (Phase 1, option B) beside "To change it, ask Adealia", and the
   disabled fieldset still drew boxes, menus with arrows, a two-way switch
   and pills with a ×, so it looked like a form that would not save. Here
   each control reads as its value: no box, no arrow, no ×, and a switch
   shows only the side that is chosen. Scoped to the read-only page. */
.jb[data-readonly="yes"] .jb-frozen input[type="text"],
.jb[data-readonly="yes"] .jb-frozen input[type="number"],
.jb[data-readonly="yes"] .jb-frozen input:not([type]),
.jb[data-readonly="yes"] .jb-frozen textarea,
.jb[data-readonly="yes"] .jb-frozen select {
  border-color: transparent; background: transparent; box-shadow: none;
  padding-left: 0; padding-right: 0; color: var(--jb-ink);
  -webkit-appearance: none; appearance: none; background-image: none;
  resize: none; cursor: default; opacity: 1;
}
.jb[data-readonly="yes"] .jb-seg { background: transparent; padding: 0; }
.jb[data-readonly="yes"] .jb-seg label:has(input:not(:checked)) { display: none; }
.jb[data-readonly="yes"] .jb-seg input:checked + span {
  background: transparent; box-shadow: none; text-align: left; padding: 0;
}
.jb[data-readonly="yes"] .jb-pill__x { display: none; }
.jb[data-readonly="yes"] .jb-pill input,
.jb[data-readonly="yes"] .jb-check input { display: none; }
.jb-readonly-none { margin: 4px 0 0; color: var(--jb-text2); }

/* ── A4: change with the assistant ────────────────────────────────── */

.jb-change { display: grid; grid-template-columns: minmax(0, 1fr) 470px;
             flex: 1; min-height: 100%; }
.jb-change__list { padding: 28px 32px; min-width: 0; }
.jb-change__title { margin: 0 0 14px; font-size: var(--fs-section); font-weight: 600; }
.jb-change__title span { font-size: var(--fs-meta); font-weight: 400;
                         color: var(--jb-meta); }
.jb-aside { background: var(--jb-surface); border-left: 1px solid var(--jb-border);
            display: flex; flex-direction: column; min-width: 0; }
.jb-aside__head { padding: 20px 24px; border-bottom: 1px solid var(--jb-divider);
                  font-size: var(--fs-body); font-weight: 600; }
.jb-aside__body { flex: 1; padding: 20px 24px; display: flex;
                  flex-direction: column; gap: 16px; }
.jb-aside__foot { padding: 14px 24px 20px;
                  border-top: 1px solid var(--jb-divider); }
.jb-aside__foot input { width: 100%; padding: 11px 14px; font-size: var(--fs-ui);
                        border: 1px solid var(--jb-input); border-radius: var(--radius-sm); }
.jb-bubble { align-self: flex-end; max-width: 86%; padding: 12px 15px;
             border-radius: 16px 16px 4px 16px; background: var(--jb-ink);
             color: var(--on-anchor); font-size: var(--fs-body); line-height: 1.5; margin: 0;
             white-space: pre-wrap; }
.jb-said { margin: 0; font-size: var(--fs-body); line-height: 1.55; }
.jb-diff { border: 1px solid var(--jb-border); border-radius: var(--radius);
           overflow: hidden; }
.jb-diff__part { padding: 14px 16px; border-top: 1px solid var(--jb-divider); }
.jb-diff__part:first-child { border-top: 0; }
.jb-diff__part--added { background: var(--jb-ok-bg); }
.jb-diff__part--changed { background: var(--jb-changed-bg); }
.jb-diff__part--removed { background: var(--jb-red-bg); }
.jb-diff__label { margin: 0 0 6px; font-size: var(--fs-label); font-weight: 600; }
.jb-diff__part--added .jb-diff__label { color: var(--jb-ok); }
.jb-diff__part--changed .jb-diff__label { color: var(--jb-warn-fg); }
.jb-diff__part--removed .jb-diff__label { color: var(--jb-red); }
.jb-diff__name { margin: 0 0 4px; font-size: var(--fs-body); font-weight: 500; }
.jb-diff__text { margin: 0; font-size: var(--fs-meta); line-height: 1.55; }
.jb-diff__part--added .jb-diff__text { color: var(--ok-fg); }
.jb-diff__part--changed .jb-diff__text { color: var(--warn-fg); }
.jb-diff__part--removed .jb-diff__text { color: var(--jb-red-dark); }
.jb-diff__side { margin: 0; font-size: var(--fs-meta); line-height: 1.55;
                 color: var(--jb-text2); }
.jb-diff__side b { font-weight: 600; color: var(--jb-ink); }
.jb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.jb-actions form { margin: 0; }

/* ── A5: preview as the broker ────────────────────────────────────── */

.jb-preview { display: flex; flex: 1; background: var(--jb-chip);
              min-height: 100%; }
.jb-preview__aside { width: 380px; flex: none; background: var(--jb-surface);
                     border-right: 1px solid var(--jb-border); padding: 28px;
                     display: flex; flex-direction: column; gap: 22px; }
.jb-preview__aside h1 { margin: 0 0 6px; font-size: var(--fs-heading); font-weight: 600; }
.jb-preview__aside .jb-back { margin-bottom: 8px; }
.jb-preview__aside p { margin: 0; }
.jb-preview__form { display: flex; flex-direction: column; gap: 22px; }
.jb-summary { padding: 16px; border-radius: var(--radius); background: var(--jb-subtle);
              border: 1px solid var(--jb-divider); font-size: var(--fs-ui);
              line-height: 1.6; color: var(--jb-body2); }
.jb-summary p { margin: 0; }
/* Report 147 (B2): the answers inside the list the rules read. */
.jb-preview__sub { margin: 4px 0 -8px; font-size: var(--fs-ui); font-weight: 600;
                   color: var(--jb-ink); }
.jb-checks { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-ui);
             color: var(--jb-ink); }
.jb-checks label { display: flex; gap: 8px; align-items: center; }
.jb-summary p + p { margin-top: 8px; }
.jb-summary b { font-weight: 600; color: var(--jb-ink); }
.jb-summary i { font-style: normal; font-weight: 500; }
/* Review of report 141: under the summary, not pushed to the foot of a
   panel as tall as the phone, where they sat below the fold unseen. */
.jb-preview__pretend { display: flex; flex-direction: column; gap: 8px; }
.jb-preview__pretend .jb-btn { padding: 12px 14px; white-space: normal;
                              text-align: center; line-height: 1.3; }
.jb-stage { flex: 1; display: flex; align-items: center;
            justify-content: center; padding: 40px 20px; min-width: 0; }
.jb-phone { width: 390px; max-width: 100%; min-height: 844px;
            background: var(--jb-paper); border: 1px solid var(--line-3);
            border-radius: 28px; overflow: hidden;
            box-shadow: 0 10px 30px color-mix(in srgb, var(--ink-navy) 10%, transparent); }
.jb-phone__bar { padding: 14px 18px; background: var(--jb-surface);
                 border-bottom: 1px solid var(--jb-divider); }
.jb-phone__bar img { height: 24px; width: auto; display: block; }
.jb-phone__bar span { font-size: var(--fs-ui); font-weight: 600; }
.jb-phone__body { padding: 22px 18px; }
.jb-phone h2 { margin: 0 0 6px; font-size: var(--fs-page-title); font-weight: 600;
               letter-spacing: -0.02em; }
.jb-phone__count { margin: 0 0 12px; font-size: var(--fs-body); color: var(--jb-text2); }
.jb-bar { height: 8px; border-radius: var(--radius-pill); background: var(--jb-border);
          overflow: hidden; margin-bottom: 22px; }
.jb-bar span { display: block; height: 100%; background: var(--jb-ok); }
.jb-next { background: var(--jb-ink); color: var(--on-anchor); border-radius: var(--shell-radius);
           padding: 20px; margin-bottom: 22px; }
.jb-next__label { margin: 0 0 8px; font-size: var(--fs-meta); font-weight: 500;
                  color: var(--on-anchor-2); }
.jb-next__title { margin: 0 0 16px; font-size: var(--fs-heading); font-weight: 600; }
.jb-next__btn { display: block; text-align: center; padding: 13px 0;
                border-radius: var(--radius); background: var(--card-bg); color: var(--jb-ink);
                font-size: var(--fs-body); font-weight: 600; }
.jb-back-card { background: var(--jb-surface); border: 1.5px solid var(--jb-red-border);
                border-radius: var(--shell-radius); padding: 18px; margin-bottom: 22px; }
.jb-back-card .jb-chip { margin-bottom: 10px; }
.jb-back-card p { margin: 0 0 12px; font-size: var(--fs-body); line-height: 1.55; }
.jb-back-card small { display: block; font-size: var(--fs-meta); color: var(--jb-meta);
                      margin-bottom: 14px; }
.jb-back-card .jb-next__btn { background: var(--jb-ink); color: var(--on-anchor); }
.jb-plist { background: var(--jb-surface); border: 1px solid var(--jb-border);
            border-radius: var(--radius-lg); overflow: hidden; }
.jb-prow { display: flex; align-items: center; gap: 13px; padding: 14px 16px;
           border-top: 1px solid var(--jb-divider); }
.jb-prow:first-child { border-top: 0; }
.jb-prow__text { flex: 1; display: flex; flex-direction: column; gap: 2px;
                 min-width: 0; }
.jb-prow__text b { font-size: var(--fs-body); font-weight: 500; }
.jb-prow__text span { font-size: var(--fs-meta); color: var(--jb-faint); }
.jb-glyph { width: 22px; height: 22px; flex: none; border-radius: var(--radius-pill);
            border: 1.5px solid var(--jb-btn-border); background: var(--card-bg);
            display: flex; align-items: center; justify-content: center;
            font-size: var(--fs-label); font-weight: 600; }
.jb-glyph--open { border-color: var(--jb-input); }
.jb-glyph--locked { border-style: dashed; background: var(--jb-paper); }
.jb-glyph--waiting { background: var(--jb-firm-bg); border-color: var(--jb-firm-bg);
                     color: var(--jb-firm-fg2); }
.jb-glyph--done { background: var(--jb-ok); border-color: var(--jb-ok);
                  color: var(--on-anchor); }
.jb-glyph--back { background: var(--jb-red); border-color: var(--jb-red);
                  color: var(--on-anchor); }
.jb-pdone { padding: 12px 16px; font-size: var(--fs-ui); color: var(--jb-text2);
            border-top: 1px solid var(--jb-divider); }
.jb-pclear { margin: 0 0 22px; padding: 18px; border-radius: var(--shell-radius);
             background: var(--jb-ok-bg); color: var(--jb-ok-dark);
             font-size: var(--fs-body); font-weight: 500; }

/* ── A6: publish ──────────────────────────────────────────────────── */

.jb-overlay { position: fixed; inset: 0; z-index: 300;
              background: var(--jb-overlay); display: flex;
              align-items: center; justify-content: center; padding: 16px;
              overflow-y: auto; }
.jb-dialog { width: 600px; max-width: 100%; background: var(--jb-surface);
             border-radius: var(--shell-radius); padding: 30px;
             box-shadow: var(--jb-dialog-shadow); }
.jb-dialog h2 { margin: 0 0 8px; font-size: var(--fs-heading); font-weight: 600;
                letter-spacing: -0.01em; }
.jb-dialog__sub { margin: 0 0 22px; font-size: var(--fs-body); color: var(--jb-text2); }
.jb-dialog__body { display: flex; flex-direction: column; gap: 14px;
                   margin-bottom: 24px; }
.jb-dialog__changed { padding: 16px 18px; border-radius: var(--radius);
                      background: var(--jb-subtle);
                      border: 1px solid var(--jb-divider); }
.jb-dialog__changed p { margin: 0 0 8px; font-size: var(--fs-ui); font-weight: 600; }
.jb-dialog__changed ul { margin: 0; padding-left: 18px; font-size: var(--fs-ui);
                         line-height: 1.7; color: var(--jb-body2); }
.jb-dialog__changed b { font-weight: 500; color: var(--jb-ink); }
.jb-dialog__people { display: flex; gap: 14px; padding: 16px 18px;
                     border-radius: var(--radius); background: var(--jb-firm-bg);
                     color: var(--jb-firm-fg); }
.jb-dialog__people > .jb-mono { font-size: var(--fs-heading); font-weight: 500; }
.jb-dialog__people p { margin: 0; font-size: var(--fs-body); line-height: 1.55; }
.jb-dialog__people details { margin-top: 2px; font-size: var(--fs-body); }
.jb-dialog__people summary { display: inline-block; cursor: pointer;
                             text-decoration: underline; list-style: none; }
.jb-dialog__people summary::-webkit-details-marker { display: none; }
.jb-dialog__people ul { margin: 8px 0 0; padding-left: 18px; font-size: var(--fs-ui); }
.jb-dialog__plain { margin: 0; font-size: var(--fs-body); line-height: 1.55; }
.jb-dialog__foot { display: flex; gap: 10px; justify-content: flex-end;
                   flex-wrap: wrap; }
.jb-dialog__foot form { margin: 0; }
.jb-dialog__foot .jb-btn { padding: 12px 20px; font-size: var(--fs-body); }

/* ── The versions page ────────────────────────────────────────────── */

.jb-versions .jb-table__head, .jb-versions .jb-table__row {
  grid-template-columns: 120px 110px minmax(0, 1.6fr) 150px 190px; }
.jb-stack { display: flex; flex-direction: column; gap: 20px; }
.jb-inline-form { display: flex; gap: 10px; flex-wrap: wrap;
                  align-items: flex-end; margin: 0; }

/* ── Narrow screens: one column, nothing sideways ─────────────────── */

@media (max-width: 1100px) {
  .jb-change { grid-template-columns: minmax(0, 1fr); }
  .jb-aside { border-left: 0; border-top: 1px solid var(--jb-border); }
  .jb-new { grid-template-columns: minmax(0, 1fr); }
  .jb-new__aside { margin-top: 0; }
}
@media (max-width: 900px) {
  .jb-page { padding: 24px 16px 40px; }
  .jb-listcol { padding: 20px 16px 24px; }
  .jb-sheet { margin: 16px; padding: 20px 16px; }
  .jb-table__head { display: none; }
  .jb-table__row, .jb-versions .jb-table__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .jb-table__name { grid-column: 1 / -1; }
  .jb-table__label { display: block; font-size: var(--fs-label); color: var(--jb-meta);
                     font-family: var(--jb-sans); }
  .jb-preview { flex-direction: column; }
  .jb-preview__aside { width: 100%; border-right: 0;
                       border-bottom: 1px solid var(--jb-border); padding: 20px 16px; }
  .jb-stage { padding: 20px 0; }
  .jb-phone { border-radius: 0; border-left: 0; border-right: 0; min-height: 0; }
  .jb-rem { grid-template-columns: minmax(0, 1fr); }
  .jb-change__list { padding: 20px 16px; }
  .jb-aside__body, .jb-aside__head, .jb-aside__foot { padding-left: 16px;
                                                      padding-right: 16px; }
  .jb-dialog { padding: 22px 18px; }
  .jb-title { font-size: var(--fs-page-title); }
}

/* The design's ▾ on a panel's own lists. */
.jb-select { appearance: none; -webkit-appearance: none; padding-right: 34px;
             background: var(--jb-surface)
               url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%237A8899'/%3E%3C/svg%3E")
               no-repeat right 14px center; }
.jb-detail__top .jb-textbtn--quiet { font-size: var(--fs-meta); font-weight: 400; }

/* The editor fills the column, so the assistant bar sits at the bottom. */
.jb-editor__form { flex: 1; display: flex; flex-direction: column; }
.jb-editor__form > .jb-frozen { flex: 1; display: flex; flex-direction: column; }
.jb-editor__form [data-tab-panel="activities"] { flex: 1; display: flex; flex-direction: column; }

/* The page scrolls INSIDE the column, as `.ui-page` does, so the column's
   reservation for the phone's tab bar keeps everything above the bar. */
.jb-page, .jb-editor { overflow-y: auto; min-height: 0; flex: 1; }
/* A flex child with overflow set can shrink to nothing: the tab row did. */
.jb-editor > * { flex-shrink: 0; }
.jb-editor > .jb-editor__form, .jb-editor > .jb-preview, .jb-editor > .jb-change { flex: 1 0 auto; }
/* A phone taller than the stage starts at the top rather than being cut. */
.jb-stage { align-items: flex-start; }

/* Report 156 (M-O2). The assistant's notes on a draft: the whole note above
   the list, and "Check this" on each activity a note names, with the note at
   the top of that activity's panel until the owner edits it or presses
   "Looks right". Copper, the builder's word for "look here". */
.jb-tag--check { background: var(--jb-warn-bg); color: var(--jb-warn-fg); white-space: nowrap; margin-left: 6px; }
.jb-notes { background: var(--jb-surface); border: 1px solid var(--jb-border); border-left: 3px solid var(--jb-copper);
            border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 12px; font-size: var(--fs-meta); color: var(--jb-body2); }
.jb-notes b { display: block; color: var(--jb-ink); margin-bottom: 4px; }
.jb-notes p { margin: 0; line-height: 1.5; }
.jb-checknote { background: var(--jb-warn-bg); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px;
                display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.jb-checknote p { margin: 0; color: var(--jb-warn-fg); font-size: var(--fs-meta); line-height: 1.5; flex: 1 1 260px; }
/* Report 156 (M-O3): the welcome email has nobody to sign it. */
.jb-warnline { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--jb-warn-bg);
               color: var(--jb-warn-fg); font-size: var(--fs-meta); line-height: 1.5; }
.jb-warnline a { color: var(--jb-warn-fg); font-weight: 600; text-decoration: underline; }


/* Phase 1: the firm reads its journeys (migration 046). */
.jb-readonly { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--jb-subtle); border: 1px solid var(--jb-border, var(--line)); color: var(--jb-secondary, var(--ink-3)); font-size: var(--fs-ui); }

/* Report 191. Found by the overlap probe: from 901 to about 1180 the four
   fixed columns (620px with their gaps) left the journey type's own name a
   sliver, and "Last changed" ran into the row beside it. The numbers keep
   their size; the words share what is left. */
@media (min-width: 901px) and (max-width: 1180px) {
  .jb-table__head, .jb-table__row {
    grid-template-columns: minmax(0, 2fr) 90px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

/* ══ REPORT 197 — THE MODERN HANDOFF'S BUILDER ═════════════════════════
   Source: planning/design/modern-handoff/ "Adealia Firm.dc.html", screen
   "builder" (view-only and adminMode), and the Design system page's twelve
   rules for what it did not draw. The shared parts are the shell's
   (`.ui-title .ui-lede .ui-btn .ui-pill .ui-state .ui-panel__head/__body/
   __foot`); what is here is only this area's layout, under `.jb-`.
   Page gutter: 36 on a wide screen, 24 from 760 to 1023, 16 on a phone.
   ══════════════════════════════════════════════════════════════════════ */

.jb { --jb-pad: 36px; }
@media (max-width: 1023.98px) { .jb { --jb-pad: 24px; } }
@media (max-width: 759.98px)  { .jb { --jb-pad: 16px; } }

.jb-page { padding: 32px var(--jb-pad) 56px; }
.jb-title { font-size: var(--fs-page-title); letter-spacing: -0.01em; margin: 0; }
.jb-title--solo { margin-bottom: var(--space-6); }
.jb-head { align-items: flex-start; margin-bottom: var(--space-6); gap: var(--space-4) var(--space-6); }
.jb-head .jb-sub { margin-top: 4px; color: var(--ink-3); }
.jb-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 var(--space-2);
           font-size: 14px; font-weight: 600; }
.jb a.jb-back, .jb .jb-back { color: var(--ink-4); }
.jb a.jb-back:hover { color: var(--ink-1); }
.jb-back .ms { font-size: 18px; }

/* Links drawn as words ("+ Add a question"): ink, not a second copper. */
.jb-textbtn { color: var(--ink-2); font-weight: 600; font-size: 14px; min-height: 32px; }
.jb-textbtn:hover { color: var(--ink-1); text-decoration: underline; }
.jb-textbtn--danger { color: var(--alert-fg); }
.jb-textbtn--danger:hover { color: var(--alert-fg); }

/* The builder's table (the list of types, and the versions): the
   handoff's generic table — a 14px card, a tinted 12/600 head, 15/600 names. */
.jb-table { border-radius: var(--radius-lg); }
.jb-table__head { padding: 10px 18px; background: var(--rail-bg); border-bottom-color: var(--line-2);
                  font-size: var(--fs-micro); color: var(--ink-4); }
.jb-table__row { padding: 13px 18px; }
.jb-table__row > * { min-width: 0; overflow-wrap: break-word; }
@media (min-width: 901px) and (max-width: 1180px) {
  .jb-versions .jb-table__head, .jb-versions .jb-table__row {
    grid-template-columns: 100px 90px minmax(0, 1.6fr) 110px 200px; }
}
@media (max-width: 759.98px) {
  .jb-subitem__row > * { flex-basis: 100%; }
}
.jb-table__name b { font-weight: 600; }
.jb-readonly { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 var(--space-5);
               padding: 12px 16px; border: 0; border-radius: 12px;
               background: var(--warn-bg); color: var(--warn-fg); font-size: 14px; }
.jb-readonly .ms { font-size: 20px; }
/* The builder's own buttons and pills read as the shell's: 40px at the
   least, and "Broker" in the kind tint as on the steps table. */
.jb-btn--sm { min-height: 40px; }
.jb-chip--broker { background: var(--kind-bg); color: var(--ink-2); }
.jb .jb-versions .jb-table__row a { color: var(--ink-1); }
.jb .jb-versions .jb-table__row a b { font-weight: 600; }
.jb-field { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.jb-textarea { border: 1px solid var(--line-input); border-radius: var(--radius-sm); padding: 12px 14px; }
.jb-input, .jb-textarea { font-size: var(--fs-body); }
.jb-input { min-height: 44px; padding: 10px 12px; }
.jb-input:focus, .jb-textarea:focus, .jb-select:focus { outline: 2px solid var(--accent); }

/* Preview and "change with the assistant": each a card in the column. */
.jb-preview, .jb-change { border: 1px solid var(--line); border-radius: var(--radius-lg);
                          overflow: hidden; margin-bottom: var(--space-7); min-height: 0; }
.jb-preview__aside h1 { font-size: var(--fs-page-title); letter-spacing: -0.01em; }
@media (max-width: 900px) {
  .jb-preview__aside { padding: var(--space-5) var(--space-4); }
  .jb-phone { border-radius: 0; }
}
@media (max-width: 759.98px) {
  .jb-editor > .jb-preview, .jb-editor > .jb-change { margin-left: calc(-1 * var(--jb-pad));
    margin-right: calc(-1 * var(--jb-pad)); border-radius: 0; border-left: 0; border-right: 0; }
  .jb-editor:has(> .jb-preview), .jb-editor:has(> .jb-change) { padding-top: 0; }
  .jb-editor > .jb-preview, .jb-editor > .jb-change { border-top: 0; }
}

@media (max-width: 900px) {
  .jb-versions .jb-table__row { grid-template-columns: minmax(0, 1fr) auto; }
  .jb-versions .jb-table__row > :nth-child(3),
  .jb-versions .jb-table__row > :nth-child(4),
  .jb-versions .jb-table__row > :nth-child(5) { grid-column: 1 / -1; }
  .jb-versions .jb-table__row > :nth-child(5):empty { display: none; }
  .jb-versions .jb-textbtn { text-align: left; }
}

.jb-empty.ui-state { max-width: none; margin: 0; }
.jb-empty.ui-state h2, .jb-empty.ui-state p { margin: 0; }
.jb-empty.ui-state .ui-state__text { max-width: 560px; line-height: 1.55; }
.jb-empty__actions.ui-state__actions { margin-top: var(--space-3); }

/* Cards on the versions page, the new-type page and the compare page. */
.jb-card { border-radius: var(--radius-lg); padding: var(--space-5); }
.jb-card h2 { font-size: var(--fs-section); margin: 0 0 var(--space-3); }

/* ── The editor ───────────────────────────────────────────────────── */
.jb-editor { padding: 32px var(--jb-pad) 0; gap: var(--space-5); }
.jb-top { display: flex; align-items: flex-start; justify-content: space-between;
          flex-wrap: wrap; gap: var(--space-4) var(--space-6); }
.jb-top__text { flex: 1 1 420px; min-width: 0; }
.jb-top .ui-title { overflow-wrap: anywhere; }
.jb-top__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* The design's notice: the warm tint, the info icon, one line. */
.jb-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 10px var(--space-3);
             padding: 12px 16px; border-radius: 12px;
             background: var(--warn-bg); color: var(--warn-fg); font-size: 14px; }
.jb-notice > .ms { font-size: 20px; align-self: flex-start; }
.jb-notice p { flex: 1 1 280px; margin: 0; line-height: 1.5; }
.jb-notice a:not(.ui-btn) { color: var(--warn-fg); font-weight: 600; text-decoration: underline; margin-left: 4px; }
.jb-notice form { margin: 0; }

/* The tabs: words on a line, the chosen one underlined (Settings, drawn). */
.jb-tabs { padding: 0; gap: 4px; background: transparent; border-bottom: 1px solid var(--line); }
.jb-tab { padding: 10px 14px; font-size: 14px; font-weight: 600; min-height: 44px;
          display: inline-flex; align-items: center; }
.jb a.jb-tab { color: var(--ink-4); }
.jb a.jb-tab[aria-selected=true] { color: var(--ink-1); border-bottom-color: var(--ink-1); }

.jb-editor__form { gap: 0; }
.jb-listcol { padding: 0 0 var(--space-7); }
.jb-listcol__head { margin-bottom: var(--space-3); flex-wrap: wrap; }
.jb-listcol__head p { flex: 1 1 320px; color: var(--ink-3); }
.jb-listcol__head .ui-btn { margin-left: auto; }

/* The steps, as the handoff's table: Step · Who does it · Required. */
.jb-steps { background: var(--card-bg); border: 1px solid var(--line);
            border-radius: var(--radius-lg); overflow: hidden; }
.jb-steps__head, .jb-steps .jb-row {
  display: grid; align-items: center; gap: 6px 16px;
  grid-template-columns: minmax(0, 2.4fr) minmax(200px, 1.4fr) minmax(0, 1fr); }
.jb-steps__head { padding: 10px 18px; background: var(--rail-bg); border-bottom: 1px solid var(--line-2);
                  font-size: var(--fs-micro); font-weight: 600; color: var(--ink-4); }
.jb-steps .jb-list { border: 0; border-radius: 0; }
.jb-steps .jb-row { padding: 13px 18px; min-height: 64px; }
.jb[data-readonly="no"] .jb-steps__head, .jb[data-readonly="no"] .jb-steps .jb-row {
  grid-template-columns: 20px minmax(0, 2.4fr) minmax(200px, 1.4fr) minmax(0, 1fr);
  padding-left: 10px; }
.jb[data-readonly="no"] .jb-steps__head::before { content: ""; }
.jb-row__grip { width: 20px; line-height: 1; color: var(--ink-4); letter-spacing: 0; cursor: grab; }
.jb-row__grip .ms { font-size: 20px; }
.jb-row__main { gap: 2px; }
.jb-row__title { font-size: var(--fs-body); font-weight: 600; line-height: 1.35; gap: 6px 8px;
                 overflow-wrap: anywhere; }
.jb-row__n { width: auto; font-size: inherit; line-height: inherit; color: inherit; }
.jb-row__meta { color: var(--ink-4); overflow-wrap: anywhere; }
.jb-row__cond { font-style: normal; color: var(--ink-3); font-size: var(--fs-meta); }
.jb-row__who { min-width: 0; }
.jb-row__who .ui-pill { max-width: 100%; }
.jb-row__req { font-size: 14px; color: var(--ink-4); }
.jb-row__req.is-first { color: var(--ink-1); }
.jb-row.is-selected, .jb a.jb-row.is-selected:hover { background: var(--select-bg); box-shadow: none; }
.jb-row.is-drop-before { box-shadow: inset 0 3px 0 var(--ink-1); }
@media (max-width: 759.98px) {
  .jb-steps__head { display: none; }
  .jb-steps .jb-row, .jb[data-readonly="no"] .jb-steps .jb-row {
    grid-template-columns: minmax(0, 1fr); align-items: start; padding: 13px 16px; }
  .jb[data-readonly="no"] .jb-steps .jb-row { grid-template-columns: 20px minmax(0, 1fr); }
  .jb[data-readonly="no"] .jb-row__who, .jb[data-readonly="no"] .jb-row__req { grid-column: 2; }
  .jb-row__grip { grid-row: 1 / span 3; padding-top: 2px; }
}

/* ── One activity, in the side panel (this page's own; the shell's look) ── */
.jb-panel { display: none; position: fixed; inset: 0; z-index: 300; }
.jb-editor.is-sheet .jb-panel { display: block; }
.jb-panel__scrim { position: absolute; inset: 0; background: var(--scrim-panel); cursor: default; }
.jb-panel__sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 100%);
                   display: flex; flex-direction: column; background: var(--card-bg);
                   box-shadow: var(--shadow-panel); outline: none; }
@media (max-width: 759.98px) { .jb-panel__sheet { width: 100%; } }
.jb-detail { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; }
.jb-detail[hidden] { display: none; }
.jb-detail .ui-panel__close { text-decoration: none; }
.jb-detail__body { gap: var(--space-5); }
.jb-detail__top { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 -8px -12px; }
.jb-panel__note { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm);
                  background: var(--kind-bg); color: var(--ink-2); font-size: 14px; }
.jb-detail .ui-panel__foot { justify-content: space-between; }
.jb-detail .ui-panel__foot .ui-btn--primary { flex: 0 1 auto; min-width: 120px; margin-left: auto; }
.jb-foot-end { margin-left: auto; }
html.jb-has-panel, html.jb-has-panel body { overflow: hidden; }

/* The fields, by the rules: a 14/600 label over a 44px control. */
.jb-lbl, .jb-group__label { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.jb-lbl small { font-weight: 400; color: var(--ink-4); font-size: var(--fs-meta); }
.jb-group { gap: 8px; }
.jb-group__hint { color: var(--ink-4); }
.jb-name, .jb-select, .jb-text { font-size: var(--fs-body); font-weight: 400; min-height: 44px;
                                 padding: 10px 12px; border-radius: var(--radius-sm); }
.jb-select { padding-right: 34px; }
.jb-area { font-size: var(--fs-body); padding: 10px 12px; }
.jb-name:focus, .jb-select:focus, .jb-text:focus, .jb-area:focus, .jb-brokername input:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; }
.jb-seg { border-radius: var(--radius-sm); }
.jb-seg span { padding: 10px 0; font-size: 14px; }
.jb-seg input:checked + span { font-weight: 600; }
.jb-pill { font-size: var(--fs-meta); min-height: 32px; }
.jb-timing, .jb-rule { border-radius: var(--radius-sm); }
.jb-problems { border-radius: var(--radius-sm); }
.jb-checknote { margin: 0; }

/* READ-ONLY LOOKS READ-ONLY (the design's view-only panel): each control
   is its value, 15px under its label; nothing looks like a box or a handle.
   An empty timing line is not a line. Report 192's rules above still hide
   the boxes; these match the drawn type. */
.jb[data-readonly="yes"] .jb-detail .jb-name { font-size: var(--fs-body); font-weight: 400; min-height: 0; padding-top: 0; padding-bottom: 0; }
.jb[data-readonly="yes"] .jb-select, .jb[data-readonly="yes"] .jb-text,
.jb[data-readonly="yes"] .jb-area { min-height: 0; padding-top: 0; padding-bottom: 0; }
.jb[data-readonly="yes"] .jb-timing, .jb[data-readonly="yes"] .jb-rule { border: 0; padding: 0; background: transparent; }
.jb[data-readonly="yes"] .jb-timing__line:has(.jb-num:placeholder-shown) { display: none; }
.jb[data-readonly="yes"] .jb-timing:not(:has(.jb-num:not(:placeholder-shown)))::after { content: "No timing set"; color: var(--ink-3); }
.jb[data-readonly="yes"] .jb-num, .jb[data-readonly="yes"] .jb-inline-sel { border: 0; font-weight: 600; }
.jb[data-readonly="yes"] .jb-pill { cursor: default; min-height: 0; }
.jb[data-readonly="yes"] .jb-pillsel, .jb[data-readonly="yes"] .jb-pilltext {
  border-color: transparent; background: transparent; padding: 0; appearance: none; -webkit-appearance: none; }
.jb[data-readonly="yes"] .jb-radio:has(input:not(:checked)) { display: none; }
.jb[data-readonly="yes"] .jb-radio input { display: none; }
.jb[data-readonly="yes"] .jb-radio { font-size: var(--fs-body); }
.jb[data-readonly="yes"] .jb-item__grip { display: none; }
.jb[data-readonly="yes"] .jb-area { field-sizing: content; min-height: 0; }
.jb[data-readonly="yes"] .jb-subitem { border: 0; border-top: 1px solid var(--line-2); border-radius: 0;
                                       background: transparent; padding: 10px 0 0; gap: 4px; }
.jb[data-readonly="yes"] .jb-subitem:first-child { border-top: 0; padding-top: 0; }
.jb[data-readonly="yes"] .jb-subitem > .jb-text { font-weight: 600; }
.jb-readonly-none { font-size: var(--fs-body); color: var(--ink-3); }

/* The other tabs: the sheet is the design's card, in the page's column. */
.jb-sheet { margin: 0 0 var(--space-7); max-width: 820px; padding: var(--space-6);
            border-radius: var(--radius-lg); }
.jb-sheet h2 { font-size: var(--fs-section); }
/* The welcome sheet's id is also chat's empty state's (`app.css`
   `#welcome`: centred, 720px, 7vh down); it is this sheet here. */
.jb #welcome.jb-sheet { max-width: 820px; margin: 0 0 var(--space-7); padding: var(--space-6);
                        text-align: left; animation: none; }
@media (max-width: 759.98px) {
  .jb-sheet, .jb #welcome.jb-sheet { padding: var(--space-5) var(--space-4); }
  .jb-card { padding: var(--space-4); }
}
.jb-sheet__intro { color: var(--ink-3); }
.jb-box { border-radius: var(--radius-sm); }
.jb-item > summary { min-height: 56px; }
.jb-item__text b { font-weight: 600; }
.jb-welcome { border-radius: var(--radius-sm); }
.jb-rem b { font-weight: 600; }

/* The assistant's line, at the foot of the column. */
.jb-assist { margin: auto calc(-1 * var(--jb-pad)) 0; padding: 14px var(--jb-pad); flex-wrap: wrap; }
.jb-assist input { min-height: 44px; font-size: var(--fs-body); border-radius: var(--radius-sm); }
.jb-assist__problem { margin: 0 calc(-1 * var(--jb-pad)); padding: 10px var(--jb-pad); }

/* The publish dialog: the shell's radius and type. */
.jb-dialog { border-radius: var(--radius-lg); padding: var(--space-6); }
.jb-dialog h2 { font-size: var(--fs-heading); }
.jb-dialog__changed, .jb-dialog__people { border-radius: var(--radius-sm); }
.jb-dialog__foot .ui-btn { min-width: 120px; }
@media (max-width: 759.98px) {
  .jb-dialog { padding: var(--space-5) var(--space-4); }
  .jb-dialog__foot .ui-btn, .jb-dialog__foot form { flex: 1 1 100%; }
  .jb-dialog__foot form .ui-btn { width: 100%; }
}
