.task-workspace {
  width: min(1120px, calc(100% - 32px));
  margin: 22px auto 72px;
}

.task-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid #c7d9e4;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbfd, #edf5f9);
}

.task-command h1 {
  margin: 2px 0 3px;
  color: var(--navy);
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  letter-spacing: -.04em;
  line-height: 1.05;
}

.task-command #todayLabel {
  margin: 0;
  color: var(--muted);
}

.task-command .workweek-note {
  margin: 5px 0 0;
  color: #286487;
  font-size: .76rem;
  font-weight: 800;
}

.command-actions {
  display: flex;
  gap: 9px;
}

.command-actions a {
  text-decoration: none;
}

.task-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.task-metric {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: none;
}

.task-metric strong {
  font-size: 1.3rem;
  line-height: 1.1;
}

.task-metric span {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-section {
  margin-top: 0;
  padding: 22px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(20, 59, 91, .06);
}

.queue-heading {
  align-items: center;
  margin-bottom: 14px;
}

.queue-heading h2 {
  margin: 2px 0;
  font-size: 1.45rem;
}

.queue-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.task-tabs {
  flex: 0 0 auto;
}

.queue-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 210px;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: #f3f7f9;
}

.queue-tools label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #5b6878;
  font-size: .74rem;
}

.queue-tools input,
.queue-tools select {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
}

.queue-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  font-size: .83rem;
}

.task-list {
  gap: 10px;
}

.outreach-task {
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(20, 59, 91, .04);
}

.outreach-task.overdue {
  border-left: 4px solid #c83434;
}

.outreach-task.waiting {
  border-left: 4px solid #3179a7;
}

.outreach-task.waiting .due-pill {
  background: #e5f0f7;
  color: #205d83;
}

.task-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  background: #fbfdfe;
}

.task-identity {
  min-width: 0;
}

