/* board — one-line task rows, bands, lanes, drag and drop, the live Slack preview.
 * Replaces task-card.css. A task is a row, never a card, until it is expanded.
 */

#scroll-area {
  flex: 1; min-width: 0; overflow: auto;
  padding: 4px 0 40px;
}

/* ── BAND ───────────────────────────────────────────────────── */
.band { margin-top: 4px; transition: background var(--t-fast); }
.band-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px 6px;
  position: sticky; top: 0; z-index: 4;
  background: linear-gradient(var(--bg-canvas) 76%, transparent);
}
.band-nm {
  font-size: 10.5px; font-weight: 750; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3);
}
.band.attention .band-nm { color: var(--text); }
.band-ct {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3);
  background: var(--bg-hover); padding: 1px 6px; border-radius: var(--r-pill);
}
.band-flag {
  font-size: var(--font-size-xs); font-weight: 600; color: var(--warn);
  display: flex; align-items: center; gap: 5px;
}
.band-flag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.band-settled { font-size: var(--font-size-xs); color: var(--text-3); }
.band-add {
  margin-left: auto; opacity: 0;
  font-size: var(--font-size-xs); color: var(--text-3);
  padding: 2px 8px; border-radius: var(--r-sm);
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.band:hover .band-add { opacity: 1; }
.band-add:hover { background: var(--bg-hover); color: var(--text); }

.band-empty {
  padding: 4px 18px 10px 46px;
  color: var(--text-3); font-size: var(--font-size-sm); font-style: italic;
}
.band-empty.actionable { cursor: pointer; border-radius: var(--r-sm); }
.band-empty.actionable:hover { color: var(--text-2); background: var(--bg-hover); }

/* ── ROW ────────────────────────────────────────────────────── */
.row {
  display: flex; align-items: center; gap: 10px;
  height: var(--row-h); padding: 0 18px 0 14px;
  position: relative;
  transition: background var(--t-fast);
}
.row::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; border-radius: 0 2px 2px 0; background: transparent;
  transition: background var(--t-fast);
}
.row:hover { background: var(--bg-hover); }
.row:hover::before { background: var(--line-2); }
.row.is-selected { background: var(--bg-active); }
.row.is-selected::before { background: var(--accent); }
.row.is-focused::before { background: var(--accent-2); }
.row.no-slack { opacity: 0.5; }
.row.status-done .row-title { color: var(--text-2); }

/* status glyph — colour AND shape, so it survives colour-blindness */
.g {
  width: 14px; height: 14px; flex: 0 0 14px;
  border-radius: 50%; border: 2px solid currentColor;
  display: grid; place-items: center;
  font-size: 8px; font-weight: 900; line-height: 1;
  cursor: pointer; transition: transform var(--t-fast);
}
.g:hover { transform: scale(1.15); }
.g[data-s="pending"] { color: var(--st-pending); }
.g[data-s="in_progress"] {
  color: var(--st-in_progress);
  background: conic-gradient(currentColor 0 50%, transparent 50% 100%);
}
.g[data-s="in_review"] { color: var(--st-in_review); }
.g[data-s="in_review"]::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.g[data-s="done"] { color: var(--st-done); background: currentColor; }
.g[data-s="done"]::after { content: "\2713"; color: var(--bg-canvas); }
.g[data-s="blocked"] { color: var(--st-blocked); background: currentColor; }
.g[data-s="blocked"]::after { content: "\2715"; color: var(--bg-canvas); }
.g[data-s="on_hold"] { color: var(--st-on_hold); background: currentColor; }
.g[data-s="on_hold"]::after { content: "\2016"; color: var(--bg-canvas); font-size: 7px; }

.row-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--font-size-base); color: var(--text);
}
.row-title-input {
  flex: 1; min-width: 0; height: 26px;
  background: var(--bg-input); border: 1px solid var(--accent);
  border-radius: var(--r-sm); padding: 0 8px; outline: 0;
  font-size: var(--font-size-base); color: var(--text);
}

