/* Ask Orbit entry state — a 2/3 conversation overview plus the product context rail. */
.conversation-home { min-width: 0; }
.conversation-home-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.conversation-home-head h1 { margin: 4px 0 5px; font-size: clamp(26px, 2.5vw, 36px); font-weight: 620; letter-spacing: -.025em; }
.conversation-home-head p { margin: 0; color: var(--muted); font-size: 14px; }
.conversation-home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(310px, 1fr); gap: 18px; align-items: start; }
.conversation-home-main { display: grid; gap: 18px; min-width: 0; }
.conversation-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.conversation-summary-card { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; align-items: baseline; padding: 17px 18px; border-right: 1px solid var(--border); }
.conversation-summary-card:last-child { border-right: 0; }
.conversation-summary-card .micro { grid-column: 1 / -1; }
.conversation-summary-value { display: contents; }
.conversation-summary-card strong { font-size: 25px; font-weight: 620; }
.conversation-summary-value > span { color: var(--muted); font-size: 12px; }
.orbit-briefing { padding: 18px; border: 1px solid color-mix(in oklch, var(--yes) 24%, var(--border)); border-radius: var(--radius-lg); background: color-mix(in oklch, var(--yes) 12%, var(--surface)); }
.orbit-briefing-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.orbit-briefing-head h2 { margin: 4px 0 0; font-size: 19px; font-weight: 620; letter-spacing: -.012em; }
.briefing-live { color: var(--yes); background: color-mix(in oklch, var(--yes) 12%, var(--surface)); }
.briefing-list { display: grid; gap: 8px; }
.briefing-row {
  width: 100%; min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 14px; align-items: center;
  padding: 11px 13px; border: 1px solid color-mix(in oklch, var(--yes) 14%, var(--border)); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); text-align: left; appearance: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.briefing-row:hover { border-color: color-mix(in oklch, var(--yes) 55%, var(--border)); transform: translateY(-1px); box-shadow: 0 8px 22px color-mix(in oklch, var(--yes) 10%, transparent); }
