/* Tasks hub — work queue (light + dark via finish overrides) */
#tasksWrap.tasksPane,
#tasksWrap.tasks-hub-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: calc(100vh - 60px);
  overflow: hidden;
  background: var(--surface-0, #fff);
  color: var(--text-primary, #0f172a);
}

.app-shell.full-width-view #tasksWrap.tasksPane,
.app-shell.full-width-view #tasksWrap.tasks-hub-pane,
.app-shell[data-view="tasks"] #tasksWrap {
  width: 100%;
  max-width: 100%;
}

.app-shell.filters-visible[data-view="tasks"] #tasksWrap.tasksPane,
.app-shell.filters-visible[data-view="tasks"] #tasksWrap.tasks-hub-pane,
.app-shell.filters-visible[data-view="tasks"] #tasksWrap {
  max-height: none;
  height: 100%;
}

#tasksWrap.hidden {
  display: none !important;
}

.tasks-hub {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 12px 20px 24px;
  box-sizing: border-box;
}

.tasks-hub--shared-header {
  padding-top: 8px;
}

.tasks-hub__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.08));
  margin-bottom: 12px;
}

.tasks-hub__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tasks-hub__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}

.tasks-hub__stats {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
}

.tasks-hub__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tasks-hub--shared-header .tasks-hub__toolbar {
  margin-bottom: 10px;
}

.tasks-hub--shared-header .tasks-hub__filters {
  flex: 1 1 auto;
  min-width: 0;
}

.tasks-hub--shared-header .tasks-hub__stats {
  margin-left: auto;
}

.tasks-hub__search {
  flex: 1 1 220px;
  min-width: 180px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--surface-1, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 13px;
}

.tasks-hub__filters {
  display: inline-flex;
  gap: 4px;
}

.tasks-hub__owner-scope {
  display: inline-flex;
  gap: 4px;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--border, rgba(15, 23, 42, 0.12));
}

.tasks-hub__filter {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.tasks-hub__filter:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-primary, #0f172a);
}

.tasks-hub__filter.is-active {
  color: var(--text-primary, #0f172a);
  border-bottom: 2px solid #64748b;
  border-radius: 0;
}

.tasks-hub__filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary, #64748b);
  font-variant-numeric: tabular-nums;
}

.tasks-hub__filter-count[hidden] {
  display: none !important;
}

.tasks-hub__filter.is-active .tasks-hub__filter-count {
  background: rgba(15, 23, 42, 0.12);
  color: var(--text-primary, #0f172a);
}

.tasks-hub__range {
  position: relative;
  display: inline-flex;
}

.tasks-hub__range-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tasks-hub__range-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  opacity: 1;
  color: var(--text-secondary, #64748b);
  transform: translateY(-0.5px);
  margin-left: 1px;
}

.tasks-hub__range-btn:hover .tasks-hub__range-chevron,
.tasks-hub__range-btn.is-active .tasks-hub__range-chevron {
  color: var(--text-primary, #0f172a);
}

.tasks-hub__range-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 124px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--surface-0, #fff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tasks-hub__range-menu[hidden] {
  display: none !important;
}

.tasks-hub__range-option {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
}

.tasks-hub__range-option:hover {
  background: rgba(15, 23, 42, 0.05);
}

.tasks-hub__range-option.is-selected {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.tasks-hub__cal-link {
  appearance: none;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.tasks-hub__add-link {
  appearance: none;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.tasks-hub__add-link:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.45);
}

.tasks-hub__composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 12px 12px 10px;
  border-top: 1px solid var(--border, rgba(15, 23, 42, 0.08));
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.08));
  background: var(--surface-0, #fff);
}

.tasks-hub__composer[hidden] {
  display: none !important;
}

.tasks-hub__composer.is-saving {
  opacity: 0.72;
  pointer-events: none;
}

.tasks-hub__composer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tasks-hub__composer-title {
  flex: 1 1 220px;
  min-width: 180px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--surface-1, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 14px;
  font-weight: 550;
}

.tasks-hub__composer-for-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 200px;
}

.tasks-hub__composer-for-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
}

