/* Home board: one checklist (My to-dos + sub-tasks) and a shorter job header. */

.kcx-compact { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; font-size: 12px; line-height: 1.35; position: relative; }
.kcx-line { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.kcx-title-inline { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ascend-text, #1e293b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcx-sub-inline { flex: 1 1 auto; min-width: 4rem; color: var(--ascend-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcx-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 0.15rem; flex-shrink: 0; }
.kcx-line .kcx-count { margin-left: auto; }

.kci { border-top: 1px solid var(--ascend-border-subtle, #e2e8f0); margin-top: 0.35rem; padding-top: 0.3rem; }
.kci-head { font-size: 0.62rem; color: var(--ascend-text-faint); letter-spacing: 0.01em; margin-bottom: 0.15rem; }
.kci-rows { display: flex; flex-direction: column; gap: 0.2rem; }
.tc-actions .btn-ghost.ic { width: auto; height: auto; min-height: 2.75rem; padding: 0.35rem 0.7rem; gap: 0.35rem; justify-content: flex-start; font-size: 0.78rem; font-weight: 600; }
.tc-act-lab { line-height: 1.1; }
.kci-row.is-line { grid-template-columns: auto minmax(4.5rem, 1fr) auto 1.25rem minmax(5.5rem, 110px) auto; }
/* Add sub-task sits under the line name, so it never pushes the name out or spills past the card edge (lane fix, PR #248). */
.kci-row.is-line > .kci-subadd { grid-column: 2 / -1; grid-row: 2; justify-self: start; margin-top: -0.15rem; }
.kci-row.is-sub { grid-template-columns: auto minmax(0, 1fr) auto 1.25rem minmax(5.5rem, 110px) auto; }
.kci-row.is-line .kci-label { overflow: hidden; }
.kci-row.is-line .kci-line-name { flex: 1 1 4.5rem; min-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kci-row.is-sub .kci-label { padding-left: 0.85rem; }
.kci-num { color: var(--ascend-text-muted); font-weight: 700; margin-right: 0.2rem; flex: none; }
.kci-status { font-style: normal; font-size: 0.65rem; color: var(--ascend-accent-ink); background: var(--ascend-selected-bg); border-radius: 999px; padding: 0 0.4rem; flex: none; }
.kci-subadd { border: 0; background: none; color: var(--ascend-accent-ink); font-size: 10px; cursor: pointer; padding: 0 0.15rem; white-space: nowrap; flex: none; }
.kci-subadd:hover { text-decoration: underline; }
.kci-parent { font-size: 11px; max-width: 9.5rem; border: 1px solid var(--ascend-border); border-radius: 0.35rem; background: var(--ascend-card-bg); color: var(--ascend-text-secondary); padding: 0.12rem 0.2rem; }
.kci-done { display: flex; flex-direction: column; gap: 0.2rem; opacity: 0.6; }
.kci-row {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto 1.25rem 110px;
  gap: 0.3rem;
  align-items: center;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}
.kci-check { width: 0.9rem; height: 0.9rem; margin: 0; cursor: pointer; justify-self: center; }
.kci-label { min-width: 0; display: flex; align-items: center; gap: 0.25rem; }
.kci-label .mine-chip { flex: none; }
.kci-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ascend-text); outline: none; }
.kci-text:focus { white-space: normal; overflow: visible; box-shadow: 0 0 0 1px #5eead4; border-radius: 0.2rem; }
.kci-text.is-done { text-decoration: line-through; color: var(--ascend-text-faint); }
.kci-when { font-size: 10px; white-space: nowrap; justify-self: end; }
.kci-when.is-sent { color: #059669; }
[data-theme="dark"] .kci-when.is-sent { color: #6ee7b7; }
.kci-when.is-draft { color: var(--ascend-text-muted); }
.kci-mail-btn {
  width: 1.25rem; height: 1.25rem; padding: 0; border: 0; background: transparent;
  color: #6366f1; cursor: pointer; font-size: 13px; line-height: 1;
}
.kci-mail-btn.is-off { visibility: hidden; pointer-events: none; }
.kci-mail-btn:hover { color: #4338ca; }
.kci-slot { width: 110px; max-width: 110px; display: flex; justify-content: flex-end; align-items: center; min-width: 0; }
.kci-slot .mine-chip { margin: 0; }
/* Same Rappel line-item rows the phone Home card draws. */
.tc-lis { margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px dashed #cbd5e1; }
.tc-li { display: flex; gap: 0.35rem; align-items: center; font-size: 0.72rem; color: var(--ascend-text-secondary); padding: 0.1rem 0; max-width: 100%; }
.tc-li b { color: var(--ascend-text-faint); font-weight: 600; min-width: 1rem; }
.tc-li span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-li em { font-style: normal; font-size: 0.65rem; color: var(--ascend-accent-ink); background: var(--ascend-selected-bg); border-radius: 999px; padding: 0 0.4rem; flex-shrink: 0; }
.tc-li.li-done span { text-decoration: line-through; color: var(--ascend-text-faint); }
.tc-li-head { font-size: 0.62rem; color: var(--ascend-text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.1rem; }
.li-btn { border: 0; background: none; color: #94a3b8; padding: 2px 4px; font-size: 0.85rem; line-height: 1; flex-shrink: 0; min-width: 44px; min-height: 40px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.li-btn-lab { font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.li-restore { min-height: 40px; text-align: left; white-space: normal; }
.li-btn.li-tick { color: #64748b; margin-left: -0.35rem; }
.li-btn.li-tick.on { color: #059669; }
.li-more { border: 0; background: none; color: var(--ascend-accent-ink); font-size: 0.7rem; padding: 0.25rem 0.1rem; margin-right: 0.6rem; cursor: pointer; }
.kci-assign {
  width: 110px; max-width: 110px; box-sizing: border-box;
  font-size: 11px; background: var(--ascend-surface, #fff);
  border: 1px solid var(--ascend-border, #e2e8f0); border-radius: 0.35rem;
  padding: 0.12rem 0.15rem; color: #4338ca; cursor: pointer;
}
.kci-foot { display: flex; align-items: center; gap: 0.5rem; min-width: 0; margin-top: 0.2rem; }
.kci-done-btn, .kci-add-btn {
  border: 0; background: transparent; padding: 0.1rem 0; cursor: pointer;
  font-size: 12px; color: var(--ascend-text-faint); white-space: nowrap;
}
.kci-done-btn:hover, .kci-add-btn:hover { color: var(--ascend-text-body); }
.kci-add-btn { margin-left: auto; }
.kci-add { display: none; position: relative; flex: 1; min-width: 0; }
.kci-foot.is-adding .kci-add-btn { display: none; }
.kci-foot.is-adding .kci-add { display: flex; gap: 0.35rem; align-items: center; }
.kci-foot.is-adding .kci-input { flex: 1; width: auto; }
.kci-input {
  width: 100%; box-sizing: border-box; font-size: 12px; border: 0; border-bottom: 1px solid #e2e8f0;
  background: transparent; outline: none; color: var(--ascend-text-secondary); padding: 0.15rem 0;
}
.kci-input:focus { border-bottom-color: #2dd4bf; }
.kci-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: var(--ascend-card-bg); border: 1px solid var(--ascend-border); border-radius: 0.35rem; color: var(--ascend-text);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12); max-height: 7rem; overflow: auto; padding: 0.15rem;
}
.kci-results[hidden] { display: none; }
.kci-results button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0.2rem 0.35rem; font-size: 12px; cursor: pointer; }
.kci-results button:hover { background: #f5f3ff; }
#kanban-job-results .kanban-search-hit { border-radius: 0.35rem; }
#kanban-job-results button.kanban-search-hit {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 0.35rem 0.45rem; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: #4338ca;
}
#kanban-job-results .kanban-search-hit.is-hi,
#kanban-job-results button.kanban-search-hit.is-hi { background: #ede9fe; }

.todo-card .kci, .todo-card .kci * { -webkit-user-select: text; user-select: text; }

@media (pointer: coarse), (max-width: 760px) {
  .kci-row { grid-template-columns: 1.5rem minmax(0, 1fr) auto 1.5rem 110px; font-size: 0.82rem; }
  .kci-row.is-line { grid-template-columns: auto minmax(4.5rem, 1fr) auto 1.5rem minmax(5.5rem, 110px) auto; }
  .kci-row.is-sub { grid-template-columns: auto minmax(0, 1fr) auto 1.5rem minmax(5.5rem, 110px) auto; }
  .kci-check { width: 1.05rem; height: 1.05rem; }
  .kci-assign { min-height: 1.8rem; }
}

[data-theme="dark"] .tc-lis { border-top-color: var(--ascend-border); }
[data-theme="dark"] .kci-assign { color: #a5b4fc; background: #312e81; border-color: #4338ca; }
[data-theme="dark"] .kci-results { background: #1e1b4b; border-color: #4338ca; color: #e2e8f0; }
[data-theme="dark"] .kci-results button:hover { background: #312e81; }
[data-theme="dark"] #kanban-job-results button.kanban-search-hit { color: #c7d2fe; }
[data-theme="dark"] #kanban-job-results .kanban-search-hit.is-hi,
[data-theme="dark"] #kanban-job-results button.kanban-search-hit.is-hi { background: #312e81; }
[data-theme="dark"] .kci-mail-btn { color: #a5b4fc; }
[data-theme="dark"] .kci-mail-btn:hover { color: #c7d2fe; }

#kanban-columns[hidden], #home-my-list[hidden], #kanban-board-help[hidden] { display: none !important; }
.hbv-controls { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0 0 0.65rem; }
.hbv-seg { display: inline-flex; border: 1px solid var(--ascend-border, #cbd5e1); border-radius: 999px; overflow: hidden; background: var(--ascend-card-bg, #fff); }
.hbv-seg-btn { border: 0; background: transparent; padding: 0.32rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: var(--ascend-text-secondary, #475569); cursor: pointer; }
.hbv-seg-btn.is-on { background: #0f766e; color: #fff; }
.hbv-list { display: flex; flex-direction: column; }
.hbv-empty { color: var(--ascend-text-faint, #94a3b8); font-size: 0.8rem; margin: 0.4rem 0; }
.hbv-row {
  display: grid;
  grid-template-columns: 1.4rem minmax(7rem, 0.8fr) minmax(0, 1.6fr) minmax(6.5rem, 8.5rem) auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.15rem;
  border-bottom: 1px solid var(--ascend-border-subtle, #e2e8f0);
  font-size: 0.8rem;
}
.hbv-tick { width: 1rem; height: 1rem; margin: 0; border: 1.5px solid #94a3b8; border-radius: 999px; background: transparent; padding: 0; cursor: pointer; }
.hbv-job { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: #0f766e; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbv-job b { font-family: ui-monospace, monospace; }
.hbv-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ascend-text, #1e293b); }
.hbv-who { min-width: 0; }
.hbv-who .kci-assign { width: 100%; max-width: 8.5rem; }
.hbv-due { font-size: 0.72rem; color: #b45309; white-space: nowrap; }
.hbv-due.is-over { color: #b91c1c; font-weight: 700; }
@media (max-width: 760px) {
  .hbv-row { grid-template-columns: 1.6rem minmax(0, 1fr) auto; }
  .hbv-job { grid-column: 2; grid-row: 1; }
  .hbv-due { grid-column: 3; grid-row: 1; }
  .hbv-text { grid-column: 2 / -1; }
  .hbv-who { grid-column: 2 / -1; }
  .hbv-tick { grid-row: 1 / span 2; }
}
[data-theme="dark"] .hbv-seg { background: #1e1b4b; border-color: #4338ca; }
[data-theme="dark"] .hbv-seg-btn { color: #c7d2fe; }
[data-theme="dark"] .hbv-seg-btn.is-on { background: #0f766e; color: #fff; }
[data-theme="dark"] .hbv-text { color: #e2e8f0; }
[data-theme="dark"] .hbv-row { border-bottom-color: #334155; }
