/* The Board (public/board.js, drawn in app.js): every project and helper as a block on one screen. Blocks sit in
   a grid on a computer and stack in one column on a phone. An opened block spans the whole row. No entrance
   animation: blocks redraw with the page and must never blink. Colours come from the day and night tokens. */
.board-head { display: flex; flex-direction: column; gap: 10px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.board-quiet { margin: 0; }

.board-block {
  min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 8px 14px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift);
}
.board-block.needs { border-color: var(--butter-edge); }
.board-block.open { grid-column: 1 / -1; }

.board-title {
  display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; border-radius: 12px;
}
.board-title:hover .board-name b { text-decoration: underline; text-underline-offset: 3px; }
.board-title:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.board-title .av { flex: none; }
.board-dot { flex: none; width: 10px; height: 10px; margin: 0 4px; border-radius: 50%; background: var(--ink-3); }
.board-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.board-name b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-state { flex: none; font-size: 12px; font-weight: 600; line-height: 22px; padding: 0 10px; border-radius: 999px; background: var(--quiet-bg); color: var(--quiet-ink); }
.board-state.needs { background: var(--butter); color: var(--on-butter); }
.board-state.moving { background: var(--lilac); color: var(--lilac-ink); }

/* A closed block's last lines: who, then one line each. */
.board-lines { display: flex; flex-direction: column; gap: 4px; }
.board-line {
  margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.board-line b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.board-line.now b { color: var(--lilac-ink); }
.board-line.pending { opacity: .6; }

.board-review {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 8px 12px; text-align: left;
  border: 1px solid var(--butter-line); border-radius: 14px; background: var(--butter-soft); color: var(--ink); font: inherit; cursor: pointer;
}
.board-review:hover { background: var(--butter-pale); }
.board-review:focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }
.board-more-waits {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600;
  color: var(--butter-ink); text-decoration: underline; text-underline-offset: 3px; border-radius: 8px;
}
.board-more-waits:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.board-review-tag { font-size: 12px; font-weight: 600; color: var(--butter-ink); }
.board-review-title { font-size: 14px; }

/* An opened block: the talk scrolls inside it, so the box stays in reach. */
.board-convo { display: flex; flex-direction: column; gap: 12px; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }

.board-box {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 4px 4px 4px 14px;
}
.board-box:focus-within { border-color: var(--mute); }
.board-box textarea {
  min-height: 36px; max-height: 160px; padding: 8px 0; border: 0; outline: none; resize: none; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; line-height: 1.35;
}
.board-box textarea::placeholder { color: var(--ink-3); }
.board-box .send, .board-block .thread-box .send { min-width: 44px; min-height: 44px; }
.board-block .thread-hint { display: none; }

.board-more {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-2);
  border-radius: 999px; background: var(--card); color: var(--ink-2); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer;
}
.board-more:hover { color: var(--ink); background: var(--hover); }
.board-more:focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }

/* Every block has its own box, so the page's chat box steps aside on the Board. */
.board-on .main > .composer-wrap { display: none; }

/* A crew card that opens its helper's block. */
.ccard.linked { cursor: pointer; }
.ccard.linked:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

@media (max-width: 640px) {
  .board-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .board-block { padding: 6px 12px 12px; }
  .board-convo { max-height: 55vh; }
}
