/* Brief Builder page (Oct 6 2026) — every rule under .bbd / .bbd- ; colours only through tokens.css variables, so both themes work.
   It stands on the studio's own pieces (.card, .btn, .badge, .tip) and only adds layout. One column; under 640 px every button
   is a full thumb wide and the side-by-side table scrolls inside its own box (never the page). */
.bbd { min-width: 0; max-width: 980px; }
.bbd-top { margin-bottom: 14px; }
.bbd-title { margin: 0 0 4px; font-size: 20px; }
.bbd-intro { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.bbd-card { padding: 16px 18px; }
.bbd-card + .bbd-card, #bbd-main:not(:empty), #bbd-list:not(:empty) { margin-top: 14px; }
.bbd-quiet { color: var(--text-muted); font-size: 13px; }
.bbd-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.bbd-link:focus-visible, .bbd-drop:focus-visible { outline: 2px solid var(--brand-cyan); outline-offset: 2px; border-radius: 4px; }
.bbd-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--border);
  border-radius: var(--radius-card); background: var(--surface-subtle); cursor: pointer; text-align: center; }
.bbd-drop.on { border-color: var(--brand-cyan); background: var(--info-soft); }
.bbd-drop b { font-size: 16px; }
.bbd-err { min-height: 18px; margin: 8px 0 4px; font-size: 13px; line-height: 1.45; }
.bbd-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bbd-h { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.bbd-h3 { font-weight: 600; margin-bottom: 8px; }
.bbd-rows, .bbd-list { list-style: none; margin: 0; padding: 0; }
.bbd-list li { padding: 6px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.bbd-row { padding: 12px 0; border-top: 1px solid var(--border); }
.bbd-row:first-child { border-top: 0; }
.bbd-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bbd-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.bbd-arrow { color: var(--text-muted); }
.bbd-price { color: var(--text-muted); font-size: 13px; margin-left: auto; }
.bbd-bar { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--surface-subtle); overflow: hidden; }
.bbd-bar span { display: block; height: 100%; background: var(--brand-cyan); border-radius: 999px; transition: width .4s ease; }
.bbd-say { margin-top: 6px; font-size: 13px; line-height: 1.45; }
.bbd-must, .bbd-checks { margin-top: 8px; padding: 9px 12px; border-left: 3px solid var(--warn); border-radius: var(--radius-small); background: var(--warn-soft); font-size: 13px; line-height: 1.45; }
.bbd-checks { border-left-color: var(--border); background: var(--surface-subtle); }
.bbd-must ul, .bbd-checks ul { margin: 4px 0 0; padding-left: 18px; }
.bbd-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bbd-acts .btn { text-decoration: none; }
.bbd-start { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.bbd-start .bbd-quiet { flex-basis: 100%; }
.bbd-start-auto { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.bbd-start + .bbd-start-auto, .bbd-start-auto + .bbd-start { margin-top: 10px; }
.bbd-auto-word { margin-left: auto; }
.bbd-details { margin-top: 8px; padding: 6px 12px 9px; border-left: 3px solid var(--border); border-radius: var(--radius-small); background: var(--surface-subtle); font-size: 13px; line-height: 1.45; }
.bbd-details ul { margin: 2px 0 0; padding-left: 18px; }
.bbd-h4 { font-weight: 600; font-size: 13px; margin: 10px 0 4px; display: flex; align-items: center; gap: 4px; }
.bbd-choices, .bbd-panel { margin-top: 8px; padding: 9px 12px; border-radius: var(--radius-small); font-size: 13px; line-height: 1.45; }
.bbd-choices { border: 1px solid var(--border); background: var(--surface-subtle); }
.bbd-sugs, .bbd-panel ul { margin: 4px 0 0; padding-left: 0; list-style: none; }
.bbd-sugs li { display: flex; align-items: flex-start; gap: 4px; padding: 3px 0; }
.bbd-sug { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.bbd-sug input { margin-top: 3px; flex: none; }
.bbd-panel { margin: 0 0 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border)); border-left: 3px solid var(--warn); background: var(--warn-soft); }
.bbd-panel li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 5px 0; border-top: 1px solid var(--border); }
.bbd-panel li:first-child { border-top: 0; }
.bbd-yn { display: inline-flex; gap: 6px; }
.bbd-modal { max-width: min(1100px, 92vw); }
.bbd-changes { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.bbd-side-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-small); }
.bbd-side { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; table-layout: fixed; }
.bbd-side th, .bbd-side td { padding: 6px 8px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.bbd-side thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.bbd-side .bbd-scene th { background: var(--surface-subtle); font-weight: 600; }
.bbd-side .bbd-diff td { background: var(--info-soft); }
@media (max-width: 640px) {
  .bbd-acts .btn, .bbd-start .btn { width: 100%; white-space: normal; }
  .bbd-price { margin-left: 0; }
}

/* Nov 2: the pack line and the paste box */
.bbd-pack { margin: 6px 0 2px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bbd-pack[data-words]::after { content: attr(data-words); color: var(--muted, #667); margin-left: 6px; }
.bbd-paste { margin-top: 10px; }
.bbd-paste textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; margin-top: 6px; }