.task-card-head h3 {
  margin: 2px 0;
  overflow: hidden;
  color: #172033;
  font-size: 1.08rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-head p {
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-step {
  font-size: .67rem;
}

.task-card-meta {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.sequence-pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: #e7f0f6;
  color: #205d83;
  font-size: .72rem;
  font-weight: 850;
  white-space: nowrap;
}

.task-card-body {
  padding: 14px 16px 16px;
}

.task-channel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.task-subject-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  margin-top: 11px;
  padding: 9px 11px;
  border: 1px solid #d8e4eb;
  border-radius: 9px;
  background: #f8fbfc;
}

.task-subject-line span {
  color: var(--blue);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.task-subject-line strong {
  min-width: 0;
  color: #172033;
  font-size: .86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.channel-summary {
  min-width: 0;
}

.channel-summary small,
.channel-summary strong {
  display: block;
}

.channel-summary small {
  color: var(--blue);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.channel-summary strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: .87rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-warning {
  color: #935700;
}

.task-channel-bar .hermes-status {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e7edf2;
  color: #536276;
  font-size: .66rem;
  font-weight: 850;
}

.task-channel-bar .hermes-valid { background: #dff4e5; color: #126b39; }
.task-channel-bar .hermes-invalid,
.task-channel-bar .hermes-error { background: #fde0e0; color: #a82727; }
.task-channel-bar .hermes-catch-all,
.task-channel-bar .hermes-unknown,
.task-channel-bar .hermes-pending { background: #fff0bf; color: #805b00; }

.task-quick-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.task-quick-actions button,
.task-quick-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 8px 11px;
  font-size: .8rem;
  font-weight: 850;
  text-decoration: none;
}

.mark-sent {
  margin-left: 0;
  background: var(--navy);
  color: #fff;
}

.manual-complete {
  background: #fff3d6;
  color: #754f00;
  box-shadow: inset 0 0 0 1px #e5c66f;
}

.message-details,
.stop-details {
  margin-top: 11px;
  border-top: 1px solid #e8eef2;
  padding-top: 10px;
}

.message-details summary,
.stop-details summary {
  color: var(--blue);
  cursor: pointer;
  font-size: .79rem;
  font-weight: 850;
  list-style-position: inside;
}

.message-box {
  margin-top: 9px;
}

.message-box pre {
  max-height: 340px;
  padding: 14px;
  overflow: auto;
  font-size: .88rem;
  line-height: 1.5;
}

.task-note {
  margin-top: 8px;
  font-size: .76rem;
}

.connection-request-status {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #b9d5e6;
  border-radius: 9px;
  background: #eef6fa;
  color: #205d83;
  font-size: .76rem;
  line-height: 1.4;
}

.connection-request-status span {
  color: #4f6575;
}

.stop-row {
  justify-content: flex-start;
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.done-card {
  justify-content: flex-start;
  padding: 13px 14px;
}

.done-card-channel {
  margin-left: auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f0f6;
  color: #205d83;
  font-size: .7rem;
  font-weight: 850;
  text-transform: capitalize;
}

.load-more-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e8eef2;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
}

.task-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(8, 30, 46, .28);
}

.task-dialog::backdrop {
  background: rgba(8, 30, 46, .58);
  backdrop-filter: blur(3px);
}

.task-dialog form {
  position: relative;
  padding: 26px;
}

.task-dialog h2 {
  margin: 3px 0 8px;
  font-size: 1.55rem;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #edf3f7;
  color: var(--navy);
  font-size: 1.35rem;
}

.completion-summary {
  margin: 0 0 14px;
  color: var(--muted);
}

.recorded-channel {
  padding: 12px 14px;
  border-radius: 11px;
  background: #edf5f9;
  color: var(--navy);
  font-weight: 800;
}

.manual-completion {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e6c978;
  border-radius: 12px;
  background: #fff9e8;
}

.manual-completion p {
  margin: 0;
  color: #674d0a;
  font-size: .84rem;
}

.manual-email-field {
  display: grid;
  gap: 6px;
  padding: 11px;
  border-radius: 10px;
  background: #fff;
}

.manual-email-field p {
  color: #286487;
  font-size: .74rem;
  font-weight: 750;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

#confirmCompletionButton:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 860px) {
  .task-metrics {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .task-metrics::-webkit-scrollbar { display: none; }
  .task-metric { flex: 0 0 132px; }
}

@media (max-width: 680px) {
  .task-workspace {
    width: min(100% - 20px, 600px);
    margin-top: 10px;
  }

  .task-command {
    padding: 12px 13px;
  }

  .task-command h1 { margin-top: 0; font-size: 1.45rem; }
  .task-command .eyebrow { display: none; }
  .task-command #todayLabel { font-size: .76rem; }
  .task-command .workweek-note { max-width: 235px; font-size: .67rem; line-height: 1.3; }
  .command-actions { gap: 6px; }
  .command-actions .ghost { padding: 7px 9px; font-size: .76rem; text-align: center; white-space: nowrap; }

  .task-metrics { margin: 9px 0; }
  .task-metric { flex-basis: 112px; padding: 10px 11px; }

  .queue-section { padding: 14px 10px; }
  .queue-heading { gap: 0; margin-bottom: 8px; }
  .queue-heading > div:first-child { display: none; }
  .task-tabs { width: 100%; }
  .task-tabs button { flex: 1; padding: 8px; }

  .queue-tools { grid-template-columns: minmax(0, 1fr) 125px; gap: 6px; padding: 6px; }
  .queue-tools label { display: block; }
  .queue-tools label > span { display: none; }
  .queue-tools input,
  .queue-tools select { padding: 8px; font-size: .8rem; }
  .queue-notice { padding: 8px 9px; font-size: .75rem; line-height: 1.35; }

  .task-card-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .task-card-meta { justify-content: space-between; }
  .task-card-body { padding: 11px 12px 13px; }
  .task-channel-bar { align-items: stretch; flex-direction: column; }
  .task-quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .task-quick-actions .mark-sent,
  .task-quick-actions .manual-complete { grid-column: 1 / -1; }
  .task-quick-actions button,
  .task-quick-actions a { width: 100%; }
  .message-box pre { max-height: 280px; }
  .stop-row { align-items: stretch; }
  .stop-row label { display: none; }
  .stop-row select { min-width: 0; }
  .task-dialog form { padding: 24px 18px 18px; }
  .dialog-actions button { flex: 1; }
}