.briefing-copy { min-width: 0; display: grid; gap: 3px; }
.briefing-copy strong { font-size: 13.5px; font-weight: 610; }
.briefing-copy small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.briefing-state { color: var(--warn); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; }
.briefing-state.is-clear { color: var(--yes); }
.briefing-state.is-quiet { color: var(--muted); }
.conversation-archive { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.conversation-section-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.conversation-section-head h2 { margin: 3px 0 0; font-size: 17px; font-weight: 620; }
.conversation-home-search { width: min(220px, 44%); min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface-2); }
.conversation-home-search:focus-within { border-color: var(--yes); color: var(--yes); }
.conversation-home-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 12px; }
.archive-row {
  width: 100%; min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 16px; align-items: center;
  padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--fg); text-align: left; appearance: none;
}
.archive-row:last-child { border-bottom: 0; }
.archive-row:hover { background: var(--fg-soft); }
.archive-row > span:first-child { min-width: 0; display: grid; gap: 3px; }
.archive-row strong { font-size: 13.5px; font-weight: 600; }
.archive-row small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.archive-row time { color: var(--muted); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; }
.conversation-home-empty { margin: 0; padding: 28px; color: var(--muted); font-size: 12px; text-align: center; }
.conversation-home-side { display: grid; gap: 18px; min-width: 0; }
.conversation-home-side > .panel { min-width: 0; overflow: hidden; }
.home-portfolio-total { margin: 6px 0 4px; font-family: var(--font-mono); font-size: 30px; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.05; }
.home-side-rule { margin: 14px 0; }
.home-portfolio-kv { margin: 0; }
.conversation-home-side .exec-row .top > a { min-width: 0; overflow: hidden; color: var(--fg); font-size: 13.5px; font-weight: 550; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.conversation-home-side .exec-row .top > a:hover { color: var(--yes); }
.home-author-line { margin-top: 6px; }
.home-community-row { grid-template-columns: 1fr; }
.conversation-home-back { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 4px 0 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 550; }
.conversation-home-back:hover { color: var(--yes); }
.conversation-chat-view .conversation-workspace { display: block; }

/* Conversation detail — a persistent, adjustable reading split. */
.conversation-detail-shell {
  display: grid;
  grid-template-columns: var(--chat-pane-width, minmax(420px, 5fr)) 18px minmax(520px, 1fr);
  gap: 0;
  min-width: 0;
  align-items: stretch;
}
.conversation-detail-shell > .panel { min-width: 0; overflow: hidden; }
.conversation-chat-panel { grid-column: 1; display: flex; flex-direction: column; height: calc(100vh - var(--topbar) - var(--ribbon) - 48px); min-height: 680px; }
.workflow-canvas { grid-column: 3; }
.workspace-divider {
  position: relative;
  z-index: 3;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}
.workspace-divider::before {
  position: absolute;
  inset: 0 auto;
  left: 50%;
  width: 1px;
  background: var(--border);
  content: "";
  transform: translateX(-50%);
  transition: background-color .16s ease, width .16s ease;
}
.workspace-divider:hover::before,
.workspace-divider:focus-visible::before,
.workspace-divider.is-resizing::before { width: 2px; background: var(--accent); }
.workspace-divider:focus-visible { outline: 0; }
.divider-toggle,
.divider-grip {
  position: relative;
  z-index: 1;
  width: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 3px 10px color-mix(in oklch, var(--bg) 22%, transparent);
}
.divider-toggle {
  height: 24px;
  padding: 0;
  border-radius: 5px;
  font: 600 16px/1 var(--font-body);
  appearance: none;
  cursor: pointer;
}
.divider-toggle:hover,
.divider-toggle:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }
.divider-grip { height: 34px; gap: 3px; border-radius: 6px; cursor: col-resize; }
.divider-grip i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.conversation-detail-shell.is-chat-hidden { grid-template-columns: 0 26px minmax(0, 1fr); }
.conversation-detail-shell.is-workflow-hidden { grid-template-columns: minmax(0, 1fr) 26px 0; }
.conversation-detail-shell.is-chat-hidden .conversation-chat-panel,
.conversation-detail-shell.is-workflow-hidden .workflow-canvas { visibility: hidden; pointer-events: none; }
.conversation-detail-shell.is-chat-hidden .divider-toggle-workflow,
.conversation-detail-shell.is-workflow-hidden .divider-toggle-chat,
.conversation-detail-shell.is-chat-hidden .divider-grip,
.conversation-detail-shell.is-workflow-hidden .divider-grip { display: none; }
.conversation-chat-head { flex: none; gap: 12px; }
.conversation-chat-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-chat-head .conversation-home-back { flex: none; }
.conversation-detail-shell .conversation-workspace { flex: 1; min-height: 0; }
.conversation-detail-shell .chat { height: 100%; min-height: 0; }
.conversation-detail-shell .chat-scroll { padding: 28px 26px 20px; gap: 30px; }
.conversation-detail-shell .chat-foot { display: grid; gap: 10px; padding: 12px 14px 14px; }
.conversation-detail-shell .intent-shortcuts { gap: 6px; padding: 0; }
.conversation-detail-shell .intent-shortcuts button { min-height: 30px; padding: 6px 9px; }
.conversation-detail-shell .queue-state { margin: 0; padding: 6px 8px; }
.conversation-detail-shell .promptbar { min-height: 48px; padding: 6px 6px 6px 12px; border-radius: 8px; }
.conversation-detail-shell .promptbar input { height: 34px; padding: 0; font-size: 13.5px; line-height: 34px; }
.conversation-detail-shell .prompt-send { width: 34px; height: 34px; min-height: 34px; flex: 0 0 34px; border-radius: 6px; }
.conversation-detail-shell .prompt-error { margin: -3px 2px 0; color: var(--no); font-size: 10.5px; line-height: 1.4; }
.conversation-detail-shell .prompt-error[hidden] { display: none !important; }
.conversation-detail-shell .promptbar:has(input[aria-invalid="true"]) { border-color: var(--no); box-shadow: 0 0 0 3px color-mix(in oklch, var(--no) 12%, transparent); }
.conversation-detail-shell .msg { grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: 16px auto; grid-template-areas: "avatar speaker" "avatar body"; column-gap: 10px; row-gap: 5px; }
.conversation-detail-shell .msg-avatar { grid-area: avatar; width: 26px; height: 26px; margin-top: 0; border-radius: 7px; font-size: 8px; }
.conversation-detail-shell .msg-avatar.is-ai { display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: none; color: transparent; font-size: 0; }
.conversation-detail-shell .msg-avatar.is-ai img { display: block; width: 21px; height: 21px; object-fit: contain; }
.conversation-detail-shell .msg-body > p { font-size: 13.5px; line-height: 1.62; text-wrap: pretty; }
.conversation-detail-shell .msg-speaker { grid-area: speaker; align-self: end; color: var(--muted); font-family: var(--font-body); font-size: 10.5px; font-weight: 560; letter-spacing: 0; line-height: 1; text-transform: none; }
.conversation-detail-shell .msg-ai .msg-body { max-width: min(100%, 78ch); padding: 1px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.conversation-detail-shell .msg-ai .msg-body::before { display: none; }
.conversation-detail-shell .msg-ai .msg-speaker { color: var(--accent); }
.conversation-detail-shell .msg-user { grid-template-columns: minmax(0, min(54ch, 70%)) 26px; grid-template-rows: 16px auto; grid-template-areas: "speaker avatar" "body avatar"; justify-content: end; column-gap: 9px; row-gap: 5px; }
.conversation-detail-shell .msg-user .msg-body { justify-self: end; max-width: 54ch; padding: 11px 13px 12px; border: 1px solid color-mix(in oklch, var(--accent) 18%, var(--border)); border-radius: 11px; background: color-mix(in oklch, var(--accent) 7%, var(--surface)); box-shadow: none; color: var(--fg); }
.conversation-detail-shell .msg-user .msg-body::after { display: none; }
.conversation-detail-shell .msg-user .msg-speaker { justify-self: end; padding-right: 2px; color: var(--muted); text-align: right; }
.conversation-detail-shell .msg-user .msg-avatar { border-color: var(--border); background: var(--surface-2); color: var(--muted); }
.conversation-detail-shell .msg + .msg-user, .conversation-detail-shell .msg-user + .msg-ai { margin-top: 0; }
.voice-note { width: 100%; display: grid; grid-template-columns: auto minmax(80px, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 9px; padding: 8px 9px; border: 1px solid color-mix(in oklch, var(--accent) 18%, var(--border)); border-radius: 8px; background: color-mix(in oklch, var(--accent) 5%, var(--surface)); color: var(--muted); appearance: none; }
.voice-note:hover { border-color: color-mix(in oklch, var(--accent) 42%, var(--border)); color: var(--fg); }
.voice-time, .voice-play { font-family: var(--font-mono); font-size: 9px; }
.voice-wave { height: 18px; display: flex; align-items: center; gap: 2px; }
.voice-wave i { width: 2px; height: 35%; border-radius: 2px; background: currentColor; opacity: .75; }
.voice-wave i:nth-child(2n) { height: 70%; }
.voice-wave i:nth-child(3n) { height: 100%; }
.voice-note.is-playing .voice-wave i { animation: voice-pulse .72s ease-in-out infinite alternate; }
.voice-note.is-playing .voice-wave i:nth-child(2n) { animation-delay: -.24s; }
.voice-note.is-playing .voice-wave i:nth-child(3n) { animation-delay: -.46s; }
@keyframes voice-pulse { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
.build-summary { display: grid; gap: 7px; margin: 10px 0 12px; padding: 0; list-style: none; }
.build-summary li { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; }
.build-summary svg { color: var(--yes); }
.generated-module { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--fg); text-align: left; appearance: none; }
.generated-module:hover { border-color: var(--yes); }
.generated-module > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.generated-module strong { font-size: 11.5px; }
.generated-module small { overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.module-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--yes-soft); color: var(--yes); font-family: var(--font-mono); font-size: 9px; font-weight: 650; }
.canvas-sync { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--yes); font-family: var(--font-mono); font-size: 9.5px; }

