/* console.css — Visual design for ah-hi Console
 * Generated stub by tools/codegen.py — IMPLEMENT the CREATIVE sections.
 *
 * DESIGN AUTHORITY:
 *   docs/D-70-ARTIFACT-INTERFACE-DESIGN.md
 *   specs/IS-CONSOLE.md §3.10 Visual Design Language
 *   specs/CONSOLE-PROTOTYPE.jsx (117K working reference)
 *
 * DOM STRUCTURE (from index.html):
 *   body > #sidebar, #main-col, #input-bar, #debug-drawer
 *   #main-col > #observatory (canvas), #chat-messages
 *   #sidebar > #folio-tabs + #folio-content > .folio-panel (#rt-list, #library-list, #analysis-list, #journals-list, #insights-list)
 */

/* ══════════════════════════════════════════════════════
 * CREATIVE: Implement all styles below.
 *
 * Read D-70 and IS-CONSOLE §3.10 before writing any CSS.
 * The prototype (CONSOLE-PROTOTYPE.jsx) has working examples.
 * ══════════════════════════════════════════════════════ */

/* ── 1. CSS Variables (D-70 §Implementation Notes, IS-CONSOLE §3.10.1) ──
 *
 * REQUIRED — define on :root:
 *
 * Background layers:
 *   --bg-void:     #06080f    (deepest layer — the void)
 *   --bg-surface:  #0a0d16    (card surfaces)
 *   --bg-elevated: #0f1320    (hover states, modals)
 *   --bg-glass:    rgba(10, 13, 22, 0.85)  (frosted overlays)
 *
 * Cell colors (29 unique, all WCAG AA against --bg-void):
 *   --cell-beacon:    #E8C547   (gold — command, warmth)
 *   --cell-morgan:    #7EB8DA   (soft sky — care)
 *   ... (see IS-CONSOLE §3.10.1 for full palette)
 *
 * State colors:
 *   --state-fresh:  rgba(255,255,255, 0.85)
 *   --state-idle:   rgba(255,255,255, 0.35)
 *   --state-error:  #C75050
 *
 * Artifact (D-70 §Implementation Notes):
 *   --artifact-border, --artifact-bg, --artifact-border-hover, --artifact-bg-hover
 *   --viewer-backdrop, --viewer-surface, --viewer-border, --viewer-shadow
 *   --syn-keyword, --syn-string, --syn-number, --syn-comment, etc.
 */

/* ── 1b. Variables ── */
:root {
  --bg-void: #06080f;
  --bg-surface: #0a0d16;
  --bg-elevated: #0f1320;
  --state-fresh: rgba(255,255,255, 0.85);
  --state-idle: rgba(255,255,255, 0.35);
  --state-error: #C75050;
}

/* ── 2. Reset + Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; overflow: hidden; }

/* ── Scrollbars (thin, dark, unobtrusive) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}
*::-webkit-scrollbar-corner { background: transparent; }

body {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  background: var(--bg-void);
  color: var(--state-fresh);
  display: grid;
  height: 100vh;
  grid-template-rows: 1fr auto 0;
  grid-template-columns: 380px 1fr 0;
  grid-template-areas: "sidebar main viewer" "sidebar input viewer" "debug debug debug";
  transition: grid-template-columns 250ms ease, grid-template-rows 200ms ease;
}
body.viewer-open {
  grid-template-columns: 380px 1fr min(50vw, 720px);
}
body.debug-open {
  grid-template-rows: 1fr auto 200px;
}

/* ── 3b. Folio Tabs (vertical, left edge of sidebar) ── */
#folio-tabs {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0;
  background: var(--bg-void);
  border-right: 1px solid rgba(255,255,255,0.04);
}

.folio-tab {
  width: 36px;
  flex: 1;
  border: none;
  background: none;
  color: var(--state-idle);
  font: inherit;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  transition: background 150ms, color 150ms, border-color 150ms;
  position: relative;
  border-left: 2px solid transparent;
  white-space: nowrap;
}

