/*
  The Nervus System — Projects + Tasks, designed for the project manager.
  Loaded by projects.html and tasks.html after projects-tasks.css (the
  Phase 10b light layer, still loaded for the setup wizard and create
  forms) and before jarvis-shell.css.

  Structure follows the information, not a card template:
  - Portfolio (projects.html): signal line → filter chips → sortable
    table → rail (deadlines, activity). Comparing projects is a table job.
  - Project workspace (tasks.html#/p/<id>/…): project header with status,
    health, progress, timeline, team; tabs for Overview, Board, List,
    Timeline, Sprints, Activity.
  - My Tasks (tasks.html): a personal work queue grouped by urgency.
  - Task workspace: a large two-column sheet instead of a narrow drawer.
*/

/* ============ Page frame ============ */

html,
body {
  background: var(--db-bg) !important;
  color: var(--db-text);
  font-family: var(--font-body);
}

.pm-page {
  max-width: 1480px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8) var(--space-10) !important;
  background: var(--db-bg);
  min-height: calc(100vh - var(--jx-shell-h, 52px));
}

.pm-page * {
  box-sizing: border-box;
}

.pm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.pm-muted {
  color: var(--db-text-faint);
}

.pm-nowrap {
  white-space: nowrap;
}

/* ============ Header ============ */

.pm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.pm-head-text {
  min-width: 0;
}

.pm-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-page-title-size);
  line-height: var(--text-page-title-line);
  color: var(--db-text);
}

.pm-signals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--db-text-muted);
}

.pm-sep {
  margin: 0 8px;
  color: var(--db-text-faint);
}

.pm-signal {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--db-text);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}

.pm-signal:hover {
  border-bottom-color: currentColor;
}

.pm-signal-alert {
  color: var(--db-primary);
}

.pm-signal-danger {
  color: var(--db-danger);
}

.pm-signal-warn {
  color: var(--db-warning-hover);
}

.pm-signal-ok {
  color: var(--db-success-hover);
  font-weight: 600;
}

.pm-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============ Buttons ============ */

.pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-full);
  background: var(--db-surface);
  color: var(--db-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

.pm-btn:hover {
  border-color: var(--db-border-strong);
  background: var(--db-surface-hover);
}

.pm-btn:focus-visible,
.pm-chip:focus-visible,
.pm-icon-btn:focus-visible,
.pm-tab:focus-visible {
  outline: 2px solid var(--db-primary);
  outline-offset: 2px;
}

.pm-btn[hidden] {
  display: none;
}

.pm-btn-primary {
  background: var(--db-primary);
  border-color: var(--db-primary);
  color: #fff;
}

.pm-btn-primary:hover {
  background: var(--db-primary-hover);
  border-color: var(--db-primary-hover);
}

.pm-btn-sm {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
}

.pm-btn-ghost {
  border-color: transparent;
  background: none;
  color: var(--db-text-muted);
}

.pm-btn-ghost:hover {
  background: var(--db-surface-hover);
  border-color: transparent;
  color: var(--db-text);
}

.pm-btn-danger {
  color: var(--db-danger);
}

.pm-btn-danger:hover {
  background: var(--db-danger-soft);
  border-color: var(--db-danger-soft);
}

.pm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--db-radius-sm);
  background: none;
  color: var(--db-text-faint);
  cursor: pointer;
}

.pm-icon-btn:hover {
  background: var(--db-surface-hover);
  color: var(--db-text);
}

.pm-icon-danger:hover {
  background: var(--db-danger-soft);
  color: var(--db-danger);
}

/* ============ Search ============ */

.pm-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 240px;
  height: 34px;
  padding: 0 12px;
  gap: 8px;
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-full);
  background: var(--db-surface);
  color: var(--db-text-faint);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.pm-search:focus-within {
  border-color: var(--db-primary);
  box-shadow: 0 0 0 3px var(--db-primary-soft);
}

.pm-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: none;
  color: var(--db-text);
  font: inherit;
  font-size: 13px;
}

/* ============ Chips ============ */

.pm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.pm-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-full);
  background: var(--db-surface);
  color: var(--db-text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-standard);
}

.pm-chip:hover {
  color: var(--db-text);
  border-color: var(--db-border-strong);
}

.pm-chip.active {
  background: var(--db-primary);
  border-color: var(--db-primary);
  color: #fff;
}

.pm-chip-count {
  font-size: 11px;
  font-weight: 650;
  color: var(--db-text-faint);
  font-variant-numeric: tabular-nums;
}

.pm-chip.active .pm-chip-count {
  color: rgba(255, 255, 255, 0.75);
}

.pm-chip-alert:not(.active) .pm-chip-count {
  color: var(--db-danger);
}

/* ============ Health, status, counts, avatars ============ */

.pm-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  color: var(--db-text-muted);
}

.pm-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--db-text-faint);
  flex-shrink: 0;
}

.pm-health-on { color: var(--db-success-hover); }
.pm-health-on .pm-health-dot { background: var(--db-success); }
.pm-health-risk { color: var(--db-warning-hover); }
.pm-health-risk .pm-health-dot { background: var(--db-warning); }
.pm-health-off { color: var(--db-danger); }
.pm-health-off .pm-health-dot { background: var(--db-danger); }
.pm-health-planning { color: var(--db-info, var(--db-primary)); }
.pm-health-planning .pm-health-dot { background: var(--db-info, var(--db-primary)); }
.pm-health-complete .pm-health-dot { background: var(--db-success); }
.pm-health-hold .pm-health-dot,
.pm-health-empty .pm-health-dot,
.pm-health-archived .pm-health-dot {
  background: transparent;
  border: 1.5px solid var(--db-text-faint);
}

.pm-pstatus {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
  color: var(--db-text-muted);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.pm-pstatus-active {
  background: var(--db-primary-soft);
  color: var(--db-primary);
}

.pm-pstatus-planning {
  background: var(--db-info-soft, var(--db-primary-soft));
  color: var(--db-info, var(--db-primary));
}

.pm-pstatus-completed {
  background: var(--db-success-soft);
  color: var(--db-success-hover);
}

.pm-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--db-radius-full);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pm-count-danger {
  background: var(--db-danger-soft);
  color: var(--db-danger);
}

