/* Board v2 prototype. Every class starts with bd- so neither the document's
   rules nor these leak across. The aliases below are the only difference from
   the extension page: there the --pc-* names come from __picode/tokens.css. */

.bd-wall { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; }
.bd-wall[data-material="solid"][data-theme="dark"] { background: #0e0e11; }
.bd-wall[data-material="solid"][data-theme="light"] { background: #f0f2f7; }
/* Measured from the owner's capture: Mica under the glass ground gives #26262f. */
.bd-wall[data-material="glass"][data-theme="dark"] { background: #17171c; }
.bd-wall[data-material="glass"][data-theme="light"] { background: #e2e6ee; }
/* Strong glass shows the blurred desktop behind the window: a stand-in here. */
.bd-wall[data-material="strong"][data-theme="dark"] { background: radial-gradient(90% 120% at 12% 0%, #24406b 0%, transparent 60%), radial-gradient(80% 110% at 96% 100%, #3b2d52 0%, transparent 62%), #14151b; }
.bd-wall[data-material="strong"][data-theme="light"] { background: radial-gradient(90% 120% at 12% 0%, #bcd0ef 0%, transparent 60%), radial-gradient(80% 110% at 96% 100%, #dccdea 0%, transparent 62%), #e9ebf2; }

/* Resets carry no specificity, so a class always wins over them. */
:where(.bd-root, .bd-root *) { box-sizing: border-box; }
:where(.bd-root button, .bd-root input, .bd-root textarea) { font: inherit; color: inherit; }
:where(.bd-root button) { background: none; border: 0; padding: 0; cursor: pointer; }
:where(.bd-root h1, .bd-root h2, .bd-root h3, .bd-root p, .bd-root ul, .bd-root dl, .bd-root dd) { margin: 0; padding: 0; font: inherit; }
:where(.bd-root ul) { list-style: none; }
:where(.bd-root em, .bd-root i) { font-style: normal; }

.bd-root {
  --pc-bg: var(--bg-base); --pc-panel: var(--bg-panel); --pc-elevated: var(--bg-elevated); --pc-hover: var(--bg-hover);
  --pc-border: var(--border); --pc-border-strong: var(--border-strong);
  --pc-text: var(--text-primary); --pc-text-muted: var(--text-secondary);
  --pc-accent: var(--accent); --pc-accent-fill: var(--accent-fill); --pc-on-accent: var(--on-accent);
  --pc-ok: var(--ok); --pc-warn: var(--warn); --pc-danger: var(--danger);
  --pc-radius: var(--radius-ctl); --pc-radius-panel: var(--radius-panel); --pc-ctl-h: var(--ctl-h);
  --pc-font: var(--font-sans); --pc-font-code: var(--font-code);

  --bd-card: var(--pc-elevated);
  --bd-card-hover: var(--pc-hover);
  --bd-btn: var(--pc-elevated);
  --bd-btn-hover: var(--pc-hover);
  --bd-btn-line: var(--pc-border-strong);
  --bd-line: color-mix(in srgb, var(--pc-text) 10%, transparent);
  --bd-fill: color-mix(in srgb, var(--pc-text) 5%, transparent);
  --bd-fill-2: color-mix(in srgb, var(--pc-text) 9%, transparent);
  --bd-fill-3: color-mix(in srgb, var(--pc-text) 15%, transparent);
  --bd-danger-box: color-mix(in srgb, var(--pc-danger) 10%, var(--bd-card));
  --bd-danger-line: color-mix(in srgb, var(--pc-danger) 32%, transparent);
  --bd-warn-box: color-mix(in srgb, var(--pc-warn) 9%, var(--bd-card));
  --bd-warn-line: color-mix(in srgb, var(--pc-warn) 30%, transparent);
  --bd-fast: 120ms; --bd-med: 220ms; --bd-ease: cubic-bezier(0.16, 1, 0.3, 1);

  container: bd / inline-size;
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 12px; color: var(--pc-text); font: 13px/1.45 var(--pc-font);
  background: var(--pc-bg);
}
.bd-root[data-material="glass"], .bd-root[data-material="strong"] { background: rgb(120 120 150 / .156); }
.bd-root[data-theme="light"][data-material="glass"], .bd-root[data-theme="light"][data-material="strong"] { background: rgb(255 255 255 / .635); }
/* On the lighter glass ground a card has to rise above it, not sit below. */
.bd-root[data-theme="dark"][data-material="glass"], .bd-root[data-theme="dark"][data-material="strong"] {
  --bd-card: color-mix(in srgb, var(--pc-text) 10%, var(--pc-elevated));
  --bd-card-hover: color-mix(in srgb, var(--pc-text) 15%, var(--pc-elevated));
  --bd-btn: color-mix(in srgb, var(--pc-text) 17%, var(--pc-elevated));
  --bd-btn-hover: color-mix(in srgb, var(--pc-text) 23%, var(--pc-elevated));
  --bd-btn-line: color-mix(in srgb, var(--pc-text) 26%, transparent);
  --pc-text-muted: color-mix(in srgb, var(--text-secondary) 76%, var(--text-primary));
}

.bd-i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bd-root :focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }

/* Controls */
.bd-btn { height: var(--pc-ctl-h); padding: 0 14px; border-radius: var(--pc-radius); border: 1px solid var(--bd-btn-line); background: var(--bd-btn); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background var(--bd-fast) var(--bd-ease); }
.bd-btn:hover { background: var(--bd-btn-hover); }
.bd-btn.is-primary { background: var(--pc-accent-fill); border-color: transparent; color: var(--pc-on-accent); font-weight: 600; }
.bd-btn.is-primary:hover { background: color-mix(in srgb, var(--pc-accent-fill) 86%, white); }
.bd-btn.is-icon { width: var(--pc-ctl-h); padding: 0; }
.bd-btn.is-quiet { border-color: transparent; background: transparent; color: var(--pc-text-muted); }
.bd-btn.is-quiet:hover { background: var(--bd-fill-2); color: var(--pc-text); }

.bd-field { position: relative; display: flex; align-items: center; height: var(--pc-ctl-h); width: 224px; }
.bd-field .bd-i { position: absolute; left: 10px; color: var(--pc-text-muted); pointer-events: none; }
.bd-field input { width: 100%; height: 100%; padding: 0 10px 0 32px; border-radius: var(--pc-radius); border: 1px solid var(--control-line); background: var(--bd-card); outline-offset: 0; }
.bd-field input::placeholder { color: var(--pc-text-muted); opacity: 1; }

.bd-seg { display: inline-flex; height: var(--pc-ctl-h); border: 1px solid var(--bd-btn-line); border-radius: var(--pc-radius); background: var(--bd-card); padding: 2px; gap: 2px; }
.bd-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 6px; color: var(--pc-text-muted); transition: background var(--bd-fast) var(--bd-ease), color var(--bd-fast) var(--bd-ease); }
.bd-seg button:hover { color: var(--pc-text); }
.bd-seg button[aria-pressed="true"] { background: var(--bd-fill-3); color: var(--pc-text); font-weight: 600; }

/* Top of the page */
.bd-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 20px 24px 16px; flex: none; min-height: 106px; }
.bd-hero { min-width: 0; }
.bd-title { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.015em; }
.bd-live { margin-top: 6px; min-height: 22px; font-size: 14px; color: var(--pc-text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; }
.bd-live > span { display: inline-flex; align-items: center; }
.bd-live b { color: var(--pc-text); font-weight: 600; margin-right: 4px; }
.bd-live .bd-tile { margin-right: 6px; }
.bd-live .bd-live-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--pc-warn); }
.bd-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.bd-toolrow { display: flex; align-items: center; gap: 8px; }
.bd-toolrow.is-status { min-height: 28px; }
.bd-sync { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; margin-right: -8px; border-radius: 8px; font-size: 12px; color: var(--pc-text-muted); }
.bd-sync:hover { background: var(--bd-fill-2); color: var(--pc-text); }
.bd-sync .bd-gh { width: 14px; height: 14px; fill: currentColor; flex: none; }
.bd-sync .bd-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pc-ok); margin-left: 2px; }
.bd-sync.is-bad .bd-sync-dot { background: var(--pc-warn); }

/* A tile holds an agent CLI's own mark, always at one size. */
.bd-tile { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--bd-fill-3); flex: none; }
.bd-tile img { width: 13px; height: 13px; display: block; }

/* Banners: the whole box is tinted, no side stripe. */
.bd-banner { display: flex; align-items: center; gap: 12px; margin: 0 24px 14px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--bd-warn-box); border: 1px solid var(--bd-warn-line); flex: none; }
.bd-banner.is-danger { background: var(--bd-danger-box); border-color: var(--bd-danger-line); }
.bd-banner .bd-i { color: var(--pc-warn); }
.bd-banner.is-danger .bd-i { color: var(--pc-danger); }
.bd-banner-text { flex: 1; min-width: 0; }
.bd-banner b { font-weight: 600; margin-right: 8px; }
.bd-banner span { color: var(--pc-text-muted); }