/* Per-tab accent colors */
.folio-tab[data-section="observatory"]  { --tab-color: #e8c547; }
.folio-tab[data-section="roundtables"] { --tab-color: #47b8e8; }
.folio-tab[data-section="library"]     { --tab-color: #e87847; }
.folio-tab[data-section="analysis"]    { --tab-color: #a347e8; }
.folio-tab[data-section="journals"]    { --tab-color: #47e88c; }
.folio-tab[data-section="insights"]    { --tab-color: #e84787; }

.folio-tab:hover {
  background: var(--bg-elevated);
  color: var(--tab-color);
  border-left-color: var(--tab-color);
}

.folio-tab.active {
  background: var(--bg-surface);
  color: var(--tab-color);
  border-left-color: var(--tab-color);
  border-right: 1px solid var(--bg-surface);
  margin-right: -1px;
  z-index: 1;
}

/* Unread dot on folio tab */
.folio-tab.has-unread::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tab-color);
  animation: unread-pulse 2s ease-in-out infinite;
}

/* ── Unread indicators ── */
.rt-item.unread { position: relative; color: var(--state-fresh); }
.rt-item.unread::after {
  content: '';
  position: absolute;
  top: 50%; transform: translateY(-50%);
  right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--state-fresh);
  animation: unread-pulse 2s ease-in-out infinite;
}
@keyframes unread-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ── Folio Content Panel ── */
#folio-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.folio-panel {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: none;
}
.folio-panel.active {
  display: block;
}

.folio-new-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px;
  padding: 6px;
  background: none;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--state-idle);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms, color 150ms;
}
.folio-new-btn:hover {
  border-color: rgba(71, 184, 232, 0.3);
  color: #47b8e8;
}

/* ── 4b. Sidebar (folio layout: tabs strip + content panel) ── */
#sidebar {
  grid-area: sidebar;
  background: var(--bg-surface);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
}

/* ── Sidebar Search ── */
#sidebar-search {
  padding: 10px 12px 6px;
  flex-shrink: 0;
}
#sidebar-search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--state-fresh);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
}
#sidebar-search-input:focus {
  border-color: rgba(232,197,71,0.4);
  box-shadow: 0 0 0 1px rgba(232,197,71,0.1);
}
#sidebar-search-input::placeholder {
  color: var(--state-idle);
}

/* ── Roundtable Items ── */
.rt-item {
  padding: 6px 16px;
  cursor: pointer;
  font-size: 12px;
  color: var(--state-idle);
  display: flex;
  align-items: center;
  gap: 4px;
}
.rt-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-item-edit {
  flex-shrink: 0;
  background: none; border: none; color: var(--state-idle);
  font-size: 11px; cursor: pointer; padding: 0 2px;
  opacity: 0; transition: opacity 0.15s;
}
.rt-item:hover .rt-item-edit { opacity: 0.6; }
.rt-item-edit:hover { opacity: 1 !important; color: var(--state-fresh); }
.rt-rename-input {
  flex: 1; min-width: 0;
  background: var(--bg-elevated); border: 1px solid rgba(232,197,71,0.4);
  color: #fff; font-size: 12px; padding: 2px 6px;
  border-radius: 3px; outline: none;
  font-family: inherit;
}
.rt-rename-input:focus { border-color: #E8C547; }
.rt-item:hover { background: var(--bg-elevated); color: var(--state-fresh); }
.rt-item.active { color: #fff; border-left: 2px solid #E8C547; }

/* ── Sidebar Items (library, journal, insight) ── */
.sidebar-item {
  padding: 5px 12px 5px 16px;
  cursor: pointer;
  font-size: 11px;
  color: var(--state-idle);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 100ms;
}
.sidebar-item:hover {
  background: var(--bg-elevated);
  color: var(--state-fresh);
}
.sidebar-item-icon {
  font-size: 12px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}
.sidebar-item-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-item-meta {
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
  white-space: nowrap;
}

.cell-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
#version-tag {
  padding: 12px 16px 8px;
  font-size: 10px;
  font-family: monospace;
  color: rgba(255,255,255,0.15);
  margin-top: auto;
}

/* ── Item Full View (cmd+click opens as tab) ── */
.item-full-view {
  padding: 24px;
}
.item-full-header {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: var(--bg-elevated);
}
.item-full-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.item-full-meta {
  font-size: 11px;
  color: var(--state-idle);
}
.item-full-description {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
  line-height: 1.4;
}
.item-full-content {
  padding: 0 4px;
}

/* ── 5b. Main Content ── */
#main-col {
  grid-area: main;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}
#observatory { width: 100%; height: 100%; display: block; }
#chat-messages { padding: 16px; display: flex; flex-direction: column; gap: 8px; }

