/* ==========================================================================
   Board — every site in its stage, in the order the agents will work them.
   The page is the room; cards are white; the only thing at rest with a shadow is a card that waits for a person.
   A card reads: the site, its power now as the figure (with how sure we are and who is on it), then its state; power
   not known yet has no figure, so the card stays short. Set aside stands apart, behind a hairline, its cards hollow.
   The prioritizer's status line ends in its chat, which opens as a panel over the last two lanes.
   ========================================================================== */
.view-board { overflow-x: auto; overflow-y: hidden; }
.bd { position: relative; height: 100%; min-width: 1200px; display: flex; flex-direction: column; padding: 0 32px; }

/* Breathing marks share one clock (see phase() in board.js) */
.view-board .av-agent.is-live::after, .view-board .dot-live,
.bd-ghost .av-agent.is-live::after, .bd-flight .av-agent.is-live::after { animation-delay: var(--bd-phase, 0ms); }

/* ---------- The prioritizer's live line, then its chat: the dot hangs, so the words start on the lanes' text edge ---------- */
.bd-head { flex: none; display: flex; align-items: center; gap: 16px; height: 60px; padding-left: 16px; }
.bd-live { flex: 0 1 auto; min-width: 0; margin-left: -22px; cursor: default; }
.bd-live > .dot.is-quiet { visibility: hidden; }
.bd-chat-btn { flex: none; }
.bd-chat-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--ink); }
.bd-chat-btn .count { margin-right: -6px; }

/* ---------- Lanes ---------- */
.bd-lanes {
  position: relative; flex: 1 1 auto; min-height: 0; display: grid; column-gap: 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .88fr);
}
.bd-lane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; animation: rise var(--dur-3) var(--ease) backwards; }
.bd-lane > * { position: relative; z-index: 1; }

