/* ============ TASKS V3 ============ */

.tasks-screen {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tasks-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}
.tasks-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text-primary);
  margin: 0;
}
.tasks-meta {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
}
.tasks-meta-up { color: #34C759; font-weight: 500; }
.tasks-meta-warn { color: var(--kw-red); font-weight: 500; }

.tasks-divider {
  height: 1px;
  background: var(--separator);
  margin: 4px 0 12px;
}

/* ── Insight Bar ─────────────────────────────────────── */

.insight-bar {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px 20px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--separator);
  border-left: 3px solid var(--kw-red);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  animation: fadeIn 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.insight-emoji {
  font-size: 26px;
  line-height: 1;
  margin-top: 2px;
}
.insight-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.insight-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--kw-red);
}
.insight-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: pretty;
}
.insight-actions {
  display: flex;
  gap: 16px;
  margin-top: 2px;
}
.insight-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--kw-red);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: opacity 140ms;
}
.insight-link:hover { opacity: 0.7; }
.insight-link.muted { color: var(--text-tertiary); }

/* ── View switcher row ──────────────────────────────── */

.tasks-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.view-switch {
  display: inline-flex;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.view-switch button {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-switch button:hover { color: var(--text-primary); }
.view-switch button.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.5);
}
[data-theme="dark"] .view-switch button.active {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.08);
}

.tasks-ctl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid var(--separator);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.tasks-ctl-btn:hover {
  color: var(--text-primary);
  border-color: var(--separator-strong);
}
.tasks-ctl-btn.active {
  color: var(--kw-red);
  border-color: var(--kw-red);
  background: var(--kw-red-soft-bg);
}
.tasks-ctl-search {
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tasks-ctl-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}
.tasks-ctl-search input::placeholder { color: var(--text-tertiary); }

.tasks-ctl-spacer { flex: 1; }

.tasks-ctl-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--kw-red-gradient);
  color: white;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  box-shadow: var(--kw-red-halo);
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.tasks-ctl-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 32px -2px rgba(200,16,46,0.45);
}
.tasks-ctl-add kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  margin-left: 4px;
}

/* ── Filter dropdown ────────────────────────────────── */

.tasks-filter-wrap { position: relative; }
.tasks-filter-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  width: 360px;
  background: var(--bg-glass);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: popIn 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes popIn {
  from { transform: translateY(-6px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}
.filter-section { display: flex; flex-direction: column; gap: 8px; }
.filter-section-h {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-tinted);
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 140ms;
}
.filter-chip:hover { color: var(--text-primary); }
.filter-chip.on {
  background: var(--kw-red-soft-bg);
  border-color: var(--kw-red);
  color: var(--kw-red);
}
.filter-foot {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--separator);
  padding-top: 12px;
}
.filter-foot button {
  background: none; border: none; padding: 4px 8px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  color: var(--text-secondary);
}
.filter-foot button.primary { color: var(--kw-red); }
.filter-foot button:hover { opacity: 0.7; }

/* ── Bulk bar ────────────────────────────────────────── */

