/* ============================================================
   AgntUX Cowork demo — embed styles
   16:9 canvas (1600 x 900), transform-scaled to fill viewport.
   Dark, original host shell with light-theme MCP App cards.
   ============================================================ */

:root {
  /* host shell — dark, warm-neutral */
  --bg: #0d0d0e;
  --bg-elev: #161618;
  --bg-side: #131315;
  --bg-input: #1c1c1f;
  --border: #262629;
  --border-soft: #1f1f22;
  --text: #ececec;
  --text-mute: #8a8a90;
  --text-dim: #5a5a5e;

  /* warm accent (AgntUX brand-adjacent) */
  --accent: #d97757;
  --accent-soft: rgba(217, 119, 87, 0.16);
  --accent-line: rgba(217, 119, 87, 0.32);
  --blue: #5d8bf4;

  /* MCP App UI tokens (light card) */
  --card-bg: #fbfbfa;
  --card-fg: #1a1a1a;
  --card-border: #e7e6e3;
  --card-muted: #f3f2ef;
  --card-mute-fg: #6b6b6b;
  --card-dim: #9a9a9a;

  /* pill palettes */
  --red-50: #fef2f2;     --red-100: #fee2e2;   --red-700: #b91c1c;   --red-600: #dc2626;
  --amber-50: #fffbeb;   --amber-700: #b45309;
  --slate-50: #f8fafc;   --slate-100: #f1f5f9; --slate-600: #475569; --slate-400: #94a3b8;
  --green-50: #f0fdf4;   --green-200: #bbf7d0; --green-600: #16a34a; --green-700: #15803d; --green-800: #166534;
  --blue-50: #eff6ff;    --blue-700: #1d4ed8;
  --indigo-50: #eef2ff;  --indigo-700: #4338ca; --indigo-200: #c7d2fe;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: #050505;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ───── Scale stage: 1600x900 canvas, fits any viewport ───── */
.stage {
  position: fixed;
  inset: 0;
  background: #050505;
  overflow: hidden;
  /* Demo is a video — block all manual interaction with the canvas. */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1600px;
  height: 900px;
  background: var(--bg);
  overflow: hidden;
  transform-origin: 0 0;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ───── Host shell layout ───── */
.host {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  grid-template-rows: 100%;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* ── sidebar ── */
.side {
  background: var(--bg-side);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 6px;
  font-size: 13px;
}
.side-window {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 14px;
}
.traffic {
  width: 12px; height: 12px; border-radius: 50%;
}
.traffic.red { background: #ff5f57; }
.traffic.yel { background: #febc2e; }
.traffic.grn { background: #28c840; }

.side-tabs {
  display: flex; gap: 4px; padding: 2px;
  background: var(--bg-input);
  border-radius: 8px;
  margin: 8px 0 14px;
}
.side-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text-mute);
  border-radius: 6px;
  cursor: default;
}
.side-tab.active {
  background: #2a2a2e;
  color: var(--text);
}
.side-tab svg { width: 14px; height: 14px; }

.side-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  color: var(--text);
  border-radius: 6px;
  cursor: default;
}
.side-row .dot {
  width: 6px; height: 6px; border-radius: 50%; background: transparent;
  border: 1.5px solid var(--text-dim);
  flex-shrink: 0;
}
.side-row .dot.filled { background: var(--blue); border-color: var(--blue); }
.side-row svg { width: 15px; height: 15px; color: var(--text-mute); }
.side-row.active { background: #1f1f22; }
.side-row .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-input);
  padding: 1px 7px;
  border-radius: 999px;
}

.side-label {
  text-transform: none;
  font-size: 11px;
  color: var(--text-dim);
  padding: 12px 8px 4px;
}

.side-user {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid var(--border-soft);
}
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97757, #b45309);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 12px;
}
.side-user .name { font-size: 13px; }
.side-user .plan { font-size: 12px; color: var(--text-dim); }

/* ── main chat area ── */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.main-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-soft);
}
.main-title {
  display: flex; align-items: center; gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.main-title svg { width: 14px; height: 14px; color: var(--text-mute); }
.main-top-actions { display: flex; gap: 8px; color: var(--text-mute); }
.main-top-actions svg { width: 16px; height: 16px; }

.thread {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 56px 12px;
  display: flex; flex-direction: column;
  gap: 18px;
  position: relative;
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Non-interactive: this is a video, not a UI. Block all pointer
     events so manual scrolling/wheel/touch can't move the thread or
     interact with the demo content. */
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.thread::-webkit-scrollbar { display: none; }
.thread-inner {
  display: flex; flex-direction: column;
  gap: 18px;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.thread-spacer { flex-shrink: 0; }

/* user message bubble (right aligned) */
.msg-user {
  align-self: flex-end;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  max-width: 75%;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.msg-user.compact {
  max-width: 85%;
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.55;
}
.msg-user .slash { color: var(--blue); }
.msg-user .guill { color: var(--text-dim); }

/* "tool ran" inline status */
.tool-status {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-mute);
  font-size: 13px;
}
.tool-status .check {
  width: 14px; height: 14px; color: var(--text-mute);
}
.tool-status .caret {
  width: 14px; height: 14px; color: var(--text-dim);
  margin-left: 2px;
}

/* assistant action buttons row (after a message) */
.assist-actions { display: flex; gap: 4px; color: var(--text-dim); }
.assist-actions svg { width: 14px; height: 14px; }

/* assistant avatar/sparkle */
.sparkle {
  width: 28px; height: 28px;
  color: var(--accent);
}

/* MCP App card host wrapper */
.app-card-wrap {
  max-width: 820px;
  width: 100%;
}
.app-card {
  background: var(--card-bg);
  color: var(--card-fg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.18);
  overflow: hidden;
}
.app-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}
.app-card-header .logo {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--card-fg);
}
.app-card-header .logo svg { display: block; height: 16px; width: auto; }
.app-card-header .logo-card-text { color: var(--card-fg); }
.app-card-header .logo-card-text .grad {
  background: linear-gradient(135deg, #19e6c8 0%, #1a8cff 50%, #7c5cff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.app-card-header .dot-sep { color: #cfcdc8; }
.app-card-header .sub { color: var(--card-mute-fg); font-size: 12px; }
.app-card-body { padding: 12px; }

/* composer */
.composer-wrap {
  padding: 8px 56px 4px;
  border-top: 1px solid transparent;
}
.composer {
  border: 1px solid var(--border);
  background: #1a1a1c;
  border-radius: 18px;
  padding: 16px 18px 10px;
}
.composer-input {
  display: block;
  min-height: 24px;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: hidden;
  max-height: 76px; /* ~3 lines so long prompts don't blow up the layout */
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
          mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}
.composer-input.short {
  -webkit-mask-image: none;
          mask-image: none;
}
.composer-input .placeholder { color: var(--text-dim); }
.composer-input .typed { color: var(--text); }
.composer-input .typed .slash { color: var(--blue); }
.composer-input .guill { color: #b3b3b8; }
.composer-caret {
  display: inline-block;
  width: 1.5px; height: 16px;
  background: var(--text);
  margin-left: 1px;
  animation: blink 1s steps(2,end) infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }

.composer-bar {
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px;
  color: var(--text-mute);
  font-size: 12px;
}
.composer-bar .plus {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-mute);
  font-size: 16px;
  line-height: 1;
}
.composer-bar .mic {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-mute);
}
.composer-bar .ask {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-mute);
}
.composer-bar .ask svg { width: 14px; height: 14px; }
.composer-bar .spacer { flex: 1; }
.composer-bar .model {
  color: var(--text-mute); font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
}
.composer-bar .send-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: grid; place-items: center;
  transition: transform 0.1s ease, background 0.15s ease;
}
.composer-bar .send-btn.dim { background: #3a3a3e; color: #6b6b6f; }
.composer-bar .send-btn.pulse { animation: btn-press 0.45s ease; }
.composer-bar .send-btn svg { width: 14px; height: 14px; }

.disclaimer {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-dim);
  padding: 6px 0 8px;
}

