/* ── Chat Modal ── */ .chat-modal-content { max-width: 95vw; max-height: 80vh; max-height: 80dvh; padding: 0; display: flex; flex-direction: column; overflow: hidden; } .chat-modal-header { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); flex-shrink: 0; } .chat-modal-title { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--font-sm); font-weight: 700; color: var(--text); margin: 0; } .chat-modal-status { display: flex; align-items: center; gap: var(--space-sm); margin-left: var(--space-md); } .chat-modal-status-dot { width: var(--table-cell-pad-y); height: var(--table-cell-pad-y); border-radius: var(--radius-round); background: var(--text-dim); transition: background var(--transition-base); } .chat-modal-status-dot.online { background: var(--positive); box-shadow: 0 0 var(--radius-md) color-mix(in srgb, var(--positive) 50%, transparent); } .chat-modal-status-dot.offline { background: var(--negative); } .chat-modal-status-dot.checking { background: var(--warning); animation: chatModalPulse 1.5s infinite; } .chat-modal-status-text { font-size: var(--font-xs); color: var(--text-dim); } @keyframes chatModalPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } } .chat-modal-model { font-size: var(--font-xs); color: var(--text-dim); font-family: var(--font-mono); margin-left: auto; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2xs) var(--space-xs-plus); cursor: pointer; max-width: 200px; min-height: var(--trades-layout-offset); } .chat-modal-model:hover { border-color: var(--accent); } .chat-modal-model:focus { outline: var(--radius-sm) solid var(--accent); outline-offset: var(--radius-sm); border-color: var(--accent); box-shadow: 0 0 0 var(--focus-ring-width) color-mix(in srgb, var(--accent) 30%, transparent); } /* ── Messages ── */ .chat-modal-body { flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); min-height: 0; scroll-behavior: smooth; background: var(--bg); } /* Welcome */ .chat-modal-welcome { text-align: center; padding: var(--space-xl) var(--space-md); max-width: var(--split-card-min); margin: auto; } .chat-modal-welcome-icon { font-size: var(--font-hero); margin-bottom: var(--space-sm); } .chat-modal-welcome-title { font-size: var(--font-lg); font-weight: 700; color: var(--text); margin-bottom: var(--space-xs); } .chat-modal-welcome-text { font-size: var(--font-sm); color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--space-md); } .chat-modal-welcome-hints { display: flex; flex-direction: column; gap: var(--space-xs); align-items: center; } .chat-modal-welcome-hint { /* Surface from .surface (common.css); the rule owns the type and padding. */ font-size: var(--font-xs); color: var(--text-muted); padding: var(--space-xs) var(--space-sm); } /* Message bubbles */ .chat-modal-msg { display: flex; gap: var(--space-xs); max-width: 85%; animation: chatMsgIn 0.2s ease-out; } @keyframes chatMsgIn { from { opacity: 0; /* 6px is this message's slide distance, not a radius or a gap: the tokens with that value name a corner and a spacing step. */ transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } } .chat-modal-msg.user { align-self: flex-end; flex-direction: row-reverse; } .chat-modal-msg.assistant { align-self: flex-start; } .chat-modal-msg.system { align-self: center; max-width: 100%; } .chat-modal-msg-avatar { width: var(--control-height); height: var(--control-height); border-radius: var(--radius-round); display: flex; align-items: center; justify-content: center; font-size: var(--font-md); flex-shrink: 0; background: var(--bg-elevated); border: 1px solid var(--border); } .chat-modal-msg.user .chat-modal-msg-avatar { background: var(--accent); color: var(--bg); border-color: var(--accent); } .chat-modal-msg-body { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; } .chat-modal-msg.user .chat-modal-msg-body { align-items: flex-end; } .chat-modal-msg-bubble { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); font-size: var(--font-sm); line-height: 1.6; overflow-wrap: break-word; white-space: pre-wrap; } .chat-modal-msg.user .chat-modal-msg-bubble { background: var(--accent); color: var(--bg); border-bottom-right-radius: var(--radius-sm); } .chat-modal-msg.assistant .chat-modal-msg-bubble { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: var(--radius-sm); } .chat-modal-msg.system .chat-modal-msg-bubble { background: transparent; color: var(--text-muted); border: 1px solid var(--border); font-size: var(--font-xs); text-align: center; padding: var(--space-xs) var(--space-sm); } /* Tool call indicator */ .chat-modal-tool-call { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); font-size: var(--font-xs); color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); animation: chatMsgIn 0.2s ease-out; align-self: flex-start; max-width: 90%; } /* The ring itself is the base .spinner (common.css); only the size differs, a tool-call row is a dense strip and a 24px ring does not fit it. The done state below still stops the spin. */ .chat-modal-tool-call .spinner { width: 10px; height: 10px; } .chat-modal-tool-call.done { border-color: var(--positive); color: var(--positive); } .chat-modal-tool-call.done .spinner { border-color: var(--positive); animation: none; } .chat-modal-tool-result { margin-left: auto; font-size: var(--font-xs); color: var(--positive); } /* Typing */ .chat-modal-typing { /* Surface from .surface (common.css), then the bubble's own tail corner. */ display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border-bottom-left-radius: var(--radius-sm); align-self: flex-start; } .chat-modal-typing-dots { display: flex; gap: 3px; } .chat-modal-typing-dot { width: 5px; height: 5px; border-radius: var(--radius-round); background: var(--text-muted); animation: chatTypingBounce 1.4s infinite; } .chat-modal-typing-dot:nth-child(2) { animation-delay: 0.2s; } .chat-modal-typing-dot:nth-child(3) { animation-delay: 0.4s; } @keyframes chatTypingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } } .chat-modal-typing-label { font-size: var(--font-xs); color: var(--text-muted); } /* ── Input ── */ .chat-modal-input-area { border-top: 1px solid var(--border); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); flex-shrink: 0; } .chat-modal-input-row { display: flex; gap: var(--space-xs); align-items: flex-end; } .chat-modal-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-xs) var(--space-sm); font-family: var(--font-sans); font-size: var(--font-sm); color: var(--text); resize: none; min-height: var(--touch-min); max-height: 120px; line-height: 1.5; transition: border-color var(--transition-fast); } .chat-modal-input:focus { outline: var(--radius-sm) solid var(--accent); outline-offset: var(--radius-sm); border-color: var(--accent); } .chat-modal-input::placeholder { color: var(--text-dim); } .chat-modal-send-btn { width: var(--touch-min); height: var(--touch-min); border-radius: var(--radius-md); background: var(--accent); color: var(--bg); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition-fast); padding: 0; } .chat-modal-send-btn:hover:not(:disabled) { filter: brightness(1.2); } .chat-modal-send-btn:disabled { opacity: 0.4; cursor: not-allowed; } .chat-modal-send-btn svg { width: var(--icon-size); height: var(--icon-size); } .chat-modal-input-footer { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-xs); padding: 0 var(--space-xs); } .chat-modal-input-hint { font-size: var(--font-xs); color: var(--text-dim); } .chat-modal-tokens { font-size: var(--font-xs); color: var(--text-dim); font-family: var(--font-mono); } /* ── Footer shortcuts bar ── */ .chat-modal-footer { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-xs) var(--space-md); border-top: 1px solid var(--border); background: var(--bg-elevated); flex-shrink: 0; flex-wrap: wrap; } .chat-modal-examples { display: flex; gap: var(--space-xs); flex-wrap: wrap; flex: 1; } .chat-modal-example-btn { background: transparent; border: 1px solid var(--border); color: var(--text-dim); padding: var(--space-2xs) var(--space-sm); font-size: var(--font-xs); font-weight: 500; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; } .chat-modal-example-btn:hover { border-color: var(--accent); color: var(--text); background: var(--surface); } .chat-modal-clear-btn { background: transparent; border: 1px solid transparent; color: var(--text-dim); padding: var(--space-2xs) var(--space-sm); font-size: var(--font-xs); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; } .chat-modal-clear-btn:hover { color: var(--negative); border-color: var(--negative); } /* ── Markdown formatting ── */ .chat-modal-msg-bubble strong { font-weight: 700; } .chat-modal-msg-bubble em { font-style: italic; } .chat-modal-msg-bubble code { font-family: var(--font-mono); font-size: var(--font-xs); background: var(--bg); padding: 1px var(--space-xs); border-radius: var(--radius-sm); color: var(--positive); } .chat-modal-msg-bubble pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-sm); margin: var(--space-xs) 0; overflow-x: auto; font-size: var(--font-xs); } .chat-modal-msg-bubble pre code { background: none; padding: 0; color: var(--text); } .chat-modal-msg-bubble .positive { color: var(--positive); } .chat-modal-msg-bubble .negative { color: var(--negative); } .chat-modal-msg-bubble .accent { color: var(--accent); } /* ── z-index ── */ /* Chat modal must win over a simultaneously-open fullscreen chart (.chart-fs-overlay also sits at var(--z-1000)); scope to this modal's own root id so shared .modal-overlay usage elsewhere is unaffected. */ #chat-modal { z-index: var(--z-max); } /* ── Responsive ── */ @media (width <= 768px) { .chat-modal-content { width: 100%; max-width: 100vw; max-height: var(--viewport-h); border-radius: var(--radius-none); } .chat-modal-header { flex-wrap: wrap; } .chat-modal-body { padding: var(--space-sm); } .chat-modal-msg { max-width: 92%; } .chat-modal-examples { display: none; } }