/* meta chips */
.chips { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.chip {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--text-3); white-space: nowrap;
}
.chip svg { width: 11px; height: 11px; }
.chip.mono { font-family: var(--font-mono); font-size: 10px; }
.chip.proj {
  background: var(--bg-hover); color: var(--text-2);
  padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis;
}
.chip.warn { color: var(--warn); font-weight: 600; }
.chip.due { color: var(--danger); font-weight: 600; }
.chip.auto {
  background: var(--accent-dim); color: var(--accent-2);
  padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
}
.chip a { color: inherit; }
.chip a:hover { color: var(--accent-2); text-decoration: underline; }

/* hover-revealed tools — width is reserved so nothing shifts on hover */
.row-tools {
  display: flex; align-items: center; gap: 3px;
  flex: 0 0 auto; width: 112px; justify-content: flex-end;
}
.strip { display: flex; gap: 3px; opacity: 0; transition: opacity var(--t-fast); }
.row:hover .strip, .row.is-focused .strip { opacity: 1; }
.strip i {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.6px solid currentColor; cursor: pointer;
  transition: transform var(--t-fast);
}
.strip i:hover { transform: scale(1.4); }
.strip i[data-s="pending"] { color: var(--st-pending); }
.strip i[data-s="in_progress"] {
  color: var(--st-in_progress);
  background: conic-gradient(currentColor 0 50%, transparent 50%);
}
.strip i[data-s="in_review"] { color: var(--st-in_review); }
.strip i[data-s="done"] { color: var(--st-done); background: currentColor; }
.strip i[data-s="blocked"] { color: var(--st-blocked); background: currentColor; }
.strip i[data-s="on_hold"] { color: var(--st-on_hold); background: currentColor; }

.row-more {
  opacity: 0; width: 28px; height: 28px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--text-3);
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.row:hover .row-more, .row.is-focused .row-more { opacity: 1; }
.row-more:hover { background: var(--line); color: var(--text); }
.row-more svg { width: 16px; height: 16px; }