/* ── right panel ── */
.right {
  background: var(--bg-side);
  border-left: 1px solid var(--border-soft);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 12px;
}
.right-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 12px;
}
.right-card .title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.right-card .title .caret { color: var(--text-dim); }
.right-card .body { color: var(--text-mute); margin-top: 8px; font-size: 12px; }
.right-card .row {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-mute);
  padding: 4px 0;
}
.right-card .row svg { width: 12px; height: 12px; color: var(--text-dim); }

.progress-fill {
  height: 4px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), #f0a47d);
  transition: width 0.3s linear;
}

/* ============================================================
   MCP App UI — Triage card (light theme inside dark host)
   Mirrors the classes in agntux-core view-tool main-component
   ============================================================ */
.triage { display: flex; flex-direction: column; }
.triage-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 6px 4px 12px;
}
.triage-head h2 {
  font-size: 14px; font-weight: 600; margin: 0;
  color: var(--card-fg);
}
.triage-head .meta { font-size: 11px; color: var(--card-dim); }

.triage-controls {
  display: flex; align-items: center; gap: 6px; padding: 0 4px 12px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 8px;
}
.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 11px;
  line-height: 1.4;
  border-radius: 999px;
  background: var(--card-muted);
  color: var(--card-mute-fg);
  border: 1px solid transparent;
  cursor: default;
  white-space: nowrap;
}
.chip.active {
  background: var(--card-fg);
  color: white;
}
.chip-sort {
  margin-left: auto;
  font-size: 11px;
  color: var(--card-mute-fg);
  padding: 4px 9px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: white;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Action rows */
.action {
  border-bottom: 1px solid var(--card-border);
  padding: 12px 4px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background 0.2s ease;
  position: relative;
}
.action:last-child { border-bottom: none; }
.action.hover { background: rgba(0,0,0,0.025); }

.action-line1 {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.action-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--card-fg);
  margin-right: auto;
}
.action-summary {
  font-size: 12.5px;
  color: var(--card-mute-fg);
  line-height: 1.5;
}