.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-glass);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--kw-red);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px -8px rgba(200,16,46,0.18);
  animation: bulk-bar-in 240ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes bulk-bar-in {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.bulk-count {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.bulk-count span { color: var(--kw-red); }
.bulk-actions { display: flex; gap: 6px; margin-left: auto; }
.bulk-action {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 140ms;
}
.bulk-action:hover { border-color: var(--kw-red); color: var(--kw-red); }
.bulk-action.danger:hover { background: rgba(200,16,46,0.08); }
.bulk-clear {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.bulk-clear:hover { background: var(--bg-tinted); color: var(--text-primary); }

/* ── List view: groups & rows ───────────────────────── */

.tasks-list { display: flex; flex-direction: column; gap: 4px; }

.task-group { padding-bottom: 4px; }
.task-group-h {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 8px 12px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 8px;
}
.task-group-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.task-group-chev.collapsed { transform: rotate(-90deg); }
.task-group-emoji { font-size: 16px; line-height: 1; }
.task-group-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.task-group-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  letter-spacing: -0.005em;
}
.task-group-add-inline {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: all 200ms;
}
.task-group-h:hover .task-group-add-inline { opacity: 0.6; }
.task-group-add-inline:hover { opacity: 1; background: var(--bg-tinted); color: var(--text-primary); }

.task-group-body {
  display: flex; flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: max-height 320ms cubic-bezier(0.32, 0.72, 0, 1), opacity 220ms;
}
.task-group-body.collapsed { max-height: 0; opacity: 0; }

/* Task row */

.task-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 14px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.task-row:hover {
  border-color: var(--separator-strong);
  background: var(--bg-glass-hi);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.task-row.selected {
  border-color: var(--kw-red);
  background: var(--kw-red-soft-bg);
  box-shadow: 0 0 0 1px var(--kw-red), var(--shadow-md);
}
.task-row.completed { opacity: 0.55; }
.task-row.completed .task-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task-checkbox {
  width: 22px; height: 22px;
  border: 1.5px solid var(--separator-strong);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
  margin-top: 2px;
}
.task-checkbox:hover {
  border-color: var(--kw-red);
  transform: scale(1.06);
}
.task-checkbox.checked {
  background: var(--kw-red-gradient);
  border-color: transparent;
  box-shadow: 0 0 16px -4px rgba(200,16,46,0.4);
  animation: check-burst 280ms cubic-bezier(0.32, 0.72, 0, 1);
}
.task-checkbox.checked::after {
  content: '';
  width: 10px; height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(0, -1px);
}
@keyframes check-burst {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.12); box-shadow: 0 0 24px -2px rgba(200,16,46,0.55); }
  100% { transform: scale(1);    box-shadow: 0 0 16px -4px rgba(200,16,46,0.4); }
}

.task-body {
  display: flex; flex-direction: column;
  min-width: 0;
}
.task-title {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.011em;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0 0 6px;
  text-wrap: pretty;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}
.task-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-tinted);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.task-pill.prio-2 { background: rgba(200,16,46,0.10); color: var(--kw-red); }
.task-pill.prio-1 { background: rgba(255,159,10,0.12); color: #C77A00; }
[data-theme="dark"] .task-pill.prio-1 { color: #FFB95C; }
.task-pill.prio-0 { background: var(--bg-tinted); color: var(--text-tertiary); }
.task-pill.due-overdue { background: rgba(200,16,46,0.10); color: var(--kw-red); }
.task-pill.due-today   { background: rgba(0,122,255,0.10); color: #007AFF; }

.task-rationale-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  min-width: 0;
}
.task-rationale {
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.task-source-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-tertiary);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: none;
  font-size: 11.5px;
  padding: 0;
  font-family: inherit;
}
.task-source-link:hover { color: var(--kw-red); }

.task-kebab {
  align-self: flex-start;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: all 180ms;
}
.task-row:hover .task-kebab,
.task-row.selected .task-kebab { opacity: 1; }
.task-kebab:hover { background: var(--bg-tinted); color: var(--text-primary); }

.task-drag-handle {
  position: absolute;
  left: -22px; top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  cursor: grab;
  color: var(--text-tertiary);
  transition: opacity 180ms;
  display: flex;
  align-items: center;
}
.task-row:hover .task-drag-handle { opacity: 0.5; }
.task-row.dragging {
  cursor: grabbing;
  opacity: 0.85;
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 16px 32px -12px rgba(0,0,0,0.18);
  z-index: 10;
}

/* Kebab menu */

.kebab-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  background: var(--bg-glass);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: popIn 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.kebab-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-primary);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 140ms;
}
.kebab-item:hover { background: var(--bg-tinted); }
.kebab-item.danger { color: var(--kw-red); }
.kebab-item-emoji { font-size: 14px; line-height: 1; width: 18px; text-align: center; }
.kebab-item-arrow { margin-left: auto; color: var(--text-tertiary); }
.kebab-divider { height: 1px; background: var(--separator); margin: 4px 0; }
.kebab-submenu {
  position: absolute;
  top: 0; left: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-glass);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: popIn 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* Inline composer */

.composer-row {
  background: var(--bg-glass-hi);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--kw-red);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: composer-in 220ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 0 0 3px var(--kw-red-soft-bg), var(--shadow-md);
}
@keyframes composer-in {
  from { transform: translateY(-4px) scale(0.99); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}
.composer-top {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 14px;
  align-items: center;
}
.composer-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.011em;
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
}
.composer-input::placeholder { color: var(--text-tertiary); }
.composer-meta { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 36px; }
.composer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 140ms;
  font-family: inherit;
}
.composer-pill:hover { color: var(--text-primary); border-color: var(--separator-strong); }
.composer-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: -0.005em;
}
.composer-hint kbd {
  font-family: inherit;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  margin: 0 2px;
}

/* ── Board view ─────────────────────────────────────── */