/* One surface for lists of rows: Needs you and Done. */
.bd-panel { background: var(--bd-card); border: 1px solid var(--bd-line); border-radius: 12px; overflow: hidden; }
[data-theme="light"] .bd-panel, [data-theme="light"] .bd-card { box-shadow: 0 1px 2px rgb(22 24 29 / .06); }

/* Needs you */
.bd-needs { padding: 0 24px 16px; flex: none; }
.bd-sechead { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px; font-size: 14px; font-weight: 600; width: 100%; }
.bd-sechead i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc-warn); }
.bd-sechead span { color: var(--pc-text-muted); font-weight: 400; font-size: 13px; }
.bd-sechead .bd-i { margin-left: auto; color: var(--pc-text-muted); transition: transform var(--bd-fast) var(--bd-ease); }
.bd-sechead[aria-expanded="true"] .bd-i { transform: rotate(180deg); }
.bd-need { display: grid; grid-template-columns: 168px minmax(0, 1fr) minmax(0, 360px) auto; align-items: center; gap: 16px; min-height: 48px; padding: 6px 7px 6px 14px; cursor: pointer; transition: background var(--bd-fast) var(--bd-ease); }
.bd-need + .bd-need { border-top: 1px solid var(--bd-line); }
.bd-need:hover { background: var(--bd-card-hover); }
.bd-need-why { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.bd-need-why i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc-warn); flex: none; }
.bd-need-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-need-who { font-size: 12px; color: var(--pc-text-muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.bd-need-who span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-need .bd-btn { min-width: 116px; }

/* Stage tabs: phone and narrow panes only */
.bd-tabs { display: none; gap: 6px; padding: 0 16px 10px; overflow-x: auto; flex: none; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.bd-tab { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--bd-fill); color: var(--pc-text-muted); white-space: nowrap; flex: none; }
.bd-tab[aria-pressed="true"] { background: var(--bd-fill-3); color: var(--pc-text); font-weight: 600; }
.bd-tab em { font-weight: 400; }

/* The board */
.bd-board { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 16px; padding: 2px 24px 24px; overflow-x: auto; overflow-y: hidden; }
.bd-lane { container: bdlane / inline-size; flex: 1 1 0; min-width: 216px; max-height: 100%; display: flex; flex-direction: column; border-radius: 12px; transition: box-shadow var(--bd-fast) var(--bd-ease), background var(--bd-fast) var(--bd-ease); }
.bd-lane-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px; font-size: 14px; font-weight: 600; flex: none; }
.bd-lane-head .bd-glyph { color: var(--pc-text-muted); }
.bd-count { color: var(--pc-text-muted); font-weight: 400; font-size: 13px; }
.bd-lane-tail { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--pc-text-muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.bd-pips { display: inline-flex; gap: 3px; }
.bd-pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--bd-fill-3); }
.bd-pips i.is-on { background: var(--pc-text-muted); }
.bd-lane-tail.is-over .bd-pips i.is-on { background: var(--pc-warn); }
.bd-lane-add { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--pc-text-muted); }
.bd-lane-add:hover { background: var(--bd-fill-2); color: var(--pc-text); }
.bd-lane-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 8px; align-content: start; min-height: 0; overflow-y: auto; padding: 2px; margin: 0 -2px; scrollbar-width: thin; }
.bd-lane-body.is-scroll { mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
.bd-glyph { width: 16px; height: 16px; flex: none; display: block; }
.bd-lane-note { color: var(--pc-text-muted); padding: 10px 12px; border: 1px dashed var(--pc-border-strong); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bd-link { color: var(--pc-accent); font-weight: 600; }
.bd-link:hover { text-decoration: underline; }

/* An empty stage is only its name. A drag turns it into a place to land. */
.bd-cluster { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; min-width: 116px; }
.bd-rail { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 8px; color: var(--pc-text-muted); white-space: nowrap; transition: background var(--bd-fast) var(--bd-ease), color var(--bd-fast) var(--bd-ease); }
.bd-rail:hover { background: var(--bd-fill-2); color: var(--pc-text); }
.bd-rail-count { margin-left: auto; }
.bd-rail-drop { display: none; font-weight: 600; text-align: center; white-space: normal; }
.bd-board.is-dragging .bd-cluster { flex-basis: 150px; align-self: stretch; gap: 8px; }
.bd-board.is-dragging .bd-rail { flex: 1; height: auto; flex-direction: column; justify-content: center; padding: 10px; border: 1.5px dashed var(--pc-border-strong); }
.bd-board.is-dragging .bd-rail-name, .bd-board.is-dragging .bd-rail-count { display: none; }
.bd-board.is-dragging .bd-rail-drop { display: block; }
.bd-board.is-dragging .bd-rail.is-over { background: var(--bd-fill-2); border-color: var(--pc-text-muted); color: var(--pc-text); }
.bd-board.is-dragging .bd-lane { align-self: stretch; }
.bd-lane.is-over { background: var(--bd-fill); box-shadow: 0 0 0 8px var(--bd-fill); }

/* No active work: the queue says so on the left, Done is the content. */
.bd-board.is-idle { gap: 32px; }
.bd-queue { flex: 1 1 0; min-width: 0; }
.bd-chiprow { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 28px; }
.bd-board.is-idle .bd-lane { flex: 1.5 1 0; }

/* Card: state, title, one line about who has it. */
.bd-card { container: bdcard / inline-size; position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--bd-card); border: 1px solid var(--bd-line); cursor: grab; user-select: none; transition: background var(--bd-fast) var(--bd-ease), border-color var(--bd-fast) var(--bd-ease); }
.bd-card:hover { background: var(--bd-card-hover); }
.bd-card.is-open { background: var(--bd-card-hover); border-color: color-mix(in srgb, var(--pc-text) 46%, transparent); }
.bd-card.is-source { opacity: .32; }
.bd-card.is-new { animation: bd-flash 1.2s var(--bd-ease); }
@keyframes bd-flash { 0% { background: color-mix(in srgb, var(--pc-text) 24%, var(--bd-card)); } 100% { } }
.bd-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 20px; font-size: 12px; color: var(--pc-text-muted); }
.bd-state { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; color: var(--pc-text); }
.bd-state > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bd-state em { color: var(--pc-text-muted); flex: none; }
.bd-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--pc-text-muted); }
.bd-state.is-run .bd-dot { background: var(--pc-ok); animation: bd-pulse 2.4s ease-in-out infinite; }
.bd-state.is-ask .bd-dot { background: var(--pc-warn); }
@keyframes bd-pulse { 50% { opacity: .45; } }
@container bdcard (max-width: 260px) { .bd-state em { display: none; } }
.bd-card-meta { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.bd-id { font-family: var(--pc-font-code); font-size: 11px; color: var(--pc-text-muted); position: relative; top: 1.5px; }
.bd-pri { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bd-pri i { width: 3px; border-radius: 1px; background: var(--bd-fill-3); }
.bd-pri i:nth-child(1) { height: 5px; } .bd-pri i:nth-child(2) { height: 8px; } .bd-pri i:nth-child(3) { height: 12px; }
.bd-pri i.is-on { background: var(--pc-text); }
.bd-card-title { font-size: 14px; line-height: 20px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bd-card-live { color: var(--pc-text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; min-height: 20px; font-size: 12px; color: var(--pc-text-muted); }
.bd-who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; color: var(--pc-text); }
.bd-who small { font-size: inherit; color: var(--pc-text-muted); overflow: hidden; text-overflow: ellipsis; }
@container bdcard (max-width: 232px) { .bd-who small { display: none; } }
.bd-lease { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex: none; }
.bd-ring { width: 14px; height: 14px; display: block; transform: rotate(-90deg); }
.bd-ring circle { fill: none; stroke-width: 2.4; }
.bd-ring .bg { stroke: var(--bd-fill-3); }
.bd-ring .fg { stroke: currentColor; stroke-linecap: round; }
.bd-chips { display: inline-flex; gap: 4px; min-width: 0; overflow: hidden; }
.bd-chip { height: 20px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--bd-fill-2); font-size: 11px; color: color-mix(in srgb, var(--pc-text) 86%, transparent); white-space: nowrap; }

/* Landing slot */
.bd-slot { border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--pc-text) 34%, transparent); background: var(--bd-fill); }
.bd-ghost { position: absolute; z-index: 40; margin: 0; pointer-events: none; transform: rotate(2.4deg) scale(1.02); box-shadow: 0 18px 40px rgb(0 0 0 / .42); cursor: grabbing; background: var(--bd-card); }

