
/* Ticket-centered agent workflow inspired by service desk thread conventions. */
.dialog:has(#nd-ticket-workflow) {
  width: min(1020px,100%);
}
.nd-ticket-workflow-head {
  display: flex;
  justify-content: space-between;
  margin: 28px 0 12px;
}
.nd-ticket-workflow-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: -.3px;
}
.nd-ticket-workflow-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.nd-ticket-work-stats {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  margin: 15px 0 20px;
}
.nd-ticket-work-stats>span {
  border: 1px solid var(--line);
  background: var(--surface2);
  border-radius: 11px;
  padding: 12px 14px;
  min-width: 0;
}
.nd-ticket-work-stats strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}
.nd-ticket-work-stats small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.nd-thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0 22px;
}
.nd-thread-blank {
  padding: 25px 15px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.nd-thread-post {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  padding: 15px 17px;
  box-shadow: 0 3px 16px #00000007;
}
.nd-thread-note {
  border-left: 4px solid #d2a456;
  background: color-mix(in srgb,var(--surface) 91%,#dbad5e 9%);
}
.nd-thread-reply {
  border-left: 4px solid #867aff;
}
.nd-thread-post-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.nd-post-avatar {
  background: var(--surface3);
  border: 1px solid var(--line);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}
.nd-thread-post-head>div {
  flex: 1;
  min-width: 0;
}
.nd-thread-post-head strong,.nd-thread-post-head small {
  display: block;
}
.nd-thread-post-head strong {
  font-size: 12px;
}
.nd-thread-post-head small {
  font-size: 10px;
  color: var(--muted);
}
.nd-thread-label {
  font-size: 10px;
  font-weight: 750;
  background: #2d2a55;
  color: #d2caff;
  border: 1px solid #4b4586;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
}
.nd-thread-label.nd-note-tag {
  background: #4a3821;
  border-color: #76562c;
  color: #ffdb96;
}
.nd-thread-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text);
}
.nd-work-receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  margin-top: 13px;
  color: var(--text);
  font-size: 11px;
}
.nd-work-receipt>strong {
  color: #8bd6be;
}
.nd-work-receipt small {
  color: var(--muted);
}
.nd-thread-event {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 11px;
}
.nd-thread-event>span:last-child {
  flex: 1;
}
.nd-thread-event strong {
  color: var(--text);
}
.nd-thread-event small {
  display: block;
  color: var(--muted);
}
.nd-event-dot {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--primary);
}
.nd-ticket-timer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 13px;
}
.nd-ticket-timer strong {
  display: block;
  font-size: 12px;
}
.nd-ticket-timer small {
  color: var(--muted);
  font-size: 10px;
  display: block;
}
.nd-compose {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  overflow: hidden;
  margin-bottom: 25px;
}
.nd-compose-mode {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}
.nd-mode {
  background: none;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 19px;
  font-size: 12px;
  font-weight: 780;
}
.nd-mode.active {
  color: var(--text);
  border-bottom-color: #a89dff;
  background: var(--surface);
}
.nd-compose-editor {
  padding: 17px 17px 3px;
}
.nd-compose-editor label {
  font-size: 11px;
  font-weight: 800;
  display: block;
  margin-bottom: 9px;
}
.nd-compose-editor textarea {
  width: 100%;
  min-height: 135px;
  resize: vertical;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  line-height: 1.65;
}
.nd-compose-editor textarea:focus,.nd-time-fields input:focus,.nd-time-fields select:focus {
  outline: 2px solid #7970e9;
  outline-offset: 1px;
}
.nd-compose-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 12px;
}
.nd-inline-work {
  margin: 0 17px;
  padding: 15px 0 2px;
  border-top: 1px solid var(--line);
}
.nd-inline-work-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.nd-time-fields {
  padding: 14px 0 5px;
}
.nd-time-choice {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.nd-time-choice label {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}
.nd-time-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}
.nd-time-grid label,.nd-post-footer-controls label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.nd-time-grid input:not([type=checkbox]),.nd-time-grid select,.nd-post-footer-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  min-height: 37px;
  padding: 7px 9px;
}
.nd-post-footer-controls {
  padding: 9px 17px 0;
}
.nd-post-footer-controls select {
  max-width: 290px;
}
.nd-compose-bottom {
  padding: 14px 17px 17px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.nd-compose-bottom small {
  font-size: 10px;
  color: var(--muted);
}
body.light .nd-thread-note {
  background: #fffaf0;
}
body.light .nd-thread-label {
  background: #ebe9ff;
  color: #5046b2;
  border-color: #cfc8fe;
}
body.light .nd-thread-label.nd-note-tag {
  background: #fff3da;
  color: #725121;
  border-color: #f5dbac;
}
body.light .nd-work-receipt>strong {
  color: #237f6a;
}
@media(max-width:690px) {
  .nd-ticket-work-stats {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .nd-time-grid {
    grid-template-columns: 1fr;
  }
  .nd-thread-post {
    padding: 12px;
  }
  .nd-compose-bottom .btn {
    width: 100%;
  }
  .nd-mode {
    padding: 12px 10px;
    flex: 1;
  }
  .nd-thread-post-head {
    gap: 6px;
  }
}
.nd-inline-work-toggle {
  justify-content: space-between;
  flex-wrap: wrap;
}
.nd-inline-work-toggle span {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}
#nd-work-minutes {
  font-size: 16px;
  font-weight: 750;
}

/* NexusDesk 3.10.4 — editable ticket content and audited conversation */
.nd-edit-wide { grid-column: 1 / -1; }
.nd-edit-wide input, .nd-edit-wide textarea { width: 100%; }
.nd-thread-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.nd-thread-actions small { color: var(--muted); margin-right: auto; }
.nd-post-editor { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.nd-post-editor label { display: grid; gap: 8px; font-size: 12px; font-weight: 650; }
.nd-post-editor textarea { width: 100%; min-height: 105px; padding: 10px; border-radius: 8px; background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.nd-post-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 9px 0; }
.nd-post-editor small { color: var(--muted); }
.nd-post-history { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--line); }
.nd-post-history > div { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; overflow-wrap: anywhere; }
.nd-post-history p { white-space: pre-wrap; margin: 4px 0; }
.nd-time-unrecorded { opacity: .8; }
