/* Chat interface styles */

/* Right panel — 3 states */
.chat-panel { display: flex; flex-direction: column; } /* layout-exception: chat domain layout */
.chat-panel.right--collapsed { width: auto; }
.chat-panel.right--expanded { height: calc(100vh - 44px); width: 280px; }
.chat-panel.right--full { height: calc(100vh - 44px); width: 100%; max-width: 720px; }
.chat-panel > .right-toggle-btn { flex-shrink: 0; } /* layout-exception: chat domain layout */
.chat-panel > .right-content { display: flex; flex-direction: column; flex: 1; min-height: 0; } /* layout-exception: chat domain layout */

/* Empty state — vertically centered */
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: auto; margin-bottom: auto; } /* layout-exception: chat domain layout */
.chat-empty-icon { font-size: 20px; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; opacity: 0.5; }
.chat-empty-input { width: 180px; max-width: 80%; text-align: center; border-radius: 16px; padding: 6px 12px; font-size: 12px; min-height: 28px; resize: none; }
.chat-context-btn { background: none; border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); padding: 3px 10px; font-size: 11px; font-family: inherit; cursor: pointer; }
.chat-context-btn:not(:disabled):hover { color: var(--accent-blue); border-color: var(--accent-blue); }
.chat-context-btn:disabled { opacity: 0.3; cursor: default; }
.chat-context-bar { padding: 4px 12px; }
.chat-empty.hidden { display: none; }

/* Conversation state — visibility toggles (exception: display toggle) */
.chat-state-empty .chat-conversation { display: none; }
.chat-state-conversation .chat-empty { display: none; }
.chat-conversation.hidden { display: none; }
.chat-conversation { display: flex; flex-direction: column; flex: 1; min-height: 0; } /* layout-exception: chat domain layout */

/* Hide send button — Enter submits */
.chat-send-btn { display: none; }

.chat-messages { flex: 1; overflow-y: auto; padding: 2px 8px; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; } /* layout-exception: chat domain layout */