/* Done rows */
.bd-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; text-align: left; transition: background var(--bd-fast) var(--bd-ease); }
.bd-row + .bd-row { border-top: 1px solid var(--bd-line); }
.bd-row:hover { background: var(--bd-card-hover); }
.bd-row:hover .bd-id, .bd-row:hover .bd-row-how { color: var(--pc-text); }
.bd-row .bd-glyph { color: var(--pc-text-muted); }
.bd-row-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-row-how { font-size: 12px; color: var(--pc-text-muted); white-space: nowrap; flex: none; }
.bd-row-how.is-code { font-family: var(--pc-font-code); font-size: 11px; }
@container bdlane (max-width: 340px) { .bd-row-how { display: none; } }

/* Primary empty, no-results */
.bd-empty { flex: 1; align-self: stretch; min-width: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 32px; }
.bd-empty h2 { font-size: 16px; font-weight: 600; }
.bd-empty p { color: var(--pc-text-muted); max-width: 44ch; margin-bottom: 12px; }
.bd-empty.is-left { align-items: flex-start; text-align: left; justify-content: flex-start; padding: 0 10px; min-width: 0; }

/* List view */
.bd-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 24px 24px; scrollbar-width: thin; }
.bd-group { margin-bottom: 16px; }
.bd-group-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px; font-size: 14px; font-weight: 600; }
.bd-group-head .bd-glyph { color: var(--pc-text-muted); }
.bd-line { display: grid; grid-template-columns: 52px 196px minmax(0, 1fr) 180px; align-items: center; gap: 12px; min-height: 40px; padding: 4px 12px; cursor: pointer; transition: background var(--bd-fast) var(--bd-ease); }
.bd-line + .bd-line { border-top: 1px solid var(--bd-line); }
.bd-line:hover { background: var(--bd-card-hover); }
.bd-line-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bd-line-state { font-size: 12px; min-width: 0; }

