/* Board — Trello-shaped, but every card carries its dated trail. */

.board-wrap { display: flex; flex-direction: column; height: 100%; }

.board-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--rule-soft);
}
.board-bar .filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.label-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--rule);
  background: var(--ink-800);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.label-filter .dot { width: 8px; height: 8px; border-radius: 2px; }
.label-filter.on { color: var(--text); border-color: var(--rule-strong); background: var(--ink-600); }

/* The Details toggle reads as pressed while it is on. */
.board-bar .btn.on { color: var(--text); border-color: var(--rule-strong); background: var(--ink-600); }

.board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4) var(--s5) var(--s5);
  overflow-x: auto;
  overflow-y: hidden;
}

.list {
  flex: 0 0 300px;
  display: flex; flex-direction: column;
  max-height: 100%;
  background: var(--ink-850);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r3);
}
.list.done-list { background: linear-gradient(180deg, var(--ok-wash), transparent 120px), var(--ink-850); }
.list.drop-target { border-color: var(--signal); }

.list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 8px;
}
.list-head .title {
  flex: 1; min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim);
  background: none; border: 0; padding: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-head .title:focus { outline: none; color: var(--text); }
.list-head .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.list-head .n.over { color: var(--danger); }

.list-body {
  flex: 1 1 auto;
  min-height: 24px;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 6px;
}

.list-foot { padding: 6px 8px 8px; }
.list-foot .btn { width: 100%; justify-content: flex-start; background: none; border-color: transparent; color: var(--text-faint); }
.list-foot .btn:hover { background: var(--ink-700); color: var(--text); }

.card {
  position: relative;
  padding: 9px 10px;
  background: var(--ink-700);
  border: 1px solid var(--rule);
  border-radius: var(--r2);
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: block;
}
.card:hover { border-color: var(--rule-strong); background: var(--ink-600); }
.card.dragging { opacity: .4; }
.card.hit { box-shadow: 0 0 0 2px var(--signal); }

.card .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card .labels span { height: 4px; width: 26px; border-radius: 2px; }
.card .title { font-size: 13.5px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.card .meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 7px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint);
}
.card .meta .bit { display: inline-flex; align-items: center; gap: 3px; }
.card .meta .due.overdue { color: var(--danger); }
.card .meta .due.today { color: var(--signal); }
.card .meta .due.soon { color: var(--warn); }
.card .who {
  margin-left: auto;
  background: var(--ink-500); color: var(--text-dim);
  border-radius: 20px; padding: 1px 6px;
}

/* --- searching one board --------------------------------------------------- */

.board-search {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--ink-800);
  color: var(--text-faint);
}
.board-search:focus-within { border-color: var(--rule-strong); color: var(--text-dim); }
.board-search input {
  width: 170px;
  background: none; border: 0; padding: 0;
  color: var(--text); font-family: var(--font-sans); font-size: 12.5px;
}
.board-search input::-webkit-search-cancel-button { display: none; }
.board-search input:focus { outline: none; }
.board-search button {
  background: none; border: 0; padding: 0 2px;
  color: var(--text-faint); font-size: 14px; line-height: 1; cursor: pointer;
}
.board-search button:hover { color: var(--text); }