.chat-message {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 85%;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Thinking indicator */
.chat-thinking { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text-muted); font-size: 13px; } /* layout-exception: chat domain layout */
.chat-thinking-icon { font-size: 16px; animation: think-pulse 1.5s ease-in-out infinite; }
@keyframes think-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Message publisher styles — exception: align-self is dynamic (set by JS appendMessage) */
.chat-message--human {
  background: var(--accent-blue);
  color: var(--color-on-accent);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message--ai {
  background: var(--bg-overlay);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message--other {
  background: var(--bg-surface);
  color: var(--text-secondary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-left: 2px solid var(--accent-purple, #a371f7);
}

.chat-message--system {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  margin: 2px 1rem;
  padding: 2px 8px;
  background: none;
  max-width: 100%;
  align-self: center;
}

.chat-message-name {
  font-weight: 600;
  font-size: 11px;
  display: block;
  margin-bottom: 1px;
  color: var(--text-muted);
}

.chat-message--human .chat-message-name { color: var(--color-on-accent); opacity: 0.8; }
.chat-message--ai .chat-message-name { color: var(--accent-blue); }
.chat-message--other .chat-message-name { color: var(--accent-purple, #a371f7); }

.chat-message-text { display: block; }

.chat-message--share {
  border: 1px solid var(--border);
  border-radius: 8px;
}

.chat-shared-context {
  padding: 6px 8px;
  background: var(--bg-deep);
  border-radius: 2px;
  margin-top: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* MCP UI inline components in chat — square chrome, distinct from round message bubbles */
.mcp-ui-compare { margin: 0; border: 1px solid var(--border); border-radius: 2px; overflow: hidden; background: var(--bg-deep); }
.mcp-ui-compare-title { padding: 3px 6px; font-size: 9px; font-weight: 600; color: var(--accent-blue); background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); text-transform: uppercase; letter-spacing: 0.3px; }
.mcp-ui-table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
.mcp-ui-table th { padding: 2px 4px; font-size: 9px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; text-align: center; border-bottom: 1px solid var(--border-subtle); line-height: 1.2; }
.mcp-ui-table th:first-child { text-align: left; width: 30%; }
.mcp-ui-table td { padding: 1px 2px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); text-align: center; }
.mcp-ui-table td:first-child { text-align: left; }
.mcp-ui-table tr:last-child td { border-bottom: none; }

/* Decision table overrides — tighter than default mcp-ui-table */
table.decision-table-grid { border-spacing: 0; white-space: normal; }
table.decision-table-grid th { padding: 2px 2px; font-size: 8px; line-height: 1.1; }
table.decision-table-grid td { padding: 1px 1px; border-bottom: none; vertical-align: middle; }
table.decision-table-grid td:first-child { font-size: 9px; color: var(--text-muted); padding-right: 4px; line-height: 1.1; }
.mcp-ui-label { color: var(--text-muted); font-size: 10px; }
.mcp-ui-highlight { color: var(--accent-green); font-weight: 600; }
.mcp-ui-link { color: var(--accent-blue); text-decoration: none; }
.mcp-ui-link:hover { text-decoration: underline; }
.mcp-ui-link.mcp-ui-highlight { color: var(--accent-green); }
.mcp-ui-compare-title .mcp-ui-link { color: var(--accent-blue); }
.chat-inline-component { margin: 0; }

/* Component-only messages: full width, square chrome, no extra spacing */
.chat-message:has(.chat-inline-component):not(:has(.chat-message-text)) { max-width: 100%; padding: 0; background: none; border-radius: 2px; white-space: normal; }
.chat-message:has(.chat-inline-component) { max-width: 100%; border-radius: 2px; white-space: normal; }

/* Decision table — interactive buttons in cells */
.decision-btn { background: var(--accent-blue); color: var(--color-on-accent); border: none; border-radius: 2px; padding: 2px 2px; font-family: inherit; font-size: 9px; font-weight: 600; cursor: pointer; text-align: center; transition: all 0.1s; display: block; width: 100%; line-height: 1.15; margin: 1px 0; }
.decision-btn:hover:not(:disabled) { opacity: 0.85; transform: scale(1.03); }
.decision-btn:disabled { opacity: 0.25; cursor: default; transform: none; }
.decision-btn--selected { background: var(--accent-green); color: var(--color-on-accent); }
.decision-col--eliminated { opacity: 0.2; }
.decision-col--eliminated .decision-btn { text-decoration: line-through; background: var(--bg-overlay); color: var(--text-muted); }

.chat-shared-context:hover {
  background: var(--bg-overlay);
}

/* Channel status bar above input */
.chat-channel-bar {
  display: none;
  padding: 3px 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}
.chat-channel-bar.active { display: block; }

/* Typing indicator */
.chat-status--typing { color: var(--accent-purple, #a371f7); }

.chat-component {
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 8px;
  background: var(--bg-deep);
}

/* Chat input bar */
.chat-input-bar { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-subtle); } /* layout-exception: chat domain layout */

.chat-input {
  flex: 1; /* layout-exception: chat domain layout */
  background: var(--bg-deep);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  resize: none;
  min-height: 36px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.chat-send-btn {
  background: var(--accent-blue);
  color: var(--color-on-accent);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chat-send-btn:hover {
  opacity: 0.9;
}

.chat-status {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 12px 4px;
  min-height: 16px;
}

/* Chat context label */
.chat-context-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 12px 2px; }

/* Chat panel */
.right-toggle-icon { display: inline-block; }

/* Edit Modal */
.edit-modal { max-width: 640px; }
.edit-modal-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 12px; }
.edit-modal-content { max-height: 70vh; overflow-y: auto; }
.edit-region-block { margin-bottom: 16px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 12px; }
.edit-region-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } /* layout-exception: edit domain layout */
.edit-region-name { font-size: 12px; font-weight: 600; color: var(--accent-purple); text-transform: uppercase; letter-spacing: 0.5px; min-width: 60px; }
.edit-component-select { background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; font-size: 12px; font-family: var(--font-mono); }
.edit-props-editor { width: 100%; background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-family: var(--font-mono); font-size: 12px; resize: vertical; tab-size: 2; }
.edit-props-editor:focus { outline: none; border-color: var(--accent-blue); }
.edit-region-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; } /* layout-exception: edit domain layout */
.edit-region-status { font-size: 11px; }

/* Modal — exception: mm-modal[open] display:flex is visibility toggle */
.mm-modal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; width: 80vw; height: 80vh; min-width: 320px; min-height: 400px; max-width: none; max-height: none; padding: 0; color: var(--text-primary); position: fixed; inset: 0; margin: auto; resize: none; }
.mm-modal[open] { display: flex; flex-direction: column; } /* layout-exception: visibility toggle */
.mm-modal[style*="top"] { margin: 0; inset: unset; }
.mm-modal--inline { position: relative; width: 100%; height: auto; max-width: 480px; margin: 8px auto; }
.mm-modal--sm { width: 50vw; height: auto; min-height: 200px; max-height: 60vh; }
/* Verify/ToSpec result rows */
.verify-loading { color: var(--text-muted); padding: 12px 0; }
.verify-error { color: var(--accent-red); }
.verify-skip { color: var(--text-muted); }
.verify-success { color: var(--accent-green); }
.verify-success code { display: block; margin-top: 8px; color: var(--text-primary); font-size: 13px; }
.verify-input { margin-bottom: 12px; font-size: 13px; }
.verify-input-label { color: var(--text-muted); }
.verify-input code { color: var(--accent-blue); }
.verify-checks { display: flex; flex-direction: column; gap: 8px; } /* layout-exception: verify domain layout */
.verify-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; } /* layout-exception: verify domain layout */
.verify-row--pass { background: color-mix(in srgb, var(--accent-green) 8%, transparent); }
.verify-row--fail { background: color-mix(in srgb, var(--accent-red) 8%, transparent); }
.verify-icon { flex-shrink: 0; }
.verify-field { font-weight: 600; min-width: 80px; }
.verify-value { color: var(--text-secondary); }
.verify-diff { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; } /* layout-exception: verify domain layout */
.verify-diff-label { font-size: 11px; color: var(--text-muted); margin-right: 4px; }
.verify-expected { color: var(--accent-green); word-break: break-word; }
.verify-actual { color: var(--accent-red); word-break: break-word; }
/* Pipeline inspector */
.pipeline-content { padding: 12px; font-size: 12px; overflow-y: auto; max-height: calc(100vh - 200px); }
.pipeline-phase { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.pipeline-phase-name { font-size: 11px; font-weight: 700; color: var(--accent-blue); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.pipeline-phase-body { display: flex; flex-direction: column; gap: 4px; } /* layout-exception: pipeline domain layout */
.pipeline-row { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; font-size: 12px; } /* layout-exception: pipeline domain layout */
.pipeline-row--editable { background: color-mix(in srgb, var(--accent-blue) 6%, transparent); border-radius: 4px; padding: 4px 6px; }
.pipeline-label { font-weight: 600; color: var(--text-muted); min-width: 90px; flex-shrink: 0; }
.pipeline-value { color: var(--text-primary); word-break: break-word; }
.pipeline-value--mono { font-family: var(--font-mono); font-size: 11px; }
.pipeline-input { background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; font-size: 12px; font-family: inherit; flex: 1; min-width: 0; }
.pipeline-input:focus { outline: none; border-color: var(--accent-blue); }
.pipeline-tree-header { font-weight: 600; color: var(--text-bright); margin-bottom: 8px; }
.pipeline-region { border: 1px solid var(--border-subtle); border-radius: 6px; padding: 8px; margin-bottom: 6px; }
.pipeline-region-name { font-size: 11px; font-weight: 700; color: var(--accent-purple); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.pipeline-props-details { margin-top: 4px; }
.pipeline-props-details summary { font-size: 11px; color: var(--text-muted); cursor: pointer; }
.pipeline-props-json { background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 8px; font-size: 11px; font-family: var(--font-mono); overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.pipeline-erb-source { background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 10px; font-size: 11px; font-family: var(--font-mono); overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin-top: 8px; line-height: 1.6; }
.pipeline-css-rule { border: 1px solid var(--border-subtle); border-radius: 4px; padding: 6px; margin-bottom: 6px; }
.pipeline-css-selector { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent-blue); margin-bottom: 4px; }
.pipeline-template { display: flex; flex-direction: column; gap: 4px; } /* layout-exception: pipeline domain layout */
.pipeline-resolution { display: flex; flex-direction: column; gap: 4px; } /* layout-exception: pipeline domain layout */
/* Style tab interactive elements */
.pipeline-row--clickable { cursor: pointer; }
.pipeline-row--clickable:hover { background: color-mix(in srgb, var(--accent-blue) 6%, transparent); }
.pipeline-value--editable { cursor: text; border-bottom: 1px dashed var(--border-subtle); }
.pipeline-value--editable:hover { border-color: var(--accent-blue); }
.pipeline-css-selector--clickable { cursor: pointer; }
.pipeline-css-selector--clickable:hover { text-decoration: underline; }
.pipeline-inline-input { background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--accent-blue); border-radius: 3px; padding: 2px 6px; font-size: 12px; font-family: var(--font-mono); width: 120px; }
.pipeline-inline-actions { display: inline-flex; gap: 4px; margin-left: 6px; } /* layout-exception: inline editing controls */
.pipeline-inline-btn { background: var(--accent-blue); color: var(--color-on-accent, #fff); border: none; border-radius: 3px; padding: 2px 8px; font-size: 11px; cursor: pointer; font-family: inherit; }
.pipeline-inline-btn--muted { background: var(--bg-overlay); color: var(--text-muted); }
.pipeline-inline-btn:hover { opacity: 0.9; }
.pipeline-color-swatch { width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 3px; padding: 0; cursor: pointer; vertical-align: middle; margin-left: 4px; }
.pipeline-cascade { background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 8px; margin: 4px 0; font-size: 12px; }
.pipeline-cascade-header { font-family: var(--font-mono); font-weight: 600; margin-bottom: 4px; color: var(--text-bright); }
.pipeline-cascade-actions { display: flex; gap: 6px; margin-top: 6px; } /* layout-exception: cascade action buttons */
/* Intention pane */
.intention-category-label { font-size: 11px; font-weight: 700; color: var(--accent-purple); text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; padding: 4px 0; }
.pipeline-intent { display: flex; flex-direction: column; gap: 4px; } /* layout-exception: intent domain layout */
.pipeline-intent .pipeline-input { font-family: inherit; }
.pipeline-intent textarea.pipeline-input { resize: vertical; }
/* Tune sliders */
.pipeline-tune { display: flex; flex-direction: column; gap: 4px; } /* layout-exception: tune domain layout */
.tune-slider-row { align-items: center; }
.tune-slider { flex: 1; min-width: 80px; accent-color: var(--accent-blue); cursor: pointer; }
.tune-slider-value { font-family: var(--font-mono); font-size: 11px; min-width: 40px; text-align: right; color: var(--accent-blue); }
/* Role switcher */
.editor-sidebar-header { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-bottom: 1px solid var(--border-subtle); } /* layout-exception: sidebar header */
.editor-role-select { background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-size: 11px; font-family: inherit; cursor: pointer; flex: 1; }
/* Provenance owner attribution */
.provenance-owner { font-size: 10px; font-weight: 400; color: var(--accent-purple); background: color-mix(in srgb, var(--accent-purple) 10%, transparent); padding: 1px 6px; border-radius: 8px; margin-left: 6px; }
/* Playground */
.playground-input-bar { display: flex; gap: 6px; margin-bottom: 8px; } /* layout-exception: playground input */
.playground-message-input { flex: 1; }
.playground-history { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; } /* layout-exception: playground history */
.playground-history-entry { font-size: 11px; color: var(--accent-blue); background: color-mix(in srgb, var(--accent-blue) 8%, transparent); padding: 2px 8px; border-radius: 10px; cursor: pointer; }
.playground-history-entry:hover { background: color-mix(in srgb, var(--accent-blue) 15%, transparent); }
/* Execution trace */
.execution-arrow { text-align: center; color: var(--text-muted); font-size: 16px; line-height: 1; padding: 2px 0; }
.provenance-links { display: flex; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-subtle); } /* layout-exception: provenance cross-links */
.mm-modal::backdrop { background: color-mix(in srgb, var(--bg-deep) 40%, transparent); pointer-events: none; }
/* Modal header */
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); cursor: grab; user-select: none; } /* layout-exception: modal domain layout */
.modal-header:active { cursor: grabbing; }
.modal-title { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text-bright); }
.modal-body { overflow-y: auto; flex: 1; padding: 16px; font-size: 13px; } /* layout-exception: modal domain layout */
/* Modal tabs */
.modal-tabs { display: flex; gap: 4px; } /* layout-exception: modal domain layout */
.modal-tab { background: none; border: none; color: var(--text-secondary); padding: 6px 12px; font-size: 12px; font-family: inherit; cursor: pointer; border-radius: 6px; }
.modal-tab:hover { color: var(--text-primary); background: var(--bg-overlay); }
.modal-tab.active { color: var(--accent-blue); background: color-mix(in srgb, var(--accent-blue) 10%, transparent); }
.modal-tab-panel { display: none; padding: 16px; font-size: 13px; }
.modal-tab-panel.active { display: block; }
.modal-status-line { padding: 4px 0; }

/* Accordion in modals */
.modal-accordion-tab { cursor: pointer; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); user-select: none; }
.modal-accordion-tab::before { content: "\25B6  "; font-size: 10px; }
.modal-accordion-tab.open::before { content: "\25BC  "; }
.modal-accordion-tab:hover { color: var(--text-bright); }
.modal-accordion-panel { display: none; padding: 8px 12px; }
.modal-accordion-panel.open { display: block; }

/* Quick action toggles — layout via .row.justify-between in markup */
.quick-action { padding: 4px 0; }
.quick-toggle { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--text-primary); } /* layout-exception: toggle domain layout */
.quick-toggle-label { font-size: 13px; }
.quick-toggle-switch { background: var(--border); border-radius: 10px; width: 36px; height: 20px; position: relative; cursor: pointer; transition: background 0.15s; }
.quick-toggle-switch.on { background: var(--accent-blue); }
.quick-toggle-switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: white; top: 2px; left: 2px; transition: left 0.15s; }
.quick-toggle-switch.on::after { left: 18px; }