.pm-count-warn {
  background: var(--db-warning-soft);
  color: var(--db-warning-hover);
}

.pm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--db-primary-soft);
  color: var(--db-primary);
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.pm-avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
}

.pm-avatar-xs {
  width: 18px;
  height: 18px;
  font-size: 8.5px;
}

.pm-avatars {
  display: inline-flex;
  gap: 3px;
}

.pm-avatar-more {
  background: var(--db-surface-sunken);
  color: var(--db-text-muted);
}

.pm-progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--db-surface-sunken);
  overflow: hidden;
}

.pm-progress > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--db-primary);
}

.pm-key {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--db-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ============ Panels ============ */

.pm-panel {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  min-width: 0;
}

.pm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--db-border);
}

.pm-panel-title {
  margin: 0;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
  color: var(--db-text-faint);
}

.pm-panel-title-lg {
  font-family: var(--font-display);
  font-size: var(--text-section-title-size);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--db-text);
}

.pm-panel-body {
  padding: 12px 16px 16px;
}

.pm-panel-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--db-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.pm-panel-link:hover {
  text-decoration: underline;
}

/* ============ Tables ============ */

.pm-table-scroll {
  overflow-x: auto;
}

.pm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.pm-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--db-border);
  background: var(--db-surface);
  color: var(--db-text-faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  user-select: none;
}

.pm-table th:first-child {
  padding-left: 16px;
}

.pm-table th[data-sort] {
  cursor: pointer;
}

.pm-table th[data-sort]:hover {
  color: var(--db-text);
}

.pm-table th.sorted {
  color: var(--db-primary);
}

.pm-table th.sorted::after {
  content: " ↑";
}

.pm-table th.sorted[data-dir="desc"]::after {
  content: " ↓";
}

.pm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--db-border);
  vertical-align: middle;
  color: var(--db-text);
}

.pm-table td:first-child {
  padding-left: 16px;
}

.pm-table tbody tr:last-child td {
  border-bottom: none;
}

.pm-row {
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.pm-row:hover td {
  background: var(--db-surface-hover);
}

.pm-row:focus-visible {
  outline: 2px solid var(--db-primary);
  outline-offset: -2px;
}

.pm-num {
  text-align: center !important;
  width: 64px;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.pm-cell-main {
  font-weight: 550;
  white-space: nowrap;
}

.pm-cell-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--db-text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.pm-col-actions {
  width: 64px;
  padding-left: 4px !important;
  text-align: right;
  white-space: nowrap;
}

.pm-portfolio-table .pm-col-actions {
  position: sticky;
  right: 0;
  background: var(--db-surface);
}

.pm-portfolio-table th.pm-col-actions {
  z-index: 2;
}

.pm-row:hover td.pm-col-actions {
  background: var(--db-surface-hover);
}

.pm-col-actions .pm-icon-btn {
  color: var(--db-text-muted, var(--db-text-faint));
}

/* ============ Portfolio ============ */

.pm-portfolio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-5);
  align-items: start;
}

.pm-table-panel {
  overflow: hidden;
}

.pm-project-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--db-text);
}

.pm-col-project {
  min-width: 220px;
}

.pm-col-health {
  min-width: 120px;
}

.pm-col-health .pm-cell-sub {
  white-space: normal;
  max-width: 150px;
  line-height: 1.35;
}

.pm-col-progress {
  width: 130px;
  min-width: 112px;
}

.pm-col-due {
  min-width: 150px;
}

.pm-col-due .pm-cell-sub {
  max-width: 160px;
}

.pm-col-team {
  width: 104px;
}

.pm-col-updated {
  width: 92px;
  white-space: nowrap;
}

.pm-empty {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  color: var(--db-text-muted);
  font-size: 13.5px;
}

.pm-empty-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--db-text);
  margin-bottom: 6px;
}

.pm-empty p {
  margin: 0 0 14px;
}

.pm-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: calc(var(--jx-shell-h, 52px) + var(--space-4));
}

/* Feeds (deadlines, activity) */
.pm-feed {
  padding: 4px 0;
}

.pm-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-standard);
}

.pm-feed-item:hover {
  background: var(--db-surface-hover);
}

.pm-feed-date {
  flex-shrink: 0;
  width: 68px;
  padding-top: 1px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--db-text-muted);
  font-variant-numeric: tabular-nums;
}

.pm-feed-date.soon {
  color: var(--db-warning-hover);
}

.pm-feed-date.late {
  color: var(--db-danger);
}

.pm-feed-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.pm-feed-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--db-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-feed-sub {
  font-size: 11.5px;
  color: var(--db-text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-feed-empty,
.pm-feed-more {
  margin: 0;
  padding: 8px 16px 10px;
  font-size: 12.5px;
  color: var(--db-text-faint);
}

/* ============ Legacy modal chrome on these pages ============ */

#edit-project-key {
  background: var(--db-surface-sunken) !important;
  color: var(--db-text-muted);
}

/* ============ Responsive (portfolio) ============ */

@media (max-width: 1240px) {
  .pm-portfolio {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Laptop widths: drop "Updated" so the row actions never cover a column */
@media (max-width: 1360px) {
  .pm-portfolio-table .pm-col-updated {
    display: none;
  }
}

@media (max-width: 900px) {
  .pm-page {
    padding: var(--space-5) var(--space-4) var(--space-8) !important;
  }

  .pm-portfolio-table .pm-col-team,
  .pm-portfolio-table .pm-col-updated,
  .pm-portfolio-table th:nth-child(5),
  .pm-portfolio-table td:nth-child(5) {
    display: none;
  }

  .pm-search {
    flex: 1;
    width: auto;
  }

  .pm-head-actions {
    width: 100%;
  }
}

/* =====================================================================
   PROJECT WORKSPACE (tasks.html#/p/<id>/…)
   ===================================================================== */

#pm-tasks-page.dashboard-main3 {
  margin: 0 auto;
  width: 100%;
}

.pm-eyebrow {
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
  color: var(--db-text-faint);
}

.ws-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.ws-head-main {
  min-width: 0;
}

.ws-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--db-text-faint);
  margin-bottom: 2px;
}

