/* The Board (design/redesign-2026-10/theme.css "screen: board", NOTES.md §8): owners' Needs-you
   asks, the tools, five columns of cards and a card's drawer (a base.css .sheet). Columns take their
   colour from tags.js columnClass (`review` is drawn as col-check). */

/* ---------------------------------------------------------------- screen: board */
.asks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.ask {
  --h: var(--hue-amber);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 16px;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-1), inset 3px 0 0 oklch(var(--tone-dot-l) var(--tone-dot-c) var(--h));
}
.ask.s-playtest {
  --h: var(--hue-teal);
}
.ask > .status {
  grid-row: span 2;
  align-self: start;
  margin-top: 1px;
}
.ask b {
  font-weight: 600;
}
.ask p {
  font-size: var(--fs-13);
  color: var(--ink-3);
}
.ask .btn-row {
  grid-column: 2;
  margin-top: 8px;
}
.board-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.board-tools .chip-row {
  flex: 1 1 380px;
  min-width: 0;
}
.board-tools .search {
  flex: 0 1 220px;
}
.col-switch {
  display: none;
}
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.column {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-5);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  min-width: 0;
}
.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 2px 4px 0 8px;
}
.column-head h2 {
  font-size: var(--fs-14);
  font-weight: 650;
}
.column-head .n {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.column-head .icon-btn {
  margin-left: auto;
}
.column-hint {
  margin: -6px 0 2px;
  padding: 0 8px;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.column > .head-band {
  height: 3px;
  margin: -2px 8px 0;
  border-radius: 999px;
  background: oklch(var(--tone-dot-l) calc(var(--tone-dot-c) * var(--chroma)) var(--h));
  opacity: 0.85;
}
.cards {
  display: grid;
  gap: 8px;
}
.bcard {
  display: block;
  border-radius: 12px; /* 20 column - 8 padding */
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition-property: box-shadow, translate;
  transition-duration: var(--t-fast);
  transition-timing-function: var(--ease);
}
.bcard:hover {
  box-shadow: var(--shadow-2);
}
.bcard:active {
  translate: 0 1px;
}
.bcard .media {
  border-radius: 0;
  aspect-ratio: 16 / 8;
}
.bcard-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px 11px;
}
.bcard h3 {
  font-size: var(--fs-14);
  font-weight: 560;
  line-height: 1.38;
  color: var(--ink);
  text-wrap: pretty;
}
.bcard-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}
.bcard-foot .avatar-stack {
  margin-left: auto;
}
.bcard-foot .bcard-slice {
  font-size: var(--fs-12);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.bcard.is-done h3 {
  color: var(--ink-3);
}
.add-card {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-2);
  font-size: var(--fs-13);
  font-weight: 560;
  color: var(--ink-3);
}
.add-card:hover {
  background: var(--hover);
  color: var(--ink);
}
.slice-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  font-size: var(--fs-14);
}
.slice-line .mono {
  color: var(--ink-3);
}
.slice-line .status {
  margin-left: auto;
}
@media (min-width: 721px) and (max-width: 1279px) {
  .board {
    grid-template-columns: repeat(5, 264px);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }
  .column {
    scroll-snap-align: start;
  }
}

/* ---------------------------------------------------------------- the build's own pieces */
.board-page {
  flex: 1;
  min-width: 0;
}
/* asks: their words, who asked, the answer row */
.ask > b,
.ask > .ask-md,
.ask > .ask-more,
.ask > .ask-by,
.ask > .ask-acts {
  grid-column: 2;
  min-width: 0;
}
.ask > b {
  font-size: var(--fs-14);
  line-height: 1.4;
  text-wrap: pretty;
}
.ask-md {
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--ink-3);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.ask-md > * + * {
  margin-top: 0.45em;
}
.ask-md ul,
.ask-md ol {
  padding-left: 1.2em;
}
.ask-md strong {
  font-weight: 650;
  color: var(--ink-2);
}
.ask-md code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.ask-md a {
  color: var(--accent);
}
.ask-md.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
}
.ask .ask-more {
  justify-self: start;
  font-size: var(--fs-12);
}
.ask .ask-by {
  font-size: var(--fs-12);
  color: var(--ink-4);
}
.ask .ask-acts {
  margin-top: 8px;
}
.ask-reply {
  display: grid;
  gap: 8px;
  width: 100%;
}
.ask-reply .textarea {
  min-height: 64px;
}
.ask-reply .btn-row {
  justify-content: flex-end;
}

/* tools */
.board-tools .chip .n {
  margin-left: -2px;
}
.board-tools .search .input {
  width: 100%;
}
.board-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-size: var(--fs-13);
  color: var(--ink-2);
  text-wrap: pretty;
}
.board-note > .i {
  margin-top: 1px;
  color: var(--ink-3);
}
.board-note[data-tone='bad'] > .i {
  color: oklch(var(--tone-dot-l) var(--tone-dot-c) var(--hue-red));
}
.board-note .btn.is-link {
  font-size: inherit;
}