/* pills */
.pill {
  display: inline-flex; align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill.high   { background: var(--red-50);   color: var(--red-700); }
.pill.medium { background: var(--amber-50); color: var(--amber-700); }
.pill.low    { background: var(--slate-100);color: var(--slate-600); }

.badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
}
.badge.risk, .badge.production-incident { background: var(--red-50); color: var(--red-700); }
.badge.response-needed { background: var(--blue-50); color: var(--blue-700); }
.badge.deal-movement   { background: var(--amber-50); color: var(--amber-700); }
.badge.knowledge-update,
.badge.default          { background: var(--slate-100); color: var(--slate-600); }

.due {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  border: 1px solid var(--card-border);
  color: var(--card-mute-fg);
}
.due.overdue {
  border-color: var(--red-600);
  color: var(--red-700);
}
.source {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--card-dim);
}

/* suggested action buttons */
.sa-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
}
.sa {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background: white;
  color: var(--card-fg);
  cursor: default;
  display: inline-flex; align-items: center; gap: 5px;
  position: relative;
  transition: background 0.15s ease, transform 0.1s ease;
}
.sa.primary {
  background: var(--card-fg);
  color: white;
  border-color: var(--card-fg);
}
.sa.dim {
  border: none;
  background: transparent;
  color: var(--card-mute-fg);
  padding: 6px 8px;
}
.sa svg { width: 13px; height: 13px; }
.sa.pulse {
  animation: btn-press 0.45s ease;
}
@keyframes btn-press {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.94); filter: brightness(0.92); }
  100% { transform: scale(1); }
}

/* feedback row (replaces a row after action) */
.feedback {
  padding: 14px 12px;
  display: flex; align-items: center; gap: 10px;
  background: var(--green-50);
  border-radius: 8px;
  margin: 6px 0;
  color: var(--green-800);
  font-size: 13px;
}
.feedback svg { width: 16px; height: 16px; }

/* ============================================================
   MCP App UI — Slack Compose card
   ============================================================ */
.compose { display: flex; flex-direction: column; gap: 12px; }

.compose-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px;
}
.compose-header .chan {
  font-size: 14px; font-weight: 600;
}
.compose-header .ctx {
  font-size: 12px; color: var(--card-mute-fg);
  margin-top: 2px;
}
.compose-header .open {
  font-size: 12px; color: var(--card-mute-fg);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: default;
}

.thread-panel {
  border: 1px solid var(--card-border);
  border-radius: 8px;
}
.thread-summary {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--card-mute-fg);
  display: flex; align-items: center; gap: 6px;
  cursor: default;
}
.thread-summary .caret { transition: transform 0.2s ease; }
.thread-summary.open .caret { transform: rotate(90deg); }
.thread-body {
  padding: 0 12px 12px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px;
  color: var(--card-mute-fg);
}
.quote-parent, .quote-reply {
  padding-left: 8px;
  border-left: 2px solid;
  font-size: 12px;
  line-height: 1.5;
}
.quote-parent { border-color: var(--accent); }
.quote-reply  { border-color: var(--card-border); }
.quote-author { font-weight: 600; color: var(--card-fg); margin-right: 4px; }

.field-label {
  font-size: 11px; font-weight: 500; color: var(--card-mute-fg);
  margin-bottom: 4px;
  display: block;
}