.tasks-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}
.kanban-col {
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  border-radius: 18px;
  padding: 16px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-col.drag-over {
  border-color: var(--kw-red);
  background: var(--kw-red-soft-bg);
}
.kanban-col-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 8px;
}
.kanban-col-h-emoji { font-size: 14px; line-height: 1; }
.kanban-col-count {
  margin-left: auto;
  background: var(--bg-elevated);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--text-secondary);
  letter-spacing: 0;
}
.kanban-card {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-card:hover {
  border-color: var(--kw-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kanban-card.dragging { opacity: 0.5; }
.kanban-card.completed { opacity: 0.6; }
.kanban-card.completed .kanban-card-title { text-decoration: line-through; color: var(--text-tertiary); }
.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.011em;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  text-wrap: pretty;
}
.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kanban-add {
  background: transparent;
  border: 1px dashed var(--separator-strong);
  border-radius: 12px;
  padding: 10px;
  color: var(--text-tertiary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 180ms;
}
.kanban-add:hover {
  border-color: var(--kw-red);
  color: var(--kw-red);
  background: var(--kw-red-soft-bg);
}

/* ── Inspector ──────────────────────────────────────── */

.task-inspector-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 200ms ease;
}
.task-inspector {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 92vw;
  z-index: 101;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border-left: 1px solid var(--separator);
  box-shadow: -24px 0 60px -12px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: insp-in 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes insp-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.insp-head {
  display: grid;
  grid-template-columns: 26px 1fr 28px;
  gap: 14px;
  align-items: flex-start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--separator);
}
.insp-head .task-checkbox { width: 26px; height: 26px; }
.insp-head .task-checkbox.checked::after { width: 12px; height: 6px; }
.insp-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
  text-wrap: pretty;
}
.insp-title.completed { text-decoration: line-through; color: var(--text-tertiary); }
.insp-close {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.insp-close:hover { background: var(--bg-tinted); color: var(--text-primary); }

.insp-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 24px 18px;
}

.insp-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.insp-section-h {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}
.insp-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
  margin: 0;
}

.insp-rows { display: flex; flex-direction: column; gap: 2px; }
.insp-row {
  display: grid;
  grid-template-columns: 22px 90px 1fr 14px;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
  color: var(--text-primary);
}
.insp-row:hover { background: var(--bg-tinted); }
.insp-row-icon { font-size: 14px; line-height: 1; text-align: center; color: var(--text-secondary); }
.insp-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.insp-row-value {
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.insp-row-arrow { color: var(--text-tertiary); }

.insp-rationale {
  background: var(--bg-tinted);
  border-left: 2px solid var(--kw-red);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.insp-timeline { display: flex; flex-direction: column; gap: 10px; }
.insp-tl-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  font-size: 12px;
  align-items: baseline;
}
.insp-tl-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--separator-strong);
  margin-top: 5px;
  justify-self: center;
}
.insp-tl-item:last-child .insp-tl-dot { background: var(--kw-red); box-shadow: 0 0 8px rgba(200,16,46,0.4); }
.insp-tl-label { color: var(--text-primary); font-weight: 500; }
.insp-tl-who { color: var(--text-tertiary); font-size: 11.5px; display: block; margin-top: 1px; }
.insp-tl-time { color: var(--text-tertiary); font-size: 11px; }

.insp-actions {
  padding: 18px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.insp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--kw-red-gradient);
  color: white;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.011em;
  border: none;
  cursor: pointer;
  box-shadow: var(--kw-red-halo);
  transition: all 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.insp-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 32px -2px rgba(200,16,46,0.45);
}
.insp-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.insp-secondary button {
  padding: 9px 8px;
  border-radius: 10px;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 140ms;
}
.insp-secondary button:hover { border-color: var(--separator-strong); }
.insp-secondary button.danger { color: var(--kw-red); }
.insp-secondary button.danger:hover { background: rgba(200,16,46,0.06); border-color: var(--kw-red); }

.insp-delegate-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 24px; right: 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: popIn 200ms cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 5;
}
.insp-actions { position: relative; }

/* ── Empty / Loading ────────────────────────────────── */

.tasks-empty {
  text-align: center;
  padding: 72px 32px 56px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tasks-empty-emoji { font-size: 38px; line-height: 1; opacity: 0.85; }
.tasks-empty-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.tasks-empty-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 360px;
  text-wrap: pretty;
}
.tasks-empty-text kbd {
  font-family: inherit;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  margin-left: 4px;
}

/* ── Shortcuts modal ────────────────────────────────── */

.shortcuts-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease;
}
.shortcuts-modal {
  width: 540px;
  max-width: 92vw;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 24px 28px 28px;
  animation: insp-in 280ms cubic-bezier(0.32, 0.72, 0, 1);
}
.shortcuts-h {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.shortcuts-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 18px;
}
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--separator);
}
.shortcut-row span { color: var(--text-secondary); }
.shortcut-keys { display: inline-flex; gap: 3px; }
.shortcut-keys kbd {
  font-family: inherit;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-tinted);
  border: 1px solid var(--separator);
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Animations entry ───────────────────────────────── */

.task-row-enter {
  animation: row-spring-in 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes row-spring-in {
  from { opacity: 0; transform: scale(0.97) translateY(-4px); background: var(--kw-red-soft-bg); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 1100px) {
  .tasks-board { grid-template-columns: 1fr; }
  .insight-bar { padding: 14px 16px; }
  .tasks-title { font-size: 30px; }
}