/* columns: lists, the empty drop space, the column under a dragged card */
.column {
  grid-template-columns: minmax(0, 1fr);
  transition: box-shadow var(--t-fast) var(--ease);
}
.column.is-target {
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 2px oklch(var(--tone-dot-l) calc(var(--tone-dot-c) * var(--chroma)) var(--h) / 0.45);
}
.column-head h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 8px;
}
.cards > li {
  min-width: 0;
}
.cards.is-empty {
  min-height: 48px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.column.is-target .cards.is-empty {
  box-shadow: none;
}
.add-card {
  width: 100%;
}

/* a card */
.bcard {
  position: relative;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.bcard:focus-visible {
  outline-offset: 2px;
  border-radius: 12px;
}
.bcard.is-open {
  box-shadow: 0 0 0 2px var(--accent);
}
.bcard.is-pressing {
  scale: 0.97;
  transition-property: box-shadow, translate, scale;
  transition-duration: 280ms;
}
.bcard .media .play {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
}
.bcard .media .play .i {
  width: 13px;
  height: 13px;
}
.bcard .media .blank {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
}
.bcard-foot .avatar-stack .avatar.is-more {
  --chroma: 0;
  font-size: 9.5px;
}
.bcard.is-done .bcard-body {
  gap: 6px;
  padding-top: 9px;
  padding-bottom: 9px;
}
@media (hover: hover) {
  .board.can-edit .bcard {
    cursor: grab;
  }
}

/* dragging: the card left behind, the one in the hand, where it lands */
.cards > li.is-lifted .bcard {
  opacity: 0.32;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.bcard.is-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  margin: 0;
  pointer-events: none;
  box-shadow: var(--shadow-pop);
  rotate: 2deg;
  scale: 1.02;
  will-change: translate;
}
.drop-line {
  flex: none;
  height: 2px;
  margin: -5px 4px;
  border-radius: 2px;
  background: oklch(var(--tone-dot-l) calc(var(--tone-dot-c) * var(--chroma)) var(--h));
  box-shadow: 0 0 0 2px oklch(var(--tone-dot-l) calc(var(--tone-dot-c) * var(--chroma)) var(--h) / 0.25);
  list-style: none;
}
.cards.is-empty .drop-line {
  margin-top: 22px;
}
body.is-dragging-card,
body.is-dragging-card * {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}

/* adding a card in a column */
.add-form {
  display: grid;
  gap: 6px;
}
.add-form .textarea {
  min-height: 64px;
  border-radius: 12px;
  font-size: var(--fs-14);
  resize: none;
}
.add-form .btn-row {
  gap: 6px;
}
.add-form .hint {
  margin-left: auto;
  font-size: var(--fs-12);
  color: var(--ink-4);
  white-space: nowrap;
}

/* the card's drawer */
.card-sheet .sheet-head .label,
.card-sheet .sheet-head .status {
  flex: none;
}
.card-title-input {
  display: block;
  width: 100%;
  min-height: 0;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--r-2);
  background: none;
  resize: none;
  overflow: hidden;
  color: var(--ink);
  transition: box-shadow var(--t-fast) var(--ease);
}
.card-title-input:hover:not([readonly]) {
  box-shadow: inset 0 0 0 1px var(--line);
}
.card-title-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft);
}
.card-by {
  font-size: var(--fs-12);
  color: var(--ink-4);
}
.card-sheet .sheet-sec:first-child {
  padding-top: 0;
}
.card-details {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.card-details .prose {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--ink-2);
  justify-self: stretch;
}
.card-details .textarea {
  min-height: 140px;
}
.card-details .btn-row .hint {
  font-size: var(--fs-12);
  color: var(--ink-4);
}
.card-sheet .seg {
  justify-self: start;
}
.card-sheet .seg button .dot {
  width: 7px;
  height: 7px;
}
.card-sheet .thumbs .thumb {
  width: 148px;
}
.card-sheet .thumb .trunc {
  color: var(--ink-2);
}
.card-sheet .thumb:hover .trunc {
  color: var(--ink);
}
.card-sheet .thumb .status {
  justify-self: start;
}
.card-sheet .sheet-sec > .btn {
  justify-self: start;
}
.slice-line a {
  display: contents;
}
.slice-line .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 4px 0 3px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: var(--fs-13);
  font-weight: 560;
  color: var(--ink-2);
}
.person-chip:not(:has(.icon-btn)) {
  padding-right: 12px;
}
.person-chip .icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.people-box .input {
  width: 180px;
  height: 32px;
  border-radius: 999px;
  font-size: var(--fs-13);
}
.card-sheet .faint {
  font-size: var(--fs-13);
}

/* ---------------------------------------------------------------- tablets and phones */
@media (min-width: 721px) and (max-width: 1279px) {
  .board {
    margin: 0 calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    scroll-padding-left: var(--gutter);
  }
}
@media (max-width: 720px) {
  .ask {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .ask > .status {
    grid-row: auto;
    margin-top: 0;
  }
  .ask > b,
  .ask > .ask-md,
  .ask > .ask-more,
  .ask > .ask-by,
  .ask > .ask-acts {
    grid-column: 1;
  }
  .board-tools .chip-row {
    flex: 1 1 100%;
  }
  .board-tools .search {
    flex: 1 1 0;
  }
  .board-add .lab {
    display: none;
  }
  .board-add {
    width: 36px;
    height: 36px;
    padding: 0;
  }
  .col-switch {
    display: flex;
    width: 100%;
    margin-bottom: 12px;
  }
  .col-switch button {
    flex: 1 0 auto;
    justify-content: center;
    padding: 0 8px;
  }
  .col-switch button .dot {
    width: 7px;
    height: 7px;
  }
  .board {
    grid-template-columns: minmax(0, 1fr);
  }
  .board .column:not([data-active]) {
    display: none;
  }
  .card-sheet .sheet-foot .btn.is-accent {
    flex: 1;
  }
  .people-box .input {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bcard.is-ghost {
    rotate: 0deg;
  }
}