/* Drawer */
.bd-scrim { position: absolute; inset: 0; z-index: 20; background: rgb(0 0 0 / .16); animation: bd-fade var(--bd-fast) var(--bd-ease); }
.bd-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; width: 480px; max-width: 100%; display: flex; flex-direction: column; background: var(--pc-panel); border-left: 1px solid var(--pc-border-strong); box-shadow: -20px 0 48px rgb(0 0 0 / .4); animation: bd-in var(--bd-med) var(--bd-ease); }
[data-theme="light"] .bd-drawer { box-shadow: -12px 0 32px rgb(22 24 29 / .12); }
@keyframes bd-in { from { transform: translateX(32px); opacity: 0; } }
.bd-d-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 0 20px; color: var(--pc-text-muted); font-size: 12px; flex: none; }
.bd-d-src { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--pc-font-code); font-size: 11px; color: var(--pc-text-muted); white-space: nowrap; overflow: hidden; }
.bd-d-src .bd-gh { width: 13px; height: 13px; fill: currentColor; flex: none; }
.bd-d-src .bd-i { width: 12px; height: 12px; }
.bd-d-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 16px; scrollbar-width: thin; }
.bd-d-title { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.bd-d-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 12px; color: var(--pc-text-muted); }
.bd-d-facts .bd-pri { margin-right: -4px; }
.bd-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-top: 16px; padding: 3px; border-radius: 10px; background: var(--bd-fill); }
.bd-step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: 8px; color: var(--pc-text-muted); font-size: 11px; transition: background var(--bd-fast) var(--bd-ease), color var(--bd-fast) var(--bd-ease); }
.bd-step:hover { background: var(--bd-fill-2); color: var(--pc-text); }
.bd-step[aria-current="step"] { background: var(--bd-fill-3); color: var(--pc-text); font-weight: 600; }
.bd-d-sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bd-line); }
.bd-d-label { font-size: 12px; font-weight: 600; color: var(--pc-text-muted); margin-bottom: 8px; }
.bd-d-agent { display: flex; align-items: center; gap: 10px; }
.bd-d-agent-main { flex: 1; min-width: 0; }
.bd-d-agent-main p { font-size: 12px; color: var(--pc-text-muted); display: flex; align-items: center; gap: 6px; }
.bd-d-actions { display: flex; gap: 8px; margin-top: 10px; }
.bd-d-body { white-space: pre-wrap; }
.bd-d-trust { font-size: 12px; color: var(--pc-text-muted); margin-top: 8px; }
.bd-log li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 6px 0; font-size: 12px; }
.bd-log time { color: var(--pc-text-muted); text-align: right; white-space: nowrap; }
.bd-log .is-note { display: block; margin-top: 2px; font-size: 13px; }
.bd-log span.bd-who-log { color: var(--pc-text-muted); }
.bd-log .bd-mirror { color: var(--pc-text-muted); display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.bd-d-compose { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--bd-line); flex: none; }
.bd-input { height: var(--pc-ctl-h); flex: 1; min-width: 0; padding: 0 10px; border-radius: var(--pc-radius); border: 1px solid var(--control-line); background: var(--pc-elevated); outline-offset: 0; }
.bd-input::placeholder { color: var(--pc-text-muted); opacity: 1; }
textarea.bd-input { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.bd-err { color: var(--pc-text); font-size: 12px; min-height: 16px; }

/* Popovers, dialog, toast */
.bd-pop { position: absolute; z-index: 50; background: var(--pc-elevated); border: 1px solid var(--pc-border-strong); border-radius: 12px; padding: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .32); animation: bd-fade var(--bd-fast) var(--bd-ease); }
[data-theme="light"] .bd-pop { box-shadow: 0 10px 28px rgb(22 24 29 / .16); }
@keyframes bd-fade { from { opacity: 0; } }
.bd-pop h3 { font-weight: 600; margin-bottom: 2px; }
.bd-pop p { color: var(--pc-text-muted); font-size: 12px; margin-bottom: 10px; }
.bd-pop-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.bd-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 12px; margin-bottom: 10px; }
.bd-facts dt { color: var(--pc-text-muted); }
.bd-facts dd { margin: 0; text-align: right; }
.bd-menu { padding: 4px; min-width: 190px; }
.bd-menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px; border-radius: 8px; text-align: left; }
.bd-menu button:hover, .bd-menu button:focus-visible { background: var(--bd-fill-2); }
.bd-menu button[aria-current="true"] { color: var(--pc-text-muted); }
.bd-menu kbd { margin-left: auto; }
.bd-root kbd { font-family: var(--pc-font-code); font-size: 11px; color: var(--pc-text-muted); border: 1px solid var(--pc-border-strong); border-radius: 5px; padding: 0 5px; }
.bd-keys { display: grid; grid-template-columns: auto auto; gap: 6px 18px; align-items: center; font-size: 12px; }
.bd-keys span { color: var(--pc-text-muted); }