/* ── 6b. Messages ── */
.message {
  padding: 10px 14px;
  border-radius: 6px;
}
.message-human { background: var(--bg-elevated); }
.message-header { margin-bottom: 4px; }
.cell-name {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.cell-designation {
  font-size: 10px;
  color: var(--state-idle);
  margin-left: 6px;
}
.message-timestamp {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  margin-left: 8px;
  cursor: default;
}
.message-timestamp:hover { color: rgba(255,255,255,0.5); }
.entry-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}
.entry-badge-tool {
  background: rgba(255, 180, 50, 0.15);
  color: rgb(255, 180, 50);
  border: 1px solid rgba(255, 180, 50, 0.3);
}
.entry-badge-result {
  background: rgba(80, 200, 120, 0.15);
  color: rgb(80, 200, 120);
  border: 1px solid rgba(80, 200, 120, 0.3);
}
.entry-badge-thinking {
  background: rgba(180, 140, 255, 0.15);
  color: rgb(180, 140, 255);
  border: 1px solid rgba(180, 140, 255, 0.3);
}
.entry-badge-insight {
  background: rgba(100, 200, 255, 0.15);
  color: rgb(100, 200, 255);
  border: 1px solid rgba(100, 200, 255, 0.3);
}
.entry-badge-journal {
  background: rgba(160, 210, 130, 0.15);
  color: rgb(160, 210, 130);
  border: 1px solid rgba(160, 210, 130, 0.3);
}

