/* ============================================================================ */ /* Embed Studio - Full-screen chart editor panel */ /* ============================================================================ */ .embed-studio { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; flex-direction: column; background: var(--page-bg); color: var(--text-color); } /* --- Header --- */ .es-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--border-color); background: var(--surface-bg); flex-shrink: 0; } .es-header__left { display: flex; align-items: center; gap: 8px; } .es-header__icon { font-size: 16px; } .es-header__title { font-size: 14px; font-weight: 600; } .es-header__src { font-family: var(--font-mono); font-size: 12px; color: var(--muted-color); background: var(--code-bg); padding: 2px 6px; border-radius: 4px; } .es-header__actions { display: flex; gap: 4px; } /* --- Body: split panel --- */ .es-body { display: flex; flex: 1; min-height: 0; } /* --- Chat panel (left) --- */ .es-chat { width: 400px; min-width: 320px; max-width: 480px; display: flex; flex-direction: column; border-right: 1px solid var(--border-color); } .es-chat__messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; } .es-chat__empty { text-align: center; color: var(--muted-color); padding: 40px 20px; font-size: 13px; line-height: 1.6; } .es-chat__hint { font-size: 12px; opacity: 0.7; font-style: italic; margin-top: 8px; } /* Messages */ .es-message { max-width: 90%; font-size: 13px; line-height: 1.5; } .es-message--user { align-self: flex-end; } .es-message--ai { align-self: flex-start; } .es-message__text { padding: 8px 12px; border-radius: 12px; word-break: break-word; font-size: 0.82rem; line-height: 1.55; } .es-message--user .es-message__text { white-space: pre-wrap; } /* Markdown inside embed assistant bubbles */ .es-message__text p { margin: 0 0 0.4em; } .es-message__text p:last-child { margin-bottom: 0; } .es-message__text ul, .es-message__text ol { margin: 0.3em 0; padding-left: 1.4em; } .es-message__text li { margin-bottom: 0.15em; } .es-message__text code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85em; background: rgba(0,0,0,0.15); padding: 1px 4px; border-radius: 3px; } .es-message__text pre { background: rgba(0,0,0,0.15); padding: 8px 10px; border-radius: 6px; overflow-x: auto; margin: 0.4em 0; } .es-message__text pre code { background: none; padding: 0; } .es-message__text strong { font-weight: 600; } .es-message__text a { color: var(--primary-color); text-decoration: underline; } .es-message__text blockquote { margin: 0.4em 0; padding-left: 10px; border-left: 2px solid var(--border-color); opacity: 0.7; } .es-message--user .es-message__text { background: var(--primary-color); color: var(--on-primary); border-bottom-right-radius: 4px; } .es-message--ai .es-message__text { background: var(--surface-bg); border: 1px solid var(--border-color); border-bottom-left-radius: 4px; } .es-message__tool { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 11px; font-family: var(--font-mono); background: var(--code-bg); border-radius: 6px; color: var(--muted-color); margin-top: 4px; max-width: 100%; } .es-message__tool-name { font-weight: 600; white-space: nowrap; } .es-message__tool-subtitle { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; } .es-message__tool--running { color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 12%, var(--code-bg)); } .es-message__tool--done { color: var(--success-color, var(--muted-color)); } .es-message__tool-status--running { color: var(--primary-color); } .es-message__tool-status--done { color: var(--success-color); } /* Input area */ .es-chat__input-area { padding: 12px; border-top: 1px solid var(--border-color); background: var(--surface-bg); flex-shrink: 0; } .es-chat__error { font-size: 12px; color: var(--danger-color); padding: 4px 0 8px; } .es-chat__input-row { display: flex; align-items: flex-end; gap: 8px; } .es-chat__textarea { flex: 1; resize: none; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: inherit; line-height: 1.5; background: var(--page-bg); color: var(--text-color); outline: none; min-height: 36px; max-height: 160px; } .es-chat__textarea:focus { border-color: var(--primary-color); } .es-chat__send-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; border-radius: 8px; background: var(--primary-color); color: var(--on-primary); cursor: pointer; flex-shrink: 0; transition: opacity 120ms ease; } .es-chat__send-btn:hover { opacity: 0.85; } .es-chat__send-btn:disabled { opacity: 0.4; cursor: default; } /* --- Preview panel (right) --- */ .es-preview { flex: 1; display: flex; flex-direction: column; min-width: 0; } .es-preview__toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--border-color); background: var(--surface-bg); flex-shrink: 0; } .es-preview__tab { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: 12px; color: var(--muted-color); cursor: pointer; transition: all 120ms ease; } .es-preview__tab:hover { background: var(--border-color); color: var(--text-color); } .es-preview__tab--active { background: var(--border-color); color: var(--text-color); font-weight: 600; } /* Iframe container */ .es-preview__frame-container { flex: 1; position: relative; overflow: hidden; /* The iframe body is set to `background: transparent` by build-doc, so whatever sits behind the iframe is what actually shows. Pin the container to --page-bg so the preview tracks the theme instead of falling through to the browser's default white. */ background: var(--page-bg); } .es-preview__frame-container iframe { /* Some browsers paint a default white canvas on `srcdoc` iframes before the document's own