.bd-dialog-wrap { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgb(0 0 0 / .5); animation: bd-fade var(--bd-fast) var(--bd-ease); }
.bd-dialog { width: 460px; max-width: calc(100% - 32px); background: var(--pc-panel); border: 1px solid var(--pc-border-strong); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.bd-dialog h2 { font-size: 16px; font-weight: 600; }
.bd-f { display: flex; flex-direction: column; gap: 4px; }
.bd-f > span { font-size: 12px; color: var(--pc-text-muted); }
.bd-dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bd-dialog-foot .bd-err { margin-right: auto; }

.bd-toast { position: absolute; left: 50%; bottom: 20px; z-index: 70; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 14px; min-height: 44px; border-radius: 12px; background: var(--pc-elevated); border: 1px solid var(--pc-border-strong); box-shadow: 0 12px 32px rgb(0 0 0 / .32); white-space: nowrap; animation: bd-fade var(--bd-fast) var(--bd-ease); }

/* Skeleton */
.bd-sk { display: block; border-radius: 12px; background: var(--bd-fill-2); animation: bd-pulse 1.6s ease-in-out infinite; }

/* Narrow panes and the phone */
@container bd (max-width: 720px) {
  .bd-top { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 16px 12px; min-height: 0; }
  .bd-tools { align-items: stretch; }
  .bd-toolrow { justify-content: space-between; }
  .bd-toolrow.is-status { min-height: 0; justify-content: flex-start; }
  .bd-sync { margin: 0 0 0 -8px; }
  .bd-lane-head { display: none; }
  .bd-field { flex: 1; width: auto; height: 44px; }
  .bd-seg.is-view, .bd-keysbtn { display: none; }
  .bd-btn { height: 44px; }
  .bd-btn.is-icon { width: 44px; }
  .bd-input { height: 44px; }
  .bd-banner { margin: 0 16px 12px; flex-wrap: wrap; }
  .bd-needs { padding: 0 16px 8px; }
  .bd-sechead { height: 44px; }
  .bd-need { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 12px 14px; }
  .bd-need-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .bd-need-who { align-items: flex-start; }
  .bd-need-who span:last-child { white-space: normal; }
  .bd-need .bd-btn { justify-self: start; margin-top: 7px; }
  .bd-tabs { display: flex; }
  .bd-board { flex-direction: column; align-items: stretch; padding: 2px 16px 16px; overflow-x: hidden; overflow-y: auto; }
  .bd-lane { display: none; min-width: 0; max-height: none; flex: none; }
  .bd-lane.is-current { display: flex; }
  .bd-cluster { display: none; }
  .bd-empty { min-width: 0; }
  .bd-lane-body { overflow: visible; grid-template-columns: minmax(0, 1fr); }
  .bd-lane-body.is-scroll { mask-image: none; }
  .bd-drawer { top: 44px; width: 100%; border-left: 0; border-top: 1px solid var(--pc-border-strong); border-radius: 16px 16px 0 0; animation-name: bd-up; }
  .bd-scrim { background: rgb(0 0 0 / .5); }
  .bd-d-compose { padding-bottom: 16px; }
  .bd-dialog-wrap { place-items: end stretch; }
  .bd-dialog { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .bd-row { height: 44px; }
  .bd-step { min-height: 56px; }
  .bd-toast { left: 16px; right: 16px; transform: none; justify-content: space-between; white-space: normal; }
  .bd-list { padding: 2px 16px 16px; }
}
@keyframes bd-up { from { transform: translateY(32px); opacity: 0; } }

/* Reduced motion removes the movement and keeps the fades. */
@media (prefers-reduced-motion: reduce) {
  .bd-drawer { animation-name: bd-fade; }
  .bd-ghost { transform: none; }
}
