/* #region zone:monitor.style.ops-chat — แชทวิศวกร ข้อความ markdown สิ่งที่ตรวจพบ ใบงาน และประวัติเวอร์ชัน (Ops Agent v2) */
/* Tokens only (design-system.css): spacing >= 8px between controls, motion = transform/opacity, light + dark via vars. */
.ops-chat2 {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  /* Desktop: the whole viewport under the header (above the floating Luna launcher). */
  height: calc(100dvh - var(--topbar-h) - var(--s-5) - var(--luna-clear));
  max-height: none;
  min-height: 480px;
  overflow: hidden;
}
.ops-chat2 > .panel-header {
  flex: none;
}
.ops2-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.ops2-msg {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  max-width: 100%;
  animation: ops2-in var(--dur) var(--ease) both;
}
.ops2-msg-user {
  justify-content: flex-end;
}
.ops2-avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--h-sm);
  height: var(--h-sm);
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.ops2-avatar-glyph {
  width: 16px;
  height: 16px;
}
.ops2-bubble {
  min-width: 0;
  max-width: min(100%, 640px);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}
.ops2-msg-user .ops2-bubble {
  background: var(--accent-soft);
  border-color: transparent;
  max-width: 88%;
}
.ops2-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.ops2-meta strong {
  color: var(--text-1);
}
.ops2-meta .copy-button {
  margin-inline-start: auto;
}
.ops2-text {
  margin: 0;
  white-space: pre-wrap;
}
.ops2-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.ops2-step {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.ops2-step-done {
  color: var(--text-3);
}
.ops2-step-glyph {
  width: 14px;
  height: 14px;
  flex: none;
}
.ops2-step-done .ops2-step-glyph {
  color: var(--accent-text);
}
.ops2-step-active {
  animation: ops2-pulse 1.4s ease-in-out infinite;
}
.ops2-elapsed {
  margin-inline-start: auto;
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ops2-pending .ops-chat-pending-heading {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.ops2-empty {
  margin: auto;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  text-align: center;
  padding: var(--s-4);
}
.ops2-empty p {
  margin: 0;
}
.ops2-empty-glyph {
  width: 28px;
  height: 28px;
  color: var(--accent-text);
}
.ops2-followups {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-1);
}
.ops2-chip {
  min-height: var(--h-sm);
  padding: 0 var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.ops2-chip:hover {
  background: var(--surface-hover);
}
.ops2-chip:active {
  transform: scale(0.98);
}
.ops2-chip:focus-visible,
.ops-file-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ops2-status {
  flex: none;
  margin: 0;
  color: var(--danger-fg);
  font-size: var(--fs-sm);
}
.ops2-status:empty {
  display: none;
}
.ops2-composer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.ops-chat2 textarea.ops2-input {
  width: 100%;
  /* 3 lines at rest; ops-agent-chat-v2.js grows it with the text up to 40% of the panel. */
  min-height: calc(var(--fs-md) * 1.5 * 3 + var(--s-4));
  max-height: 40dvh;
  padding: var(--s-2) var(--s-3);
  resize: none;
  font-size: var(--fs-md);
  line-height: 1.5;
}
.ops2-tools {
  /* Row 1: model select + "ระดับการคิด"; row 2: cost estimate + send. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-2);
}
.ops2-model {
  grid-column: 1;
  min-width: 0;
}
.ops2-effort-slot {
  grid-column: 2;
  min-width: 0;
}
.ops2-send {
  grid-column: 2;
  min-width: 0;
}
/* #region zone:monitor.style.ops-chat.interject — ปุ่มส่งและหยุดวางข้างกัน */
.ops2-actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
/* #endregion */
.ops-effort {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.ops-effort-caption {
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.ops-effort .segmented.is-disabled {
  opacity: 0.5;
}
.ops-fix-effort {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
}
.ops2-cost {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.ops2-hint {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
/* markdown */
.ops-md {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}
.ops-md-p,
.ops-md-h {
  margin: 0;
}
.ops-md-h {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold, 600);
  margin-top: var(--s-2);
}
.ops-md-list {
  margin: 0;
  padding-inline-start: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.ops-md-code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 1px var(--s-1);
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.ops-md-block {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-3);
  overflow: hidden;
}
.ops-md-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-2) var(--s-1) var(--s-3);
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.ops-md-pre {
  margin: 0;
  padding: var(--s-3);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: pre;
}
.ops-file-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin: 2px var(--s-1);
  padding: 2px var(--s-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--accent-text);
  font: inherit;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  cursor: pointer;
  vertical-align: baseline;
}
.ops-file-chip-glyph {
  width: 12px;
  height: 12px;
}
/* findings, tickets, versions */
.ops-findings,
.ops-tickets {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.ops-finding,
.ops-ticket {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  min-width: 0;
}
.ops-finding-critical {
  border-inline-start: 3px solid var(--danger);
}
.ops-finding-warn {
  border-inline-start: 3px solid var(--warning, var(--border-strong));
}
.ops-finding-head,
.ops-ticket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.ops-finding-what {
  margin: 0;
}
.ops-finding-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin: 0;
  font-size: var(--fs-sm);
}
.ops-finding-facts dt {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.ops-finding-facts dd {
  margin: 0;
  font-family: var(--mono);
}
.ops-evidence {
  margin: 0;
  padding: var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface-3);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ops-problem-actions,
.ops-problem-tags,
.ops-code-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.ops-problem-actions {
  justify-content: flex-end;
}
.ops-finding .ops-problem-actions {
  justify-content: flex-start;
}
.ops-ticket-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ops-ticket-meta {
  margin: 0;
  font-size: var(--fs-sm);
}
.ops-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
}
.ops-timeline-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-inline-start: var(--s-3);
  border-inline-start: 2px solid var(--accent);
}
.ops-timeline-status {
  font-weight: var(--fw-medium, 500);
  font-size: var(--fs-sm);
}
.ops-timeline-time {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ops-versions {
  list-style: none;
  margin: var(--s-4) 0 var(--s-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.ops-version {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
.ops-version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.ops-version-number {
  font-family: var(--mono);
}
.ops-version-title,
.ops-version-detail {
  margin: 0;
}
.ops-ver-current {
  margin: 0 0 var(--s-3);
}
/* fix dialog */
.ops-fix-dialog {
  width: min(720px, calc(100vw - 32px));
}
.ops-fix-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.ops-fix-note,
.ops-ticket-count,
.ops-ticket-label {
  margin: 0;
}
.ops-ticket-preview {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.ops-ticket-notify {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.ops-notice-text {
  margin: 0;
  padding: var(--s-3);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  white-space: pre-wrap;
}
@keyframes ops2-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ops2-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
@media (max-width: 820px) {
  .ops-chat-dialog .ops-chat2 {
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
  }
  .ops2-bubble {
    max-width: 100%;
  }
  .ops2-msg-user .ops2-bubble {
    max-width: 94%;
  }
}
@media (max-width: 480px) {
  .ops-effort-caption {
    display: none;
  }
  .ops-problem-actions {
    justify-content: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ops2-msg,
  .ops2-step-active {
    animation: none;
  }
  .ops2-chip {
    transition: none;
  }
}
/* #endregion */