.ws-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--db-text-muted);
}

.ws-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ws-fact svg {
  color: var(--db-text-faint);
}

.ws-fact-sub {
  font-size: 12px;
  color: var(--db-text-faint);
}

.ws-fact-progress .pm-progress {
  width: 120px;
}

.ws-status-select select,
.ws-select,
.ws-input {
  height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-full);
  background: var(--db-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  color: var(--db-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.ws-input {
  padding: 0 12px;
  background-image: none;
  font-weight: 500;
  cursor: text;
  border-radius: var(--db-radius-sm);
}

.ws-select {
  height: 30px;
  font-weight: 550;
}

.ws-status-select select:focus,
.ws-select:focus,
.ws-input:focus {
  outline: none;
  border-color: var(--db-primary);
  box-shadow: 0 0 0 3px var(--db-primary-soft);
}

/* Tabs */
.ws-tabs {
  display: flex;
  gap: var(--space-5);
  border-bottom: 1px solid var(--db-border);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

#pm-tasks-page .pm-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  height: auto;
  padding: 10px 2px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--db-text-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

#pm-tasks-page .pm-tab:hover {
  color: var(--db-text);
  background: none;
}

#pm-tasks-page .pm-tab.active {
  color: var(--db-primary);
  border-bottom-color: var(--db-primary);
  background: none;
}

.pm-tab-count {
  font-size: 11px;
  font-weight: 650;
  color: var(--db-text-faint);
}

/* Filter toolbar (Board / List / Timeline) */
.ws-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4);
}

.ws-toolbar[hidden] {
  display: none;
}

.ws-search {
  width: 200px;
  height: 30px;
}

.ws-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-chip-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.ws-filter-count {
  font-size: 12px;
  color: var(--db-text-faint);
  margin-left: 4px;
}

/* =====================================================================
   BOARD — dense cards
   ===================================================================== */

#kanban-view.tasks-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding: 0 0 12px;
  margin: 0;
  background: none;
  grid-template-columns: none;
}

#kanban-view .task-column {
  flex: 1 1 260px;
  min-width: 260px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 290px);
  min-height: 160px;
  padding: 0;
  background: var(--db-surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--db-radius-lg);
  box-shadow: none;
  transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard);
}

#kanban-view .task-column.drag-over {
  border-color: var(--db-primary);
  background: var(--db-primary-soft);
}

#kanban-view .task-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px 12px;
  margin: 0;
  border: none;
  background: none;
}

#kanban-view .task-column-header h3 {
  flex: none;
  text-align: left;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--db-text);
  text-transform: none;
  letter-spacing: 0;
}

.kc-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--col, var(--db-text-faint));
  flex-shrink: 0;
}

#kanban-view .task-column-header .task-count {
  min-width: 0;
  height: auto;
  padding: 0;
  background: none;
  color: var(--db-text-faint);
  font-size: 12px;
  font-weight: 650;
  border: none;
}

.kc-col-add {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--db-radius-sm);
  background: none;
  color: var(--db-text-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.kc-col-add:hover {
  background: var(--db-surface);
  color: var(--db-primary);
}

#kanban-view .task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
  padding: 2px 8px 10px;
  overflow-y: auto;
}

#kanban-view .task-card.kc {
  display: block;
  margin: 0;
  padding: 8px 10px 8px;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  cursor: grab;
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

#kanban-view .task-card.kc:hover {
  border-color: var(--db-border-strong);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transform: none;
}

#kanban-view .task-card.kc:focus-visible {
  outline: 2px solid var(--db-primary);
  outline-offset: 1px;
}

#kanban-view .task-card.kc.dragging {
  opacity: 0.45;
}

#kanban-view .task-card.kc.is-blocked {
  border-left: 3px solid var(--db-warning);
  padding-left: 8px;
}

#kanban-view .task-card.kc.completed {
  opacity: 1;
  background: var(--db-surface);
}

#kanban-view .task-card.kc.completed .kc-title {
  color: var(--db-text-muted);
}

.kc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

/* Delete on board cards and list rows */
.task-delete-btn {
  flex: none;
  width: 22px;
  height: 22px;
  margin: -3px -4px -3px 0;
}

.kc-top .task-delete-btn {
  margin-left: 2px;
}

.tasks-table .tl-actions {
  width: 44px;
  padding-left: 0 !important;
  text-align: right;
  white-space: nowrap;
}

.kc-key {
  font-size: 11px;
  font-weight: 650;
  color: var(--db-text-faint);
  font-variant-numeric: tabular-nums;
}

.kc-type {
  font-size: 10.5px;
  font-weight: 650;
  color: var(--db-text-muted);
  padding: 0 6px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
}

/* Priority as three ascending bars: readable at a glance, no colour words */
.kc-prio {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
  margin-left: auto;
  vertical-align: -1px;
}

.kc-prio i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--db-border-strong);
}

.kc-prio i:nth-child(1) { height: 5px; }
.kc-prio i:nth-child(2) { height: 8px; }
.kc-prio i:nth-child(3) { height: 11px; }

.kc-prio-low i:nth-child(1) { background: var(--db-text-faint); }
.kc-prio-medium i:nth-child(-n+2) { background: var(--db-warning); }
.kc-prio-high i,
.kc-prio-critical i,
.kc-prio-urgent i { background: var(--db-danger); }

.tl-title .kc-prio,
td > .kc-prio,
.mt-row .kc-prio {
  margin-left: 0;
}

.kc-title {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.38;
  color: var(--db-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.kc-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.kc-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--db-text-muted);
}

.kc-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--label, var(--db-text-faint));
}

.kc-label-more {
  font-size: 10.5px;
  color: var(--db-text-faint);
}

.kc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-height: 18px;
  font-size: 11.5px;
  color: var(--db-text-faint);
}

.kc-spacer {
  flex: 1;
}