.tasks-hub__composer-for {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.tasks-hub__for-picker {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
}

.tasks-hub__for-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--surface-1, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 13px;
  box-sizing: border-box;
}

.tasks-hub__for-input[hidden] {
  display: none !important;
}

.tasks-hub__for-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 38px;
  padding: 0 6px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: rgba(15, 23, 42, 0.03);
}

.tasks-hub__for-chip-wrap[hidden] {
  display: none !important;
}

.tasks-hub__for-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
}

.tasks-hub__for-chip-type {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
}

.tasks-hub__for-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.tasks-hub__for-chip-clear {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.tasks-hub__for-chip-clear:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary, #0f172a);
}

.tasks-hub__for-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: min(52vh, 280px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--surface-0, #fff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.tasks-hub__for-results[hidden] {
  display: none !important;
}

.tasks-hub__for-result {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  text-align: left;
  padding: 9px 10px;
  border: none;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.06));
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.tasks-hub__for-result:last-child {
  border-bottom: none;
}

.tasks-hub__for-result:hover,
.tasks-hub__for-result.is-active {
  background: rgba(15, 23, 42, 0.04);
}

.tasks-hub__for-result-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
}

.tasks-hub__for-result-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tasks-hub__for-result-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-hub__for-result-meta {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-hub__for-picker.is-shake {
  animation: tasks-hub-shake 0.34s ease;
}

@keyframes tasks-hub-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.tasks-hub__composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tasks-hub__composer-due {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tasks-hub__composer-due-custom {
  display: inline-flex;
  align-items: center;
}

.tasks-hub__composer-due-custom[hidden] {
  display: none !important;
}

.tasks-hub__composer-due-date,
.tasks-hub__composer-due-time {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: var(--surface-1, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 12px;
  font-weight: 550;
  box-sizing: border-box;
}

.tasks-hub__composer-due-date {
  min-width: 136px;
}

.tasks-hub__composer-due-time {
  display: inline-block !important;
  width: 96px !important;
  max-width: 96px !important;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0 8px;
  color-scheme: light dark;
}

.tasks-hub__composer-due-chip {
  appearance: none;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.tasks-hub__composer-due-chip:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-primary, #0f172a);
}

.tasks-hub__composer-due-chip.is-active {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(239, 246, 255, 0.85);
}

.tasks-hub__composer-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tasks-hub__composer-hint {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.tasks-hub__composer-more,
.tasks-hub__composer-save {
  appearance: none;
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.tasks-hub__composer-save {
  color: #047857;
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(236, 253, 245, 0.85);
}

.tasks-hub__composer-more:hover {
  background: rgba(37, 99, 235, 0.06);
}

.tasks-hub__composer-save:hover {
  background: rgba(236, 253, 245, 1);
}

.tasks-hub__empty-add {
  appearance: none;
  margin-top: 12px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.tasks-hub__empty-add:hover {
  background: rgba(37, 99, 235, 0.06);
}

.tasks-hub__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scroll-padding-top: 8px;
}

.tasks-hub__agenda {
  padding-bottom: 28px;
}

.tasks-hub__empty {
  padding: 28px 8px;
  border-top: 1px solid var(--border, rgba(15, 23, 42, 0.06));
  color: var(--text-secondary, #64748b);
}

.tasks-hub__empty h2 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text-primary, #0f172a);
}

.tasks-hub__empty p {
  margin: 0;
  font-size: 13px;
}

.tasks-hub__section {
  margin-bottom: 4px;
}

.tasks-hub__section-title {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 8px 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.06));
  background: color-mix(in srgb, var(--surface-0, #fff) 92%, transparent);
  backdrop-filter: blur(8px);
}

.tasks-hub__section-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-hub__section-count {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary, #64748b);
}

.tasks-hub__section--overdue .tasks-hub__section-count {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.tasks-hub__section--today .tasks-hub__section-count {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.tasks-hub__rows {
  display: flex;
  flex-direction: column;
}

.tasks-hub__row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 11px 8px;
  min-height: 54px;
  border: none;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.06));
  border-left: 2px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition:
    background 0.12s ease,
    opacity 0.18s ease,
    transform 0.18s ease,
    max-height 0.2s ease,
    padding 0.2s ease,
    border-color 0.12s ease;
}

.tasks-hub__row:hover,
.tasks-hub__row:focus-within {
  background: rgba(15, 23, 42, 0.03);
}

.tasks-hub__row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: -2px;
}

.tasks-hub__row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.tasks-hub__row-actions--empty {
  min-width: 0;
}

.tasks-hub__row:hover .tasks-hub__row-actions:not(.tasks-hub__row-actions--empty),
.tasks-hub__row:focus-within .tasks-hub__row-actions:not(.tasks-hub__row-actions--empty) {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .tasks-hub__row-actions:not(.tasks-hub__row-actions--empty) {
    opacity: 1;
    pointer-events: auto;
  }
}

.tasks-hub__action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface-0, #fff);
  color: var(--text-primary, #0f172a);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.tasks-hub__action:hover {
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}

.tasks-hub__action--call:hover {
  border-color: rgba(5, 150, 105, 0.4);
  color: #047857;
}

.tasks-hub__action--email:hover {
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
}

.tasks-hub__row--overdue {
  border-left-color: #f87171;
}

.tasks-hub__row-mark {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary, #64748b);
  border: 1.5px solid rgba(100, 116, 139, 0.45);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 2px;
}

.tasks-hub__row-mark:hover {
  border-color: rgba(5, 150, 105, 0.55);
  background: #ecfdf5;
  color: #047857;
}

.tasks-hub__row-mark:hover span {
  visibility: hidden;
  position: relative;
}

.tasks-hub__row-mark:hover span::after {
  content: "✓";
  visibility: visible;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tasks-hub__row--overdue .tasks-hub__row-mark {
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(254, 242, 242, 0.65);
}

.tasks-hub__row--overdue .tasks-hub__row-mark:hover {
  color: #047857;
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.45);
}

.tasks-hub__row.is-completing {
  opacity: 0.55;
  pointer-events: none;
}

.tasks-hub__row.is-completing-out {
  opacity: 0;
  transform: translateX(12px);
  max-height: 0;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
  overflow: hidden;
  pointer-events: none;
}

.tasks-hub__action--done:hover {
  border-color: rgba(5, 150, 105, 0.4);
  color: #047857;
}

.tasks-hub__action--done-new:hover {
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
}

.tasks-hub__row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tasks-hub__row-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-primary, #0f172a);
}

.tasks-hub__row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  overflow: hidden;
  white-space: nowrap;
}

/* Phone / email / title — same meta line on highlight (no vertical bounce) */
.tasks-hub__row-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
  transition:
    max-width 0.16s ease,
    opacity 0.12s ease;
}