.role-option { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; color: var(--text-primary); cursor: pointer; } /* layout-exception: form domain layout */
.role-option input[type="radio"] { accent-color: var(--accent-blue); }

.context-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; } /* layout-exception: context domain layout */
.context-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border-radius: 4px; font-size: 12px; } /* layout-exception: context domain layout */
.context-item:hover { background: var(--bg-overlay); }
.context-item-info { display: flex; gap: 6px; min-width: 0; flex: 1; } /* layout-exception: context domain layout */
.context-item-target { font-weight: 600; color: var(--accent-blue); font-size: 11px; white-space: nowrap; }
.context-item-summary { color: var(--text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-item-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.context-item-delete:hover { color: var(--accent-red, #f85149); }
.context-clear-btn { background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); padding: 4px 10px; font-size: 11px; font-family: inherit; cursor: pointer; margin-top: 4px; }
.context-clear-btn:hover { color: var(--accent-red, #f85149); border-color: var(--accent-red, #f85149); }

/* Chat inline components */
.chat-message--component { padding: 4px 0; max-width: 100%; background: none; border-radius: 0; white-space: normal; }
.chat-message--actions { max-width: 100%; background: none; border-radius: 0; white-space: normal; }
.chat-data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.chat-data-table caption { font-weight: 600; font-size: 12px; text-align: left; padding: 4px 0; }
.chat-data-table th { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-muted); }
.chat-data-table td { padding: 4px 6px; border-bottom: 1px solid var(--border-subtle); }
.chat-product-list-title { font-weight: 600; font-size: 12px; padding: 4px 0; }
.chat-product-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; } /* layout-exception: product list domain layout */
.chat-product-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface, #fff); transition: border-color 0.15s, background 0.15s; } /* layout-exception: product list domain layout */
.chat-product-item[data-product-url]:hover { border-color: var(--accent-blue); background: var(--bg-overlay, #f0f4ff); }
.chat-product-name { font-weight: 600; font-size: 12px; }
.chat-product-brand { font-size: 11px; color: var(--text-muted); }
.chat-product-price { font-size: 12px; font-weight: 600; color: var(--accent-blue); margin-left: auto; }
.chat-product-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; text-decoration: none; color: inherit; width: 100%; } /* layout-exception: product list domain layout */
.chat-message--actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; } /* layout-exception: action button group */
.chat-action-btn { background: var(--bg-surface, #fff); border: 1px solid var(--accent-blue); border-radius: 4px; color: var(--accent-blue); padding: 4px 10px; font-size: 11px; font-family: inherit; cursor: pointer; }
.chat-action-btn:hover { background: var(--accent-blue); color: #fff; }

/* Context shelf — accordion product tray above chat messages */
.chat-shelf { display: flex; flex-direction: column; border-bottom: 1px solid var(--border-subtle); background: var(--bg-deep); flex-shrink: 0; max-height: 40vh; overflow-y: auto; } /* layout-exception: shelf domain layout */
.chat-shelf.hidden { display: none; }
.chat-shelf:empty { display: none; }

/* Accordion sections */
.shelf-accordion { border-bottom: 1px solid var(--border-subtle); }
.shelf-accordion:last-child { border-bottom: none; }
.shelf-accordion-header { display: flex; align-items: center; gap: 4px; padding: 5px 8px; font-size: 11px; font-weight: 600; color: var(--text-secondary); cursor: pointer; user-select: none; } /* layout-exception: shelf domain layout */
.shelf-accordion-header:hover { color: var(--text-primary); background: var(--bg-overlay); }
.shelf-accordion-arrow { font-size: 9px; width: 12px; text-align: center; }
.shelf-accordion-body { display: none; padding: 2px 8px 6px; }
.shelf-accordion.open .shelf-accordion-body { display: flex; flex-direction: column; gap: 3px; } /* layout-exception: shelf domain layout */

/* Shelf cards and actions */
.shelf-card { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface); font-size: 11px; transition: border-color 0.15s; }
.shelf-card:hover { border-color: var(--accent-blue); }
.shelf-card-name { display: inline; font-size: 11px; font-weight: 600; }
.shelf-card-meta { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.shelf-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0; } /* layout-exception: shelf domain layout */
.shelf-card--explored { border-color: var(--accent-blue); background: color-mix(in srgb, var(--accent-blue) 5%, var(--bg-surface)); }
.shelf-card--explored .shelf-card-name { color: var(--accent-blue); }

/* Provenance — designer mode shows source trace on interactive elements */
[data-role="designer"] .has-provenance { outline: 1px dashed var(--accent-purple, #a371f7); position: relative; }
[data-role="designer"] .has-provenance:hover { outline-color: var(--accent-blue); }
[data-role="designer"] .has-provenance::after { content: attr(data-provenance-label); position: absolute; top: -14px; right: 0; font-size: 8px; color: var(--accent-purple, #a371f7); background: var(--bg-surface); padding: 0 3px; border-radius: 2px; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
[data-role="designer"] .has-provenance:hover::after { opacity: 1; }

/* Folder dividers — thin separators between conversation directions */
.chat-folder-header { text-align: center; font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 0; margin: 4px 0; border-top: 1px solid var(--border-subtle); }

.use-case-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; } /* layout-exception: list domain layout */
.use-case-item { display: block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text-primary); }
.use-case-item:hover { background: var(--bg-overlay); border-color: var(--accent-blue); }
.use-case-name { font-size: 13px; font-weight: 600; }
.use-case-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Designer styles tab */
.editor-styles-content { padding: 8px 12px; font-size: 12px; overflow-y: auto; flex: 1; min-height: 0; } /* layout-exception: editor domain layout */
.style-selector-group { margin-bottom: 12px; }
.style-selector-label { font-size: 11px; font-weight: 600; color: var(--accent-blue); font-family: var(--font-mono, monospace); padding: 4px 0; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.style-prop-row { display: grid; grid-template-columns: 100px 1fr; gap: 4px; align-items: center; padding: 2px 0; } /* layout-exception: editor domain layout */
.style-prop-label { font-size: 11px; color: var(--text-muted); text-align: right; padding-right: 4px; }
.style-prop-input { background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; font-family: var(--font-mono, monospace); font-size: 11px; }
.style-prop-input:focus { outline: none; border-color: var(--accent-blue); }

.modal-label { display: block; font-size: 11px; color: var(--text-muted); margin: 8px 0 4px; }
.modal-select { width: 100%; background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-family: inherit; font-size: 13px; }
.modal-textarea { width: 100%; min-height: 80px; background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-family: inherit; font-size: 12px; resize: vertical; }
.modal-range { width: 100%; accent-color: var(--accent-blue); }
.modal-input { width: 100px; background: var(--bg-deep); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-family: inherit; font-size: 13px; }
.modal-badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--bg-overlay); color: var(--text-muted); margin-left: 4px; }
.modal-btn { background: var(--accent-blue); color: var(--color-on-accent); border: none; border-radius: 6px; padding: 8px 16px; font-family: inherit; font-size: 13px; cursor: pointer; }
.modal-btn:hover { opacity: 0.9; }

/* Header action buttons */
/* Role badge in header */
.header-role-badge { font-size: 11px; font-weight: 600; color: var(--accent-blue); background: color-mix(in srgb, var(--accent-blue) 10%, transparent); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }

.header-action-btn { background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); padding: 2px 8px; font-family: inherit; font-size: 12px; cursor: pointer; }
.header-action-btn:hover { color: var(--accent-blue); border-color: var(--accent-blue); }

/* Modal popover (mouseover preview) */
.modal-popover { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text-primary); z-index: 1000; max-width: 320px; min-width: 200px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.modal-popover-title { font-size: 12px; font-weight: 600; color: var(--text-bright); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border-subtle); }
.modal-popover .modal-body { padding: 0; overflow: visible; }
.modal-popover .modal-tabs { margin-bottom: 6px; }

/* AI button status states */
.header-action-btn[data-ai-status="thinking"] { animation: ai-pulse 1.2s ease-in-out infinite; color: var(--accent-blue); border-color: var(--accent-blue); }
.header-action-btn[data-ai-status="error"] { color: var(--accent-red, #f85149); border-color: var(--accent-red, #f85149); }
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Inline action buttons in chat messages */
.chat-action-btn { background: var(--accent-blue); color: var(--color-on-accent); border: none; border-radius: 6px; padding: 2px 10px; font-family: inherit; font-size: 12px; cursor: pointer; margin-top: 6px; display: inline-block; }
.chat-action-btn:hover { opacity: 0.9; }

/* data-state selectors */
.chat-panel[data-state="expanded"] .right-content,
.chat-panel.right--full .right-content,
.chat-panel[data-panel-state="full"] .right-content { display: flex; flex-direction: column; flex: 1; min-height: 0; } /* layout-exception: chat domain layout */
.chat-panel[data-state="collapsed"] .right-content { display: none; }
.header-breadcrumb[data-state="loading"] { opacity: 0.5; }
.header-action-btn[data-state="active"] { color: var(--accent-blue); border-color: var(--accent-blue); }
.header-action-btn[data-state="disabled"] { opacity: 0.4; pointer-events: none; }
.mm-modal[data-state="loading"] .modal-body { opacity: 0.5; }

.participants-list { display: flex; flex-direction: column; gap: 4px; } /* layout-exception: list domain layout */
.participant-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; } /* layout-exception: list domain layout */
.participant-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.participant-status-dot.online { background: var(--accent-green, #3fb950); }
.participant-status-dot.offline { background: var(--text-muted); opacity: 0.4; }
.participant-name { flex: 1; color: var(--text-primary); } /* layout-exception: list domain layout */
.participant-role-badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--bg-overlay); color: var(--text-muted); }

/* Invite section */
.invite-section { padding: 4px 0; }
.invite-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.invite-session-id { font-family: var(--font-mono, monospace); font-size: 13px; color: var(--accent-blue); background: var(--bg-deep); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); user-select: all; }

.others-channels { display: flex; flex-direction: column; gap: 6px; } /* layout-exception: channel domain layout */
.others-channel-controls { display: flex; gap: 6px; } /* layout-exception: channel domain layout */
.others-channel-controls button { flex: 1; /* layout-exception: channel domain layout */ padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface); color: var(--text-primary); font-family: inherit; font-size: 12px; cursor: pointer; }
.others-channel-controls button:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.others-channel-controls button.channel-active { background: var(--accent-blue); color: var(--color-on-accent); border-color: var(--accent-blue); }
.channel-status { font-size: 11px; color: var(--text-muted); padding: 2px 0; min-height: 0; }
.channel-status:empty { display: none; }

/* Screen share preview */
.screen-share-preview { max-height: 200px; overflow: hidden; border-radius: 4px; }
.screen-share-preview:empty { display: none; }
.screen-share-video { width: 100%; border-radius: 4px; }

.remote-videos-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px; } /* layout-exception: video domain layout */
/* Video containers */
.local-video-container { position: relative; }
.local-video-container video { width: 120px; border-radius: 4px; }
.local-video-container video:not([src]):not([srcObject]) { display: none; }
.remote-videos-container:empty { display: none; }
.remote-video { width: 100%; border-radius: 4px; }
