/* CLI-style transcript shared by /history and /remote: monospace tool rows, thinking blocks and
 * full output, exactly what the terminal shows. Nothing is collapsible. */
.turns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.turn { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.turn-meta { display: flex; align-items: center; gap: 10px; font: 12px/1 var(--mono); color: var(--muted); }
.turn-role { text-transform: lowercase; letter-spacing: 0.04em; color: var(--ink-2); }
.turn-time { color: var(--muted); }

/* user turn: the raised block with a left accent, like the prompt panel */
.turn-user .user-body {
  border-left: 2px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  overflow-wrap: anywhere;
}
.turn-user .md-p { white-space: pre-wrap; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.attachment {
  font: 12px/1.4 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

/* pictures: sent photos and images a tool put on screen; a click opens them full size */
.chat-img {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
  cursor: zoom-in;
  max-width: min(100%, 320px);
}
.chat-img:hover { border-color: var(--line-2); }
.chat-img:focus-visible { outline: 1px solid var(--accent, var(--ink)); outline-offset: 2px; }
.chat-img img { display: block; max-width: 100%; max-height: 220px; height: auto; object-fit: contain; }
.tool-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.img-zoom {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}
.img-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* assistant text */
.assistant-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.md { display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.md-p { white-space: pre-wrap; }
.md-heading { font: 600 15px/1.35 var(--sans); margin: 4px 0 0; color: var(--ink); }
.md-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 2px; }
.md-quote { margin: 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.md-callout { --tone: #38bdf8; display: grid; gap: 4px; padding: 8px 12px; border-left-color: var(--tone); background: color-mix(in srgb, var(--tone) 7%, transparent); border-radius: 0 6px 6px 0; }
.md-callout-title { font-weight: 700; color: var(--tone); }
.md-callout-tip, .md-callout-success { --tone: #6fcf8a; }
.md-callout-important { --tone: #818cf8; }
.md-callout-warning { --tone: #e1bd80; }
.md-callout-caution, .md-callout-error { --tone: #ef8f8f; }
.md-rule { border: 0; border-top: 1px solid var(--line); margin: 6px 0; align-self: stretch; }
.inline-code { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.md-link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.md-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin: 6px 0;
}
.code-block {
  margin: 0;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}

/* thinking: muted and italic, always expanded */
.think { border-left: 2px solid var(--line); padding-left: 12px; }
.think-head { font: 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.02em; margin-bottom: 4px; }
.think-text {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* tool call: one header line then the whole payload, never folded */
.tool { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.tool-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  font: 12.5px/1.4 var(--mono);
  min-width: 0;
}
.tool-icon { flex: none; width: 1em; text-align: center; }
.tool-icon.ok { color: var(--ok); }
.tool-icon.bad { color: var(--danger); }
.tool-name { flex: none; color: var(--ink-2); }
.tool-detail { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.tool-body { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 8px; }
.tool-args { margin: 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-out {
  margin: 0;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: none;
  overflow-x: auto;
}
.tool-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 122, 102, 0.35);
  border-radius: 4px;
  color: var(--danger);
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tool-note { font: 11.5px/1.3 var(--mono); color: var(--muted); }
.tool-diff { display: flex; flex-direction: column; font: 12.5px/1.5 var(--mono); padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; }
.diff-add { color: var(--ok); white-space: pre; }
.diff-del { color: var(--danger); white-space: pre; }
.diff-same { color: var(--muted); white-space: pre; }

/* assistant footer: agent · model · tokens · time */
.turn-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font: 11.5px/1.4 var(--mono);
  color: var(--muted);
  padding-top: 2px;
}
.foot-item::before { content: "▣ "; color: var(--line-2); }
.turn-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 122, 102, 0.35);
  border-radius: var(--radius-sm);
  color: var(--danger);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.turn-empty { list-style: none; color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  .turns { gap: 18px; }
  .tool-head { flex-wrap: wrap; }
  .tool-detail { flex-basis: 100%; padding-left: calc(1em + 8px); }
}