.kc-due {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kc-due.soon {
  color: var(--db-warning-hover);
}

.kc-due.late {
  color: var(--db-danger);
}

.kc-blocked {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  height: 17px;
  border-radius: var(--db-radius-full);
  background: var(--db-warning-soft);
  color: var(--db-warning-hover);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 1px;
}

.kc-subs {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kc-subs::before {
  content: "☑ ";
  font-weight: 400;
}

/* =====================================================================
   LIST — sortable table
   ===================================================================== */

#list-view .pm-panel {
  overflow-x: auto;
}

.tasks-table.pm-table {
  min-width: 920px;
}

.tasks-table.pm-table thead {
  background: none;
}

.tasks-table.pm-table tbody tr {
  border: none;
}

.tasks-table.pm-table td {
  font-size: 13px;
}

.tl-check {
  width: 34px;
}

.tl-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--db-primary);
  cursor: pointer;
}

.tl-title {
  min-width: 260px;
}

.tl-title-main {
  font-weight: 550;
}

.pm-row.is-done .tl-title-main {
  color: var(--db-text-faint);
  text-decoration: line-through;
}

.tl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text);
  white-space: nowrap;
}

.tl-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--st, var(--db-text-faint));
}

.tl-person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.tl-late {
  color: var(--db-danger) !important;
  font-weight: 600;
}

/* =====================================================================
   TIMELINE
   ===================================================================== */

#gantt-view .gantt-container {
  padding: 0;
  overflow: hidden;
}

#gantt-view .gantt-body {
  padding: 0;
  max-height: none;
}

.gt-scroll {
  overflow-x: auto;
}

.gt-grid {
  --gt-label: 300px;
  position: relative;
  width: calc(var(--gt-label) + var(--gt-width));
  min-width: 100%;
}

#gantt-view .gantt-row {
  display: grid;
  grid-template-columns: var(--gt-label) var(--gt-width);
  align-items: center;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--db-border);
  background: var(--db-surface);
  cursor: pointer;
}

#gantt-view .gantt-row:hover {
  background: var(--db-surface-hover);
}

#gantt-view .gantt-row:hover .gantt-task-info {
  background: var(--db-surface-hover);
}

#gantt-view .gantt-task-info {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  min-width: 0;
  padding: 6px 12px 6px 16px;
  background: var(--db-surface);
  border-right: 1px solid var(--db-border);
  font-size: 12.5px;
}

.gt-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--db-text);
  font-weight: 550;
}

#gantt-view .gantt-bar-container {
  position: relative;
  height: 36px;
  min-width: 0;
  margin: 0;
  background: none;
  overflow: visible;
}

#gantt-view .gt-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 30px;
  cursor: default;
  background: var(--db-surface);
}

#gantt-view .gt-head .gantt-task-info {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--db-text-faint);
}

#gantt-view .gt-head .gantt-bar-container {
  height: 30px;
}

.gt-day {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
}

.gt-day.weekend {
  background: var(--db-surface-sunken);
}

.gt-day.monday {
  border-left: 1px solid var(--db-border);
}

.gt-day span {
  position: absolute;
  top: 8px;
  left: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--db-text-muted);
  white-space: nowrap;
}

.gt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--db-accent);
  z-index: 1;
  pointer-events: none;
}

#gantt-view .gantt-bar {
  position: absolute;
  top: 9px;
  height: 18px;
  min-width: 0;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--db-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: none;
}

#gantt-view .gantt-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#gantt-view .gantt-bar.gt-todo { background: #94a3b8; }
#gantt-view .gantt-bar.gt-active { background: var(--db-primary); }
#gantt-view .gantt-bar.gt-blocked { background: var(--db-warning); }
#gantt-view .gantt-bar.gt-late { background: var(--db-danger); }
#gantt-view .gantt-bar.gt-done { background: var(--db-success); opacity: 0.55; }
#gantt-view .gantt-bar.gt-nodue {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.25) 0 4px, transparent 4px 8px);
}

.gt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 16px;
  font-size: 11.5px;
  color: var(--db-text-muted);
}

.gt-k {
  display: inline-block;
  width: 14px;
  height: 8px;
  margin-right: -8px;
  border-radius: 2px;
}

.gt-k.gt-todo { background: #94a3b8; }
.gt-k.gt-active { background: var(--db-primary); }
.gt-k.gt-blocked { background: var(--db-warning); }
.gt-k.gt-late { background: var(--db-danger); }
.gt-k.gt-done { background: var(--db-success); opacity: 0.55; }

/* =====================================================================
   OVERVIEW
   ===================================================================== */

.ov-grid,
.sp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-4);
  align-items: start;
}

.ov-main,
.ov-side,
.sp-main,
.sp-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.ov-attention {
  padding: 4px 0 8px;
}

.ov-group + .ov-group {
  border-top: 1px solid var(--db-border);
}

.ov-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--db-text);
}

.ov-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
  color: var(--db-text-muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  vertical-align: 1px;
}

.ov-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 150px 170px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 16px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--db-text);
  cursor: pointer;
}

.ov-row:hover {
  background: var(--db-surface-hover);
}

.ov-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}

.ov-row-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--db-text-muted);
}

.ov-row-person span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-row-meta {
  font-size: 12px;
  color: var(--db-text-faint);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-row-meta.late {
  color: var(--db-danger);
  font-weight: 650;
}

.ov-row-meta.warn {
  color: var(--db-warning-hover);
  font-weight: 600;
}

.ov-more {
  padding: 4px 16px 6px 90px;
  font-size: 12px;
  color: var(--db-text-faint);
}

.ov-clear {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  font-size: 13.5px;
  color: var(--db-text-muted);
}

.ov-clear-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--db-success-soft);
  color: var(--db-success-hover);
  font-weight: 700;
}

.ov-stack {
  display: flex;
  height: 12px;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--db-surface-sunken);
}

.ov-stack span {
  display: block;
  min-width: 4px;
}

.ov-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--db-text-muted);
}

.ov-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
}

.ov-legend b {
  color: var(--db-text);
  margin-left: 3px;
}

.ov-load td,
.ov-load th {
  white-space: nowrap;
}

.ov-load-bar {
  min-width: 140px;
}

.ov-load-bar .pm-progress {
  display: inline-block;
  width: 90px;
  vertical-align: middle;
  margin-right: 8px;
}

.ov-dl,
.tw-dl,
.tw-meta {
  margin: 0;
}