.tasks-hub__row:hover .tasks-hub__row-contact,
.tasks-hub__row:focus-within .tasks-hub__row-contact {
  max-width: 36rem;
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .tasks-hub__row-contact {
    max-width: 36rem;
    opacity: 1;
    pointer-events: auto;
  }
}

.tasks-hub__contact-link {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
  flex-shrink: 1;
  border-bottom: 1px solid transparent;
}

.tasks-hub__contact-link:hover {
  color: #1d4ed8;
  border-bottom-color: rgba(37, 99, 235, 0.35);
}

.tasks-hub__contact-plain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  max-width: 10rem;
}

.tasks-hub__contact-sep {
  opacity: 0.45;
  flex-shrink: 0;
}

.tasks-hub__meta-name,
.tasks-hub__meta-rest,
.tasks-hub__meta-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-hub__chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tasks-hub__chip--deal {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.tasks-hub__chip--project {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.28);
}

.tasks-hub__row-when {
  justify-self: end;
  font-size: 11px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  color: #475569;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  text-align: center;
}

.tasks-hub__row-when--overdue {
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(254, 242, 242, 0.7);
}

.tasks-hub__row-when--today {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(239, 246, 255, 0.85);
}

.tasks-hub__row-when--tomorrow {
  color: #0f766e;
  border-color: rgba(20, 184, 166, 0.35);
  background: rgba(240, 253, 250, 0.85);
}