/* While a card is dragged, the lane under it is framed by an outline */
.bd-lane::before {
  content: ""; position: absolute; z-index: 0; inset: -8px -8px 20px; border-radius: var(--r-4);
  box-shadow: inset 0 0 0 1px transparent; pointer-events: none; transition: box-shadow var(--dur-2) var(--ease);
}
.bd.is-dragging .bd-lane.is-target::before { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* The head: name and count, then the power in writing the lane holds now (● after it; none, no figure). Its words sit on the cards' text edge. */
.bd-lane-head { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 0 16px 8px; }
.bd-lane-title { display: flex; align-items: center; gap: 8px; min-width: 0; height: 24px; }
.bd-lane-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-heading); font-weight: 500; line-height: 24px; cursor: default; }
.bd-lane-head .count { flex: none; }
.bd-lane-total { display: flex; align-items: center; gap: 6px; min-height: 17px; font-size: var(--fs-meta); line-height: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.bd-lane-total:empty { pointer-events: none; }

/* Set aside stands apart: more room, a hairline, hollow cards */
.bd-lane.s-aside { margin-left: 16px; }
.bd-lane.s-aside::after { content: ""; position: absolute; z-index: 0; left: -16.5px; top: 2px; bottom: 28px; width: 1px; background: var(--line); }

/* The body scrolls on its own; its padding leaves room for the cards' shadows */
.bd-lane-body {
  position: relative; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px; margin: 0 -12px; padding: 6px 12px 24px;
  scrollbar-width: none;
}
.bd-lane-body::-webkit-scrollbar { display: none; }
.bd-empty { display: none; align-items: center; gap: 10px; padding: 2px 16px; font-size: var(--fs-body); line-height: 20px; }
.bd-lane.is-empty .bd-empty { display: flex; }
.bd-lane-body:has(.bd-slot) .bd-empty { display: none; }

/* ---------- Cards ---------- */
.bd-card {
  position: relative; flex: none; display: flex; flex-direction: column; min-width: 0;
  padding: 14px 16px 16px; border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ring);
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
  transition: box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.bd-card:hover { box-shadow: var(--shadow-2); }

/* The site: name (Strong) and, for a site that waits, the needs-you marker; place and country (Meta). Names wrap, never cut. */
.bd-card-top { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.bd-card-name { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; font-size: var(--fs-body); font-weight: 500; line-height: 20px; }
.bd-card-mark { flex: none; display: inline-grid; place-items: center; width: 8px; height: 20px; }
.bd-card-place { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin-top: 1px; font-size: var(--fs-meta); line-height: 16px; }
/* Power not known yet: no figure; its mark follows the place, held to the last word, and who is on it ends the line */
.bd-place { min-width: 0; }
.bd-nb { white-space: nowrap; }
.bd-mark { margin-left: 6px; vertical-align: middle; }
.bd-card-place > .bd-who { margin-block: -4px; }

/* The figure: power now (Figure), "MW" (Strong), its certainty mark; who is on it at the far end */
.bd-card-fig { display: flex; align-items: center; gap: 8px; min-width: 0; height: 32px; margin-top: 16px; }
.bd-fig { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bd-fig-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-figure); font-weight: 300; line-height: 32px; font-variant-numeric: tabular-nums; }
.bd-fig-val .unit { margin-left: .25em; }
.bd-or { margin: 0 .3em; font-size: var(--fs-body); font-weight: 500; }
.bd-fig > .src { flex: none; }
.bd-who { flex: none; display: inline-flex; margin-left: auto; }
.bd-who .av-stack > .av:not(:last-child)::after { display: none; } /* several agents on it: one breathing dot for the stack */

/* A lane's first card: why it leads, in whole sentences, two lines at most (the rest on hover) */
.bd-why { margin: 12px 0 0; font-size: var(--fs-body); line-height: 20px; }
.bd-fit { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* The state, when there is one: what waits for you and since when · when a set-aside site comes back · research stopped */
.bd-card-state { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line); }
.bd-card-note { font-size: var(--fs-body); line-height: 20px; }
.bd-ask { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-weight: 500; }
.bd-ask .bd-age { font-weight: 400; }
.bd-age { margin-left: 8px; font-size: var(--fs-meta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-stopped { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; font-size: var(--fs-meta); line-height: 16px; white-space: nowrap; cursor: default; }
.bd-stopped .chip { padding: 0 10px 0 9px; }
.bd-stop-ic { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }

/* Needs a person: lifted, with the one dark-red marker; the question in its own words */
.bd-card.s-person { box-shadow: var(--raise); }
.bd-card.s-person:hover { box-shadow: var(--raise), var(--shadow-2); }

/* Set aside: hollow and compact; power in the Strong style, then what brings it back, never cut */
.bd-card.s-aside { padding: 12px 16px 14px; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.bd-card.s-aside:hover { background: var(--surface); box-shadow: var(--ring); }
.bd-card.s-aside .bd-card-fig { height: 20px; margin-top: 10px; }
.bd-card.s-aside .bd-fig-val { font-size: var(--fs-body); font-weight: 500; line-height: 20px; }
.bd-card.s-aside .bd-card-state { margin-top: 10px; padding-top: 0; box-shadow: none; }

/* Moved by the prioritizer, or pointed at from the chat: a fine ring, then gone (a waiting card keeps its lift) */
.bd-card.is-moved { z-index: 2; box-shadow: 0 0 0 1.5px var(--stroke); }
.bd-card.is-pointed { z-index: 2; box-shadow: 0 0 0 1.5px var(--ink); }
.bd-card.s-person.is-moved { box-shadow: var(--raise), 0 0 0 1.5px var(--stroke); }
.bd-card.s-person.is-pointed { box-shadow: var(--raise), 0 0 0 1.5px var(--ink); }
/* Waiting in Set aside for its reason: pending, so a dashed edge */
.bd-card.is-pending { box-shadow: none; background: transparent; }
.bd-card.is-pending::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1.5px dashed var(--stroke); pointer-events: none; }
.bd-card.is-dragging { display: none; }

/* ---------- Dragging: the card lifts and follows; a dashed slot shows where it lands ---------- */
html.bd-grabbing, html.bd-grabbing * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.bd-slot { flex: none; border-radius: var(--r-3); border: 1.5px dashed var(--stroke); }
.bd-ghost { position: fixed; left: 0; top: 0; z-index: 65; pointer-events: none; will-change: transform; }
.bd-ghost > .bd-card { transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease); }
.bd-ghost.is-lifted > .bd-card { transform: rotate(1.5deg) scale(1.03); background: var(--surface); box-shadow: var(--shadow-3); }
.bd-ghost.is-settling { transition: transform 200ms var(--ease); }
.bd-flight { position: fixed; z-index: 35; margin: 0; pointer-events: none; background: var(--surface); box-shadow: var(--shadow-2); }

/* ---------- The chat: a panel over the last two lanes, from the lane heads down to the bottom edge, as the lanes run ---------- */
.bd-chat {
  position: absolute; z-index: 40; grid-column: 5 / -1; grid-row: 1; inset: 0; display: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.bd-chat.is-open { display: flex; }
.bd.is-busy .bd-chat { opacity: 0; transform: translateX(8px); pointer-events: none; }

.bd-panel {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-4) var(--r-4) 0 0; background: var(--surface); box-shadow: var(--shadow-2); transform-origin: top right;
}
.bd-chat.is-opening .bd-panel { animation: bd-panel-in var(--dur-3) var(--ease); }
@keyframes bd-panel-in { from { opacity: 0; transform: translateX(12px); } }

.bd-ch-head { flex: none; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 12px 0 16px; box-shadow: inset 0 -1px 0 var(--line); }
.bd-ch-head > .icon-btn:first-child { margin-left: -6px; }
.bd-ch-title { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-heading); font-weight: 500; line-height: 1.4; }

.bd-ch-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 16px; }