.ov-dl div,
.tw-dl div,
.tw-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}

.ov-dl dt,
.tw-meta dt {
  color: var(--db-text-muted);
}

.ov-dl dd,
.tw-meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.ov-sprint-name {
  font-weight: 650;
  font-size: 13.5px;
}

button.pm-feed-item {
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Sprint pace: work done vs time elapsed */
.sp-pace {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 6px;
}

.sp-pace-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--db-text-muted);
}

.sp-pace-row b {
  text-align: right;
  color: var(--db-text);
  font-variant-numeric: tabular-nums;
}

.sp-time > span {
  background: var(--db-text-faint);
}

.sp-verdict {
  font-size: 12px;
  font-weight: 700;
}

.sp-verdict.ok {
  color: var(--db-success-hover);
}

.sp-verdict.behind {
  color: var(--db-danger);
}

/* =====================================================================
   SPRINTS
   ===================================================================== */

.sp-active-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px 16px 4px;
}

.sp-name {
  margin: 2px 0 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--db-text);
}

.sp-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, auto)) minmax(220px, 1fr);
  gap: 0;
  align-items: center;
  margin: 10px 16px 14px;
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius);
}

.sp-stats > div {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-right: 1px solid var(--db-border);
}

.sp-stats > div:last-child {
  border-right: none;
}

.sp-stats b {
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--db-text);
  font-variant-numeric: tabular-nums;
}

.sp-stats span {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--db-text-faint);
}

.sp-stats .warn b { color: var(--db-warning-hover); }
.sp-stats .danger b { color: var(--db-danger); }

.sp-stats .sp-stats-pace .sp-pace {
  margin: 0;
}

.sp-stats .sp-stats-pace span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.sp-active .pm-table {
  border-top: 1px solid var(--db-border);
}

.sp-action {
  text-align: right;
  white-space: nowrap;
}

.sp-none {
  padding: var(--space-6);
}

.sp-planned {
  padding: 4px 0;
}

.sp-planned-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--db-border);
}

.sp-planned-name {
  font-weight: 650;
  font-size: 13.5px;
}

.sp-planned-actions {
  display: flex;
  gap: 4px;
}

.sp-active-head .pm-cell-sub,
.ov-sprint .pm-cell-sub {
  max-width: none;
  white-space: normal;
}

.sp-hist-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--db-border);
}

.sp-hist-row:last-child {
  border-bottom: none;
}

.sp-hist-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.sp-hist-pct {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.sp-hist-row .pm-cell-sub {
  max-width: none;
  margin-top: 6px;
}

/* Empty states inside the task sheet: plain text, not the old grey boxes */
#task-details-modal .tw-empty {
  padding: 0;
  background: none !important;
  border: none !important;
}

.sp-planned-actions .pm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sp-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.sp-create .ws-input {
  grid-column: 1 / -1;
  height: 32px;
}

.sp-create .ws-select {
  height: 32px;
}

.sp-history .pm-table td,
.sp-history .pm-table th {
  padding: 8px 10px;
  font-size: 12px;
}

.sp-hist-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sp-hist-bar .pm-progress {
  width: 48px;
}

/* =====================================================================
   ACTIVITY
   ===================================================================== */

.act-panel {
  padding: 4px 0 8px;
  max-width: 980px;
}

.act-day {
  padding: 14px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--db-text-faint);
}

.act-row {
  display: grid;
  grid-template-columns: 72px 10px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 6px 16px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--db-text);
  cursor: pointer;
}

.act-row:hover {
  background: var(--db-surface-hover);
}

.act-time {
  font-size: 12px;
  color: var(--db-text-faint);
  font-variant-numeric: tabular-nums;
}

.act-kind {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--db-border-strong);
  align-self: center;
}

.act-kind.act-comment { background: var(--db-primary); }
.act-kind.act-status,
.act-kind.act-Status { background: var(--db-accent); }
.act-kind.act-create { background: var(--db-text-faint); }

.act-body b {
  font-weight: 600;
}

.act-text {
  display: block;
  color: var(--db-text-muted);
  font-size: 12.5px;
}

/* =====================================================================
   MY TASKS — personal work queue
   ===================================================================== */

#pt-view-mytasks {
  max-width: 1180px;
}

.mt-group {
  margin-bottom: var(--space-5);
}

.mt-group-title {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--db-text-muted);
}

.mt-overdue .mt-group-title { color: var(--db-danger); }
.mt-today .mt-group-title { color: var(--db-warning-hover); }

.mt-list {
  overflow: hidden;
}

.mt-row {
  display: grid;
  grid-template-columns: 20px 16px minmax(0, 1fr) minmax(0, 220px) 130px 104px;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--db-border);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.mt-row:last-child {
  border-bottom: none;
}

.mt-row:hover {
  background: var(--db-surface-hover);
}

.mt-row:focus-visible {
  outline: 2px solid var(--db-primary);
  outline-offset: -2px;
}

.mt-check {
  width: 15px;
  height: 15px;
  accent-color: var(--db-primary);
  cursor: pointer;
}

.mt-title {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-project {
  font-size: 12px;
  color: var(--db-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-due {
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  color: var(--db-text-muted);
  font-variant-numeric: tabular-nums;
}

.mt-due.late { color: var(--db-danger); }
.mt-due.soon { color: var(--db-warning-hover); }

/* =====================================================================
   TASK WORKSPACE — replaces the narrow drawer
   ===================================================================== */

.tw-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) - 1);
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.tw-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

body.tw-open {
  overflow: hidden;
}

#task-details-modal.tw-sheet {
  position: fixed;
  z-index: var(--z-drawer);
  top: 24px;
  bottom: 24px;
  left: 50%;
  width: min(1180px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--db-text);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base);
}

#task-details-modal.tw-sheet.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.tw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 22px;
  border-bottom: 1px solid var(--db-border);
}

.tw-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--db-text-muted);
}

.tw-crumb-sep {
  color: var(--db-text-faint);
}

#task-details-modal .task-id {
  font-weight: 700;
  color: var(--db-text);
  font-variant-numeric: tabular-nums;
}

#task-details-modal .task-type-badge {
  padding: 1px 8px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
  color: var(--db-text-muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.tw-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tw-titlebar {
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--db-border);
}