/* Markdown body — rendered by marked.js */
.message-body { line-height: 1.55; color: var(--state-fresh); }
.message-body p { margin: 0.4em 0; }
.message-body p:first-child { margin-top: 0; }
.message-body p:last-child { margin-bottom: 0; }
.message-body strong { color: #fff; }
.message-body em { font-style: italic; color: rgba(255,255,255,0.7); }
.message-body ul, .message-body ol { padding-left: 1.4em; margin: 0.4em 0; }
.message-body li { margin: 0.2em 0; }
.message-body a { color: #7EB8DA; text-decoration: none; }
.message-body a:hover { text-decoration: underline; }
.message-body blockquote {
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 12px;
  margin: 0.5em 0;
  color: rgba(255,255,255,0.6);
}
.message-body code {
  font-family: inherit;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.message-body pre {
  background: var(--bg-void);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0.5em 0;
  overflow-x: auto;
}
.message-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
}
.message-body table { border-collapse: collapse; margin: 0.5em 0; width: 100%; }
.message-body th, .message-body td {
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 8px;
  text-align: left;
  font-size: 12px;
}
.message-body th { background: rgba(255,255,255,0.04); color: #fff; }
.message-body h1, .message-body h2, .message-body h3,
.message-body h4, .message-body h5, .message-body h6 {
  color: #fff;
  margin: 0.6em 0 0.3em;
  font-size: 13px;
  font-weight: 600;
}
.message-body h1 { font-size: 16px; }
.message-body h2 { font-size: 15px; }
.message-body h3 { font-size: 14px; }
.message-body hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0.6em 0;
}

/* JSON tree renderer */
.json-tree {
  font-size: 12px;
  line-height: 1.6;
}
.json-object-root {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.json-object {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.06);
  margin: 2px 0;
}
.json-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.json-key {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  min-width: max-content;
  flex-shrink: 0;
}
.json-key::after { content: ':'; }
.json-val { flex: 1; min-width: 0; }
.json-string { color: #7EB8DA; word-break: break-word; }
.json-string-block {
  display: block;
  white-space: pre-wrap;
  background: var(--bg-void);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 6px 8px;
  margin: 2px 0;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.json-number { color: #60D9A0; }
.json-boolean { color: #E8C547; }
.json-null { color: rgba(255,255,255,0.25); font-style: italic; }
.json-bracket { color: rgba(255,255,255,0.3); }
.json-array-inline { color: #7EB8DA; font-size: 11px; }
.json-array { padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.06); }
.json-array-item { margin: 1px 0; }

/* System messages */
.message-system {
  font-style: italic;
  color: var(--state-idle);
  font-size: 12px;
  padding: 4px 14px;
  text-align: center;
}

/* ── Synthesis Indicator (fixed at bottom of main-col) ── */
.synthesis-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: rgba(232, 197, 71, 0.7);
  letter-spacing: 0.04em;
  transition: opacity 300ms ease, transform 300ms ease;
}
.synthesis-indicator.hidden {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

.synthesis-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(232, 197, 71, 0.15);
  border-top-color: rgba(232, 197, 71, 0.7);
  border-radius: 50%;
  animation: synthesis-spin 0.8s linear infinite;
}

.synthesis-label {
  animation: synthesis-pulse 2s ease-in-out infinite;
}

@keyframes synthesis-spin {
  to { transform: rotate(360deg); }
}

@keyframes synthesis-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.turn-separator {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  padding: 6px 0;
  position: relative;
}
.turn-separator::before, .turn-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.turn-separator::before { left: 0; }
.turn-separator::after { right: 0; }

/* ── 10b. Input Bar ── */
#input-bar {
  grid-area: input;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-top: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
#msg-input {
  width: 100%;
  min-height: 80px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--state-fresh);
  font: inherit;
  font-size: 13px;
  padding: 8px 44px 8px 12px;
  resize: none;
  outline: none;
}
#msg-input:focus { border-color: #E8C547; box-shadow: 0 0 0 1px rgba(232,197,71,0.2); }
#msg-input::placeholder { color: var(--state-idle); }

/* ── 11b. Debug Drawer (grid row controlled by body.debug-open) ── */
#debug-drawer {
  grid-area: debug;
  background: var(--bg-void);
  border-top: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  padding: 0 12px;
}
body.debug-open #debug-drawer { overflow-y: auto; padding: 8px 12px; }
#debug-log {
  font-size: 11px;
  color: var(--state-idle);
  white-space: pre-wrap;
  font-family: inherit;
}

/* ── Copy message button ── */
.msg-copy-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.15);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 6px;
  font-family: inherit;
  line-height: 1;
  vertical-align: middle;
  transition: color 150ms;
  opacity: 0;
}
.message:hover .msg-copy-btn { opacity: 1; }
.msg-copy-btn:hover { color: rgba(255,255,255,0.6); }
.msg-copy-btn.copied { color: #60D9A0; opacity: 1; }

/* ── Copy transcript link button (top-right of main-col) ── */
.copy-link-btn {
  position: sticky;
  top: 8px;
  float: right;
  z-index: 10;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
  font-family: inherit;
  margin: 8px 12px 0 0;
}
.copy-link-btn:hover {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}
.copy-link-btn.copied {
  color: #60D9A0;
  border-color: rgba(96,217,160,0.3);
}

/* ── 3. Folio Sidebar ── */

/* Folio layout: vertical tab strip (left edge) + content panel (right)
 * #folio-tabs: 36px narrow strip, vertical text, per-tab accent colors
 * .folio-tab: writing-mode: vertical-rl, rotated 180deg (reads bottom-to-top)
 * #folio-content: item list for active section
 * .folio-panel: one visible at a time
 */

/* ── 5. Main Content Area ── */

/* CREATIVE:
 * #main-col: overflow-y auto, position relative
 * #observatory: full width/height canvas
 * #chat-messages: padding, flex column, gap
 */

/* ── 6. Message Styling (D-70 §Part 1, IS-CONSOLE §3.10) ── */

/* CREATIVE: Message bubbles
 * .message: cell color bar (left border), padding, background,
 *   border-radius, margin-bottom
 * .message-name: uppercase, cell color, 10px, letter-spacing
 * .message-designation: smaller, muted, follows name
 * .message-content: 13px, line-height 1.5, color --state-fresh
 * .message-timestamp: muted, small, right-aligned or inline
 * .message-user: differentiated for Tony (white accent, different bg)
 * .message-system: italic, muted, centered
 * .turn-separator: horizontal rule, centered turn number, subtle
 *
 * Tool calls:
 * .tool-badge: inline badge with tool name
 * .tool-badge.pending: spinning indicator
 * .tool-badge.success: green tint
 * .tool-badge.error: red tint
 *
 * Animation:
 * .message-enter: opacity 0→1, translateY(4px→0), 200ms ease-out
 */

/* ── 7. Artifact Cards (D-70 §Part 1) ── */

.artifact-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.artifact-card {
  border: 1px dashed rgba(var(--card-r, 160), var(--card-g, 160), var(--card-b, 160), 0.25);
  border-radius: 10px;
  padding: 12px 16px;
  background: rgba(var(--card-r, 160), var(--card-g, 160), var(--card-b, 160), 0.04);
  transition: border-color 200ms ease-out, background 200ms ease-out, box-shadow 200ms ease-out;
  cursor: pointer;
  animation: artifact-card-enter 350ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.artifact-card:hover {
  border-color: rgba(var(--card-r, 160), var(--card-g, 160), var(--card-b, 160), 0.4);
  background: rgba(var(--card-r, 160), var(--card-g, 160), var(--card-b, 160), 0.07);
  box-shadow: 0 2px 12px rgba(var(--card-r, 160), var(--card-g, 160), var(--card-b, 160), 0.1);
}

@keyframes artifact-card-enter {
  from { opacity: 0; max-height: 0; padding: 0 16px; }
  to   { opacity: 1; max-height: 200px; padding: 12px 16px; }
}

.artifact-card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.artifact-icon { font-size: 16px; flex-shrink: 0; }
.artifact-filename {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-size {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.artifact-card-description {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.artifact-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}
.artifact-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
  font-family: inherit;
}
.artifact-btn:hover {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}

/* ── 8. Artifact Viewer (D-70 §Part 3) ── */

/* Right-side panel — part of grid layout, pushes content left when open */
#viewer-panel {
  grid-area: viewer;
  display: none;
  flex-direction: column;
  background: var(--bg-surface, #0a0d16);
  border-left: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  min-width: 0;
}
body.viewer-open #viewer-panel {
  display: flex;
}

.viewer-header {
  position: sticky;
  top: 0;
  z-index: 52;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-elevated, #0f1320);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.viewer-filename {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.viewer-size {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-height: 0;
}

/* Type-specific viewer styles */
.viewer-markdown {
  line-height: 1.6;
  color: rgba(255,255,255,0.8);
}
.viewer-markdown h1, .viewer-markdown h2, .viewer-markdown h3 { color: #fff; margin: 0.8em 0 0.4em; }
.viewer-markdown h1 { font-size: 18px; }
.viewer-markdown h2 { font-size: 16px; }
.viewer-markdown h3 { font-size: 14px; }
.viewer-markdown p { margin: 0.5em 0; }
.viewer-markdown code {
  font-family: inherit;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.viewer-markdown pre {
  background: var(--bg-void, #06080f);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
}
.viewer-markdown pre code { background: none; padding: 0; }
.viewer-markdown ul, .viewer-markdown ol { padding-left: 1.5em; }
.viewer-markdown blockquote {
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0.5em 0;
}

.viewer-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
  word-break: break-all;
  tab-size: 2;
  background: var(--bg-void, #06080f);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
}

.viewer-csv-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.viewer-csv-table th,
.viewer-csv-table td {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 10px;
  text-align: left;
}
.viewer-csv-table th {
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.viewer-csv-table tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.viewer-csv-table tr:hover { background: rgba(255,255,255,0.04); }

.viewer-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* ── 9. Attachment Zone (D-70 §Part 2) ── */

/* ── Attach button ── */
#attach-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 28px; height: 28px;
  background: none; border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.4;
  transition: opacity 0.15s;
  padding: 0;
  line-height: 28px;
  text-align: center;
}
#attach-btn:hover { opacity: 0.8; }

/* ── Drop overlay (full-window) ── */
#drop-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#drop-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.drop-overlay-content {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.6);
  font-size: 18px; font-weight: 500;
}
.drop-icon {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: rgba(255,255,255,0.4);
}

.staged-files {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 8px;
}
.staged-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,197,71,0.08);
  border: 1px solid rgba(232,197,71,0.25);
  border-radius: 16px;
  padding: 4px 8px 4px 10px;
  font-size: 13px;
  animation: pill-enter 200ms ease-out both;
}
@keyframes pill-enter {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.staged-pill-name {
  color: rgba(255,255,255,0.85);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staged-pill-size {
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.staged-pill-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  font-family: inherit;
  line-height: 1;
}
.staged-pill-remove:hover { color: var(--state-error, #C75050); }

/* ── 10. Input Bar ── */

/* CREATIVE: Input styling
 * #input-bar: background, border-top
 * #msg-input:
 *   background: --bg-elevated or similar
 *   border: 1px solid #333
 *   border-radius: 8px
 *   color: --state-fresh
 *   focus: border-color --cell-beacon (gold glow)
 *   placeholder: muted color
 */

/* ── 11. Debug Drawer ── */

/* CREATIVE: Debug drawer styling
 * #debug-drawer: background --bg-void, border-top
 * #debug-drawer.open: transform translateY(0)
 * #debug-log: monospace, muted color
 */

/* ── 12. Observatory Hover Cards ── */

/* CREATIVE: Hover card over Observatory cells
 * .obs-hover-card:
 *   position absolute, backdrop-filter blur
 *   Cell name, designation, ring label
 *   Activity metrics (last active, message count)
 *   Cell color accent
 */

/* ── 13. Loading + Error States ── */

/* CREATIVE:
 * .loading-skeleton: shimmer animation
 * .error-banner: red/yellow banner, auto-dismiss animation
 * .error-banner.recoverable: yellow tint, fade out after 5s
 * .error-banner.fatal: red tint, stays until dismissed
 */

/* ── 14. Responsive / Aura (D-70 §Part 7) ── */

/* CREATIVE: Aura and mobile adaptations
 * @media (max-width: 768px): single column, hide sidebar
 * [data-aura]: hide viewer, attachment zone, file picker
 * Artifact elements gated behind min-width: 769px
 */