.row-btn {
  height: 22px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: var(--font-size-xs); font-weight: 600;
  border: 1px solid var(--line-2); color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.row-btn:hover { background: var(--bg-hover); color: var(--text); }
.row-btn.ok { color: var(--ok); border-color: rgba(56, 217, 138, 0.35); }
.row-btn.ok:hover { background: rgba(56, 217, 138, 0.12); }

/* auto-suggested */
.row.suggested { opacity: 0.85; }
.row.suggested::before { background: repeating-linear-gradient(var(--accent) 0 3px, transparent 3px 6px); }
.row.suggested .row-title { font-style: italic; color: var(--text-2); }

.add-row {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 18px 0 14px;
  color: var(--text-3); font-size: var(--font-size-sm); width: 100%;
  transition: background var(--t-fast), color var(--t-fast);
}
.add-row:hover { background: var(--bg-hover); color: var(--text-2); }
.add-row .plus {
  width: 14px; height: 14px; flex: 0 0 14px;
  display: grid; place-items: center;
  border: 1.5px dashed currentColor; border-radius: 50%;
  font-size: 10px; line-height: 1;
}

/* ── DRAG AND DROP ──────────────────────────────────────────── */
.grip {
  position: absolute; left: 1px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 20px; display: grid; place-items: center;
  color: var(--text-3); opacity: 0; cursor: grab;
  transition: opacity var(--t-fast);
}
.row:hover .grip { opacity: 0.6; }
.grip:hover { opacity: 1; }
.grip:active { cursor: grabbing; }
.grip svg { width: 9px; height: 14px; fill: currentColor; }
.row.dragging { opacity: 0.35; background: var(--bg-active); }
.row.dragging::before { background: var(--accent); }

.dropline {
  height: 2px; margin: 1px 18px 1px 14px;
  border-radius: 2px; background: var(--accent);
  position: relative; box-shadow: 0 0 8px var(--accent-glow);
}
.dropline::before {
  content: ""; position: absolute; left: -5px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.dropline span {
  position: absolute; right: 0; top: -9px;
  padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.lane .dropline {
  margin: 3px 2px;
}
.lane .dropline::before {
  left: -4px;
}
.band.dropping { background: var(--accent-dim); border-radius: var(--r-md); }
.band.dropping .band-head { background: none; }
.band.dropping .band-nm { color: var(--accent-2); }
.band.nodrop { background: rgba(255, 96, 96, 0.06); border-radius: var(--r-md); }
.band.nodrop .band-nm { color: var(--danger); }
.band-nodrop-note {
  display: flex; align-items: center; gap: 7px;
  margin: 0 18px 6px; padding: 7px 11px;
  border: 1px dashed rgba(255, 96, 96, 0.4); border-radius: var(--r-md);
  background: rgba(255, 96, 96, 0.05);
  font-size: var(--font-size-xs); color: var(--danger);
}
.band-nodrop-note svg { width: 13px; height: 13px; flex: 0 0 13px; }

/* ── EXPANDED ROW (inline editor) ───────────────────────────── */
.expand {
  margin: 4px 12px 10px;
  background: var(--bg-panel); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  overflow: hidden;
}
.ex-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px 4px; }
.ex-title {
  flex: 1; min-width: 0;
  font-size: var(--font-size-md); font-weight: 600;
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 7px 10px; outline: 0;
}
.ex-title:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.ex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 14px; }
.ex-wide { padding: 0 14px 10px; }
.fld label {
  display: block; margin-bottom: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-3);
}
.fld label .lbl-note { font-weight: 500; letter-spacing: 0; text-transform: none; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 7px 9px;
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: var(--font-size-sm); outline: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.fld textarea {
  resize: vertical; min-height: 66px;
  font-family: var(--font-mono); font-size: var(--font-size-sm);
  line-height: 1.65; tab-size: 4;
}
.fld textarea.prose { font-family: var(--font-family); }
.fld .hint { margin-top: 4px; font-size: 10.5px; color: var(--text-3); }

/* · a rejected field says so at the field, not in the status bar where nothing
 *   connects the message to the input that caused it */
.fld input.is-invalid,
.fld textarea.is-invalid,
.fld select.is-invalid,
.ex-title.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 96, 96, 0.14);
}
.field-error {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-error::before {
  content: "";
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; flex: 0 0 4px;
}
.ex-top { position: relative; }
.ex-top .field-error { position: absolute; left: 46px; bottom: -13px; }
.ex-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--line);
  background: var(--bg-canvas);
}
.ex-foot .grow { flex: 1; }
.saved { display: flex; align-items: center; gap: 5px; font-size: var(--font-size-xs); color: var(--ok); }
.saved::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.saved.pending { color: var(--text-3); }

.switch { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); color: var(--text-2); cursor: pointer; }
.switch .sw {
  width: 32px; height: 18px; border-radius: var(--r-pill);
  background: var(--line-2); position: relative; flex: 0 0 32px;
  transition: background var(--t-fast);
}
.switch .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: left var(--t-fast);
}
.switch .sw.on { background: var(--accent); }
.switch .sw.on::after { left: 16px; }