.tw-title {
  display: block;
  width: 100%;
  margin: 0;
  padding: 2px 0;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
  background: none;
  color: var(--db-text);
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.2;
}

.tw-title:focus {
  box-shadow: 0 2px 0 var(--db-primary);
}

.tw-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.tw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
  color: var(--db-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.tw-chip a {
  color: inherit;
  font-weight: 700;
}

.tw-chip-danger {
  background: var(--db-danger-soft);
  color: var(--db-danger);
}

.tw-chip-warn {
  background: var(--db-warning-soft);
  color: var(--db-warning-hover);
}

.tw-chip-plain {
  background: none;
  padding-left: 0;
  color: var(--db-text);
}

.tw-state .tl-status {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
}

.tw-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.tw-main {
  overflow-y: auto;
  padding: 6px 22px 28px;
}

.tw-side {
  overflow-y: auto;
  padding: 14px 18px 22px;
  border-left: 1px solid var(--db-border);
  background: var(--db-surface-sunken);
}

.tw-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--db-border);
}

.tw-section:last-child {
  border-bottom: none;
}

.tw-section[hidden] {
  display: none;
}

.tw-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tw-section-title {
  margin: 0 0 8px;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
  color: var(--db-text-faint);
}

.tw-count {
  margin-left: 4px;
  color: var(--db-text-muted);
  letter-spacing: 0;
}

.tw-textarea,
.tw-input,
.tw-select,
.tw-inline-form select {
  width: 100%;
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-sm);
  background: var(--db-surface);
  color: var(--db-text);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.tw-textarea {
  display: block;
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
  font-size: 14px;
}

.tw-input,
.tw-select,
.tw-inline-form select {
  height: 32px;
  padding: 0 10px;
}

.tw-select,
.tw-inline-form select {
  padding-right: 28px;
  appearance: none;
  background: var(--db-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  cursor: pointer;
}

.tw-textarea:focus,
.tw-input:focus,
.tw-select:focus,
.tw-inline-form select:focus {
  outline: none;
  border-color: var(--db-primary);
  box-shadow: 0 0 0 3px var(--db-primary-soft);
}

.tw-empty {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--db-text-faint);
}

.tw-inline-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.tw-inline-form select:first-child {
  flex: 0 0 130px;
}

.tw-inline-form select:only-of-type,
.tw-inline-form select + select {
  flex: 1;
  min-width: 0;
}

.tw-inline-form-tight {
  margin-top: 6px;
}

#task-details-modal .subtasks-list,
#task-details-modal .linked-issues-list,
#task-details-modal .attachments-list,
#task-details-modal .comments-list,
#task-details-modal .activity-log {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

#task-details-modal .subtask-item,
#task-details-modal .linked-issue-item,
#task-details-modal .attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 4px;
  border: none;
  border-bottom: 1px solid var(--db-border);
  border-radius: 0;
  background: none;
  font-size: 13px;
}

#task-details-modal .subtask-item:hover,
#task-details-modal .linked-issue-item:hover {
  background: var(--db-surface-hover);
}

#task-details-modal .subtask-title,
#task-details-modal .linked-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--db-text);
  text-decoration: none;
}

#task-details-modal .subtask-title.completed {
  color: var(--db-text-faint);
  text-decoration: line-through;
}

#task-details-modal .link-type {
  flex: 0 0 76px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--db-text-muted);
  text-transform: capitalize;
}

#task-details-modal .linked-issue-item.is-blocking .link-type {
  color: var(--db-warning-hover);
}

#task-details-modal .linked-task-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--db-primary);
  text-decoration: none;
}

.linked-task-state {
  font-size: 11.5px;
  color: var(--db-text-faint);
  white-space: nowrap;
}

#task-details-modal .btn-delete {
  border: none;
  background: none;
  color: var(--db-text-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  padding: 2px 6px;
}

#task-details-modal .subtask-item:hover .btn-delete,
#task-details-modal .linked-issue-item:hover .btn-delete {
  opacity: 1;
}

#task-details-modal .btn-delete:hover {
  color: var(--db-danger);
}

#task-details-modal .attachment-icon {
  display: flex;
  color: var(--db-text-faint);
}

#task-details-modal .attachment-name {
  flex: 1;
  font-weight: 550;
}

#task-details-modal .attachment-size {
  font-size: 12px;
  color: var(--db-text-faint);
}

/* Comments / activity tabs */
.tw-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--db-border);
}

.tw-tab {
  padding: 6px 0;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--db-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tw-tab.active {
  color: var(--db-primary);
  border-bottom-color: var(--db-primary);
}

.tw-comment-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 12px;
}

.tw-comment-box .tw-textarea {
  min-height: 64px;
}

#task-details-modal .comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border: none;
  border-top: 1px solid var(--db-border);
  background: none;
}

#task-details-modal .comment-content {
  flex: 1;
  min-width: 0;
}

#task-details-modal .comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

#task-details-modal .comment-author {
  font-size: 13px;
  font-weight: 650;
  color: var(--db-text);
}

#task-details-modal .comment-time {
  font-size: 11.5px;
  color: var(--db-text-faint);
}

#task-details-modal .comment-action {
  margin-left: auto;
  border: none;
  background: none;
  font-size: 11.5px;
  color: var(--db-text-faint);
  cursor: pointer;
}

#task-details-modal .comment-action:hover {
  color: var(--db-danger);
}

#task-details-modal .comment-text {
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--db-text);
}

#task-details-modal .activity-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border: none;
  background: none;
}

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--db-border-strong);
  flex-shrink: 0;
  transform: translateY(-1px);
}

#task-details-modal .activity-content {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
}

#task-details-modal .activity-text {
  font-size: 13px;
  color: var(--db-text);
}

#task-details-modal .activity-time {
  font-size: 11.5px;
  color: var(--db-text-faint);
  white-space: nowrap;
}

/* Emails Nodis linked to the task */
.activity-dot.is-email {
  background: var(--db-primary, #1e3a8a);
}

#task-details-modal .activity-email .activity-text a {
  color: var(--db-primary, #1e3a8a);
  text-decoration: none;
}

#task-details-modal .activity-email .activity-text a:hover {
  text-decoration: underline;
}