/* The line that actually matched, under the card it matched on. */
.card .why { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.card .why-line {
  font-size: 11.5px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .why-line em {
  font-family: var(--font-mono); font-style: normal;
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--signal); margin-right: 6px;
}

.list.hit { border-color: var(--signal); }

/* --- collapsed lists -------------------------------------------------------- */

.list-head .collapse {
  flex: 0 0 auto;
  background: none; border: 0; padding: 0;
  color: var(--text-faint); cursor: pointer; line-height: 0;
}
.list-head .collapse:hover { color: var(--text); }
.list-head .collapse .icon { transform: rotate(90deg); }

.list.collapsed { flex: 0 0 44px; align-self: stretch; }
.list.collapsed .spine {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  height: 100%; width: 100%;
  padding: 10px 0;
  background: none; border: 0; cursor: pointer;
  color: var(--text-dim);
}
.list.collapsed .spine:hover { color: var(--text); }
.list.collapsed .spine .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.list.collapsed .spine .name {
  writing-mode: vertical-rl;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-height: calc(100% - 44px);
}
.list.collapsed .spine .icon { transform: rotate(-90deg); margin-top: auto; }

/* --- detailed card fronts --------------------------------------------------- */

/* Named chips replace the colour bars, so they have to out-rank the rule
   that gives every label span a 26x4 block. */
.card .labels.named { gap: 4px; margin-bottom: 7px; }
.card .labels.named span.label-chip {
  height: auto; width: auto;
  padding: 1px 7px;
  border: 1px solid; border-radius: 20px;
  font-size: 10.5px; line-height: 1.55;
}
.card .prio {
  display: inline-block; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px;
  background: var(--ink-500); color: var(--text-dim);
}
.card .prio.urgent { background: var(--danger-wash-strong); color: var(--danger); }
.card .prio.high { background: var(--signal-wash-strong); color: var(--signal); }

.card .subtasks {
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 2px;
}
.card .subtask { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text-dim); cursor: pointer; }
.card .subtask input { margin: 2px 0 0; accent-color: var(--signal); }
.card .subtask.done span { text-decoration: line-through; color: var(--text-faint); }
.card .subtasks .more { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); padding-left: 20px; }

.drop-line { height: 2px; background: var(--signal); border-radius: 2px; margin: 1px 0; }

.add-list {
  flex: 0 0 260px;
  padding: 10px;
  border: 1px dashed var(--rule);
  border-radius: var(--r3);
  color: var(--text-faint);
  background: none;
  cursor: pointer;
  text-align: left;
}
.add-list:hover { border-color: var(--rule-strong); color: var(--text); }

/* --- card dialog ----------------------------------------------------------- */

.card-grid { display: grid; grid-template-columns: 1fr 260px; gap: var(--s5); }
@media (max-width: 760px) { .card-grid { grid-template-columns: 1fr; } }

.card-title-input {
  width: 100%; font-size: 19px; font-weight: 600; line-height: 1.3;
  background: none; border: 1px solid transparent; border-radius: var(--r2);
  padding: 4px 6px; margin: -4px -6px;
}
.card-title-input:hover { border-color: var(--rule); }
.card-title-input:focus { border-color: var(--rule-strong); background: var(--ink-700); outline: none; }

.sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 8px; }

.checkline { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
.checkline input { margin-top: 3px; accent-color: var(--signal); }
.checkline span { flex: 1; font-size: 13px; }
.checkline.done span { color: var(--text-faint); text-decoration: line-through; }
.checkline button { opacity: 0; background: none; border: 0; color: var(--text-faint); cursor: pointer; }
.checkline:hover button { opacity: 1; }

.meter { height: 3px; background: var(--ink-600); border-radius: 2px; overflow: hidden; margin: 6px 0 10px; }
.meter i { display: block; height: 100%; background: var(--ok); }

.label-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--rule); background: var(--ink-800); color: var(--text-dim); cursor: pointer;
}
.label-toggle .dot { width: 8px; height: 8px; border-radius: 2px; }
.label-toggle.on { color: var(--text); border-color: currentColor; }

.mini-entry {
  border-left: 2px solid var(--rule-strong);
  padding: 2px 0 2px 12px;
  margin-bottom: 12px;
}
.mini-entry .head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.mini-entry .when { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.mini-entry h4 { margin: 0; font-size: 13.5px; font-weight: 600; }

.card.is-done .title { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--rule-strong); }
.card .meta .done-bit { color: var(--ok); }

/* The tick sits beside the title rather than over it, so a long title wraps
   against the text column and not around the control. */
.card .title-row { display: flex; align-items: flex-start; gap: 8px; }
.card .title-row .title { flex: 1; min-width: 0; }
.card .tick {
  flex: none;
  width: 16px; height: 16px; margin-top: 1px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--rule-strong); border-radius: 50%;
  background: transparent; color: transparent; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.card .tick:hover { border-color: var(--ok); }
.card .tick.on { border-color: var(--ok); background: var(--ok); color: var(--ink-900); }
.card .tick:disabled { opacity: .5; cursor: default; }
.card .tick:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