/* Intent-aware chat objects: compact enough to read as conversation, structured enough to act on. */
.intent-line { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; }
.intent-type { padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.intent-card { margin-top: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: none; }
.intent-card-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.intent-card-head h3 { margin: 2px 0 0; font-size: 13.5px; font-weight: 610; }
.intent-source { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.decision-list { display: grid; }
.decision-row { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 51px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--fg); text-align: left; appearance: none; }
.decision-row:hover { background: var(--fg-soft); }
.decision-row > span:first-child { color: var(--muted); font-family: var(--font-mono); font-size: 9px; }
.decision-row > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.decision-row b { font-size: 11.5px; font-weight: 600; }
.decision-row small { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.decision-row em { color: var(--yes); font-family: var(--font-mono); font-size: 8.5px; font-style: normal; text-transform: uppercase; }
.decision-row:last-child em { color: var(--warn); }
.review-question { padding: 11px 12px; background: color-mix(in oklch, var(--warn) 7%, var(--surface)); }
.review-question > strong { font-size: 11.5px; font-weight: 600; }
.intent-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.intent-feedback { margin: 0; padding: 8px 12px; border-top: 1px solid color-mix(in oklch, var(--yes) 24%, var(--border)); background: color-mix(in oklch, var(--yes) 9%, var(--surface)); color: var(--yes); font-size: 10.5px; }
.intent-shortcuts { display: flex; gap: 6px; padding: 8px 11px 0; overflow-x: auto; scrollbar-width: none; }
.intent-shortcuts::-webkit-scrollbar { display: none; }
.intent-shortcuts button { flex: none; min-height: 28px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); font: 550 10px/1 var(--font-body); appearance: none; }
.intent-shortcuts button:hover { border-color: var(--accent); color: var(--accent); }

/* Portfolio answers stay conversational: a compact summary first, full holdings on demand. */
.positions-answer-card { max-width: 760px; }
.position-answer-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.position-answer-metrics > div { min-width: 0; display: grid; gap: 5px; padding: 12px; border-right: 1px solid var(--border); }
.position-answer-metrics > div:last-child { border-right: 0; }
.position-answer-metrics span { color: var(--muted); font: 500 8.5px/1 var(--font-mono); letter-spacing: .03em; text-transform: uppercase; }
.position-answer-metrics strong { overflow: hidden; font-size: 16px; font-weight: 590; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.position-answer-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.position-answer-meta span { padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); font: 520 8px/1 var(--font-mono); }
.position-answer-list { display: grid; }
.position-answer-row { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) 92px 92px; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--fg); }
.position-answer-row:hover { background: var(--fg-soft); }
.position-answer-copy { min-width: 0; display: grid; gap: 3px; }
.position-answer-copy strong { overflow: hidden; font-size: 11px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.position-answer-copy small { color: var(--muted); font-size: 8.5px; }
.position-answer-holding { display: flex; align-items: center; gap: 6px; }
.position-answer-holding .pill { min-width: 32px; justify-content: center; }
.position-answer-holding small { color: var(--muted); font-size: 9px; }
.position-answer-value { min-width: 0; display: grid; gap: 3px; text-align: right; }
.position-answer-value strong { font-size: 10.5px; font-weight: 570; }
.position-answer-value small { font-size: 9px; }

/* Trade quote flow: venue data first, then an explicit review and confirmation boundary. */
.trade-card { --trade-direction: var(--yes); --trade-direction-soft: var(--yes-soft); max-width: 860px; }
.trade-card[data-side="sell"] { --trade-direction: var(--no); --trade-direction-soft: var(--no-soft); }
.trade-card-head { min-height: 64px; padding: 12px 14px; box-shadow: inset 0 2px 0 var(--trade-direction); }
.trade-card-head h3 { max-width: 620px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.trade-head-badges { display: flex; align-items: center; gap: 7px; }
.trade-direction { flex: none; padding: 6px 9px; border: 1px solid color-mix(in oklch, var(--trade-direction) 42%, transparent); border-radius: 999px; background: var(--trade-direction-soft); color: var(--trade-direction); font: 700 8.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.venue-badge { flex: none; padding: 6px 9px; border: 1px solid currentColor; border-radius: 999px; font: 650 8.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.venue-hyperliquid { border-color: color-mix(in oklch, var(--yes) 26%, transparent); background: color-mix(in oklch, var(--yes) 10%, var(--surface)); color: var(--yes); }
.venue-polymarket { border-color: color-mix(in oklch, var(--accent) 26%, transparent); background: color-mix(in oklch, var(--accent) 10%, var(--surface)); color: var(--accent); }
.trade-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.trade-progress span { position: relative; min-width: 0; display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 12px; color: var(--muted); font-size: 9.5px; }
.trade-progress span + span { border-left: 1px solid var(--border); }
.trade-progress span::after { position: absolute; inset: auto 0 -1px; height: 2px; background: transparent; content: ""; }
.trade-progress i { width: 18px; height: 18px; display: grid; flex: none; place-items: center; border: 1px solid var(--border); border-radius: 50%; font: 600 8px/1 var(--font-mono); font-style: normal; }
.trade-progress span.is-active { color: var(--fg); }
.trade-progress span.is-active::after { background: var(--trade-direction); }
.trade-progress span.is-active i { border-color: var(--trade-direction); background: var(--trade-direction); color: var(--on-accent); }
.trade-progress span.is-complete { color: var(--yes); }
.trade-progress span.is-complete i { border-color: var(--yes); background: var(--yes-soft); }
.trade-quote-status { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.trade-quote-status strong { font-size: 10.5px; font-weight: 570; }
.trade-quote-status button { margin-left: auto; padding: 4px 0; border: 0; background: transparent; color: var(--muted); font: 550 9px/1 var(--font-body); }
.trade-quote-status button:hover { color: var(--accent); }
.quote-live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--yes); box-shadow: 0 0 0 3px color-mix(in oklch, var(--yes) 13%, transparent); }
.trade-card.is-quoting .quote-live-dot { background: var(--accent); box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 30%, transparent); animation: queue-pulse 1.4s ease-out infinite; }
.trade-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.trade-metrics > div { min-width: 0; min-height: 94px; display: grid; align-content: center; gap: 5px; padding: 13px 14px; }
.trade-metrics > div + div { border-left: 1px solid var(--border); }
.trade-metrics span { color: var(--muted); font: 550 8px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.trade-metrics strong { overflow: hidden; font-family: var(--font-mono); font-size: clamp(15px, 1.5vw, 19px); font-weight: 610; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trade-metrics small { overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.trade-context { display: grid; grid-template-columns: 1fr 1.65fr 1.35fr .7fr; background: color-mix(in oklch, var(--surface-2) 66%, var(--surface)); }
.trade-context span { min-width: 0; display: grid; gap: 4px; padding: 10px 14px; }
.trade-context span + span { border-left: 1px solid var(--border); }
.trade-context b { color: var(--muted); font: 500 8px/1 var(--font-mono); text-transform: uppercase; }
.trade-context em { overflow: hidden; color: var(--fg); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.trade-notice { --notice-color: var(--accent); display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin: 12px 14px 14px; padding: 12px 13px; border: 1px solid color-mix(in oklch, var(--notice-color) 34%, var(--border)); border-radius: 7px; background: color-mix(in oklch, var(--notice-color) 8%, var(--surface)); color: var(--fg); }
.trade-notice[hidden] { display: none !important; }
.trade-notice[data-state="error"] { --notice-color: var(--no); }
.trade-notice[data-state="failed"] { --notice-color: var(--warn); }
.trade-notice[data-state="success"] { --notice-color: var(--yes); }
.trade-notice-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid color-mix(in oklch, var(--notice-color) 42%, transparent); border-radius: 50%; background: color-mix(in oklch, var(--notice-color) 13%, var(--surface)); color: var(--notice-color); font: 700 15px/1 var(--font-body); }
.trade-notice-copy { min-width: 0; display: grid; gap: 4px; }
.trade-notice-copy strong { color: var(--fg); font-size: 12px; font-weight: 620; line-height: 1.25; }
.trade-notice-copy p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; text-wrap: pretty; }
.trade-notice > button { min-height: 32px; padding: 7px 10px; border: 1px solid color-mix(in oklch, var(--notice-color) 36%, var(--border)); border-radius: 5px; background: var(--surface); color: var(--notice-color); font: 600 10px/1 var(--font-body); }
.trade-notice > button:hover { background: color-mix(in oklch, var(--notice-color) 9%, var(--surface)); }
.trade-notice-actions { display: flex; align-items: center; gap: 7px; }
.trade-notice-actions[hidden] { display: none !important; }
.trade-notice-actions button { min-height: 32px; padding: 7px 10px; border: 1px solid color-mix(in oklch, var(--notice-color) 36%, var(--border)); border-radius: 5px; background: var(--surface); color: var(--notice-color); font: 600 10px/1 var(--font-body); }
.trade-notice-actions button:hover { background: color-mix(in oklch, var(--notice-color) 9%, var(--surface)); }
.trade-notice-actions .is-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.trade-notice-actions .is-primary:hover { filter: brightness(.94); }
.trade-status-notice { margin-top: 0; }
.trade-quote-actions { min-height: 54px; display: flex; align-items: center; gap: 14px; justify-content: flex-end; padding: 9px 14px; border-top: 1px solid var(--border); }
.trade-quote-actions span { margin-right: auto; color: var(--muted); font-size: 9px; }
.trade-quote-actions [data-trade-review]:not(:disabled),
.trade-confirm [data-trade-confirm-button]:not(:disabled) { border-color: var(--trade-direction); background: var(--trade-direction); color: var(--on-accent); }
.trade-quote-actions [data-trade-review]:not(:disabled):hover,
.trade-confirm [data-trade-confirm-button]:not(:disabled):hover { filter: brightness(.94); }
.trade-confirm > header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.trade-confirm h4 { margin: 3px 0 0; font-size: 14px; font-weight: 610; }
.trade-confirm-grid { display: grid; grid-template-columns: minmax(210px, .85fr) 1.65fr; border-bottom: 1px solid var(--border); }
.trade-order-summary { display: grid; align-content: center; gap: 6px; min-height: 152px; padding: 18px; border-right: 1px solid var(--border); background: color-mix(in oklch, var(--trade-direction) 6%, var(--surface)); }
.trade-order-summary .trade-side { width: max-content; padding: 4px 6px; border-radius: 3px; background: var(--trade-direction-soft); color: var(--trade-direction); font: 700 8px/1 var(--font-mono); letter-spacing: .08em; }
.trade-order-summary strong { font-size: 14px; font-weight: 610; line-height: 1.35; }
.trade-order-summary small { color: var(--muted); font-size: 9px; }
.trade-confirm dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.trade-confirm dl div { display: grid; align-content: center; gap: 5px; min-height: 76px; padding: 12px 14px; }
.trade-confirm dl div:nth-child(even) { border-left: 1px solid var(--border); }
.trade-confirm dl div:nth-child(n+3) { border-top: 1px solid var(--border); }
.trade-confirm dt { color: var(--muted); font: 500 8px/1 var(--font-mono); text-transform: uppercase; }
.trade-confirm dd { margin: 0; font-family: var(--font-mono); font-size: 13px; font-weight: 590; font-variant-numeric: tabular-nums; }
.trade-risk-note { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--warn) 7%, var(--surface)); }
.trade-risk-note strong { font-size: 10px; font-weight: 600; }
.trade-risk-note p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.trade-confirm > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; }
.trade-card.is-failed .trade-confirm > footer { display: none; }

/* A completed trade is a new Orbit message, not a buried mutation of the review card. */
.trade-completed-message .msg-body { width: min(680px, 100%); }
.trade-completed-line .intent-type { border-color: color-mix(in oklch, var(--yes) 36%, transparent); background: var(--yes-soft); color: var(--yes); }
.trade-completed-card { --completed-direction: var(--yes); overflow: hidden; border: 1px solid color-mix(in oklch, var(--yes) 36%, var(--border)); border-radius: 8px; background: var(--surface); }
.trade-completed-card[data-side="sell"] { --completed-direction: var(--no); }
.trade-completed-head { min-height: 68px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--yes) 6%, var(--surface)); }
.trade-completed-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid color-mix(in oklch, var(--yes) 42%, transparent); border-radius: 50%; background: var(--yes-soft); color: var(--yes); font: 700 17px/1 var(--font-body); }
.trade-completed-head h3 { margin: 3px 0 0; font-size: 15px; font-weight: 620; letter-spacing: -.012em; }
.trade-completed-direction { padding: 5px 8px; border: 1px solid color-mix(in oklch, var(--completed-direction) 38%, transparent); border-radius: 999px; background: color-mix(in oklch, var(--completed-direction) 10%, var(--surface)); color: var(--completed-direction); font: 700 8.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.trade-completed-instrument { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.trade-completed-instrument strong { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.trade-completed-instrument span { flex: none; color: var(--muted); font-size: 9px; }
.trade-completed-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--border); }
.trade-completed-metrics div { min-width: 0; display: grid; align-content: center; gap: 5px; min-height: 72px; padding: 11px 14px; }
.trade-completed-metrics div + div { border-left: 1px solid var(--border); }
.trade-completed-metrics dt { color: var(--muted); font: 500 8px/1 var(--font-mono); text-transform: uppercase; }
.trade-completed-metrics dd { overflow: hidden; margin: 0; font: 600 11px/1.35 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trade-completed-foot { min-height: 56px; display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 9px 14px; }
.trade-completed-foot > span { max-width: 360px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.trade-completed-foot > div { display: flex; flex: none; gap: 7px; }

/* Single-response queue. Current work stays active; later messages remain user-owned. */
.queue-state { min-height: 34px; display: flex; align-items: center; gap: 8px; margin: 7px 11px 0; padding: 7px 9px; border: 1px solid color-mix(in oklch, var(--accent) 24%, var(--border)); border-radius: 7px; background: color-mix(in oklch, var(--accent) 7%, var(--surface)); color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; }
.queue-state[hidden] { display: none !important; }
.queue-state-pulse { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 34%, transparent); animation: queue-pulse 1.5s ease-out infinite; }
.queue-state-copy { min-width: 0; overflow: hidden; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.queue-state-count { flex: 0 0 auto; padding: 3px 6px; border: 1px solid color-mix(in oklch, var(--accent) 24%, var(--border)); border-radius: 999px; background: var(--surface); color: var(--accent); font-weight: 650; font-variant-numeric: tabular-nums; }
.queue-state-count[hidden] { display: none !important; }
.queue-state button { margin-left: auto; flex: 0 0 auto; min-height: 24px; padding: 3px 2px; border: 0; background: transparent; color: var(--muted); font: inherit; }
.queue-state button:hover { color: var(--no); }
@keyframes queue-pulse { 65%, 100% { box-shadow: 0 0 0 6px transparent; } }
.msg-user.is-queued .msg-body { border-color: color-mix(in oklch, var(--accent) 44%, var(--border)); background: color-mix(in oklch, var(--accent) 11%, var(--surface)); box-shadow: none; }
.queued-message-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 7px; border-top: 1px solid color-mix(in oklch, var(--accent) 18%, var(--border)); color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; }
.queue-position-badge { width: 20px; height: 20px; display: inline-grid; flex: 0 0 auto; place-items: center; border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--border)); border-radius: 50%; background: var(--surface); color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.queue-position-copy { margin-right: auto; }
.queued-message-controls button { padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; }
.queued-message-controls button:hover { color: var(--accent); }
.queue-edit-form { display: grid; gap: 8px; min-width: min(360px, 64vw); }
.queue-edit-form textarea { width: 100%; min-height: 72px; resize: vertical; padding: 8px 9px; border: 1px solid color-mix(in oklch, var(--accent) 32%, var(--border)); border-radius: 6px; outline: 0; background: var(--surface); color: var(--fg); font: 500 12px/1.45 var(--font-body); }
.queue-edit-form textarea:focus { border-color: var(--accent); }
.queue-edit-error { margin: 0; color: var(--no); font-size: 10px; }
.queue-edit-actions { display: flex; justify-content: flex-end; gap: 7px; }
.queue-edit-actions button { min-height: 28px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; background: transparent; color: var(--muted); font: 550 10px/1 var(--font-body); }
.queue-edit-actions button[data-queue-save] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.thinking-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 250px; max-width: 390px; padding: 10px 12px; border: 1px solid color-mix(in oklch, var(--accent) 16%, var(--border)); border-radius: 8px; background: var(--surface-2); }
.thinking-orbit { position: relative; width: 26px; height: 26px; border: 1px solid color-mix(in oklch, var(--accent) 24%, var(--border)); border-radius: 50%; }
.thinking-orbit::before { position: absolute; inset: 5px; border-radius: 50%; background: color-mix(in oklch, var(--accent) 18%, transparent); content: ""; animation: thinking-breathe 1.4s ease-in-out infinite; }
.thinking-orbit i { position: absolute; inset: -1px; border: 1px solid transparent; border-top-color: var(--accent); border-radius: 50%; animation: thinking-orbit 1.1s linear infinite; }
.thinking-copy { min-width: 0; display: grid; gap: 3px; }
.thinking-head { color: var(--fg); font-size: 11.5px; font-weight: 570; }
.thinking-phase { overflow: hidden; color: var(--muted); font-family: var(--font-mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
@keyframes thinking-orbit { to { transform: rotate(360deg); } }
@keyframes thinking-breathe { 50% { opacity: .42; transform: scale(.72); } }
.promptbar.is-queueing { border-color: color-mix(in oklch, var(--accent) 50%, var(--border)); }
.promptbar.is-queueing .prompt-send { background: color-mix(in oklch, var(--accent) 82%, var(--surface)); }

.queue-leave-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.queue-leave-layer[hidden] { display: none !important; }
.queue-leave-backdrop { position: absolute; inset: 0; border: 0; background: color-mix(in oklch, var(--bg) 72%, transparent); backdrop-filter: blur(5px); }
.queue-leave-dialog { position: relative; z-index: 1; width: min(430px, 100%); padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 24px 70px color-mix(in oklch, var(--bg) 70%, transparent); }
.queue-leave-dialog h2 { margin: 5px 0 8px; font-size: 21px; font-weight: 620; letter-spacing: -.018em; }
.queue-leave-dialog > p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.queue-leave-summary { display: grid; gap: 6px; margin: 15px 0 18px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.queue-leave-summary span { display: flex; justify-content: space-between; gap: 14px; }
.queue-leave-summary b { color: var(--fg); font-weight: 570; }
.queue-leave-actions { display: flex; justify-content: flex-end; gap: 8px; }
.queue-leave-actions [data-queue-abandon] { border-color: color-mix(in oklch, var(--no) 38%, var(--border)); background: var(--no); color: var(--on-accent); }
.queue-leave-actions [data-queue-abandon]:hover { filter: brightness(.94); }
body.has-queue-dialog { overflow: hidden; }

.quote-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quote-cell { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--border); }
.quote-cell:last-child { border-right: 0; }
.quote-cell span { display: block; margin-bottom: 4px; color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; }
.quote-cell strong { font-family: var(--font-mono); font-size: 15px; font-weight: 570; font-variant-numeric: tabular-nums; }
.quote-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.quote-empty { color: var(--muted); }
.curve-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 4px; }
.curve-legend { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 9.5px; }
.curve-key { display: inline-flex; align-items: center; gap: 5px; }
.curve-key::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.curve-key b { color: var(--fg); font-family: var(--font-mono); font-weight: 600; }
.curve-key-a { color: var(--accent); }
.curve-key-b { color: var(--stage-watch); }
.curve-tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); }
.curve-tabs button { min-width: 34px; min-height: 26px; padding: 4px 7px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: 550 9px/1 var(--font-mono); appearance: none; }
.curve-tabs button.is-selected { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px color-mix(in oklch, var(--bg) 18%, transparent); }
.curve-chart-wrap { padding: 4px 12px 8px; }
.curve-chart { width: 100%; display: block; overflow: visible; }
.curve-chart [hidden] { display: none; }
.curve-grid path { fill: none; stroke: color-mix(in oklch, var(--border) 78%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.curve-line-a { stroke: var(--accent); }
.curve-line-b { stroke: var(--stage-watch); }
.curve-dot-a { fill: var(--accent); }
.curve-dot-b { fill: var(--stage-watch); }
.curve-axis { display: flex; justify-content: space-between; color: var(--muted); font: 500 8px/1 var(--font-mono); }
.curve-readout { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 54px; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.curve-readout span { display: grid; gap: 2px; }
.curve-readout small { color: var(--muted); font-size: 8.5px; }
.curve-readout strong { font-family: var(--font-mono); font-size: 16px; font-weight: 620; }
.curve-readout p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.probability-summary { display: grid; grid-template-columns: 1.2fr 1fr; border-bottom: 1px solid var(--border); }
.probability-score, .probability-delta { display: grid; gap: 3px; padding: 13px 12px; }
.probability-score { border-right: 1px solid var(--border); }
.probability-score > span, .probability-delta > span { color: var(--muted); font: 500 8.5px/1 var(--font-mono); text-transform: uppercase; }
.probability-score strong { color: var(--accent); font-family: var(--font-mono); font-size: 27px; font-weight: 620; letter-spacing: -.04em; }
.probability-delta b { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.probability-score small, .probability-delta small { color: var(--muted); font-size: 8.5px; }
.probability-bars { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.probability-bars > div { display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; gap: 8px; align-items: center; color: var(--muted); font-size: 9px; }
.probability-bars i { height: 5px; overflow: hidden; border-radius: 4px; background: var(--border); }
.probability-bars i b { height: 100%; display: block; border-radius: inherit; background: var(--accent); }
.probability-bars > div:nth-child(2) i b { background: var(--stage-watch); }
.probability-bars em { color: var(--fg); font: 550 9px/1 var(--font-mono); font-style: normal; text-align: right; }
.evidence-list { display: grid; }
.evidence-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.evidence-row > span:last-child { display: grid; gap: 2px; }
.evidence-row b { font-size: 10px; font-weight: 590; }
.evidence-row small { color: var(--muted); font-size: 8.5px; }
.evidence-direction { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font: 650 10px/1 var(--font-mono); }
.evidence-direction.is-up { background: color-mix(in oklch, var(--yes) 11%, var(--surface)); color: var(--yes); }
.evidence-direction.is-down { background: color-mix(in oklch, var(--no) 10%, var(--surface)); color: var(--no); }
.probability-rationale { padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.probability-rationale strong { font-size: 10px; font-weight: 600; }
.probability-rationale p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.scenario-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px; gap: 5px; border-bottom: 1px solid var(--border); }
.scenario-tabs button { min-height: 36px; display: grid; grid-template-columns: 1fr auto; gap: 5px; align-items: center; padding: 7px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); font: 550 9.5px/1 var(--font-body); text-align: left; appearance: none; }
.scenario-tabs button b { color: var(--fg); font: 600 10px/1 var(--font-mono); }
.scenario-tabs button.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.scenario-detail { min-height: 130px; padding: 13px 12px; }
.scenario-detail h4 { margin: 4px 0 5px; font-size: 14px; font-weight: 620; letter-spacing: -.012em; }
.scenario-detail p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.scenario-signals { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.scenario-signals span { padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--muted); font: 500 8px/1 var(--font-mono); }
.uncertainty-body { padding: 13px 12px; }
.uncertainty-body strong { font-size: 11px; font-weight: 600; }
.uncertainty-body ul { display: grid; gap: 6px; margin: 10px 0; padding-left: 17px; color: var(--fg); font-size: 10px; }
.uncertainty-body li::marker { color: var(--no); }
.uncertainty-body p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.market-result-list { display: grid; }
.market-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 62px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.market-result:last-child { border-bottom: 0; }
.market-result-copy { min-width: 0; display: grid; gap: 3px; }
.market-result-copy strong { overflow: hidden; font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.market-result-copy small { color: var(--muted); font-size: 9.5px; }
.market-price { text-align: right; }
.market-price b { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.market-price small { color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; }
.event-form { display: grid; gap: 10px; padding: 12px; }
.event-field { display: grid; gap: 5px; }
.event-field span { color: var(--muted); font-size: 9.5px; font-weight: 550; }
.event-field input, .event-field select { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; outline: 0; background: var(--surface); color: var(--fg); font: 500 11px/1.3 var(--font-body); }
.event-field input:focus, .event-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.event-fields-two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.event-error { margin: 0; color: var(--no); font-size: 10px; }

/* Source and trigger drafts expose the two objects separately, then show their place in the workflow. */
.config-card { max-width: 720px; }
.config-card .intent-card-head { min-height: 62px; box-shadow: inset 0 2px 0 var(--accent); }
.config-map { min-height: 39px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: 550 8.5px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.config-map span { padding: 5px 7px; border: 1px solid transparent; border-radius: 4px; }
.config-map span.is-current { border-color: color-mix(in oklch, var(--accent) 34%, var(--border)); background: var(--accent-soft); color: var(--accent); }
.config-map i { color: color-mix(in oklch, var(--muted) 70%, transparent); font-style: normal; }
.config-form { display: grid; gap: 11px; padding: 13px 12px 0; }
.config-fields-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.config-field { min-width: 0; display: grid; gap: 5px; }
.config-field > span { color: var(--muted); font-size: 9.5px; font-weight: 550; }
.config-field input, .config-field select { width: 100%; min-height: 38px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 5px; outline: 0; background: var(--surface); color: var(--fg); font: 500 11px/1.3 var(--font-body); appearance: none; }
.config-field select { padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 11px) 16px; background-repeat: no-repeat; background-size: 4px 4px, 4px 4px; }
.config-field input:focus, .config-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.config-field input[aria-invalid="true"], .config-field select[aria-invalid="true"] { border-color: var(--no); box-shadow: 0 0 0 2px color-mix(in oklch, var(--no) 10%, transparent); }
.config-note { margin: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.config-error { margin: 0; color: var(--no); font-size: 10px; line-height: 1.45; }
.config-form > .intent-actions { margin-inline: -12px; }
.chat-card-actions { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-card-actions .spacer { flex: 1; }
.chat-card-note { color: var(--muted); font-size: 9px; }
.intent-card.is-complete { border-color: color-mix(in oklch, var(--yes) 40%, var(--border)); }
.intent-card.is-complete .intent-card-head { background: color-mix(in oklch, var(--yes) 8%, var(--surface)); }

.workflow-canvas { min-width: 0; height: calc(100vh - var(--topbar) - var(--ribbon) - 48px); min-height: 680px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.workflow-canvas-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.workflow-canvas-head h2 { margin: 2px 0 0; font-size: 15px; font-weight: 620; }
.workflow-actions { display: flex; align-items: center; gap: 8px; }
.workflow-canvas-body { height: calc(100% - 58px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(18px, 2.3vw, 34px); background-color: color-mix(in oklch, var(--surface-2) 74%, var(--surface)); background-image: radial-gradient(circle, color-mix(in oklch, var(--muted) 20%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.workflow-stack { display: grid; gap: clamp(14px, 2vh, 22px); }
.workflow-step { position: relative; width: 100%; min-width: 0; display: grid; grid-template-columns: 20px 56px minmax(0, 1fr) auto 28px; gap: 16px; align-items: center; padding: 18px 20px; border: 1px solid color-mix(in oklch, var(--muted) 26%, var(--border)); border-radius: 10px; background: color-mix(in oklch, var(--surface) 96%, transparent); color: var(--fg); box-shadow: 0 10px 28px color-mix(in oklch, var(--bg) 22%, transparent); text-align: left; appearance: none; transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
.workflow-step:hover { border-color: color-mix(in oklch, var(--accent) 42%, var(--border)); transform: translateY(-1px); }
.workflow-step.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 12%, transparent), 0 12px 32px color-mix(in oklch, var(--bg) 28%, transparent); }
.workflow-grip { width: 10px; display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; opacity: .62; }
.workflow-grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.workflow-step-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; }
.stage-trigger { background: color-mix(in oklch, var(--accent) 13%, var(--surface)); color: var(--accent); }
.stage-watch { background: color-mix(in oklch, var(--stage-watch) 12%, var(--surface)); color: var(--stage-watch); }
.stage-risk { background: color-mix(in oklch, var(--no) 11%, var(--surface)); color: var(--no); }
.stage-execute { background: color-mix(in oklch, var(--yes) 12%, var(--surface)); color: var(--yes); }
.workflow-step-copy { min-width: 0; display: grid; gap: 6px; }
.workflow-step-copy strong { overflow: hidden; font-size: clamp(14px, 1.15vw, 18px); font-weight: 610; letter-spacing: -.012em; text-overflow: ellipsis; white-space: nowrap; }
.workflow-step-copy small { overflow: hidden; color: var(--muted); font-size: clamp(10px, .82vw, 12px); text-overflow: ellipsis; white-space: nowrap; }
.workflow-step-meta { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); text-transform: uppercase; white-space: nowrap; }
.workflow-step-meta b { font-size: 10px; font-weight: 550; letter-spacing: .08em; }
.workflow-step-meta em { color: var(--muted); font-size: 12px; font-style: normal; }
.workflow-step-chevron { width: 28px; height: 28px; display: grid; place-items: center; justify-self: end; color: color-mix(in oklch, var(--muted) 84%, var(--fg)); }
.workflow-step-chevron svg { transition: transform .18s cubic-bezier(.2, .8, .2, 1); transform-origin: center; }
.workflow-step:hover .workflow-step-chevron { color: var(--fg); }
.workflow-step.is-selected .workflow-step-chevron { color: var(--accent); }
.workflow-step.is-selected .workflow-step-chevron svg { transform: rotate(180deg); }
.stage-trigger-text b { color: var(--accent); }
.stage-watch-text b { color: var(--stage-watch); }
.stage-risk-text b { color: var(--no); }
.stage-execute-text b { color: var(--yes); }

@media (max-width: 1180px) {
  .conversation-detail-shell,
  .conversation-detail-shell.is-chat-hidden,
  .conversation-detail-shell.is-workflow-hidden { grid-template-columns: 1fr; gap: 14px; }
  .conversation-chat-panel, .workflow-canvas { grid-column: 1; visibility: visible !important; pointer-events: auto !important; }
  .workspace-divider { display: none; }
  .conversation-chat-panel, .workflow-canvas { height: 680px; }
}

@media (max-width: 720px) {
  .conversation-chat-panel .panel-head { flex-wrap: wrap; }
  .conversation-detail-shell .chat-foot { gap: 9px; padding: 10px 12px 12px; }
  .conversation-detail-shell .intent-shortcuts button { min-height: 36px; }
  .conversation-detail-shell .promptbar { min-height: 48px; }
  .conversation-detail-shell .prompt-send { width: 36px; height: 36px; min-height: 36px; flex-basis: 36px; }
  .workflow-canvas-head { align-items: flex-start; flex-direction: column; }
  .workflow-actions { width: 100%; justify-content: space-between; }
  .workflow-canvas-body { padding: 14px; }
  .workflow-step { grid-template-columns: 14px 46px minmax(0, 1fr) 28px; gap: 11px; padding: 15px 13px; }
  .workflow-step-icon { width: 46px; height: 46px; }
  .workflow-step-meta { grid-column: 3; justify-self: start; }
  .workflow-step-chevron { grid-column: 4; grid-row: 1 / span 2; }
  .voice-note, .generated-module { min-height: 44px; }
  .decision-row { min-height: 56px; }
  .queue-state { flex-wrap: wrap; padding-block: 8px; }
  .queue-state-copy { flex: 1 1 180px; white-space: normal; }
  .queue-state button { min-height: 36px; }
  .queued-message-controls button { min-height: 36px; padding-inline: 4px; }
  .queue-edit-form { min-width: min(280px, 72vw); }
  .queue-leave-actions { align-items: stretch; flex-direction: column; }
  .queue-leave-actions .btn { width: 100%; min-height: 44px; }
  .intent-actions, .chat-card-actions { align-items: stretch; flex-direction: column; }
  .intent-actions .btn, .chat-card-actions .btn { width: 100%; min-height: 44px; }
  .quote-grid, .event-fields-two, .config-fields-two { grid-template-columns: 1fr; }
  .position-answer-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding-block: 11px; }
  .position-answer-copy { grid-column: 1 / -1; }
  .position-answer-value { justify-self: end; }
  .config-map { overflow-x: auto; }
  .config-map span { flex: none; }
  .config-field input, .config-field select { min-height: 44px; }
  .curve-toolbar { align-items: flex-start; flex-direction: column; }
  .curve-readout { grid-template-columns: 1fr; }
  .probability-summary { grid-template-columns: 1fr; }
  .probability-score { border-right: 0; border-bottom: 1px solid var(--border); }
  .scenario-tabs { grid-template-columns: 1fr; }
  .scenario-tabs button { min-height: 44px; }
  .quote-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .quote-cell:last-child { border-bottom: 0; }
  .trade-card-head { align-items: flex-start; }
  .trade-card-head h3 { white-space: normal; }
  .trade-head-badges { align-items: flex-end; flex-direction: column; }
  .trade-progress span { align-items: flex-start; flex-direction: column; gap: 5px; padding-inline: 9px; }
  .trade-metrics { grid-template-columns: 1fr 1fr; }
  .trade-metrics > div:nth-child(3) { border-top: 1px solid var(--border); border-left: 0; }
  .trade-metrics > div:nth-child(4) { border-top: 1px solid var(--border); }
  .trade-context { grid-template-columns: 1fr 1fr; }
  .trade-context span:nth-child(3) { border-top: 1px solid var(--border); border-left: 0; }
  .trade-context span:nth-child(4) { border-top: 1px solid var(--border); }
  .trade-quote-actions { align-items: stretch; flex-direction: column; }
  .trade-quote-actions .btn { min-height: 44px; }
  .trade-notice { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
  .trade-notice > button { grid-column: 1 / -1; min-height: 44px; }
  .trade-notice-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .trade-notice-actions button { min-height: 44px; }
  .trade-confirm-grid { grid-template-columns: 1fr; }
  .trade-order-summary { min-height: 120px; border-right: 0; border-bottom: 1px solid var(--border); }
  .trade-risk-note { grid-template-columns: 1fr; gap: 6px; }
  .trade-confirm > footer { align-items: stretch; flex-direction: column-reverse; }
  .trade-confirm > footer .btn { min-height: 44px; }
  .trade-completed-instrument { align-items: flex-start; flex-direction: column; gap: 4px; }
  .trade-completed-instrument strong { white-space: normal; }
  .trade-completed-metrics { grid-template-columns: 1fr 1fr; }
  .trade-completed-metrics div:nth-child(3) { border-top: 1px solid var(--border); border-left: 0; }
  .trade-completed-metrics div:nth-child(4) { border-top: 1px solid var(--border); }
  .trade-completed-foot { align-items: stretch; flex-direction: column; }
  .trade-completed-foot > span { max-width: none; }
  .trade-completed-foot > div { display: grid; grid-template-columns: 1fr 1fr; }
  .trade-completed-foot .btn { min-height: 44px; }
  .conversation-chat-panel, .workflow-canvas { min-height: 580px; height: 640px; }
}

/* Legacy in-chat history store; the visible navigation now lives on the overview screen. */
.conversation-workspace {
  position: relative;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-width: 0;
  transition: grid-template-columns .2s ease;
}
.conversation-workspace.is-history-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.conversation-rail {
  min-width: 0;
  height: calc(100vh - var(--topbar) - var(--ribbon) - 92px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 14px 10px 10px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  transition: opacity .16s ease, visibility 0s linear 0s;
}
.conversation-workspace.is-history-collapsed .conversation-rail { opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, .16s; }
.conversation-rail-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; }
.conversation-rail-head > div { min-width: 0; }
.conversation-rail-head h3 { margin-top: 3px; font-size: 14px; font-weight: 620; }
.conversation-rail-actions { display: flex; gap: 6px; margin-left: auto; }
.conversation-collapse,
.conversation-new {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface);
}
.conversation-collapse:hover,
.conversation-new:hover { border-color: var(--accent); color: var(--accent); }
.conversation-collapse svg { transform: rotate(90deg); }
.conversation-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}
.conversation-search:focus-within { border-color: var(--accent); color: var(--accent); }
.conversation-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 12px; }
.conversation-search input::placeholder { color: var(--muted); }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.conversation-group {
  margin: 13px 8px 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.conversation-group:first-child { margin-top: 3px; }
.conversation-item {
  position: relative;
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px 30px 10px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--muted);
  box-shadow: none;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.conversation-list > .conversation-item:not([aria-current='true']) { border-color: transparent; background-color: transparent; }
.conversation-item:hover { background-color: var(--fg-soft); color: var(--fg); }
.conversation-item[aria-current='true'] { border-color: transparent; background-color: color-mix(in oklch, var(--accent) 10%, var(--surface)); color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 22%, transparent); }
.conversation-item-title { overflow: hidden; font-size: 12.5px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item-preview { overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item time { position: absolute; top: 11px; right: 8px; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.conversation-empty { display: grid; gap: 3px; padding: 22px 8px; color: var(--muted); text-align: center; }
.conversation-empty span { color: var(--fg); font-size: 12px; font-weight: 600; }
.conversation-empty small { font-size: 10.5px; }
.conversation-close { display: none; min-height: 42px; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 12px; }
.conversation-toggle { display: inline-flex; }
.conversation-workspace .chat { min-width: 0; }
.conversation-transcript-note { display: flex; justify-content: center; }
.conversation-transcript-note span { padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-family: var(--font-mono); font-size: 10px; }

@media (max-width: 1320px) {
  .conversation-home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(286px, 1fr); }
  .conversation-workspace { display: block; }
  .conversation-workspace.is-history-collapsed { display: block; }
  .conversation-collapse { display: none; }
  .conversation-rail {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 18;
    width: min(300px, calc(100vw - 48px));
    height: 100%;
    min-height: 0;
    border-right: 1px solid var(--border);
    box-shadow: 18px 0 42px color-mix(in oklch, var(--bg) 74%, transparent);
    transform: translateX(-102%);
    visibility: hidden;
    opacity: 1;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .conversation-workspace.is-history-collapsed .conversation-rail { opacity: 1; pointer-events: auto; }
  .conversation-workspace.is-history-open .conversation-rail { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  .conversation-backdrop {
    position: absolute;
    inset: 0;
    z-index: 17;
    width: 100%;
    border: 0;
    background: color-mix(in oklch, var(--bg) 66%, transparent);
  }
  .conversation-workspace.is-history-open .conversation-backdrop { display: block; }
  .conversation-close { display: block; }
}

@media (max-width: 980px) {
  .conversation-home-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .conversation-home-head { align-items: stretch; flex-direction: column; }
  .conversation-home-head .btn { min-height: 44px; justify-content: center; }
  .conversation-summary { grid-template-columns: 1fr; }
  .conversation-summary-card { border-right: 0; border-bottom: 1px solid var(--border); }
  .conversation-summary-card:last-child { border-bottom: 0; }
  .orbit-briefing { padding: 14px; }
  .orbit-briefing-head { align-items: start; flex-direction: column; gap: 9px; }
  .briefing-row { grid-template-columns: minmax(0, 1fr) 16px; min-height: 72px; }
  .briefing-state { grid-column: 1; grid-row: 2; }
  .conversation-section-head { align-items: stretch; flex-direction: column; }
  .conversation-home-search { width: 100%; min-height: 44px; }
  .archive-row { grid-template-columns: minmax(0, 1fr) 16px; min-height: 72px; }
  .archive-row time { grid-column: 1; }
  .conversation-toggle { min-height: 36px; padding-inline: 9px; }
  .conversation-toggle svg { display: none; }
  .conversation-workspace .chat-scroll { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .conversation-workspace, .conversation-rail, .conversation-item, .briefing-row, .workflow-step { transition: none; }
  .workflow-step-chevron svg { transition: none; }
  .voice-note.is-playing .voice-wave i { animation: none; }
  .queue-state-pulse, .thinking-orbit::before, .thinking-orbit i { animation: none; }
}
