/* NFTStocks agent chat: conversation and verified actions share one workspace. */
.ns-chat-view {
  --chat-border: rgba(53, 104, 76, 0.62);
  --chat-panel: rgba(7, 18, 12, 0.92);
}

.ns-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.ns-chat-card,
.ns-chat-context {
  border: 1px solid var(--chat-border);
  background: var(--chat-panel);
}

.ns-chat-card {
  min-width: 0;
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-rows: auto auto minmax(320px, 1fr) auto;
}

.ns-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--chat-border);
}

.ns-chat-head small,
.ns-chat-context > small,
.ns-chat-tools > span,
.ns-chat-empty small {
  color: var(--green, #00ef88);
  font: 700 10px/1.3 "JetBrains Mono", monospace;
  letter-spacing: .09em;
}

.ns-chat-head h2 {
  margin: 7px 0 5px;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.08;
}

.ns-chat-head p,
.ns-context-copy,
.ns-risk-copy {
  margin: 0;
  color: var(--muted, #84958b);
  font-size: 13px;
  line-height: 1.55;
}

.ns-chat-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(120, 137, 128, .36);
  color: var(--muted, #84958b);
  white-space: nowrap;
}

.ns-chat-badge i {
  width: 7px;
  height: 7px;
  background: #65736b;
  box-shadow: 0 0 0 4px rgba(101, 115, 107, .1);
}

.ns-chat-badge.is-ready {
  border-color: rgba(0, 239, 136, .48);
  color: #dfffee;
}

.ns-chat-badge.is-ready i {
  background: var(--green, #00ef88);
  box-shadow: 0 0 12px rgba(0, 239, 136, .72);
}

.ns-chat-tools {
  padding: 14px 24px 16px;
  border-bottom: 1px solid rgba(53, 104, 76, .42);
}

.ns-chat-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.ns-chat-actions button {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(71, 118, 89, .68);
  background: rgba(10, 29, 18, .62);
  color: #f1f6f2;
  text-align: left;
  cursor: pointer;
}

.ns-chat-actions button:hover,
.ns-chat-actions button:focus-visible {
  border-color: var(--amber, #ffb800);
  background: rgba(255, 184, 0, .07);
  outline: none;
}

.ns-chat-actions b,
.ns-chat-actions small {
  display: block;
}

.ns-chat-actions b {
  margin-bottom: 4px;
  font-size: 12px;
}

.ns-chat-actions small {
  color: var(--muted, #84958b);
  font: 500 10px/1.35 "JetBrains Mono", monospace;
}

.ns-chat-log {
  min-height: 360px;
  max-height: calc(100vh - 500px);
  overflow-y: auto;
  padding: 22px 24px 30px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(0, 239, 136, .4) transparent;
}

.ns-chat-empty {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--muted, #84958b);
}

.ns-chat-empty-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green, #00ef88);
  color: var(--green, #00ef88);
  font: 700 15px "JetBrains Mono", monospace;
  box-shadow: inset 0 0 22px rgba(0, 239, 136, .06);
}

.ns-chat-empty strong,
.ns-chat-empty p {
  display: block;
}

.ns-chat-empty strong {
  margin: 5px 0 4px;
  color: #f1f6f2;
  font-size: 17px;
}

.ns-chat-empty p {
  max-width: 520px;
  margin: 0;
  line-height: 1.55;
}

.ns-message {
  width: min(76%, 760px);
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(70, 113, 86, .7);
  background: rgba(10, 27, 17, .75);
}

.ns-message.is-user {
  margin-left: auto;
  border-color: rgba(255, 184, 0, .42);
  background: rgba(255, 184, 0, .055);
}

.ns-message header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ns-message header strong {
  color: var(--green, #00ef88);
  font: 700 10px "JetBrains Mono", monospace;
}

.ns-message.is-user header strong { color: var(--amber, #ffb800); }
.ns-message time { color: var(--muted, #84958b); font: 500 9px "JetBrains Mono", monospace; }
.ns-message p { margin: 0; color: #d6dfd9; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

.ns-action-journey {
  margin: 0 0 14px;
  border: 1px solid rgba(0, 239, 136, .42);
  background: rgba(4, 17, 10, .94);
}

.ns-action-journey[open] { border-color: rgba(0, 239, 136, .7); }
.ns-action-journey.is-needs-input,
.ns-action-journey.is-refused,
.ns-action-journey.is-cancelled { border-color: rgba(255, 184, 0, .58); }

.ns-action-summary {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.ns-action-summary::-webkit-details-marker { display: none; }
.ns-action-index { color: var(--green, #00ef88); font: 700 11px "JetBrains Mono", monospace; }
.ns-action-summary span { min-width: 0; }
.ns-action-summary b,
.ns-action-summary small { display: block; }
.ns-action-summary b { color: #eff8f2; font-size: 13px; }
.ns-action-summary small { margin-top: 3px; color: var(--muted, #84958b); font: 500 9px "JetBrains Mono", monospace; }
.ns-action-outcome { color: var(--green, #00ef88); font: 700 9px "JetBrains Mono", monospace; letter-spacing: .06em; }
.is-needs-input .ns-action-outcome,
.is-refused .ns-action-outcome,
.is-cancelled .ns-action-outcome { color: var(--amber, #ffb800); }

.ns-action-content {
  padding: 0 14px 15px 49px;
  border-top: 1px solid rgba(53, 104, 76, .38);
}

.ns-action-content > p { margin: 13px 0 15px; color: #d4ddd7; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ns-action-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ns-action-timeline span { min-height: 38px; padding: 8px; border: 1px solid rgba(80, 105, 89, .45); color: #738178; font: 600 9px/1.35 "JetBrains Mono", monospace; }
.ns-action-timeline span.is-done { border-color: rgba(0, 239, 136, .52); color: var(--green, #00ef88); background: rgba(0, 239, 136, .045); }
.ns-action-timeline span.is-current { border-color: var(--amber, #ffb800); color: var(--amber, #ffb800); }

.ns-receipt-link { color: var(--green, #00ef88); text-decoration: underline; text-underline-offset: 3px; }

/* Collection deploy journeys: six stages and the wallet-signature action. */
.ns-action-timeline[data-collection-steps] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ns-collection-deploy {
  min-height: 40px;
  margin-top: 10px;
  padding: 0 18px;
  border: 1px solid #0b340f;
  background: var(--green, #00ef88);
  color: #04110a;
  font: 700 11px "JetBrains Mono", monospace;
  cursor: pointer;
}
.ns-collection-deploy:hover:not(:disabled),
.ns-collection-deploy:focus-visible { filter: brightness(1.08); outline: 2px solid #fff; outline-offset: 2px; }
.ns-collection-deploy:disabled { opacity: .5; cursor: progress; }
.ns-collection-note { display: block; margin-top: 8px; color: #738178; font-size: 11px; overflow-wrap: anywhere; }
.ns-action-content .talk-collection-result { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.ns-action-content .talk-collection-result a { color: var(--green, #00ef88); font-weight: 700; }
.ns-action-journey.is-deployed .ns-action-outcome { color: var(--green, #00ef88); }

.ns-chat-form {
  padding: 16px 24px 18px;
  border-top: 1px solid var(--chat-border);
  background: rgba(5, 15, 9, .98);
}

.ns-chat-form > label {
  display: block;
  margin-bottom: 7px;
  color: #cbd7cf;
  font: 600 11px "JetBrains Mono", monospace;
}

.ns-chat-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid rgba(71, 118, 89, .7);
  background: #061009;
  color: #eff8f2;
  padding: 13px 14px;
  font: 500 13px/1.55 "JetBrains Mono", monospace;
}

.ns-chat-form textarea:focus { border-color: var(--amber, #ffb800); outline: 2px solid rgba(255, 184, 0, .13); }
.ns-chat-form textarea:disabled { opacity: .48; cursor: not-allowed; }
.ns-chat-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; margin-top: 10px; }
#ns-chat-status { color: var(--muted, #84958b); font: 500 10px/1.4 "JetBrains Mono", monospace; }
/* Same reply-wait pulse as every other agent chat surface. */
.thinking-dots { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.thinking-dots b { display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: thinking-pulse 1.1s infinite ease-in-out; }
.thinking-dots b:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots b:nth-child(3) { animation-delay: 0.3s; }
@keyframes thinking-pulse { 0%, 80%, 100% { opacity: 0.22; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .thinking-dots b { animation: none; opacity: 0.6; transform: none; } }
.ns-chat-keys { color: #627068; font: 500 9px "JetBrains Mono", monospace; white-space: nowrap; }
.ns-chat-form button { min-width: 140px; min-height: 44px; border: 1px solid #000; background: var(--amber, #ffb800); color: #070b08; font: 700 11px "JetBrains Mono", monospace; cursor: pointer; }
.ns-chat-form button:hover:not(:disabled),
.ns-chat-form button:focus-visible { filter: brightness(1.08); outline: 2px solid #fff; outline-offset: 2px; }
.ns-chat-form button:disabled { opacity: .42; cursor: not-allowed; }
.ns-chat-card[aria-busy="true"] .ns-chat-log { opacity: .76; }

.ns-chat-context {
  position: sticky;
  top: 84px;
  padding: 20px;
}

.ns-chat-context h3 { margin: 7px 0 8px; font-size: 19px; overflow-wrap: anywhere; }
.ns-context-metrics { display: grid; grid-template-columns: repeat(2, 1fr); margin: 18px 0; border-top: 1px solid var(--chat-border); border-left: 1px solid var(--chat-border); }
.ns-context-metrics span { min-height: 74px; padding: 11px; border-right: 1px solid var(--chat-border); border-bottom: 1px solid var(--chat-border); }
.ns-context-metrics small,
.ns-context-metrics strong { display: block; }
.ns-context-metrics small { color: var(--muted, #84958b); font: 500 9px "JetBrains Mono", monospace; }
.ns-context-metrics strong { margin-top: 9px; color: var(--green, #00ef88); font-size: 17px; }
.ns-context-metrics .is-warning { color: var(--amber, #ffb800); }
.ns-context-proof { padding: 14px; border: 1px solid rgba(53, 104, 76, .6); background: rgba(0, 239, 136, .025); }
.ns-context-proof b { font-size: 12px; }
.ns-context-proof ol { margin: 11px 0 0; padding-left: 18px; color: var(--muted, #84958b); font: 500 10px/1.7 "JetBrains Mono", monospace; }
.ns-context-link { min-height: 44px; display: flex; align-items: center; margin-top: 12px; color: #e7f1ea; text-decoration: none; border: 1px solid rgba(71, 118, 89, .66); padding: 0 12px; font: 600 10px "JetBrains Mono", monospace; }
.ns-context-link:hover,
.ns-context-link:focus-visible { border-color: var(--amber, #ffb800); color: var(--amber, #ffb800); outline: none; }
.ns-risk-copy { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(53, 104, 76, .42); font-size: 10px; }

@media (max-width: 1100px) {
  .ns-chat-layout { grid-template-columns: 1fr; }
  .ns-chat-context { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr); gap: 14px 24px; }
  .ns-chat-context > small,
  .ns-chat-context > h3,
  .ns-chat-context > .ns-context-copy { grid-column: 1; }
  .ns-context-metrics { grid-column: 1; }
  .ns-context-proof { grid-column: 2; grid-row: 1 / span 4; }
  .ns-context-link,
  .ns-risk-copy { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .ns-chat-card { min-height: auto; grid-template-rows: auto auto minmax(340px, 52vh) auto; }
  .ns-chat-head { padding: 18px; flex-direction: column; gap: 12px; }
  .ns-chat-tools,
  .ns-chat-log,
  .ns-chat-form { padding-left: 16px; padding-right: 16px; }
  .ns-chat-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-message { width: 90%; }
  .ns-chat-form > div { grid-template-columns: 1fr auto; }
  .ns-chat-keys { display: none; }
  .ns-chat-context { display: block; }
  .ns-context-proof,
  .ns-context-link,
  .ns-risk-copy { margin-top: 14px; }
}

@media (max-width: 480px) {
  .ns-chat-actions { grid-template-columns: 1fr; }
  .ns-message { width: 100%; }
  .ns-action-content { padding-left: 14px; }
  .ns-action-timeline { grid-template-columns: repeat(2, 1fr); }
  .ns-chat-form > div { grid-template-columns: 1fr; }
  .ns-chat-form button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ns-chat-log { scroll-behavior: auto; }
  .ns-chat-actions button,
  .ns-chat-form button { transition: none !important; }
}
