/* Task surfaces use a slightly larger type scale and stronger visual boundaries. */
.board {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 20px;
  padding-top: 26px;
}

.column {
  min-width: 280px;
  padding: 16px;
  border: 1px solid #e1e0e8;
  border-radius: 14px;
  background: #efeff4;
}

.column-head {
  min-height: 36px;
  padding: 0 2px 14px;
  font-size: 14px;
}

.column-head .total {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dfdee7;
  color: #656370;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.column-head .add-task {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  min-height: 32px;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid #d3cbed;
  border-radius: 8px;
  background: #fff;
  color: #6048c8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.column-head .add-task:hover {
  border-color: #bdb0eb;
  background: #f8f6ff;
  color: #5138bb;
}

.cards { gap: 12px; }

.task-card {
  padding: 17px;
  border-color: #dcdae4;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(37, 34, 53, .05);
}

.task-card:hover {
  border-color: #c7c1de;
  box-shadow: 0 12px 30px rgba(32, 25, 64, .11);
}

.task-card h3 {
  margin-bottom: 8px;
  color: #292632;
  font: 700 15px/1.45 Manrope, sans-serif;
}

.task-card > p {
  margin-bottom: 14px;
  color: #686572;
  font-size: 13px;
  line-height: 1.55;
}

.card-title { gap: 10px; }

.edit-task,
.view-task {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
}

.card-meta {
  min-height: 30px;
  margin-top: 15px;
  padding-top: 12px;
  color: #777380;
  font-size: 12px;
}

.delete-task {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -5px -6px -5px 6px;
  border-radius: 7px;
  font-size: 18px;
}

.delete-task:hover {
  background: #f8e9ea;
  color: #b74750;
}

.empty {
  padding: 28px 8px;
  font-size: 13px;
}

.execution-state {
  margin-top: 14px;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.4;
}

.codex-panel { margin-top: 14px; }

.codex-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 14px 0 0;
  padding: 9px 10px 10px;
}

.codex-summary-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(145deg, #8064ed, #5b3dca);
  color: #fff;
  font-size: 12px;
}