/* ── LANES (kanban by the active grouping) ──────────────────── */
#scroll-area.layout-lanes { display: flex; gap: 9px; padding: 12px; overflow-x: auto; overflow-y: hidden; }
.lane {
  flex: 1 1 0; min-width: 168px; display: flex; flex-direction: column; gap: 7px;
  border-radius: var(--r-md); padding: 4px;
  transition: background var(--t-fast);
}
.lane.dropping { background: var(--accent-dim); outline: 1px dashed var(--accent); }
.lane.nodrop { background: rgba(255, 96, 96, 0.06); outline: 1px dashed rgba(255, 96, 96, 0.4); }
.lane-head {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 6px 7px; border-bottom: 2px solid var(--lane-c, var(--line));
}
.lane-head b {
  font-size: 10.5px; font-weight: 750; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--lane-c, var(--text-3));
}
.lane-head .lane-ct {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3); background: var(--bg-hover);
  padding: 0 6px; border-radius: var(--r-pill);
}
.lane-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-bottom: 6px; }
.lc {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 8px 9px; cursor: grab;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.lc:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.lc.dragging { opacity: 0.35; border-style: dashed; }
.lc.is-selected { border-color: var(--accent); background: var(--bg-active); }
.lc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.lc-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.lc-more svg {
  width: 16px;
  height: 16px;
}
.lc:hover .lc-more {
  opacity: 1;
}
.lc-more:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.lc-title { font-size: var(--font-size-sm); line-height: 1.45; margin: 5px 0 6px; color: var(--text); cursor: pointer; transition: color var(--t-fast); }
.lc-title:hover { color: var(--accent); }
.lc .chips { flex-wrap: wrap; }
.lane-empty {
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
  padding: 14px 9px; text-align: center;
  font-size: var(--font-size-xs); color: var(--text-3); font-style: italic;
}

/* ── LIVE SLACK PREVIEW ─────────────────────────────────────── */
#preview-pane {
  width: var(--preview-w); flex: 0 0 var(--preview-w);
  border-left: 1px solid var(--line); background: var(--bg-panel);
  display: flex; flex-direction: column; min-height: 0;
}
#preview-pane.collapsed { display: none; }
#pv-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line);
}
.pv-t { font-size: 11px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.pv-ch { font-family: var(--font-mono); font-size: var(--font-size-xs); color: var(--text-2); }
.live {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--ok);
}
.live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 0 3px rgba(56, 217, 138, 0.18);
}
.live.off { color: var(--danger); }
.live.off::before { box-shadow: 0 0 0 3px rgba(255, 96, 96, 0.18); }
.live.stale { color: var(--text-3); }
.live.stale::before { box-shadow: none; }

#pv-body {
  flex: 1; overflow: auto; padding: 14px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.85;
  user-select: text;
}
.pv-h { font-weight: 700; color: var(--text); }
.pv-sec { color: var(--accent-2); font-weight: 700; margin-top: 11px; }
.pv-li { color: var(--text-2); padding-left: 14px; text-indent: -14px; }
.pv-sub { color: var(--text-3); padding-left: 30px; text-indent: -12px; }
.pv-empty { color: var(--text-3); font-style: italic; font-family: var(--font-family); }
.pv-split {
  display: flex; align-items: center; gap: 8px; margin: 12px 0;
  font-family: var(--font-family); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.pv-split::before, .pv-split::after { content: ""; flex: 1; border-top: 1px dashed var(--line-2); }

#pv-foot { border-top: 1px solid var(--line); padding: 11px 14px; display: grid; gap: 9px; }
#pv-stats { display: flex; justify-content: space-between; font-size: var(--font-size-xs); color: var(--text-3); }
#pv-stats b { color: var(--text-2); font-weight: 600; }
#pv-excluded {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; border-radius: var(--r-md);
  background: var(--bg-hover); font-size: var(--font-size-xs); color: var(--text-3);
}
#pv-excluded svg { width: 12px; height: 12px; flex: 0 0 12px; }
.pv-send {
  width: 100%; height: 38px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--font-size-md); font-weight: 650;
  transition: background var(--t-base), color var(--t-base), box-shadow var(--t-base);
}
.pv-send svg { width: 15px; height: 15px; }
.pv-send.ready { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 16px var(--accent-glow); }
.pv-send.ready:hover { background: var(--accent-2); }
.pv-send.wait { background: var(--bg-hover); color: var(--text-3); border: 1px solid var(--line-2); }
.pv-send:disabled { cursor: not-allowed; }
#pv-note { font-size: 10.5px; color: var(--text-3); text-align: center; }

/* ── ROW ENTER ──────────────────────────────────────────────── */
.row.row-enter { animation: rowIn var(--t-base) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-4px); } }
.row.row-flash { animation: rowFlash 1.1s ease; }
@keyframes rowFlash { 0%, 100% { background: transparent; } 25% { background: var(--bg-active); } }

/* narrow window: the preview pane is the first thing to go */
@media (max-width: 1180px) {
  #preview-pane { display: none; }
}

/* ── BOARD HEADER (grouping selector) ────────────────────────── */
.board-header {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--line);
  height: 48px;
  flex-shrink: 0;
}
#main.page-mode .board-header {
  display: none;
}
