/* Task block (board + list views). Tokens are shared with finder.css (.fx/.tk/.tb). */

.tb { color: var(--fx-text); font-family: "inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.tb a { text-decoration: none; }

/* ---------- header ---------- */
.tb-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 18px; }
.tb-header__main { min-width: 0; }
.tb-title { font-size: 26px; font-weight: 650; margin: 0 0 8px; line-height: 1.2; }
.tb-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--fx-muted); }
.tb-stats turbo-frame { display: inline; }
.tb-stats .chip { margin: 0; border: 0 !important; padding: 0 !important; font-size: 13px; }
.tb-stats .chip a { color: var(--fx-muted); }
.tb-meter { display: inline-flex; align-items: center; gap: 8px; }
.tb-meter__bar { width: 140px; height: 6px; border-radius: 999px; background: var(--fx-line); overflow: hidden; }
.tb-meter__bar span { display: block; height: 100%; background: #1f9d55; border-radius: inherit; transition: width .3s; }
.tb-meter__pct { font-weight: 600; color: var(--fx-text); }
.tb-header__actions { display: flex; align-items: center; gap: 8px; }

.tb-views { display: inline-flex; }
.tb-views > a, .tb-views > span, .tb-views > button {
  width: auto; height: 34px; padding: 0 12px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500;
  border: 0; background: transparent; color: var(--fx-muted); cursor: pointer; font-family: inherit;
}
.tb-views > * + * { border-left: 1px solid var(--fx-line) !important; }
.tb-views > a:hover, .tb-views > button:hover { color: var(--fx-text); background: var(--fx-hover); }
.tb-views .is-active { background: var(--fx-hover); color: var(--fx-text); cursor: default; }

/* ---------- lists container ---------- */
.tb--board .tb-scroll { overflow-x: auto; overflow-y: visible; padding-bottom: 16px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.tb--board .tb-lists { display: flex; align-items: flex-start; gap: 14px; width: max-content; min-width: 100%; }
.tb--board .tb-lists > turbo-frame { display: contents; }
.tb--board .tb-lists__inner { display: flex; align-items: flex-start; gap: 14px; }
.tb--list .tb-lists__inner { display: flex; flex-direction: column; gap: 14px; }

/* ---------- column / section ---------- */
.tb-col {
  background: var(--fx-hover); border: 1px solid var(--fx-line); border-radius: 14px;
  padding: 8px 8px 10px; display: flex; flex-direction: column;
}
.tb--board .tb-col { width: 296px; flex-shrink: 0; max-height: calc(100vh - 210px); scroll-snap-align: start; }
.tb--list .tb-col { background: var(--fx-bg); box-shadow: var(--fx-shadow); padding: 10px 12px 12px; }
.tb-col--ghost { opacity: .4; }
.tb-col--new { padding: 12px; }
.tb-col--new .field input { margin: 0 !important; }

.tb-col__head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px 0; min-height: 34px; }
.tb-grip { cursor: grab; color: var(--fx-muted); opacity: .45; display: grid; place-items: center; width: 18px; height: 28px; flex-shrink: 0; }
.tb-col__head:hover .tb-grip { opacity: 1; }
.tb-col__title { flex: 1; min-width: 0; }
.tb-col__title h2 { font-size: 14px; font-weight: 650; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-col__count { font-size: 12px; font-weight: 600; color: var(--fx-muted); background: var(--fx-bg); border: 1px solid var(--fx-line); border-radius: 999px; padding: 1px 8px; }
.tb-iconbtn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--fx-muted); cursor: pointer; }
.tb-iconbtn:hover, .fx-menu[open] > .tb-iconbtn { background: rgba(127, 127, 127, .16); color: var(--fx-text); }

.tb-tasks { display: flex; flex-direction: column; gap: 6px; min-height: 12px; padding: 2px; }
.tb--board .tb-tasks { overflow-y: auto; flex: 1 1 auto; min-height: 40px; }
.tb--list .tb-tasks { gap: 0; }