.codex-summary-copy {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #5f5969;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-summary .agent-state {
  flex: 0 0 auto;
  margin-left: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: #ebe6ff;
  color: #684bcf;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.codex-summary .agent-state.completed { background: #dff3e9; color: #247b5c; }
.codex-summary .agent-state.failed { background: #fae1e2; color: #b44049; }
.codex-summary .agent-state.queued { background: #eeeaf3; color: #746b80; }
.codex-summary .agent-state.verifying { background: #dff1fa; color: #2c7397; }
.codex-summary.waiting { border-color: #f0c36d; background: #fffaf0; box-shadow: 0 0 0 2px #fef3c7; }
.codex-summary .agent-state.waiting { background: #fef3c7; color: #a65308; }

.codex-summary .agent-state > i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: agentPulse 1.1s infinite;
}

.codex-summary .agent-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
}

.codex-summary .retry-codex {
  flex: 0 0 auto;
  min-height: 26px;
  margin-left: 0;
  padding: 3px 5px;
}

.codex-head { gap: 10px; padding: 13px; }

.codex-logo {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.codex-head strong { font-size: 13px; }

.codex-head small {
  max-width: 160px;
  margin-top: 2px;
  font-size: 11px;
}

.codex-head .agent-state {
  padding: 5px 8px;
  font-size: 10px;
}

.agent-timeline { padding: 12px 14px 6px; }

.agent-timeline li {
  grid-template-columns: 9px 1fr;
  gap: 8px;
  padding-bottom: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.codex-foot {
  min-height: 36px;
  padding: 7px 13px 9px;
  font-size: 11px;
}

.retry-codex {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 11px;
}

.archive-task {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

dialog {
  max-height: min(88vh, 900px);
  border: 1px solid #e1dfe8;
  border-radius: 18px;
  overflow: auto;
}

dialog form,
.task-detail-shell { padding: 32px; }

.modal-head { align-items: flex-start; gap: 20px; }

.modal-head h2 { font-size: 24px; }

.modal-head button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}

dialog label { font-size: 13px; }

dialog input,
dialog textarea,
dialog select {
  min-height: 46px;
  padding: 12px 13px;
  font-size: 14px;
}

dialog textarea { min-height: 108px; }

.task-attachments {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed #cec8df;
  border-radius: 11px;
  background: #faf9fd;
}

.task-attachments.has-attachments {
  border-style: solid;
  border-color: #d9d2ee;
  background: #f8f6ff;
}

.attachment-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #625b70;
}

.attachment-hint > span:first-child {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ebe6fb;
  color: #664aca;
  font-size: 17px;
}

.attachment-hint > span:last-child { display: grid; gap: 2px; }
.attachment-hint strong { font-size: 12px; }
.attachment-hint small { color: #888292; font-size: 11px; }

.task-attachment-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.task-attachment-list:empty { display: none; }

.task-attachment-preview {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d9d5e2;
  border-radius: 9px;
  background: #fff;
}

.task-attachment-preview img {
  display: block;
  width: 100%;
  height: 82px;
  object-fit: cover;
  background: #eeedf2;
}

.task-attachment-preview figcaption {
  display: grid;
  gap: 1px;
  padding: 7px 8px;
}

.task-attachment-preview figcaption strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-attachment-preview figcaption small { color: #8a8590; font-size: 9px; }

.task-attachment-preview button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #fff8;
  border-radius: 50%;
  background: #292632d9;
  color: #fff;
  font-size: 16px;
}

.task-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.task-screenshot-grid a {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #ddd8e7;
  border-radius: 9px;
  background: #f7f6f9;
  color: #5c5567;
  text-decoration: none;
}

.task-screenshot-grid img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #eeedf2;
}

.task-screenshot-grid span {
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-actions { gap: 10px; margin-top: 8px; }

.modal-actions button { min-height: 42px; }

.task-detail-modal { width: min(1120px, calc(100% - 48px)); max-width: 1120px; }

.task-log { gap: 20px; margin-top: 16px; }

.log-entry p,
.codex-answer { font-size: 14px; }

.log-entry.response > div:last-child {
  border-color: #dcd5ef;
  background: #fff;
  box-shadow: 0 8px 24px rgba(53, 39, 101, .07);
}

.codex-answer {
  padding: 16px 18px;
  border: 1px solid #e2dcf3;
  border-radius: 11px;
  background: linear-gradient(145deg, #fbfaff, #f7f4ff);
  color: #30293a;
  font-size: 15px;
  line-height: 1.7;
}

.rich-text { min-width: 0; overflow-wrap: anywhere; }
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p { margin: 0 0 12px; color: inherit; font-size: inherit; line-height: inherit; }
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 { margin: 20px 0 8px; color: #272131; font-family: Manrope, sans-serif; line-height: 1.35; }
.rich-text h2 { font-size: 20px; }
.rich-text h3 { font-size: 18px; }
.rich-text h4,
.rich-text h5,
.rich-text h6 { font-size: 16px; }
.rich-text ul,
.rich-text ol { margin: 8px 0 14px; padding-left: 24px; }
.rich-text li { margin: 5px 0; padding-left: 2px; }
.rich-text a { color: #6042c8; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.rich-text code { padding: 2px 5px; border-radius: 5px; background: #ece8f4; color: #46395a; font: .86em/1.5 'DM Mono', monospace; }
.rich-text pre,
.verification-details pre {
  max-width: 100%;
  margin: 12px 0;
  padding: 14px;
  overflow: auto;
  border-radius: 9px;
  background: #292633;
  color: #e6e1ed;
  font: 11px/1.65 'DM Mono', monospace;
  white-space: pre;
}
.rich-text pre code { padding: 0; background: none; color: inherit; font: inherit; }
.rich-text blockquote { margin: 12px 0; padding: 2px 0 2px 14px; border-left: 3px solid #a693ea; color: #625871; }
.rich-text hr { margin: 18px 0; border: 0; border-top: 1px solid #ddd6eb; }
.rich-table-scroll { max-width: 100%; margin: 12px 0; overflow-x: auto; }
.rich-text table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rich-text th,
.rich-text td { padding: 8px 10px; border: 1px solid #ddd7e8; }
.rich-text th { background: #eee9f8; color: #41364f; }

.verification-details {
  margin-top: 10px;
  border-top: 1px solid #ece8f1;
  color: #716a79;
  font-size: 11px;
}

.verification-details summary {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px 2px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.verification-details summary::-webkit-details-marker,
.execution-feed summary::-webkit-details-marker { display: none; }
.verification-details[open] summary span,
.execution-feed[open] .detail-chevron { transform: rotate(180deg); }
.verification-details pre { max-height: 240px; margin-bottom: 0; font-size: 10px; }

.log-status { padding: 5px 9px; font-size: 11px; }

.detail-activity { font-size: 12px; }

.execution-feed {
  margin: 4px 0 14px;
  overflow: hidden;
  border: 1px solid #e2deeb;
  border-radius: 11px;
  background: #f7f6fa;
}

.execution-feed > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin: 0;
  padding: 7px 11px;
  color: #514b5a;
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}

.execution-feed > summary > span:first-child { display: flex; align-items: baseline; gap: 7px; }
.execution-feed > summary small { color: #96909c; font-size: 9px; font-weight: 500; }
.execution-feed > summary .live-indicator { margin-left: auto; }
.detail-chevron { margin-left: auto; color: #8c8495; transition: transform .15s; }
.execution-feed[open] > summary { border-bottom: 1px solid #e7e3ed; }

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #694bd0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7459e5;
  box-shadow: 0 0 0 4px rgba(116, 89, 229, .12);
  animation: agentPulse 1.1s infinite;
}

.execution-feed ol {
  display: grid;
  gap: 6px;
  max-height: 260px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  list-style: none;
}

.codex-updates {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.codex-updates > header { color: #675d73; font-size: 11px; }

.codex-update {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #d4c9f7;
  border-radius: 10px;
  background: #f0ecff;
  color: #3e3157;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 3px 10px rgba(92, 67, 181, .08);
}

.codex-update .execution-event-icon { color: #684bd0; }

.execution-event {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #797380;
  font-size: 11px;
  line-height: 1.45;
}

.execution-event-icon {
  color: #958ba4;
  font-weight: 800;
  text-align: center;
}

.execution-event-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.execution-event.command {
  background: #efedf3;
  color: #716b78;
  font: 10px/1.55 'DM Mono', monospace;
}

.execution-event.result { color: #4f7768; }

.task-card button:focus-visible,
.column button:focus-visible,
dialog button:focus-visible,
dialog input:focus-visible,
dialog textarea:focus-visible,
dialog select:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .board { grid-template-columns: repeat(3, 290px); }
}

@media (max-width: 560px) {
  .task-detail-modal { width: calc(100% - 20px); }

  dialog form,
  .task-detail-shell { padding: 22px; }

  .task-create-actions { flex-wrap: wrap; }

  .task-create-actions button { flex: 1 1 120px; }

  .task-attachment-list,
  .task-screenshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