.activity-unlink {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--db-text-faint);
  cursor: pointer;
}

.activity-unlink:hover {
  color: var(--db-danger);
  text-decoration: underline;
}

/* Properties panel */
.tw-field {
  margin-bottom: 14px;
}

.tw-field:empty {
  display: none;
}

.tw-label,
#custom-fields-details-container .sidebar-label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--db-text-faint);
}

#custom-fields-details-container .sidebar-field {
  margin-bottom: 10px;
}

#custom-fields-details-container .meta-text {
  font-size: 13px;
  color: var(--db-text);
}

.tw-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tw-time label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  color: var(--db-text-muted);
}

.tw-time-bar {
  margin-top: 8px;
}

.tw-time-bar > span {
  display: block;
  height: 100%;
  background: var(--db-accent);
  border-radius: 3px;
}

#task-details-modal .labels-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  min-height: 0;
}

#task-details-modal .label-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 9px;
  border-radius: var(--db-radius-full);
  color: #fff;
  font-size: 11.5px;
  font-weight: 650;
}

#task-details-modal .label-remove {
  border: none;
  background: none;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
  font-size: 13px;
}

#task-details-modal .btn-add-label {
  height: 24px;
  padding: 0 9px;
  border: 1px dashed var(--db-border-strong);
  border-radius: var(--db-radius-full);
  background: none;
  color: var(--db-text-muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

#task-details-modal .btn-add-label:hover {
  border-color: var(--db-primary);
  color: var(--db-primary);
}

.tw-watchers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
}

.tw-watcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 3px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface);
  border: 1px solid var(--db-border);
}

.tw-watcher button {
  border: none;
  background: none;
  color: var(--db-text-faint);
  cursor: pointer;
}

.tw-meta {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--db-border);
}

.tw-meta div {
  font-size: 12px;
}

.tw-meta dd {
  font-weight: 500;
  color: var(--db-text-muted);
}

.tw-dl div {
  justify-content: flex-start;
}

.tw-dl dt {
  flex: 0 0 140px;
  color: var(--db-text-muted);
}

.tw-dl dd {
  margin: 0;
  white-space: pre-wrap;
}

/* Create-task modal: the real assignee field */
#task-assignee {
  width: 100%;
}

/* =====================================================================
   RESPONSIVE (workspace)
   ===================================================================== */

@media (max-width: 1180px) {
  .ov-grid,
  .sp-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ov-side,
  .sp-side {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .sp-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .sp-stats .sp-stats-pace {
    grid-column: 1 / -1;
    border-top: 1px solid var(--db-border);
  }
}

@media (max-width: 900px) {
  .tw-body {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .tw-main,
  .tw-side {
    overflow: visible;
  }

  .tw-side {
    border-left: none;
    border-top: 1px solid var(--db-border);
  }

  #task-details-modal.tw-sheet {
    top: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .ov-row {
    grid-template-columns: 56px minmax(0, 1fr) 110px;
  }

  .ov-row-person {
    display: none;
  }

  .mt-row {
    grid-template-columns: 20px 16px minmax(0, 1fr) 90px;
  }

  .mt-row .mt-project,
  .mt-row .tl-status {
    display: none;
  }

  .ws-search {
    flex: 1;
  }

  #gantt-view .gt-grid {
    --gt-label: 200px;
  }
}

/* Old list/timeline containers carried their own panel chrome (some with
   !important); the new panes provide it once. */
#list-view.tasks-list-view,
#gantt-view.tasks-gantt-view {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0;
}

#gantt-view .gantt-row {
  display: grid !important;
  gap: 0 !important;
  padding: 0 !important;
  border-radius: 0;
}

#gantt-view .gantt-task-info {
  flex-direction: row !important;
  justify-content: flex-start;
  text-align: left;
  width: auto;
  white-space: nowrap;
}

#gantt-view .gantt-bar-container {
  background: none !important;
  border-radius: 0;
  flex: none;
}

#gantt-view .gt-head .gantt-bar-container,
#gantt-view .gt-head {
  background: var(--db-surface) !important;
}

/* Task attachments stored by Nervus (tasks.js) */
#task-details-modal .attachment-download {
  padding: 0;
  border: 0;
  background: none;
  color: var(--db-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#task-details-modal .attachment-download:hover {
  text-decoration: underline;
}

#task-details-modal .attachment-status {
  flex: none;
  padding: 1px 7px;
  border-radius: var(--db-radius-full);
  background: var(--db-surface-sunken);
  color: var(--db-text-muted);
  font-size: 11px;
  white-space: nowrap;
}

#task-details-modal .attachment-status.is-ok {
  background: var(--db-accent-soft);
  color: var(--db-accent-hover);
}

#task-details-modal .attachment-status.is-failed,
#task-details-modal .attachment-status.is-too_large,
#task-details-modal .attachment-status.is-not_saved {
  background: var(--db-danger-soft);
  color: var(--db-danger);
}

/* An attachment is one row (tasks.css still stacks .attachment-item as a card) */
#task-details-modal .attachment-item {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
}

#task-details-modal .attachment-icon {
  font-size: inherit;
}

#task-details-modal .attachment-name {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

/* ============ Projects from Jira ============ */
.pm-source-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--db-radius-full, 999px);
  background: var(--db-primary-soft);
  color: var(--db-primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  vertical-align: middle;
}
.pm-source-badge:hover {
  text-decoration: underline;
}
.pm-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pm-jira-setup p {
  margin: 2px 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
}
.pm-jira-setup a {
  color: var(--db-primary);
}
.pm-jira-own {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 13px;
}
.pm-jira-own-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pm-jira-own-row span:first-child {
  flex: 1;
  min-width: 0;
}
.pm-jira-add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pm-jira-add input {
  flex: 1 1 140px;
  min-width: 0;
}
#tw-delete-task:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =====================================================================
   History tab (Organizational Memory): pm-tasks.js renderActivity
   ===================================================================== */

.hist {
  max-width: 980px;
}

.hist-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--db-border);
}

.hist-head .pm-panel-title-lg {
  margin: 0;
}