/* List: the guidance it follows, then the conversations */
.bd-ch-sec + .bd-ch-sec { margin-top: 24px; }
.bd-ch-label { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: var(--fs-body); font-weight: 500; line-height: 24px; cursor: default; }
.bd-guides { display: flex; flex-direction: column; }
.bd-guide { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; margin: 0 -8px; padding: 8px 2px 8px 8px; border-radius: var(--r-2); transition: background var(--dur-1) var(--ease); }
.bd-guide[data-chat-id] { cursor: pointer; }
.bd-guide:hover { background: var(--hover); }
/* A rule wraps to two lines rather than losing its end */
.bd-guide-text { flex: 1 1 auto; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 20px; }
.bd-guide .icon-btn { margin: -4px 0; opacity: 0; transition: opacity var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.bd-guide:hover .icon-btn, .bd-guide .icon-btn:focus-visible { opacity: 1; }
.bd-ch-sec .list { margin: 0 -10px; }
.bd-ch-row { align-items: flex-start; padding: 10px; }
.bd-ch-row > .av { margin-top: 2px; }
.bd-ch-row .list-row-meta { padding-top: 2px; }

/* Thread: yours on the right in the fill, the prioritizer and colleagues on the left in white */
.bd-thread { padding: 8px 16px 18px; }
.bd-thread > :first-child { margin-top: auto; } /* a short thread sits just above the composer, as in any chat */
.bd-day { align-self: center; margin: 16px 0 0; font-size: var(--fs-meta); line-height: 16px; }
.bd-msg { display: flex; min-width: 0; max-width: 86%; margin-top: 12px; }
.bd-msg.is-follow { margin-top: 4px; }
.bd-msg.is-agent { max-width: 100%; }
.bd-msg.is-mine { align-self: flex-end; }
.bd-msg.is-new { animation: rise var(--dur-3) var(--ease) backwards; }
.bd-msg > .bubble { min-width: 0; max-width: none; }
.bd-msg .bubble-who { margin-bottom: 4px; }
.bd-msg-text p + p { margin-top: 8px; }
.bd-label { font-weight: 500; }
.bd-thinking { display: inline-flex; align-items: center; gap: 10px; }
.bd-thinking > span.is-swapping { animation: swap var(--dur-3) var(--ease); }

/* Moves inside the prioritizer's answer: "↑ Neuvic  Researching  4 → 2"; hover points at the card */
.bd-moves { display: flex; flex-direction: column; margin: 10px -8px -4px; padding-top: 6px; box-shadow: inset 0 1px 0 var(--line); }
.bd-move {
  display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  height: 32px; padding: 0 8px; border: 0; border-radius: var(--r-2); background: none; color: var(--ink); text-align: left;
  font-size: var(--fs-body); transition: background var(--dur-1) var(--ease);
}
.bd-move:hover { background: var(--hover); }
.bd-move > .ic { width: 14px; height: 14px; }
.bd-move-name { font-weight: 500; white-space: nowrap; }
.bd-move-lane { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-meta); }
.bd-move-rank { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bd-move-rank .ic { width: 12px; height: 12px; color: var(--stroke); }
.bd-move-from { font-weight: 400; }
.bd-msg.is-new .bd-move { animation: rise var(--dur-3) var(--ease) backwards; animation-delay: calc(var(--i, 0) * 160ms + 200ms); }

/* A new conversation: the prioritizer and four ways to begin */
.bd-ch-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: auto 0; padding: 24px 8px; text-align: center; }
.bd-ch-empty-title { font-size: var(--fs-heading); font-weight: 500; line-height: 1.4; }
.bd-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }

/* Composer */
.bd-ch-foot { flex: none; padding: 12px 12px 16px; box-shadow: inset 0 1px 0 var(--line); }
.bd-compose {
  display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 16px; border-radius: 22px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow var(--dur-1) var(--ease);
}
.bd-compose:focus-within { box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 3px var(--fill); }
.bd-compose-input {
  flex: 1 1 auto; min-width: 0; height: 32px; max-height: 132px; padding: 6px 0; border: 0; outline: 0; background: none; resize: none;
  font: 400 var(--fs-body)/1.45 var(--font); color: var(--ink);
}
.bd-compose-input::placeholder { color: var(--ink); opacity: .42; }

/* ---------- Smaller screens (1280×800) ---------- */
@media (max-width: 1360px) {
  .bd { padding: 0 24px; }
}
@media (max-height: 860px) {
  .bd-head { height: 52px; }
  .bd-lane-head { padding-bottom: 6px; }
  .bd-lane-body { gap: 8px; }
  .bd-card { padding: 12px 16px 14px; }
  .bd-card-fig { margin-top: 12px; }
  .bd-card-state { margin-top: 12px; padding-top: 10px; }
}