/* Nav badge */
#menuTasksBtn .menuBtn-badge,
.mobile-more-item[data-more-view="tasks"] .menuBtn-badge {
  display: none;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
}

#menuTasksBtn .menuBtn-badge.is-on,
.mobile-more-item[data-more-view="tasks"] .menuBtn-badge.is-on {
  display: inline-flex;
}

/* Web Inquiries nav badge — same pill format as Tasks, red circle */
#menuLeadsBtn .menuBtn-badge,
.nav-more-item[data-nav="leads"] .menuBtn-badge,
.mobile-more-item[data-more-view="leads"] .menuBtn-badge {
  display: none;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: #ef4444;
  color: #fff;
  box-shadow: none;
  animation: none;
  position: static;
  top: auto;
  right: auto;
}

#menuLeadsBtn .menuBtn-badge.is-on,
.nav-more-item[data-nav="leads"] .menuBtn-badge.is-on,
.mobile-more-item[data-more-view="leads"] .menuBtn-badge.is-on {
  display: inline-flex;
}

/* ── Mobile Tasks hub ───────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .tasks-hub {
    padding: 12px 14px 20px;
  }

  .tasks-hub__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .tasks-hub__title {
    font-size: 20px;
  }

  .tasks-hub__subtitle {
    font-size: 12px;
  }

  .tasks-hub__stats {
    white-space: normal;
    font-size: 12px;
    line-height: 1.35;
  }

  .tasks-hub__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .tasks-hub__search {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 40px;
    font-size: 16px; /* avoid iOS zoom */
  }

  .tasks-hub__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
  }

  .tasks-hub__owner-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    padding-left: 0;
    margin-left: 0;
    border-left: none;
    padding-top: 4px;
    border-top: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  }

  .tasks-hub__filter {
    flex: 1 1 auto;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
  }

  .tasks-hub__cal-link {
    align-self: stretch;
    min-height: 36px;
    justify-content: center;
  }

  .tasks-hub__add-link {
    align-self: stretch;
    min-height: 36px;
  }

  .tasks-hub__composer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tasks-hub__composer-title,
  .tasks-hub__composer-for-wrap {
    width: 100%;
    min-width: 0;
  }

  .tasks-hub__composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tasks-hub__composer-cta {
    margin-left: 0;
    justify-content: space-between;
  }

  .tasks-hub__section-title {
    padding: 10px 4px 6px;
    font-size: 10px;
  }

  /* mark | main+when stacked; actions as a stable second row (always visible) */
  .tasks-hub__row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
      "mark main when"
      "mark actions actions";
    gap: 6px 10px;
    align-items: start;
    padding: 12px 6px;
    min-height: 0;
  }

  .tasks-hub__row-mark {
    grid-area: mark;
    margin-top: 2px;
  }

  .tasks-hub__row-main {
    grid-area: main;
    min-width: 0;
  }

  .tasks-hub__row-when {
    grid-area: when;
    align-self: start;
    margin-top: 1px;
    min-width: 0;
    padding: 3px 8px;
    font-size: 10px;
  }

  .tasks-hub__row-actions,
  .tasks-hub__row-actions--empty {
    grid-area: actions;
    justify-self: start;
    opacity: 1;
    pointer-events: auto;
    flex-wrap: wrap;
  }

  .tasks-hub__action {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }

  .tasks-hub__row-title {
    font-size: 14px;
    line-height: 1.3;
  }

  .tasks-hub__row-meta {
    gap: 4px;
    font-size: 11px;
  }

  /* Contact always on the meta line — never a third row that shifts Done */
  .tasks-hub__row-contact {
    max-width: 18rem;
    opacity: 1;
    pointer-events: auto;
  }

  .tasks-hub__contact-link,
  .tasks-hub__contact-plain {
    max-width: 9rem;
  }

  .tasks-hub__meta-name,
  .tasks-hub__meta-rest {
    max-width: 42%;
  }
}

@media (max-width: 420px) {
  .tasks-hub__contact-link,
  .tasks-hub__contact-plain {
    max-width: 7.5rem;
  }
}