/* ---------- task card ---------- */
.tb-card {
  position: relative; display: flex; gap: 8px; align-items: flex-start;
  background: var(--fx-bg); border: 1px solid var(--fx-line); border-radius: 10px;
  padding: 9px 10px; cursor: grab; user-select: none;
  transition: box-shadow .12s, border-color .12s, transform .12s;
  contain: layout paint; /* keeps long boards cheap to lay out and repaint while dragging */
}
.tb-card:hover { border-color: color-mix(in srgb, var(--fx-accent) 40%, var(--fx-line)); box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.tb--list .tb-card { border: 0; border-bottom: 1px solid var(--fx-line); border-radius: 0; padding: 10px 4px; }
.tb--list .tb-card:last-child { border-bottom: 0; }
.tb--list .tb-card:hover { background: var(--fx-hover); box-shadow: none; }
.tb-card--ghost { opacity: .35; }
.tb-card--chosen { box-shadow: 0 10px 24px rgba(16, 24, 40, .18); }
.tb-card--drag { transform: rotate(2deg); }

.tb-card__check { flex-shrink: 0; padding-top: 1px; cursor: default; }
.tb-card__check .checkbox-container { margin: 0; }
.tb-card__main { flex: 1; min-width: 0; }
.tb-card__title { display: block; color: var(--fx-text) !important; font-size: 14px; line-height: 1.4; word-break: break-word; }
.tb-card__title:hover { color: var(--fx-accent) !important; }
.tb-card.is-done .tb-card__title { color: var(--fx-muted) !important; text-decoration: line-through; }
.tb-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.tb-card__meta .tk-chip { font-size: 11px; padding: 2px 6px; }
.tb-icon { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--fx-muted); }
.tb-mini { width: 44px; height: 4px; border-radius: 999px; background: var(--fx-line); overflow: hidden; display: inline-block; }
.tb-mini span { display: block; height: 100%; background: var(--fx-accent); }
.tb-people { display: inline-flex; margin-left: auto; }
.tb-people .tb-avatar { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--fx-bg); object-fit: cover; margin-left: -6px; display: inline-grid; place-items: center; }
.tb-people .tb-avatar:first-child { margin-left: 0; }
.tb-avatar--more { background: var(--fx-hover); font-size: 10px; font-weight: 600; color: var(--fx-muted); }

/* ---------- add task + completed ---------- */
.tb-add { display: flex; align-items: center; gap: 6px; padding: 8px 8px; margin-top: 4px; border-radius: 8px; color: var(--fx-muted) !important; font-size: 13px; font-weight: 500; }
.tb-add:hover { background: rgba(127, 127, 127, .12); color: var(--fx-text) !important; }
.tb-col turbo-frame[id^="new_task_"] .box, .tb-col turbo-frame[id^="new_task_"] form { margin-top: 6px; }

.tb-done { margin-top: 6px; border-top: 1px dashed var(--fx-line); padding-top: 6px; }
.tb-done > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--fx-muted); padding: 4px 6px; border-radius: 6px; list-style: none; }
.tb-done > summary::before { content: "▸ "; }
.tb-done[open] > summary::before { content: "▾ "; }
.tb-done > summary:hover { color: var(--fx-text); }
.tb-done__row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13px; }
.tb-done__title { color: var(--fx-muted) !important; text-decoration: line-through; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-done__all { display: block; padding: 6px; font-size: 12px; color: var(--fx-accent) !important; }

.tb-empty { text-align: center; padding: 48px 16px; color: var(--fx-muted); border: 1px dashed var(--fx-line); border-radius: 14px; width: 100%; }
.tb-empty h3 { color: var(--fx-text); font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.tb-empty p { margin: 0 0 16px; font-size: 14px; }

@media (max-width: 600px) {
  .tb-title { font-size: 22px; }
  .tb-header { align-items: stretch; }
  .tb-header__actions { width: 100%; }
  .tb-header__actions .fx-btn__label { display: none; }
  .tb--board .tb-col { width: 84vw; max-height: none; }
  .tb-meter__bar { width: 90px; }
}