.hist-sub {
  margin: 4px 0 0;
  max-width: 560px;
  font-size: 12.5px;
  color: var(--db-text-muted);
}

.hist-note {
  margin: 0;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--db-text-muted);
  background: var(--db-surface-sunken);
  border-bottom: 1px solid var(--db-border);
}

.hist-loading {
  padding: 24px 16px;
  font-size: 13px;
  color: var(--db-text-muted);
}

.hist-body {
  padding: 4px 0 10px;
}

.hist-day {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  border-bottom: 1px solid var(--db-border);
}

.hist-day:last-child {
  border-bottom: none;
}

.hist-date {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 650;
  color: var(--db-text);
  font-variant-numeric: tabular-nums;
}

.hist-items {
  position: relative;
  padding: 4px 0;
}

/* the line the markers sit on */
.hist-items::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 19px;
  width: 1px;
  background: var(--db-border);
}

.hist-row {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 8px 16px 8px 13px;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--db-text);
  text-decoration: none;
}

.hist-row.is-link {
  cursor: pointer;
}

.hist-row.is-link:hover {
  background: var(--db-surface-hover);
}

.hist-row:focus-visible {
  outline: 2px solid var(--db-primary);
  outline-offset: -2px;
}

.hist-mark {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin: 4px 0 0 2px;
  border-radius: 50%;
  border: 2px solid var(--db-surface);
  box-shadow: 0 0 0 1px var(--db-border-strong);
  background: var(--db-border-strong);
}

.hist-m-decision {
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--db-primary);
  box-shadow: 0 0 0 1px var(--db-primary);
}

.hist-m-replaced {
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--db-surface);
  box-shadow: 0 0 0 1px var(--db-text-faint);
}

.hist-m-meeting {
  background: var(--db-surface);
  box-shadow: 0 0 0 1.5px var(--db-primary);
}

.hist-m-done {
  background: var(--db-accent);
  box-shadow: 0 0 0 1px var(--db-accent);
}

.hist-m-project {
  background: var(--db-text-muted);
  box-shadow: 0 0 0 1px var(--db-text-muted);
}

.hist-main {
  min-width: 0;
}

.hist-text {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hist-row:has(.hist-m-decision) .hist-text {
  font-weight: 600;
}

.hist-row:has(.hist-m-replaced) .hist-text {
  color: var(--db-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--db-text-faint);
}

.hist-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--db-text-faint);
}

.hist-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--db-radius-full);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.5;
  color: var(--db-text-muted);
  background: var(--db-surface-sunken);
  border: 1px solid var(--db-border);
  white-space: nowrap;
}

.hist-tag.is-good {
  color: var(--db-accent-hover);
  background: var(--db-accent-soft);
  border-color: transparent;
}

.hist-tag.is-warn {
  color: var(--db-warning-hover);
  background: var(--db-warning-soft);
  border-color: transparent;
}

.hist-go {
  align-self: center;
  font-size: 16px;
  color: var(--db-text-faint);
}

/* the decision side panel */
.hist-decision {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  color: var(--db-text);
}

.hist-status {
  margin: 8px 0 16px;
  font-size: 12px;
  font-weight: 650;
}

.hist-status.is-good {
  color: var(--db-accent-hover);
}

.hist-status.is-warn {
  color: var(--db-warning-hover);
}

.hist-facts {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0 0 8px;
  padding: 12px 0;
  border-top: 1px solid var(--db-border);
  border-bottom: 1px solid var(--db-border);
  font-size: 13px;
}

.hist-facts dt {
  color: var(--db-text-muted);
  font-size: 12px;
}

.hist-facts dd {
  margin: 0;
  min-width: 0;
}

.hist-facts a,
.hist-sec a {
  color: var(--db-primary);
}

.hist-sec {
  padding: 14px 0 4px;
}

.hist-sec h3 {
  margin: 0 0 8px;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
  color: var(--db-text-faint);
}

.hist-quote {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--db-primary);
  background: var(--db-primary-soft);
  border-radius: 0 var(--db-radius-sm) var(--db-radius-sm) 0;
  font-size: 13px;
  color: var(--db-text);
}

.hist-small {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
}

.hist-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.hist-list li + li {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .hist-day {
    grid-template-columns: 1fr;
  }

  .hist-date {
    padding: 12px 16px 2px;
  }
}

/* Overview › Status note (approved from a draft Nodis wrote after a meeting) */
.ov-note .pm-panel-body p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: var(--db-text); }

/* ===== Tidy up and bulk update (task-tidy.js) ===== */
.ws-tidy { margin-left: auto; }
.tasks-table th.tl-select, .tasks-table td.tl-select { width: 28px; padding-right: 0; }
.tasks-table tr.is-selected td { background: var(--db-primary-soft); }
.ws-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--db-primary) 35%, var(--db-border)); border-radius: var(--db-radius-sm, 8px); background: var(--db-primary-soft); font-size: 12.5px; }
.ws-bulk[hidden] { display: none; }
.ws-bulk strong { margin-right: 4px; color: var(--db-primary); }
.ws-bulk select, .ws-bulk input { max-width: 190px; padding: 4px 8px; border: 1px solid var(--db-border); border-radius: 6px; background: var(--db-surface); color: var(--db-text); font: inherit; }
.tidy-intro { margin: 0 0 12px; color: var(--db-text-muted); font-size: 13px; }
.tidy-group { padding: 12px 0; border-top: 1px solid var(--db-border); }
.tidy-group:first-of-type { border-top: 0; padding-top: 0; }
.tidy-tasks { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.tidy-tasks li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; font-size: 13px; }
.tidy-title { font-weight: 600; color: var(--db-text); }
.tidy-meta { grid-column: 2; color: var(--db-text-muted); font-size: 11.5px; }
.tidy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tidy-actions label { display: inline-flex; align-items: center; gap: 6px; color: var(--db-text-muted); font-size: 12px; }
.tidy-actions select { max-width: 220px; padding: 4px 8px; border: 1px solid var(--db-border); border-radius: 6px; font: inherit; font-size: 12px; }
.tidy-note { margin: 6px 0 0; color: var(--db-text-muted); font-size: 11.5px; }