.body-input {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  background: white;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--card-fg);
  resize: none;
  min-height: 110px;
  white-space: pre-wrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.body-input.focus {
  border-color: var(--card-fg);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.char-count { text-align: right; font-size: 11px; color: var(--card-dim); margin-top: 2px; }

.disclosure {
  font-size: 12px;
  color: var(--card-mute-fg);
}
.disclosure summary {
  cursor: default;
  display: inline-flex; align-items: center; gap: 6px;
}
.disclosure-list {
  margin: 6px 0 0 4px;
  padding-left: 14px;
  display: flex; flex-direction: column; gap: 4px;
}

.mode-tabs {
  display: inline-flex; padding: 3px;
  background: var(--card-muted);
  border-radius: 8px;
  gap: 2px;
}
.mode-tab {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 6px;
  color: var(--card-mute-fg);
  cursor: default;
}
.mode-tab.active {
  background: white;
  color: var(--card-fg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-weight: 500;
}

.compose-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 2px;
}
.btn {
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: default;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn.discard {
  border-color: var(--card-border);
  background: white;
  color: var(--card-mute-fg);
}
.btn.primary {
  background: var(--card-fg);
  color: white;
}
.btn.primary.sent { background: var(--green-600); }
.btn.pulse { animation: btn-press 0.45s ease; }

.success-banner {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--green-800);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}

/* spinner */
.spin {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* assistant streaming dot */
.streaming-orb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(0.6px);
  animation: pulse-orb 1.4s ease-in-out infinite;
}
@keyframes pulse-orb {
  0%, 100% { opacity: 0.85; transform: scale(0.9); }
  50%      { opacity: 1;    transform: scale(1.05); }
}

/* ── animated cursor ── */
.cursor {
  position: absolute;
  z-index: 50;
  width: 22px; height: 22px;
  pointer-events: none;
  transition: top 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              left 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.15s ease;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.cursor.fast {
  transition-duration: 0.45s;
}
.cursor.pressed {
  transform: scale(0.86);
}
.click-ring {
  position: absolute;
  z-index: 49;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.click-ring.fire {
  animation: ring 0.5s ease-out;
}
@keyframes ring {
  0%   { opacity: 0.85; width: 10px; height: 10px; }
  100% { opacity: 0;    width: 44px; height: 44px; }
}

/* fade transitions */
.fade-in   { animation: fadeIn 0.4s ease both; }
.fade-up   { animation: fadeUp 0.5s ease both; }
.slide-in  { animation: slideIn 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* loop reset wash */
.wash {
  position: absolute; inset: 0;
  background: var(--bg);
  opacity: 0; z-index: 100;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.wash.show { opacity: 1; }

/* ============================================================
   Connector tool status — Slack / Gmail tool runs
   ============================================================ */
.tool-call {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
  width: 100%;
  max-width: 620px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  position: relative;
  box-sizing: border-box;
}
.tool-call .brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: #1f1f22;
}
.tool-call .brand-mark.slack { background: white; }
.tool-call .brand-mark.gmail { background: white; }
.tool-call .brand-mark svg { display: block; }
.tool-call .meta {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto;
}
.tool-call .meta .title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 500; color: var(--text);
  line-height: 1.4;
  min-height: 18px;
}
.tool-call .meta .title .step {
  font-size: 11px;
  color: var(--text-dim);
  background: #2a2a2e;
  padding: 1px 7px;
  border-radius: 999px;
}
.tool-call .meta .desc {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-call .meta .result {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-mute);
}
.tool-call .meta .result.ok { color: #6ee7a3; }
.tool-call .status-pill {
  margin-left: auto; align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-mute);
  background: #1f1f22;
  border: 1px solid var(--border-soft);
  padding: 4px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.tool-call .status-pill.ok {
  color: #6ee7a3;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.22);
}
.tool-call .spin-sm {
  width: 11px; height: 11px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ============================================================
   Details panel — expansion inside a triage row
   ============================================================ */
.details-panel {
  margin-top: 4px;
  border-top: 1px dashed var(--card-border);
  padding-top: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.details-panel h5 {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--card-dim);
  margin: 0 0 4px;
}
.details-panel p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--card-mute-fg);
}
.details-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.entity-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--card-muted);
  color: var(--card-mute-fg);
  border: 1px solid var(--card-border);
}

/* ============================================================
   Gmail-specific compose tweaks (uses .compose base styles)
   ============================================================ */
.gm-recipients {
  display: flex; flex-direction: column; gap: 6px;
}
.gm-field-row {
  display: flex; align-items: baseline; gap: 8px;
}
.gm-field-row label {
  width: 40px; flex-shrink: 0;
  font-size: 11.5px; font-weight: 500;
  color: var(--card-mute-fg);
}
.gm-field-row .gm-input {
  flex: 1;
  border: 1px solid var(--card-border);
  background: white;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  color: var(--card-fg);
}
.gm-add-cc {
  font-size: 11.5px;
  color: var(--card-mute-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gm-footer-note {
  border: 1px dashed var(--card-border);
  background: white;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 11px;
  color: var(--card-mute-fg);
  line-height: 1.5;
}

/* compose body — for gmail, allow more height */
.body-input.tall {
  min-height: 150px;
}

/* a subtle "scrolled out" message above the visible area */
.scroll-fade {
  position: absolute;
  top: 50px; left: 0; right: 0; height: 32px;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none;
  z-index: 4;
}

