/* GCE v3.25.1 — Styles
   Pure black + liquid glass. White-only typography.
   Bloomberg terminal × Apple Vision Pro aesthetic. */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --glass-bg: rgba(17, 17, 17, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: rgba(255, 255, 255, 0.85);
  --accent-glow: rgba(255, 255, 255, 0.05);
  --success: rgba(255, 255, 255, 0.5);
  --warning: #f59e0b;
  --error: #ef4444;
  --tier-0: #e2e8f0; --tier-1: #3b82f6; --tier-2: #06b6d4;
  --tier-3: #67e8f9; --tier-4: #fbbf24; --tier-5: #eab308;
  --tier-6: #f97316; --tier-7: #ec4899; --tier-8: #94a3b8;
  --tier-9: #6b7280; --tier-10: #cbd5e1; --tier-11: #f87171;
  --tier-12: #dc2626;
  /* Sovren shell identity */
  --sovren-bg:      #030507;
  --sovren-surface: #070b0f;
  --sovren-accent:  #00ccff;
  --sovren-text:    #c0d0c0;
  --sovren-text2:   #506050;
  --sovren-text3:   #2a3a2a;
  --sovren-mono:    'Share Tech Mono', 'SF Mono', monospace;
  --sovren-head:    'Orbitron', system-ui, sans-serif;
  --anim:           0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  background: var(--bg-primary); color: var(--text-primary);
  height: 100vh; overflow: hidden; display: flex; flex-direction: column;
}

/* Header */
.header {
  background: var(--glass-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.75rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 24px var(--glass-shadow);
}
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header h1 { font-family: var(--sovren-mono, 'Share Tech Mono', monospace); font-size: 11px; font-weight: 400; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-primary); }
.header .badge {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 7px; padding: 2px 6px;
  background: rgba(0,204,255,0.08); border: 1px solid rgba(0,204,255,0.3);
  border-radius: 2px; color: var(--sovren-accent, #00ccff);
  text-transform: uppercase; letter-spacing: 0.15em;
}
.header-right { display: flex; align-items: center; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.stat { display: flex; align-items: center; gap: 0.3rem; }
.stat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* v3.16.1: Energy status bar */
.energy-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.35rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.75rem; color: var(--text-muted);
}
.energy-gauge-group { display: flex; align-items: center; gap: 0.4rem; }
.energy-label { font-weight: 600; color: var(--text-secondary); min-width: 2rem; }
.energy-gauge {
  width: 80px; height: 6px; border-radius: 3px;
  background: var(--bg-tertiary); overflow: hidden;
}
.energy-gauge-fill {
  height: 100%; border-radius: 3px;
  background: var(--success);
  transition: width 0.6s ease, background 0.6s ease;
  width: 100%;
}
.energy-gauge-fill.mid { background: var(--warning); }
.energy-gauge-fill.low { background: var(--error); }
.energy-pct { min-width: 2.5rem; text-align: right; }
.energy-rel-info { color: var(--text-muted); margin-left: 0.5rem; }
.energy-conservation-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); flex-shrink: 0;
  margin-left: auto;
}
.energy-conservation-dot.violation { background: var(--error); }

/* User badge in header */
.hdr-user-badge {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 10px; padding: 2px 8px;
  background: rgba(0,204,255,0.04); border: 1px solid rgba(0,204,255,0.1);
  border-radius: 4px; color: rgba(0,204,255,0.5);
  letter-spacing: 0.05em;
}

/* Auth card (login/register overlay) */
.auth-card {
  width: 340px; padding: 2rem;
  background: var(--bg-secondary); border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.auth-brand {
  font-family: var(--sovren-head, 'Orbitron', sans-serif);
  font-size: 18px; font-weight: 700; text-align: center;
  color: var(--text-primary); letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--glass-border);
}
.auth-tab {
  flex: 1; padding: 0.5rem; text-align: center;
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active { color: var(--sovren-accent, #00ccff); border-bottom-color: var(--sovren-accent, #00ccff); }
.auth-input {
  width: 100%; padding: 0.6rem 0.8rem; margin-bottom: 0.6rem;
  background: var(--bg-primary); color: var(--text-primary);
  border: 1px solid var(--glass-border); border-radius: 6px;
  font-family: inherit; font-size: 12px;
  transition: border-color 0.2s;
}
.auth-input:focus { outline: none; border-color: var(--sovren-accent, #00ccff); }
.auth-btn {
  width: 100%; padding: 0.7rem; margin-top: 0.4rem;
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  background: rgba(0,204,255,0.15); border: 1px solid rgba(0,204,255,0.3);
  border-radius: 6px; color: var(--sovren-accent, #00ccff);
  cursor: pointer; transition: all 0.2s;
}
.auth-btn:hover { background: rgba(0,204,255,0.25); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error {
  color: var(--error); font-size: 11px; margin-top: 0.5rem;
  min-height: 1rem; text-align: center;
}

/* Header action buttons */
.hdr-action-btn {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 10px; padding: 3px 10px;
  background: transparent; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; color: var(--text-muted);
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.08em;
  transition: all 0.2s;
}
.hdr-action-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); border-color: rgba(255,255,255,0.15); }
.hdr-action-btn:active { transform: scale(0.96); }

/* Chat History panel */
.chat-history-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 9998; display: none;
}
.chat-history-overlay.open { display: block; }
.chat-history-panel {
  position: fixed; top: 0; left: -340px; width: 320px; height: 100vh;
  background: var(--bg-secondary); border-right: 1px solid var(--glass-border);
  z-index: 9999; display: flex; flex-direction: column;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}
.chat-history-panel.open { left: 0; }
.chat-history-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--glass-border);
}
.chat-history-title {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-primary);
}
.chat-history-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.chat-history-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.chat-history-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.chat-history-list::-webkit-scrollbar { width: 4px; }
.chat-history-list::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }
.chat-history-empty {
  text-align: center; color: var(--text-muted); font-size: 12px;
  padding: 2rem 1rem;
}
.chat-history-item {
  padding: 0.7rem 1rem; border-radius: 8px; cursor: pointer;
  margin-bottom: 4px; transition: background 0.15s;
  border: 1px solid transparent;
}
.chat-history-item:hover { background: rgba(255,255,255,0.05); border-color: var(--glass-border); }
.chat-history-item.active { background: rgba(0,204,255,0.08); border-color: rgba(0,204,255,0.2); }
.chat-history-item-id {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 10px; color: var(--sovren-accent, #00ccff);
  letter-spacing: 0.05em;
}
.chat-history-item-date {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
}
.chat-history-item-preview {
  font-size: 11px; color: var(--text-secondary); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Main layout */
.main { flex: 1; display: flex; overflow: hidden; }

/* Chat area */
.chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  gap: 1rem; padding: 1rem 1.5rem;
}
.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

/* Message bubbles */
.message {
  background: var(--glass-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: 16px;
  padding: 1rem; box-shadow: 0 8px 32px var(--glass-shadow);
  animation: fadeIn 0.3s ease-out; max-width: 85%;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message.user { align-self: flex-end; border-right: 3px solid var(--accent); border-left: none; }
.message.assistant { align-self: flex-start; border-left: 3px solid var(--success); }
.message-header {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.message-header .role { font-weight: 600; color: var(--text-secondary); }
.copy-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.8rem; cursor: pointer; padding: 0.1rem 0.3rem;
  border-radius: 4px; opacity: 0; transition: all 0.2s;
  margin-left: auto;
}
.message:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.copy-btn.copied { color: var(--success); opacity: 1; }
.message-content { color: var(--text-primary); font-family: Georgia, serif; font-size: 0.75rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* Inline CU spans */
.cu-span {
  position: relative; cursor: default;
  border-radius: 4px; padding: 0.05em 0.15em; margin: 0 -0.05em;
  transition: all 0.2s ease;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.cu-span:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Word-level pill spans */
.word-pill-span {
  cursor: help;
  border-radius: 2px;
  padding: 0 1px;
  transition: background 0.15s ease;
}
.word-pill-span:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Word-level tooltip */
.word-tooltip {
  display: none; position: fixed; z-index: 200;
  background: #1a1a1a; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 0.6rem; min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6); font-size: 0.75rem;
}
.word-tooltip.visible { display: block; }
.word-tooltip .row { display: flex; justify-content: space-between; margin-bottom: 0.2rem; }
.word-tooltip .lbl { color: var(--text-muted); }
.word-tooltip .val { color: var(--text-primary); font-weight: 500; max-width: 160px; text-align: right; }
.word-tooltip .def-preview {
  margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px solid var(--glass-border);
  color: var(--text-secondary); font-style: italic; line-height: 1.4; font-size: 0.72rem;
}

/* Pill strip */
.pill-strip { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 500; cursor: default;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pill .tier-label { opacity: 0.85; }

/* Score bar */
.score-bar {
  margin-top: 0.75rem; padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03); border-left: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px; font-size: 0.8rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 0.75rem;
}
.score-value { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.score-detail { font-size: 0.7rem; color: var(--text-muted); }

/* Status line */
.status-line {
  padding: 0.35rem 1.5rem; font-size: 0.75rem; color: var(--text-muted);
  border-top: 1px solid var(--glass-border); min-height: 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.status-line .spinner {
  width: 12px; height: 12px; border: 2px solid var(--glass-border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; display: none;
}
.status-line.active .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Live preview (real-time pill resolution + sentence classification) */
.live-preview {
  display: none;
  padding: 0.5rem 1.5rem;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  max-height: 200px;
  overflow-y: auto;
  transition: opacity 0.2s ease;
}
.live-preview.active { display: block; }
.lp-content {
  line-height: 1.7;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.lp-word {
  display: inline;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--text-muted);
}
.lp-word.resolved {
  color: var(--text-primary);
  background: var(--lp-domain-bg, rgba(255,255,255,0.06));
}
.lp-word.pending {
  color: var(--text-muted);
  opacity: 0.6;
}
.lp-sentence {
  display: inline;
  position: relative;
}
.lp-sentence.classified {
  border-left: 3px solid var(--lp-tier-color, var(--text-muted));
  padding-left: 0.5rem;
  margin-left: 0.2rem;
  display: block;
  margin-bottom: 0.25rem;
}
.lp-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--lp-tier-bg, rgba(255,255,255,0.08));
  color: var(--lp-tier-color, var(--text-muted));
  margin-right: 0.3rem;
  vertical-align: middle;
}
.lp-tier-badge .lp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 4px currentColor;
}

/* Scan counter (real-time word scan progress) */
.scan-counter {
  display: none;
  padding: 0.3rem 1.5rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: 'SF Mono', ui-monospace, monospace;
}
.scan-counter.active { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.scan-label { font-weight: 600; color: var(--text-secondary); text-transform: uppercase; font-size: 0.65rem; }
.scan-count { font-weight: 700; color: var(--text-primary); }
.scan-domain { font-size: 0.65rem; padding: 0.1rem 0.3rem; border-radius: 3px; }
.scan-hits { color: var(--success); }
.scan-misses { color: var(--warning); }
.scan-unresolved { color: var(--error); }

/* Input area */
.input-area {
  padding: 0.75rem 1.5rem; border-top: 1px solid var(--glass-border);
  background: var(--glass-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; gap: 0.75rem; align-items: flex-end;
}
.input-area textarea {
  flex: 1; background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 3px; padding: 8px 12px; color: var(--text-primary);
  font-family: Georgia, 'Times New Roman', serif; font-size: 12px; resize: none;
  min-height: 44px; max-height: 120px; line-height: 1.55;
  outline: none; transition: border-color 0.2s;
}
.input-area textarea:focus { border-color: var(--sovren-accent, #00ccff); }
.input-area textarea::placeholder { color: var(--text-muted); }
.input-area button {
  background: transparent;
  color: var(--sovren-accent, #00ccff);
  border: 1px solid rgba(0,204,255,0.3);
  border-radius: 3px;
  padding: 6px 14px;
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.input-area button:hover {
  background: rgba(0,204,255,0.08);
  border-color: var(--sovren-accent, #00ccff);
}
.input-area button:disabled { opacity: 0.5; cursor: not-allowed; }
/* v3.30.4: Mic button (Phase C3, CAP-522) */
#btnMic { font-size: 1rem; padding: 0.5rem 0.7rem; line-height: 1; }
#btnMic.recording {
  background: rgba(239, 68, 68, 0.3); border-color: rgba(239, 68, 68, 0.5);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* == Ingestion Toolbar (v3.2.3) ============================== */
.ingest-toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1.5rem;
  background: var(--glass-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
}
.ingest-toolbar + .input-area { border-top: none; }
.ingest-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--glass-border); background: var(--bg-tertiary);
  color: var(--text-muted); cursor: pointer; font-size: 0.7rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ingest-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.ingest-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.ingest-btn-search span { color: #3b82f6; }
.ingest-btn-news span { color: #f59e0b; }
.ingest-btn-document span { color: rgba(255, 255, 255, 0.5); }
.ingest-btn.active span { color: inherit; }
.ingest-form {
  display: none; flex: 1; align-items: center; gap: 0.4rem;
  animation: fadeIn 0.15s ease-out;
}
.ingest-input {
  flex: 1; background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 0.4rem 0.6rem; color: var(--text-primary);
  font-family: inherit; font-size: 0.8rem; outline: none; transition: border-color 0.2s;
}
.ingest-input:focus { border-color: var(--accent); }
.ingest-input::placeholder { color: var(--text-muted); }
.ingest-input-small { max-width: 60px; flex: none; text-align: center; }
.ingest-submit {
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px; padding: 0.4rem 0.8rem; font-size: 0.75rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.ingest-submit:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.2); }
.ingest-cancel {
  background: none; border: 1px solid var(--glass-border); color: var(--text-muted);
  border-radius: 6px; padding: 0.4rem 0.6rem; font-size: 0.75rem;
  cursor: pointer; transition: all 0.2s;
}
.ingest-cancel:hover { border-color: var(--error); color: var(--error); }

/* Sidebar removed in v3.9.1 — tier distribution available via GET /api/graph/stats */

/* Pill detail tooltip */
.pill-tooltip {
  display: none; position: fixed; z-index: 100;
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 0.75rem; min-width: 220px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); font-size: 0.78rem;
}
.pill-tooltip.visible { display: block; }
.pill-tooltip .row { display: flex; justify-content: space-between; margin-bottom: 0.3rem; }
.pill-tooltip .lbl { color: var(--text-muted); }
.pill-tooltip .val { color: var(--text-primary); font-weight: 500; }
.pill-tooltip .text-preview {
  margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px solid var(--glass-border);
  color: var(--text-secondary); font-style: italic; line-height: 1.4;
}

/* Input CU pills */
.input-cus { margin-top: 0.5rem; }
.input-cus .label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }

/* Welcome state */
.welcome {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 1rem; color: var(--text-muted); text-align: center; padding: 2rem;
}
.welcome h2 { font-size: 1.3rem; color: var(--text-secondary); font-weight: 500; }
.welcome p { max-width: 400px; line-height: 1.6; font-size: 0.9rem; }
.welcome .examples { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.welcome .example {
  background: var(--bg-secondary, #111); border: 1px solid var(--glass-border);
  border-radius: 3px; padding: 6px 12px; cursor: pointer;
  font-family: Georgia, serif; font-size: 11px;
  color: var(--text-secondary); transition: all 0.15s;
  text-align: left;
}
.welcome .example:hover {
  border-color: var(--sovren-accent, #00ccff);
  color: var(--text-primary);
}

/* ── Click-level detail panels (v2.5 Sections 2-4) ──────────── */
.detail-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.4);
}
.detail-overlay.visible { display: block; }

.detail-panel {
  display: none; position: fixed; z-index: 310;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--bg-secondary); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 0; min-width: 360px; max-width: 480px;
  max-height: 80vh; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: panelIn 0.2s ease-out;
}
.detail-panel.wide { min-width: 520px; max-width: 640px; }
.detail-panel.visible { display: flex; flex-direction: column; }
@keyframes panelIn { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }

.detail-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
}
.detail-breadcrumb { font-size: 0.72rem; color: var(--text-muted); }
.detail-breadcrumb .bc-seg { cursor: pointer; color: var(--text-secondary); }
.detail-breadcrumb .bc-seg:hover { color: var(--accent); text-decoration: underline; }
.detail-breadcrumb .bc-sep { margin: 0 0.3rem; color: var(--text-muted); }
.detail-breadcrumb .bc-current { color: var(--text-primary); font-weight: 600; }
.detail-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 0.2rem 0.4rem;
  border-radius: 4px; transition: all 0.15s;
}
.detail-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.detail-body {
  padding: 1rem; overflow-y: auto; flex: 1;
  font-size: 0.8rem; line-height: 1.6;
}

/* Detail panel sections */
.dp-section { margin-bottom: 1rem; }
.dp-section:last-child { margin-bottom: 0; }
.dp-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.4rem;
}
.dp-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.25rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dp-row .dp-key { color: var(--text-secondary); font-size: 0.75rem; }
.dp-row .dp-val { color: var(--text-primary); font-weight: 500; font-size: 0.75rem; }
.dp-definition {
  color: var(--text-secondary); font-style: italic; line-height: 1.5;
  padding: 0.5rem; background: rgba(255,255,255,0.03); border-radius: 6px;
  margin-top: 0.3rem;
}

/* Confidence bar (horizontal fill) */
.conf-bar {
  display: flex; align-items: center; gap: 0.5rem;
}
.conf-bar-track {
  flex: 1; height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
.conf-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.3s ease;
}
.conf-bar-label { font-size: 0.7rem; color: var(--text-secondary); min-width: 36px; text-align: right; }

/* Tier badge (used in detail panels) */
.dp-tier-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 6px;
  font-weight: 700; font-size: 0.85rem;
}

/* Gate status indicators */
.dp-gate {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0; font-size: 0.75rem;
}
.dp-gate-icon { font-size: 0.8rem; }
.dp-gate-pass { color: var(--success); }
.dp-gate-fail { color: var(--error); }

/* Intuition certification badges (v3.7.2) */
.dp-intuition-cert {
  display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.5);
  margin-left: 0.3rem;
}
.dp-intuition-learning {
  display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px;
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.4);
  margin-left: 0.3rem;
}

/* Bond list in CU detail */
.dp-bond {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem; border-radius: 6px;
  cursor: pointer; transition: background 0.15s;
  font-size: 0.75rem;
}
.dp-bond:hover { background: rgba(255,255,255,0.06); }
.dp-bond-type {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.1rem 0.3rem; border-radius: 3px; font-weight: 600;
}

/* Word composition mini cards */
.dp-word-card {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.4rem; margin: 0.1rem; border-radius: 4px;
  font-size: 0.7rem; border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; transition: all 0.15s;
}
.dp-word-card:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }

/* Tier distribution bar chart */
.dp-tier-bar {
  display: flex; height: 20px; border-radius: 4px; overflow: hidden;
  margin-top: 0.3rem; background: rgba(255,255,255,0.04);
}
.dp-tier-seg { transition: width 0.3s ease; min-width: 2px; }

/* Domain distribution */
.dp-domain-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.15rem 0; font-size: 0.72rem;
}
.dp-domain-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.dp-domain-bar {
  flex: 1; height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden;
}
.dp-domain-fill { height: 100%; border-radius: 2px; }

/* Detail panel collapsible sections */
.dp-collapsible { margin-top: 0.3rem; }
.dp-collapsible-toggle {
  display: flex; align-items: center; gap: 0.3rem;
  cursor: pointer; font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.2rem 0; transition: color 0.15s;
  user-select: none;
}
.dp-collapsible-toggle:hover { color: var(--text-secondary); }
.dp-collapsible-toggle .dp-chevron {
  font-size: 0.6rem; transition: transform 0.2s;
}
.dp-collapsible.expanded .dp-chevron { transform: rotate(90deg); }
.dp-collapsible-body {
  display: none; margin-top: 0.3rem;
}
.dp-collapsible.expanded .dp-collapsible-body { display: block; }

/* Classification trace table */
.dp-trace-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.dp-trace-row td {
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dp-trace-row td:first-child { font-weight: 600; width: 40px; }
.dp-trace-matched td { color: var(--success); }
.dp-trace-skipped td { color: var(--text-muted); opacity: 0.5; }

/* Domain source badge */
.dp-domain-source-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent);
}

/* Concreteness bar */
.dp-concreteness-bar {
  display: flex; align-items: center; gap: 0.4rem;
}
.dp-concreteness-track {
  flex: 1; height: 8px; background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: hidden;
}
.dp-concreteness-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  transition: width 0.3s ease;
}
.dp-concreteness-label {
  font-size: 0.7rem; color: var(--text-secondary);
  min-width: 30px; text-align: right;
}

/* Synonym/antonym chips */
.dp-synonym-chip {
  display: inline-block; font-size: 0.65rem;
  padding: 0.1rem 0.4rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5); margin: 0.1rem;
}
.dp-antonym-chip {
  display: inline-block; font-size: 0.65rem;
  padding: 0.1rem 0.4rem; border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444; margin: 0.1rem;
}

/* Muted text */
.dp-muted { color: var(--text-muted); font-size: 0.75rem; }

/* Reflection detail panel */
.refl-bar-clickable { cursor: pointer; }
.refl-bar-clickable:hover { background: rgba(255, 255, 255, 0.06); }
.refl-violation-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444; font-weight: 600; font-size: 0.6rem;
}
.refl-length-ok { color: var(--success); font-size: 0.6rem; }
.refl-length-warn { color: var(--warning); font-size: 0.6rem; }
.refl-budget-label {
  font-size: 0.6rem; color: var(--text-muted);
  font-family: 'SF Mono', monospace;
}

/* Provenance stacked bar */
.prov-stacked-bar {
  display: flex; height: 16px; border-radius: 4px;
  overflow: hidden; background: rgba(255,255,255,0.04);
  margin-top: 0.3rem;
}
.prov-seg { transition: width 0.3s ease; min-width: 2px; }
.prov-legend {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.3rem; font-size: 0.65rem;
}
.prov-legend-item {
  display: flex; align-items: center; gap: 0.2rem;
}
.prov-legend-dot {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}

/* Score bar clickable enhancement */
.score-bar { cursor: pointer; transition: all 0.2s; }
.score-bar:hover { background: rgba(255, 255, 255, 0.06); }

/* FE-300: Envelope summary bar */
.envelope-bar {
  margin-top: 0.5rem; padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.02); border-left: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px; font-size: 0.72rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  cursor: pointer; transition: all 0.2s; font-family: 'SF Mono', 'Fira Code', monospace;
}
.envelope-bar:hover { background: rgba(255, 255, 255, 0.05); }
.envelope-tier { font-weight: 700; font-size: 0.8rem; }
.envelope-sep { color: rgba(255, 255, 255, 0.1); }
.envelope-resistance { color: rgba(255, 255, 255, 0.4); }
.envelope-cap-badge {
  padding: 0.1rem 0.4rem; border-radius: 9px; font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.5);
}

/* FE-301: Envelope detail (expandable) */
.envelope-detail {
  margin-top: 0.25rem; padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02); border-left: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px; font-size: 0.72rem; color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.envelope-section { margin-bottom: 0.5rem; }
.envelope-section-title {
  font-size: 0.65rem; font-weight: 600; color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.envelope-meta { font-size: 0.68rem; color: rgba(255, 255, 255, 0.3); }

/* FE-302: Tier distribution chart */
.envelope-tier-chart { display: flex; flex-direction: column; gap: 2px; margin-bottom: 0.3rem; }
.envelope-tier-row { display: flex; align-items: center; gap: 0.4rem; }
.envelope-tier-label { width: 1.8rem; font-size: 0.65rem; font-weight: 600; text-align: right; }
.envelope-tier-bar-bg {
  flex: 1; height: 6px; background: rgba(255, 255, 255, 0.04);
  border-radius: 3px; overflow: hidden;
}
.envelope-tier-bar-fill { height: 100%; border-radius: 3px; min-width: 2px; transition: width 0.3s; }
.envelope-tier-count { font-size: 0.6rem; color: rgba(255, 255, 255, 0.25); width: 1.5rem; }

/* FE-301: Resistance items + barcode chain */
.envelope-res-item { font-size: 0.65rem; color: rgba(255, 255, 255, 0.3); }
.envelope-barcodes { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.envelope-barcode-link {
  padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.4);
  cursor: pointer; transition: all 0.15s;
}
.envelope-barcode-link:hover { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.7); }

/* FE-310: Hypernym chain */
.dp-hypernym-chain { font-size: 0.72rem; }
.dp-hypernym-node { padding: 0.15rem 0; }
.dp-hypernym-word { color: var(--accent); cursor: pointer; font-weight: 600; font-size: 0.72rem; }
.dp-hypernym-word:hover { text-decoration: underline; }
.dp-hypernym-defn { color: var(--text-muted); font-size: 0.65rem; font-style: italic; margin-left: 0.3rem; }

/* FE-311: All definitions + Wiki categories */
.dp-all-defs { margin: 0; padding-left: 1.2rem; font-size: 0.72rem; color: var(--text-secondary); }
.dp-all-defs li { margin-bottom: 0.2rem; }
.dp-wiki-cats { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.dp-wiki-cat-badge {
  padding: 0.1rem 0.4rem; border-radius: 9px; font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.5);
}

/* FE-313: Related atoms */
.dp-related-atoms { font-size: 0.72rem; }
.dp-related-atom-row {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0;
  cursor: pointer;
}
.dp-related-atom-row:hover { background: rgba(255, 255, 255, 0.03); }
.dp-related-atom-word { font-weight: 600; color: var(--text-primary); min-width: 4rem; }
.dp-related-atom-defn { color: var(--text-muted); font-size: 0.65rem; font-style: italic; }

/* FE-320: Mechanism badge in CU header */
.dp-mech-badge {
  padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.5);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* FE-322: Bond strength bar + permanence badge */
.dp-bond-strength-bar {
  display: inline-block; width: 3rem; height: 5px;
  background: rgba(255, 255, 255, 0.06); border-radius: 3px; overflow: hidden;
}
.dp-bond-strength-fill { display: block; height: 100%; border-radius: 3px; }
.dp-perm-badge {
  font-size: 0.55rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.05rem 0.3rem; border: 1px solid; border-radius: 4px;
  text-transform: uppercase;
}

/* FE-340: Bond detail panel */
.bond-detail-type {
  display: inline-block; padding: 0.3rem 0.8rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.bond-detail-strength-row {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem;
}
.bond-detail-strength-bar {
  flex: 1; height: 8px; background: rgba(255, 255, 255, 0.06);
  border-radius: 4px; overflow: hidden;
}
.bond-detail-strength-fill { display: block; height: 100%; border-radius: 4px; }
.bond-detail-perm-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 0.1rem 0.5rem; border: 1px solid; border-radius: 5px;
}
.bond-detail-cu-text {
  font-size: 0.78rem; color: var(--text-primary); cursor: pointer;
  padding: 0.3rem 0.5rem; border-radius: 4px;
  background: rgba(255, 255, 255, 0.03); transition: background 0.15s;
}
.bond-detail-cu-text:hover { background: rgba(255, 255, 255, 0.08); }

/* FE-341: Mini bond graph */
.bond-graph {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.5rem 0; gap: 0;
}
.bond-graph-center { margin-bottom: 0.2rem; }
.bond-graph-node {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 0.25rem 0.5rem; border: 2px solid; border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); max-width: 10rem;
}
.bond-graph-node-center { border-width: 2px; }
.bond-graph-node-tier { font-size: 0.55rem; font-weight: 700; }
.bond-graph-node-text {
  font-size: 0.6rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 9rem;
}
.bond-graph-neighbors {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem;
  margin-top: 0.1rem;
}
.bond-graph-arm {
  display: flex; flex-direction: column; align-items: center;
}
.bond-graph-edge {
  width: 0; height: 1rem; border-left: 2px dashed;
  position: relative; display: flex; justify-content: center;
}
.bond-graph-edge-label {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 0.5rem; font-weight: 600; background: var(--bg-primary, #0a0a0a);
  padding: 0 0.2rem; white-space: nowrap; left: 0.5rem;
}

/* FE-350: Assembly browser */
.asm-search-row { padding: 0 0 0.5rem; }
.asm-search-input {
  width: 100%; padding: 0.4rem 0.6rem; font-size: 0.75rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; color: var(--text-primary); outline: none;
}
.asm-search-input:focus { border-color: var(--accent); }
.asm-row {
  padding: 0.5rem 0.6rem; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.04); margin-bottom: 0.3rem;
  transition: background 0.15s;
}
.asm-row:hover { background: rgba(255,255,255,0.05); }
.asm-row-top { display: flex; gap: 0.5rem; align-items: baseline; }
.asm-barcode { font-size: 0.6rem; font-family: monospace; color: var(--text-muted); }
.asm-name { font-size: 0.75rem; color: var(--text-primary); }
.asm-row-meta { display: flex; gap: 0.6rem; font-size: 0.6rem; color: var(--text-muted); margin-top: 0.2rem; }
.asm-cu-row {
  display: flex; gap: 0.5rem; align-items: baseline; padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.asm-back-btn {
  padding: 0.3rem 0.8rem; font-size: 0.7rem; border-radius: 5px;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
}
.asm-back-btn:hover { background: rgba(255,255,255,0.1); }

/* FE-351: Compile preview */
.compile-source-toggle { display: flex; gap: 0.3rem; margin-bottom: 0.5rem; }
.compile-src-btn {
  padding: 0.25rem 0.6rem; font-size: 0.65rem; border-radius: 5px;
  background: rgba(255,255,255,0.04); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer;
}
.compile-src-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.compile-src-btn:hover:not(.active) { background: rgba(255,255,255,0.08); }
.compile-cu-row {
  padding: 0.3rem 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.compile-unverified {
  border: 1px solid #ef444430; border-radius: 6px;
  background: rgba(239,68,68,0.03); padding: 0.5rem;
}

/* FE-352: Provenance breakdown chart */
.compile-prov-bar {
  display: flex; height: 10px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,0.04); margin-bottom: 0.3rem;
}
.compile-prov-seg { height: 100%; }
.compile-prov-legend { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.compile-prov-label { display: flex; align-items: center; gap: 0.2rem; font-size: 0.6rem; color: var(--text-muted); }
.compile-prov-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Envelope document buttons (FE-350/351 trigger) */
.envelope-doc-btn {
  padding: 0.25rem 0.7rem; font-size: 0.65rem; border-radius: 5px;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.envelope-doc-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

/* FE-360: Barcode search bar */
.barcode-search {
  display: flex; gap: 0.3rem; padding: 0.4rem 0.6rem; align-items: center;
  background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.barcode-search-input {
  flex: 1; padding: 0.3rem 0.5rem; font-size: 0.75rem;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; color: var(--text-primary); outline: none;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.barcode-search-input:focus { border-color: var(--accent); }
.barcode-search-btn {
  padding: 0.3rem 0.6rem; font-size: 0.7rem; border-radius: 5px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
}
.barcode-search-close {
  padding: 0.15rem 0.4rem; font-size: 0.85rem;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
}

/* FE-362: Atom tree browser */
.atom-tree { padding: 0.3rem 0; }
.atom-tree-node {
  display: flex; align-items: baseline; gap: 0.3rem;
  padding: 0.15rem 0; font-size: 0.7rem;
}
.atom-tree-icon { font-size: 0.55rem; color: var(--text-muted); min-width: 0.8rem; }
.atom-tree-word { font-weight: 600; cursor: pointer; }
.atom-tree-word:hover { text-decoration: underline; }
.atom-tree-bc { font-size: 0.5rem; color: var(--text-muted); font-family: monospace; }
.atom-tree-defn {
  font-size: 0.6rem; color: var(--text-muted); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 12rem;
}

/* FE-363: Audit trail timeline */
.audit-timeline { padding: 0.3rem 0; }
.audit-tl-event { display: flex; gap: 0.6rem; min-height: 2rem; }
.audit-tl-track {
  display: flex; flex-direction: column; align-items: center;
  width: 12px; flex-shrink: 0;
}
.audit-tl-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 0.15rem;
}
.audit-tl-dot-end { width: 8px; height: 8px; opacity: 0.4; }
.audit-tl-line {
  width: 2px; flex: 1; min-height: 1rem;
}
.audit-tl-content { flex: 1; padding-bottom: 0.5rem; }

/* FE-372: Tier glyph inline SVG */
.tier-glyph {
  display: inline-block; vertical-align: middle; line-height: 0;
  margin-right: 2px; opacity: 0.55; pointer-events: none;
  transition: opacity 0.15s;
}
.cu-span:hover + .tier-glyph, .tier-glyph:hover { opacity: 1; }

/* FE-381: Breadcrumb trail */
.bc-link {
  color: var(--text-muted); font-size: 0.65rem; cursor: pointer;
  text-decoration: none;
}
.bc-link:hover { color: var(--accent); text-decoration: underline; }
.bc-current { color: var(--text-primary); font-size: 0.65rem; font-weight: 600; }

/* FE-382: Responsive adjustments for new panels */
@media (max-width: 768px) {
  .detail-panel { width: 100% !important; right: 0; border-radius: 12px 12px 0 0; bottom: 0; top: auto; max-height: 80vh; }
  .envelope-bar { flex-wrap: wrap; gap: 0.3rem; }
  .bond-graph-neighbors { gap: 0.15rem; }
  .bond-graph-node-text { max-width: 6rem; }
  .compile-source-toggle { flex-wrap: wrap; }
  .barcode-search { flex-wrap: wrap; }
  .asm-row-top { flex-direction: column; gap: 0.15rem; }
  .atom-tree-defn { max-width: 7rem; }
  .audit-tl-event { gap: 0.3rem; }
}

/* CU span clickable */
.cu-span { cursor: pointer; }
.word-pill-span { cursor: pointer; }

/* Loading spinner for lazy-loaded panels */
.dp-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; color: var(--text-muted);
}
.dp-loading::after {
  content: ''; width: 20px; height: 20px; margin-left: 0.5rem;
  border: 2px solid var(--glass-border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* == Link Bundles (v3.2) ===================================== */

/* Indicator bar on messages */
.link-bundles-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.6rem; margin-top: 0.4rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px; cursor: pointer;
  transition: background 0.2s;
  font-size: 0.72rem; color: var(--text-secondary);
}
.link-bundles-bar:hover {
  background: rgba(59, 130, 246, 0.15);
}
.lb-icon {
  font-weight: 700; color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
  padding: 0.1rem 0.3rem; border-radius: 3px;
  font-size: 0.65rem;
}
.lb-count { color: var(--text-muted); font-size: 0.68rem; }
.lb-thumbs { display: flex; gap: 0.2rem; }
.lb-thumb {
  width: 22px; height: 22px; border-radius: 3px;
  object-fit: cover; border: 1px solid var(--glass-border);
}
.lb-labels { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.lb-label {
  font-size: 0.65rem; padding: 0.1rem 0.3rem;
  background: var(--bg-tertiary); border-radius: 3px;
  color: var(--text-secondary);
}
.lb-more { color: var(--text-muted); }

/* Link bundles panel entity cards */
.lb-entity { border-bottom: 1px solid var(--glass-border); padding-bottom: 0.6rem; }
.lb-entity:last-child { border-bottom: none; }
.lb-entity-header {
  display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.4rem;
}
.lb-entity-img {
  width: 60px; height: 60px; border-radius: 6px;
  object-fit: cover; border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.lb-entity-info { flex: 1; min-width: 0; }
.lb-entity-label {
  font-weight: 600; font-size: 0.85rem; color: var(--text-primary);
  margin-bottom: 0.15rem;
}
.lb-entity-desc {
  font-size: 0.7rem; color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.lb-qid {
  font-size: 0.6rem; font-family: monospace;
  color: #3b82f6; background: rgba(59, 130, 246, 0.1);
  padding: 0.05rem 0.25rem; border-radius: 2px;
}
.lb-links {
  display: flex; gap: 0.3rem; margin: 0.3rem 0;
}
.lb-link {
  font-size: 0.65rem; padding: 0.15rem 0.4rem;
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 4px; color: var(--text-secondary);
  text-decoration: none; transition: background 0.2s;
}
.lb-link:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.lb-link-wiki { color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }
.lb-link-wd { color: rgba(255, 255, 255, 0.5); border-color: rgba(255, 255, 255, 0.12); }

/* Turn detail: entity rows */
.lb-turn-entity {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.lb-turn-entity:last-child { border-bottom: none; }
.lb-turn-thumb {
  width: 28px; height: 28px; border-radius: 4px;
  object-fit: cover; border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.lb-turn-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-turn-label { font-size: 0.75rem; font-weight: 500; color: var(--text-primary); }
.lb-turn-desc { font-size: 0.62rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-turn-links { display: flex; gap: 0.2rem; flex-shrink: 0; }

/* == Ingestion Messages (v3.2.3) ============================== */
.message.ingestion { align-self: flex-start; border-left: 3px solid var(--warning); max-width: 90%; }
.ingest-source-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.ingest-source-icon {
  width: 18px; height: 18px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; color: white;
}
.ingest-summary {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.4rem 0;
}
.ingest-stat-pill {
  font-size: 0.7rem; padding: 0.15rem 0.5rem;
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 999px; color: var(--text-secondary);
}
.ingest-cu-list {
  max-height: 400px; overflow-y: auto; margin-top: 0.5rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.ingest-cu-list::-webkit-scrollbar { width: 4px; }
.ingest-cu-list::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }
.ingest-cu {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.5rem; border-left: 2px solid;
  border-radius: 0 4px 4px 0; font-size: 0.75rem;
  background: rgba(255,255,255,0.02);
}
.ingest-cu:hover { background: rgba(255,255,255,0.05); }
.ingest-cu-tier {
  font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.3rem;
  border-radius: 3px; flex-shrink: 0;
}
.ingest-cu-text { flex: 1; color: var(--text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ingest-cu-conf { font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0; }
.ingest-cu-more { font-size: 0.7rem; color: var(--text-muted); padding: 0.25rem 0.5rem; font-style: italic; }

/* Truth Profile */
.truth-profile { margin: 0.5rem 0; }
.truth-profile-type {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  text-transform: capitalize; margin-bottom: 0.3rem;
}
.truth-profile-legend {
  display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.3rem;
}
.truth-profile-tag {
  font-size: 0.62rem; padding: 0.1rem 0.3rem; border-radius: 3px;
}

/* Sidebar source styles removed in v3.9.1 */

/* Export Buttons (v3.2.3) */
.export-btns { display: flex; gap: 0.3rem; }
.export-btn {
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: 4px; padding: 0.2rem 0.5rem;
  font-size: 0.65rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.export-btn:hover { border-color: var(--accent); color: var(--accent); }

/* CU Source Badges (v3.2.3, enhanced v3.22.0) */
.cu-source-badge {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 2px; margin-right: 3px; vertical-align: middle;
}
.cu-source-serp { background: #3b82f6; }
.cu-source-news { background: #f59e0b; }
.cu-source-document { background: #94a3b8; }
.cu-source-ai { background: #64748b; opacity: 0.5; }
/* Drop Zone Overlay (v3.2.3) */
.drop-overlay {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.drop-overlay.visible { display: flex; }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 3rem 4rem; border: 2px dashed var(--accent);
  border-radius: 20px; background: var(--bg-secondary);
  box-shadow: 0 0 40px var(--accent-glow);
  animation: panelIn 0.2s ease-out;
}
.drop-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
}
.drop-label {
  font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
}
.drop-formats {
  font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.05em;
}

/* == Auto-SERP Context Bar (v3.2.3) ============================== */
.serp-context-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.6rem; margin-top: 0.4rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px; cursor: pointer;
  transition: background 0.2s;
  font-size: 0.72rem; color: var(--text-secondary);
}
.serp-context-bar:hover { background: rgba(59, 130, 246, 0.15); }
.serp-context-icon {
  font-weight: 700; color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
  padding: 0.1rem 0.3rem; border-radius: 3px;
  font-size: 0.65rem;
}
.serp-context-source {
  font-size: 0.65rem; padding: 0.1rem 0.3rem;
  background: rgba(59, 130, 246, 0.08); border-radius: 3px;
  color: var(--text-secondary);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.serp-expanded {
  width: 100%; margin-top: 0.4rem;
  border-top: 1px solid rgba(59, 130, 246, 0.15);
  padding-top: 0.3rem;
}
.serp-source-row { padding: 0.2rem 0; }
.serp-source-link {
  font-size: 0.7rem; color: #60a5fa;
  text-decoration: none; word-break: break-all;
}
.serp-source-link:hover { text-decoration: underline; color: #93bbfd; }

.cu-source-serp { background: #3b82f6; }
.cu-source-news { background: #f59e0b; }
.cu-source-document { background: #94a3b8; }

/* == Compiler UI (v3.2.4) ========================================= */
.ingest-btn-compile span { color: rgba(255, 255, 255, 0.7); }
.message.compile { align-self: flex-start; border-left: 3px solid var(--accent); max-width: 90%; }
.compile-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.compile-topic {
  font-weight: 600; font-size: 0.85rem; color: var(--text-primary);
}
.compile-meta {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.4rem 0;
}
.compile-sections {
  display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem;
}
.compile-section {
  border-left: 3px solid var(--glass-border);
  border-radius: 0 6px 6px 0;
  background: rgba(255,255,255,0.02);
  transition: background 0.15s;
}
.compile-section:hover { background: rgba(255,255,255,0.04); }
.compile-section-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.6rem; cursor: pointer;
  font-size: 0.78rem;
}
.compile-section-heading {
  font-weight: 600; color: var(--text-primary); flex: 1;
}
.compile-section-stats {
  font-size: 0.68rem; color: var(--text-muted);
}
.compile-section-chevron {
  font-size: 0.65rem; color: var(--text-muted);
  transition: transform 0.2s;
}
.compile-section.expanded .compile-section-chevron { transform: rotate(90deg); }
.compile-section-body {
  display: none; max-height: 200px; overflow-y: auto;
  padding: 0 0.6rem 0.4rem;
}
.compile-section-body::-webkit-scrollbar { width: 4px; }
.compile-section-body::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }
.compile-section.expanded .compile-section-body { display: block; }
.compile-disputed {
  font-size: 0.7rem; padding: 0.15rem 0.5rem;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px; color: var(--error);
}
.compile-export-row {
  display: flex; gap: 0.3rem; margin-top: 0.5rem; padding-top: 0.4rem;
  border-top: 1px solid var(--glass-border);
}
.compile-export-btn {
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: 4px; padding: 0.2rem 0.5rem;
  font-size: 0.65rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.compile-export-btn:hover { border-color: var(--accent); color: var(--accent); }

/* View toggle (Doc / Data) */
.compile-view-toggle {
  display: flex; gap: 0.25rem; margin: 0.5rem 0 0.3rem;
}
.compile-view-btn {
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: 4px; padding: 0.2rem 0.6rem;
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.compile-view-btn:hover { color: var(--text-secondary); }
.compile-view-btn.active {
  border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

/* Document prose view */
.compile-doc-view {
  margin-top: 0.4rem; max-height: 500px; overflow-y: auto;
}
.compile-doc-view::-webkit-scrollbar { width: 4px; }
.compile-doc-view::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }
.compile-doc-section {
  border-left: 3px solid var(--glass-border);
  padding-left: 0.75rem; margin-bottom: 0.75rem;
}
.compile-doc-heading {
  font-size: 0.82rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 0.35rem; text-transform: capitalize;
}
.compile-doc-para {
  font-size: 0.8rem; line-height: 1.65; color: var(--text-secondary);
  margin: 0 0 0.4rem; padding-left: 0.4rem;
  border-left: 2px solid var(--cu-tier-color, var(--glass-border));
}

/* ── v3.3: Barcode display ─────────────────────────────── */
.dp-barcode {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.dp-barcode:hover {
  color: rgba(255, 255, 255, 0.6);
  text-decoration-style: solid;
}

/* ── v3.3: Reflection bar ──────────────────────────────── */
.reflection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
}
.refl-mode {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}
.refl-score {
  color: var(--text-secondary);
  font-family: 'SF Mono', monospace;
}
.refl-mismatch {
  font-weight: 600;
}
.refl-revisions {
  color: var(--warning);
  font-weight: 600;
}
.refl-drift {
  font-family: 'SF Mono', monospace;
  font-weight: 600;
}
.refl-emd {
  font-family: 'SF Mono', monospace;
  font-weight: 600;
  font-size: 0.7rem;
}

/* ── v3.3: Audit trail entries ─────────────────────────── */
.audit-entry {
  border-left: 3px solid var(--glass-border);
  padding: 0.4rem 0.6rem;
  margin: 0.3rem 0;
  border-radius: 0 4px 4px 0;
  background: rgba(255, 255, 255, 0.02);
}
.audit-entry:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ══ v3.8.0: Montage Player (.mtg-*) ═══════════════════════════ */

/* Overlay — fullscreen cinematic layer */
.mtg-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: #000; display: flex; flex-direction: column;
}

/* Controls bar — bottom strip */
.mtg-controls {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0; order: 2;
}
.mtg-ctrl-btn {
  background: none; border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-secondary); border-radius: 4px;
  padding: 0.3rem 0.6rem; font-size: 0.8rem; cursor: pointer;
  transition: all 0.15s; min-width: 32px; text-align: center;
}
.mtg-ctrl-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.mtg-progress {
  flex: 1; height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 2px; overflow: hidden; cursor: pointer;
}
.mtg-progress-fill {
  height: 100%; width: 0%; background: var(--accent);
  border-radius: 2px; transition: width 0.3s linear;
}
.mtg-time {
  font-size: 0.72rem; color: var(--text-muted);
  font-family: 'SF Mono', monospace; min-width: 36px; text-align: right;
}

/* Body — canvas + chat side by side */
.mtg-body {
  flex: 1; display: flex; overflow: hidden; order: 1;
}

/* Canvas — where scenes render */
.mtg-canvas {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; padding: 2rem 2rem 2.5rem;
}

/* Chat panel — right side */
.mtg-chat {
  width: 320px; display: flex; flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.08);
  background: rgba(10, 10, 10, 0.9); flex-shrink: 0;
}
.mtg-chat-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 600;
}
.mtg-chat-messages {
  flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.mtg-chat-messages::-webkit-scrollbar { width: 4px; }
.mtg-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.mtg-chat-input-area {
  display: flex; gap: 0.4rem; padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.mtg-chat-input {
  flex: 1; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 0.4rem 0.6rem;
  color: var(--text-primary); font-size: 0.78rem;
  font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.mtg-chat-input:focus { border-color: var(--accent); }
.mtg-chat-input::placeholder { color: var(--text-muted); }
.mtg-chat-send {
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px; padding: 0.4rem 0.7rem; font-size: 0.72rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.mtg-chat-send:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.2); }

/* Chat messages */
.mtg-chat-msg {
  font-size: 0.78rem; line-height: 1.5;
  padding: 0.4rem 0.6rem; border-radius: 8px;
  animation: mtgFadeIn 0.2s ease-out;
  max-width: 100%; word-break: break-word;
}
.mtg-chat-msg.user {
  background: rgba(255, 255, 255, 0.06); color: var(--text-primary);
  align-self: flex-end; border-left: 2px solid var(--accent);
}
.mtg-chat-msg.assistant {
  background: rgba(255,255,255,0.04); color: var(--text-secondary);
  align-self: flex-start; border-left: 2px solid var(--success);
}
.mtg-chat-msg.assistant .mtg-chat-streaming {
  display: inline-block; width: 4px; height: 12px;
  background: var(--accent); animation: mtgBlink 0.6s ease-in-out infinite;
  vertical-align: middle; margin-left: 2px; border-radius: 1px;
}

/* Scene elements */
.mtg-scene-title {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-muted); position: absolute; top: 1rem; left: 2rem;
  animation: mtgFadeIn 0.5s ease-out;
}

/* Scene 1: Typewriter text */
.mtg-text-container {
  max-width: 700px; text-align: center;
}
.mtg-text-word {
  display: inline; font-size: 1.6rem; font-weight: 300;
  color: white; opacity: 0;
  transition: opacity 0.15s ease-out;
  line-height: 2;
}
.mtg-text-word.visible { opacity: 1; }

/* Scene 2: Domain reveal */
.mtg-domain-word {
  display: inline-block; font-size: 1.3rem; font-weight: 400;
  padding: 0.15rem 0.4rem; margin: 0.15rem; border-radius: 4px;
  transition: color 0.4s ease, background 0.4s ease, opacity 0.4s ease, transform 0.6s ease;
  color: var(--text-primary); line-height: 1.8; cursor: pointer;
}
.mtg-domain-word.structural {
  opacity: 0.2;
}
.mtg-domain-word.revealed {
  background: var(--mtg-domain-bg, rgba(255,255,255,0.06));
  color: var(--mtg-domain-color, white);
}
.mtg-domain-label {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  margin: 0.3rem 0.15rem; animation: mtgFadeIn 0.4s ease-out;
}

/* Scene 3: Classification */
.mtg-classify-container { text-align: center; max-width: 600px; }
.mtg-tier-reveal {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.5rem; border-radius: 12px;
  font-weight: 700; font-size: 1.8rem;
  animation: mtgScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mtg-classify-text {
  font-size: 0.9rem; color: var(--text-secondary);
  margin-top: 0.75rem; line-height: 1.6;
  border-left: 3px solid; padding-left: 0.75rem;
  animation: mtgSlideUp 0.3s ease-out;
}
.mtg-conf-meter {
  margin-top: 0.6rem; animation: mtgFadeIn 0.5s ease-out 0.3s both;
}
.mtg-conf-bar-outer {
  width: 200px; height: 8px; background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: hidden; margin: 0 auto;
}
.mtg-conf-bar-inner {
  height: 100%; border-radius: 4px;
  transition: width 0.8s ease-out;
}
.mtg-conf-label {
  font-size: 0.75rem; color: var(--text-secondary);
  margin-top: 0.3rem;
  font-family: 'SF Mono', monospace;
}
.mtg-r-trace {
  font-size: 0.65rem; color: var(--text-muted);
  font-family: 'SF Mono', monospace; margin-top: 0.3rem;
  animation: mtgFadeIn 0.3s ease-out 0.6s both;
}

/* Scene 4: Word gallery */
.mtg-gallery-card {
  max-width: 500px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  padding: 1.5rem; animation: mtgScaleIn 0.4s ease-out;
  position: relative; overflow: hidden;
}
.mtg-gallery-card-img {
  position: absolute; inset: 0; object-fit: cover;
  opacity: 0.15; z-index: 0;
}
.mtg-gallery-card-content { position: relative; z-index: 1; }
.mtg-gallery-word {
  font-size: 2rem; font-weight: 700; margin-bottom: 0.3rem;
}
.mtg-gallery-pos {
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.mtg-gallery-def {
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.6; margin-top: 0.5rem; font-style: italic;
}
.mtg-gallery-source {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 3px;
  margin-top: 0.4rem; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mtg-gallery-ety {
  font-size: 0.7rem; color: var(--text-muted);
  margin-top: 0.3rem;
}
.mtg-gallery-synonyms {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  margin-top: 0.5rem;
}
.mtg-gallery-syn {
  font-size: 0.65rem; padding: 0.1rem 0.4rem;
  background: rgba(255,255,255,0.06); border-radius: 999px;
  color: var(--text-secondary);
  animation: mtgFadeIn 0.2s ease-out both;
}

/* Scene 5: Etymology tree */
.mtg-ety-container {
  display: flex; gap: 2rem; flex-wrap: wrap;
  justify-content: center; max-width: 800px;
}
.mtg-ety-group {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.3rem; min-width: 100px;
  animation: mtgSlideUp 0.4s ease-out both;
}
.mtg-ety-lang {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem; border-radius: 6px;
  margin-bottom: 0.3rem;
}
.mtg-ety-word {
  font-size: 0.85rem; color: var(--text-secondary);
  padding: 0.15rem 0.4rem; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  cursor: pointer; transition: background 0.15s;
}
.mtg-ety-word:hover { background: rgba(255,255,255,0.08); }

/* Scene 6: Score buildup */
.mtg-score-container { text-align: center; max-width: 500px; }
.mtg-score-blocks {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px; height: 120px; margin-bottom: 1rem;
}
.mtg-score-block {
  width: 24px; border-radius: 3px 3px 0 0;
  transition: height 0.6s ease-out;
  cursor: default; position: relative;
}
.mtg-score-block-label {
  position: absolute; bottom: -16px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem; color: var(--text-muted);
  white-space: nowrap;
}
.mtg-score-formula {
  font-size: 0.72rem; font-family: 'SF Mono', monospace;
  color: var(--text-muted); margin-bottom: 0.5rem;
  animation: mtgFadeIn 0.5s ease-out;
}
.mtg-score-big {
  font-size: 3.5rem; font-weight: 800;
  animation: mtgScaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mtg-score-tier-bar {
  display: flex; height: 12px; border-radius: 6px;
  overflow: hidden; margin-top: 0.75rem;
  background: rgba(255,255,255,0.04);
}
.mtg-score-tier-seg {
  transition: width 0.8s ease-out; min-width: 2px;
}

/* Scene 7: Collage */
.mtg-collage {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.75rem; max-width: 700px; width: 100%;
  animation: mtgFadeIn 0.6s ease-out;
}
.mtg-collage-cell {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 0.75rem;
}
.mtg-collage-label {
  font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 0.3rem; font-weight: 600;
}
.mtg-collage-value {
  font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
}
.mtg-collage-stat {
  font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.15rem;
}
.mtg-collage-replay {
  grid-column: 1 / -1; text-align: center; padding: 1rem;
}
.mtg-collage-replay-btn {
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 0.5rem 1.5rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; margin: 0 0.4rem;
}
.mtg-collage-replay-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.2); }
.mtg-collage-replay-btn.secondary {
  background: transparent; border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.mtg-collage-replay-btn.secondary:hover {
  border-color: var(--text-primary); color: var(--text-primary);
}

/* Scene container overflow guards — prevent content clipping */
.mtg-text-container,
.mtg-classify-container,
.mtg-gallery-card,
.mtg-ety-container,
.mtg-score-container,
.mtg-collage,
.mtg-mismatch-display,
.mtg-framing-group {
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
}

/* Line clamp for long text */
.mtg-classify-text,
.mtg-gallery-def,
.mtg-batch-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive: shorter viewport */
@media (max-height: 700px) {
  .mtg-text-container,
  .mtg-classify-container,
  .mtg-gallery-card,
  .mtg-ety-container,
  .mtg-score-container,
  .mtg-collage,
  .mtg-mismatch-display,
  .mtg-framing-group {
    max-height: calc(100vh - 8rem);
  }
}

/* Play button in editor & chat */
.mtg-play-btn {
  font-size: 0.65rem; font-weight: 600; padding: 0.25rem 0.55rem;
  border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06); color: var(--accent);
  cursor: pointer; transition: all 0.15s;
}
.mtg-play-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }

/* -- MontageDirector: Transitions (v3.8.0) -- */
.mtg-transition-fade  { animation: mtgFadeIn 0.8s ease; }
.mtg-transition-cut   { animation: none; }
.mtg-transition-wipe  { animation: mtgWipeIn 0.6s ease; }
.mtg-transition-zoom  { animation: mtgZoomIn 0.5s ease; }

/* Beat ambient accents */
.mtg-beat-setup       { --mtg-accent: #4a9eff; }
.mtg-beat-tension     { --mtg-accent: #ff6b35; }
.mtg-beat-climax      { --mtg-accent: #ff2d55; }
.mtg-beat-resolution  { --mtg-accent: #38bdf8; }

.mtg-beat-setup .mtg-scene-title,
.mtg-beat-tension .mtg-scene-title,
.mtg-beat-climax .mtg-scene-title,
.mtg-beat-resolution .mtg-scene-title {
  color: var(--mtg-accent);
  text-shadow: 0 0 20px color-mix(in srgb, var(--mtg-accent) 30%, transparent);
}

/* ClassifyBatch scene */
.mtg-batch-bar {
  display: flex; border-radius: 6px; overflow: hidden;
  height: 32px; margin-bottom: 1rem;
  background: rgba(255,255,255,0.05);
}
.mtg-batch-list {
  display: flex; flex-direction: column; gap: 0.4rem;
  max-height: 60vh; overflow-y: auto;
}
.mtg-batch-item {
  padding: 0.4rem 0.7rem; font-size: 0.8rem;
  background: rgba(255,255,255,0.03); border-radius: 4px;
}
.mtg-batch-text { opacity: 0.85; }
.mtg-batch-outlier-tag {
  font-size: 0.6rem; font-weight: 700; padding: 0.1rem 0.35rem;
  border-radius: 3px; background: rgba(255,45,85,0.2);
  color: #ff2d55; margin-left: 0.4rem;
}

/* Dispute scene */
.mtg-dispute-panel {
  animation: mtgFadeIn 0.6s ease both;
  margin-bottom: 1rem;
}
.mtg-dispute-sides {
  display: flex; align-items: center; gap: 1rem;
}
.mtg-dispute-side {
  flex: 1; padding: 1rem; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  font-size: 0.85rem; line-height: 1.5;
}
.mtg-dispute-left { border: 1px solid rgba(59,130,246,0.3); }
.mtg-dispute-right { border: 1px solid rgba(239,68,68,0.3); }
.mtg-dispute-side-text { opacity: 0.9; }
.mtg-dispute-label {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.15em;
  color: #ff2d55; white-space: nowrap;
  text-shadow: 0 0 12px rgba(255,45,85,0.4);
  animation: mtgPulse 2s ease infinite;
}

/* Framing scene */
.mtg-framing-group {
  margin-bottom: 1rem; animation: mtgSlideUp 0.5s ease both;
}
.mtg-framing-type {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 0.4rem;
}
.mtg-framing-markers {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.3rem;
}
.mtg-framing-marker {
  font-size: 0.8rem; padding: 0.2rem 0.5rem; border-radius: 4px;
  font-weight: 600; animation: mtgScaleIn 0.4s ease both;
}
.mtg-framing-arrow {
  font-size: 0.85rem; margin-top: 0.3rem; opacity: 0.7;
  font-weight: 600;
}

/* Mismatch scene */
.mtg-mismatch-display { text-align: center; padding: 1.5rem 0; }
.mtg-mismatch-pair {
  display: flex; align-items: center; justify-content: center; gap: 2rem;
  margin-bottom: 1.5rem;
}
.mtg-mismatch-badge {
  padding: 1.2rem 1.5rem; border-radius: 12px; text-align: center;
  min-width: 120px;
}
.mtg-mismatch-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.15em;
  opacity: 0.6; margin-bottom: 0.3rem;
}
.mtg-mismatch-tier { font-size: 2rem; font-weight: 800; }
.mtg-mismatch-name { font-size: 0.75rem; opacity: 0.7; margin-top: 0.2rem; }
.mtg-mismatch-gauge {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem; min-width: 80px;
}
.mtg-mismatch-gap-bar {
  height: 4px; border-radius: 2px;
  transition: width 0.6s ease;
}
.mtg-mismatch-gap-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
}
.mtg-mismatch-severity {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.15em;
}

/* Truth Ribbon (v3.8.0) — persistent CU tier strip */
.mtg-truth-ribbon {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; height: 28px; gap: 2px;
  padding: 0 0.5rem; align-items: flex-end;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mtg-ribbon-seg {
  height: 100%; border-radius: 3px 3px 0 0;
  position: relative; cursor: pointer;
  transition: opacity 0.4s ease, height 0.3s ease;
  animation: mtgSlideUp 0.3s ease both;
  min-width: 8px;
}
.mtg-ribbon-seg:hover { height: 36px; z-index: 2; }
.mtg-ribbon-label {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 0.55rem; font-weight: 700;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none; white-space: nowrap;
}
.mtg-ribbon-seg:hover .mtg-ribbon-label { opacity: 1; }
.mtg-ribbon-beat {
  position: absolute; right: 0.5rem; top: -18px;
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--mtg-accent, rgba(255, 255, 255, 0.6)); opacity: 0.6;
}

/* Outlier pulse */
.mtg-outlier-pulse { animation: mtgPulse 2s ease infinite; }

/* Keyframes */
@keyframes mtgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mtgScaleIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes mtgSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mtgBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes mtgWipeIn {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@keyframes mtgZoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes mtgPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,45,85,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,45,85,0); }
}

/* Responsive: collapse chat on narrow screens */
@media (max-width: 900px) {
  .mtg-chat { width: 240px; }
}
@media (max-width: 700px) {
  .mtg-body { flex-direction: column; }
  .mtg-chat {
    width: 100%; border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    max-height: 35vh;
  }
  .mtg-canvas { padding: 1rem; }
  .mtg-text-word { font-size: 1.2rem; }
}

/* ── AI Scriptwriter Loading State (v3.8.1) ───────────────── */
.mtg-loading-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; gap: 1.5rem;
}
.mtg-loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.mtg-loading-text {
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-secondary);
  animation: mtgPulseText 2s ease-in-out infinite;
}
@keyframes mtgPulseText {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* AI-generated background image layer (v3.8.1) */
.mtg-canvas.mtg-has-bg-image {
  position: relative;
}
.mtg-canvas.mtg-has-bg-image::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--mtg-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: blur(2px);
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}
.mtg-canvas.mtg-has-bg-image > * {
  position: relative;
  z-index: 1;
}

/* Barcode-native tooltip enhancements (v3.10) */
.wp-cited-badge {
  display: inline-block; padding: 0.1rem 0.3rem;
  border-radius: 3px; font-size: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5); font-weight: 600;
}
.wp-barcode-thumb {
  max-width: 120px; height: auto;
  margin-top: 0.3rem; border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Grounding coverage bar (v3.10) */
.grounding-bar-inline { margin-top: 0.3rem; }
.grounding-bar {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.65rem; color: var(--text-secondary);
  padding: 0.25rem 0;
}
.grounding-label { white-space: nowrap; min-width: 80px; }
.grounding-track {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.grounding-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s ease;
}
.grounding-pct {
  white-space: nowrap; min-width: 70px; text-align: right;
  font-weight: 600;
}

/* AI-generated video background layer (v3.8.1 — Sora 2) */
.mtg-canvas.mtg-has-bg-video {
  position: relative;
}
.mtg-bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: blur(1px);
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}
.mtg-canvas.mtg-has-bg-video > *:not(.mtg-bg-video) {
  position: relative;
  z-index: 1;
}

/* GCECDL Phase 1 — Feedback buttons on CU spans */
.cu-feedback {
  display: inline-flex; gap: 2px; align-items: center;
  margin-left: 3px; opacity: 0;
  transition: opacity 0.15s ease;
  vertical-align: middle;
}
.cu-span:hover .cu-feedback { opacity: 0.7; }
.cu-feedback:hover { opacity: 1 !important; }

.cu-fb-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.6rem; line-height: 1; padding: 1px 3px;
  border-radius: 3px; color: var(--text-muted);
  transition: color 0.1s, background 0.1s;
}
.cu-fb-accept:hover { color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.08); }
.cu-fb-reject:hover { color: #ef4444; background: rgba(239,68,68,0.15); }

.cu-fb-mark {
  font-size: 0.6rem; line-height: 1; padding: 1px 3px;
  border-radius: 3px; font-weight: 600;
}
.cu-fb-mark-accept { color: rgba(255, 255, 255, 0.5); }
.cu-fb-mark-reject { color: #ef4444; }

.cu-fb-override {
  position: absolute; bottom: 100%; left: 0;
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 4px 6px;
  background: rgba(17,17,17,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 1000;
  max-width: 200px;
}
.cu-fb-override-btn {
  background: none; border: 1px solid var(--glass-border);
  cursor: pointer; font-size: 0.55rem; padding: 2px 5px;
  border-radius: 3px; font-weight: 600;
  transition: background 0.1s;
}
.cu-fb-override-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Dashboard: Self & Search panels ─────────────────────────── */
.dash-self-text {
  font-size: 0.72rem; color: var(--text-secondary); line-height: 1.6;
  max-height: 200px; overflow-y: auto;
}
.dash-atom-search-input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border); border-radius: 6px;
  color: var(--text-primary); font-size: 0.75rem; padding: 0.4rem 0.6rem;
  font-family: inherit; outline: none; margin-bottom: 0.3rem;
}
.dash-atom-search-input:focus { border-color: rgba(255,255,255,0.2); }
.dash-atom-result {
  display: flex; gap: 0.4rem; padding: 0.25rem 0.4rem;
  background: rgba(255,255,255,0.02); border-radius: 4px;
  font-size: 0.65rem; align-items: baseline; margin-bottom: 0.15rem;
}
.dash-atom-word { color: var(--text-primary); font-weight: 600; flex-shrink: 0; }
.dash-atom-domain {
  font-size: 0.55rem; padding: 1px 4px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: var(--text-muted); flex-shrink: 0;
}
.dash-atom-def { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Phase F9: Framing Intelligence Display ───────────────── */
/* FE-391: Emotion bar chart */
.framing-emotion-row {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.65rem; margin-bottom: 0.15rem;
}
.framing-emotion-label {
  width: 5.5rem; text-align: right; color: var(--text-secondary);
  flex-shrink: 0; text-transform: capitalize;
}
.framing-emotion-bar-bg {
  flex: 1; height: 8px; background: rgba(255,255,255,0.06);
  border-radius: 4px; overflow: hidden;
}
.framing-emotion-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.3s ease;
}
.framing-emotion-val {
  width: 2.2rem; font-size: 0.6rem; color: var(--text-muted);
  text-align: right; flex-shrink: 0;
  font-family: 'SF Mono', Consolas, monospace;
}

/* FE-392: Sarcasm/sincerity/inversion badges */
.framing-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 3px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.framing-badge-sarcastic {
  background: rgba(239, 68, 68, 0.2); color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.framing-badge-sincere {
  background: rgba(34, 197, 94, 0.2); color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.framing-badge-performative {
  background: rgba(245, 158, 11, 0.2); color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.framing-badge-inverted {
  background: rgba(249, 115, 22, 0.2); color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* FE-393: Crisis alert */
.envelope-crisis-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 3px;
  background: rgba(239, 68, 68, 0.25); color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  letter-spacing: 0.04em; animation: crisis-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes crisis-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.cu-crisis {
  box-shadow: inset 4px 0 0 0 #ef4444 !important;
}

/* FE-394: Power dynamic indicator */
.framing-power-scale {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.6rem; color: var(--text-muted);
}
.framing-power-label-left,
.framing-power-label-right {
  flex-shrink: 0; font-size: 0.55rem; color: var(--text-muted);
}
.framing-power-bar {
  flex: 1; height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; position: relative;
  background: linear-gradient(90deg, rgba(59,130,246,0.3), rgba(255,255,255,0.06) 50%, rgba(239,68,68,0.3));
}
.framing-power-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-primary); border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 6px rgba(255,255,255,0.2);
}

/* ── Phase F10: Pipeline Intelligence Display ─────────────── */
/* FE-401: Conversational role badge */
.envelope-role-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 3px;
  border: 1px solid; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
}
/* FE-402: Novelty badge */
.envelope-novelty-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 3px;
  background: rgba(168, 85, 247, 0.2); color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  letter-spacing: 0.04em; flex-shrink: 0;
}
.envelope-grounded-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 3px;
  background: rgba(34, 197, 94, 0.15); color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
  letter-spacing: 0.04em; flex-shrink: 0;
}
/* FE-403: Environment section in envelope detail */
.envelope-env-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 0.8rem;
  font-size: 0.65rem; margin-top: 0.3rem;
}
.envelope-env-item { display: flex; gap: 0.3rem; }
.envelope-env-key { color: var(--text-muted); flex-shrink: 0; }
.envelope-env-val { color: var(--text-secondary); }
/* FE-404: Brief/silence badge */
.envelope-brief-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 3px;
  background: rgba(107, 114, 128, 0.2); color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
  letter-spacing: 0.04em; flex-shrink: 0;
}

/* ── Phase F11: User Profile Panel ────────────────────────── */
/* FE-411: Readiness bar */
.up-readiness-bar {
  width: 80px; height: 8px; background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: hidden; flex-shrink: 0;
}
.up-readiness-fill {
  height: 100%; border-radius: 4px; transition: width 0.3s ease;
}
/* FE-412: Register badge in envelope bar */
.envelope-register-slot { display: inline-flex; align-items: center; }
.envelope-register-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 3px;
  border: 1px solid; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.04); flex-shrink: 0;
  margin-left: 0.3rem;
}
/* FE-413: Domain trajectory row */
.up-traj-row {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.15rem; font-size: 0.6rem;
}
.up-traj-label { width: 5rem; text-align: right; flex-shrink: 0; }
.up-traj-bar {
  height: 6px; border-radius: 3px; min-width: 4px;
  transition: width 0.3s ease;
}
/* Tier history chips */
.up-tier-chip {
  display: inline-block; font-size: 0.55rem; font-weight: 600;
  padding: 0.08rem 0.3rem; border-radius: 3px;
  border: 1px solid; background: rgba(255,255,255,0.03);
}

/* ── Phase F12: CU Detail Completion ──────────────────────── */
/* FE-420: Gate threshold labels */
.gate-threshold {
  font-size: 0.55rem; color: var(--text-muted); font-weight: 400;
}
/* FE-422: Pill contributions */
.dp-pill-contrib {
  display: flex; gap: 0.4rem; align-items: baseline;
  font-size: 0.62rem; padding: 0.1rem 0;
}
.dp-pill-word {
  font-family: 'SF Mono', Consolas, monospace; min-width: 5rem;
  flex-shrink: 0;
}
.dp-pill-weight {
  font-family: 'SF Mono', Consolas, monospace; min-width: 3rem;
  flex-shrink: 0; color: var(--text-muted);
}
.dp-pill-tier {
  font-size: 0.58rem; flex-shrink: 0;
}

/* ── Phase F13: Reflection & Theory Panels ────────────────── */
/* FE-431: Drift timeline */
.drift-tl-turn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.5rem; font-size: 0.65rem;
  border-left: 2px solid rgba(255,255,255,0.08);
  margin-left: 0.5rem;
}
.drift-tl-shifted {
  border-left-color: #f59e0b; background: rgba(245,158,11,0.05);
}
.drift-tl-idx { color: var(--text-muted); width: 3rem; flex-shrink: 0; }
.drift-tl-tier { font-weight: 600; min-width: 1.5rem; flex-shrink: 0; }
.drift-tl-line {
  flex: 0 0 2rem; height: 0; border-top: 1px dashed rgba(255,255,255,0.15);
}
.drift-tl-topic { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drift-tl-arrow {
  font-size: 0.5rem; font-weight: 700; color: #f59e0b;
  padding: 0.05rem 0.3rem; background: rgba(245,158,11,0.15);
  border-radius: 3px; flex-shrink: 0;
}
/* FE-433: Mechanism rows */
.mech-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.15rem 0.3rem; font-size: 0.62rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mech-name { color: var(--text-secondary); }
.mech-tiers { color: var(--text-muted); font-family: 'SF Mono', Consolas, monospace; font-size: 0.58rem; }

/* ── Phase F15: Dashboard Stats Wiring ─── */
.dash-disabled-badge {
  display: inline-block; padding: 0.1rem 0.4rem;
  background: rgba(107,114,128,0.25); color: #9ca3af;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
  border-radius: 3px; text-transform: uppercase;
}
.dash-gauge-row {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0; font-size: 0.72rem;
}
.dash-gauge-label { color: var(--text-secondary); min-width: 5rem; }
.dash-gauge-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dash-mini-pct { color: var(--text-muted); font-size: 0.62rem; }

/* ── Response Copilot (v3.33.0 Phase F16) ────────────────────── */
.envelope-copilot-btn {
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.3);
  border-radius: 4px; color: rgba(139,92,246,0.9); padding: 0.15rem 0.5rem;
  cursor: pointer; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  transition: all 0.2s ease; margin-left: 0.5rem;
}
.envelope-copilot-btn:hover {
  background: rgba(139,92,246,0.2); border-color: rgba(139,92,246,0.6);
  color: #a78bfa;
}
/* v3.33.0: Model routing badge */
.envelope-routing-badge {
  font-size: 0.65rem; padding: 1px 5px; border-radius: 4px;
  border: 1px solid; margin-left: 4px; font-weight: 600;
}
.routing-fast {
  color: #22d3ee; border-color: rgba(34,211,238,0.4);
  background: rgba(34,211,238,0.1);
}
.routing-full {
  color: #a78bfa; border-color: rgba(167,139,250,0.4);
  background: rgba(167,139,250,0.1);
}
.envelope-grounding-badge {
  background: rgba(255, 165, 0, 0.2);
  color: #ffa500;
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 6px;
}
/* Phase 131: Framework badge for inline notation */
.framework-badge {
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #a78bfa;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--sovren-mono, monospace);
}

/* Phase 130: Viewpoint diversity notice */
.viewpoint-diversity-notice {
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 6px;
  color: #a78bfa;
  font-size: 11px;
  padding: 6px 10px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Phase 107: Grounding caveat badges */
.grounding-warning {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}
.grounding-caution {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: 8px;
}
/* v3.33.0: Research pump indicator + findings */
.research-indicator {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 6px;
  margin-left: 8px; display: none;
}
.research-active {
  color: #22c55e; background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  animation: research-pulse 2s ease-in-out infinite;
}
.research-paused {
  color: #eab308; background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
}
.research-done {
  color: #6b7280; background: rgba(107,114,128,0.1);
  border: 1px solid rgba(107,114,128,0.3);
}
@keyframes research-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.research-learned-block {
  background: rgba(34,197,94,0.05); border: 1px solid rgba(34,197,94,0.2);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 8px;
  font-size: 0.8rem;
}
.research-learned-header {
  color: #22c55e; font-weight: 600; margin-bottom: 4px;
}
.research-learned-item {
  color: #94a3b8; padding-left: 12px;
}
.research-learned-meta {
  color: #6b7280; font-size: 0.7rem; margin-top: 4px;
}
#copilotBody {
  display: flex; flex-direction: column; max-height: 80vh;
}
#copilotHistory {
  flex: 1; overflow-y: auto; padding-bottom: 0.75rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.copilot-welcome {
  color: var(--text-muted); font-size: 0.82rem; line-height: 1.5;
  padding: 0.5rem 0;
}
.copilot-welcome p { margin-bottom: 0.5rem; }
.copilot-examples {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem;
}
.copilot-example {
  background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.2);
  border-radius: 12px; padding: 0.25rem 0.6rem; font-size: 0.72rem;
  color: rgba(139,92,246,0.8); cursor: pointer; transition: all 0.2s;
}
.copilot-example:hover {
  background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4);
  color: #a78bfa;
}
.copilot-q {
  border-left: 3px solid rgba(139,92,246,0.5); padding: 0.4rem 0.6rem;
  font-size: 0.82rem; color: var(--text-primary); background: rgba(139,92,246,0.04);
  border-radius: 0 4px 4px 0;
}
.copilot-a {
  font-size: 0.82rem; color: var(--text-primary); line-height: 1.55;
  background: rgba(255,255,255,0.02); border-radius: 6px;
  padding: 0.6rem 0.75rem; white-space: pre-wrap;
}
.copilot-tools {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem;
}
.copilot-tool-badge {
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px; padding: 0.12rem 0.45rem; font-size: 0.65rem;
  color: rgba(139,92,246,0.7); font-family: monospace;
}
.copilot-meta {
  font-size: 0.62rem; color: var(--text-muted); margin-top: 0.2rem;
}
.copilot-error {
  color: var(--error); font-size: 0.8rem; padding: 0.4rem 0.6rem;
  background: rgba(239,68,68,0.06); border-radius: 4px;
}
.copilot-loading {
  font-size: 0.78rem; color: rgba(139,92,246,0.6); padding: 0.4rem 0;
  animation: copilot-pulse 1.5s ease-in-out infinite;
}
@keyframes copilot-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.copilot-input-row {
  display: flex; gap: 0.4rem; padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border); margin-top: 0.5rem;
}
#copilotInput {
  flex: 1; background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.82rem;
  color: var(--text-primary); outline: none; transition: border-color 0.2s;
}
#copilotInput:focus { border-color: rgba(139,92,246,0.5); }
#copilotInput::placeholder { color: var(--text-muted); }
#copilotSubmit {
  background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.3);
  border-radius: 6px; padding: 0.5rem 1rem; font-size: 0.82rem;
  color: rgba(139,92,246,0.9); cursor: pointer; font-weight: 600;
  transition: all 0.2s;
}
#copilotSubmit:hover {
  background: rgba(139,92,246,0.25); border-color: rgba(139,92,246,0.5);
}
#copilotSubmit:disabled {
  opacity: 0.4; cursor: not-allowed;
}

/* ── PL-713: "What Just Happened" summary ─────────────── */
.what-happened {
  font-size: 0.68rem; color: var(--text-muted); padding: 0.3rem 0.5rem;
  border-left: 2px solid rgba(255,255,255,0.08);
  margin-bottom: 0.3rem; line-height: 1.5;
}
.what-happened .what-happened-text {
  display: block; margin-top: 0.2rem; color: var(--text-secondary);
  font-size: 9px; line-height: 1.6; padding: 4px 0;
}
.what-happened .what-happened-detail { display: none; }
.what-happened.expanded .what-happened-detail { display: block; }
.what-happened-toggle {
  cursor: pointer; user-select: none; opacity: 0.7;
  transition: opacity 0.15s;
}
.what-happened-toggle:hover { opacity: 1; }
.what-happened.expanded .what-happened-toggle { opacity: 1; }

/* Phase 71: Score interpretation */
.score-interpretation {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.5rem 0.4rem;
  border-left: 2px solid rgba(255,255,255,0.12);
  margin-bottom: 0.4rem;
  line-height: 1.6;
  font-style: italic;
}

/* Phase 72: Classification Integrity Score */
.cis-bar {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-left: 2px solid rgba(99,102,241,0.35);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}
.cis-bar strong { color: var(--text-primary); }
.cis-grade {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(99,102,241,0.15);
  color: #818cf8;
  margin-left: 2px;
}

/* Phase 74: Score display repair */
.cis-grade-inline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(99,102,241,0.18);
  color: #818cf8;
  margin-right: 2px;
  vertical-align: middle;
}
.epistemic-level {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: auto;
}

/* Phase 20: Completion Mode */
.envelope-summary {
  font-family: var(--sovren-mono); font-size: 8px; color: var(--text-secondary);
  line-height: 1.4; flex: 1; padding-right: 8px;
}
.auto-verified-badge {
  font-family: var(--sovren-mono); font-size: 7px; letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── PL-711: Pipeline trace grid in envelope detail ──── */
.envelope-trace-grid {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem;
  margin-top: 0.3rem;
}
.envelope-trace-item {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.62rem; padding: 0.15rem 0.4rem;
  background: rgba(255,255,255,0.04); border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: default;
}
.envelope-trace-label {
  color: var(--text-secondary); white-space: nowrap;
}
.envelope-trace-ms {
  color: var(--text-muted); font-family: monospace; font-size: 0.58rem;
}

/* ── PL-722: Config description rows in dashboard ──── */
.dash-config-desc-row {
  display: flex; gap: 0.5rem; padding: 0.15rem 0;
  font-size: 0.62rem; border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: default;
}
.dash-config-desc-key {
  color: var(--accent); font-family: monospace; min-width: 14rem;
  flex-shrink: 0; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.dash-config-desc-text {
  color: var(--text-muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── PL-742: Glossary panel + header button ─────────────── */
.glossary-btn {
  background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.65rem;
  color: rgba(59, 130, 246, 0.85); cursor: pointer; font-weight: 600;
  transition: all 0.2s; margin-left: 0.5rem;
}
.glossary-btn:hover {
  background: rgba(59, 130, 246, 0.22); border-color: rgba(59, 130, 246, 0.45);
}
.glossary-search {
  width: 100%; background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.82rem;
  color: var(--text-primary); outline: none; margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.glossary-search:focus { border-color: rgba(59, 130, 246, 0.5); }
.glossary-search::placeholder { color: var(--text-muted); }
.glossary-category {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  color: rgba(59, 130, 246, 0.7); letter-spacing: 0.06em;
  padding: 0.4rem 0 0.2rem; border-bottom: 1px solid rgba(59, 130, 246, 0.12);
  margin-top: 0.5rem;
}
.glossary-category:first-child { margin-top: 0; }
.glossary-item {
  padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.glossary-label {
  font-weight: 600; font-size: 0.75rem; color: var(--text-primary);
  margin-right: 0.5rem;
}
.glossary-key {
  font-family: monospace; font-size: 0.62rem; color: var(--text-muted);
  background: rgba(255,255,255,0.04); border-radius: 3px;
  padding: 0.1rem 0.3rem;
}
.glossary-desc {
  font-size: 0.68rem; color: var(--text-secondary); margin-top: 0.15rem;
  line-height: 1.4;
}
.glossary-empty {
  font-size: 0.72rem; color: var(--text-muted); text-align: center;
  padding: 2rem 0;
}

/* ================================================================
   UI WIRING — Phase S1 + all new tab/panel/component styles
   ================================================================ */

/* UI-102: Expanded dashboard grid — extend animation entries for ~39 panels */
.dash-panel:nth-child(25) { animation-delay: 0.96s; }
.dash-panel:nth-child(26) { animation-delay: 1.00s; }
.dash-panel:nth-child(27) { animation-delay: 1.04s; }
.dash-panel:nth-child(28) { animation-delay: 1.08s; }
.dash-panel:nth-child(29) { animation-delay: 1.12s; }
.dash-panel:nth-child(30) { animation-delay: 1.16s; }
.dash-panel:nth-child(31) { animation-delay: 1.20s; }
.dash-panel:nth-child(32) { animation-delay: 1.24s; }
.dash-panel:nth-child(33) { animation-delay: 1.28s; }
.dash-panel:nth-child(34) { animation-delay: 1.32s; }
.dash-panel:nth-child(35) { animation-delay: 1.36s; }
.dash-panel:nth-child(36) { animation-delay: 1.40s; }
.dash-panel:nth-child(37) { animation-delay: 1.44s; }
.dash-panel:nth-child(38) { animation-delay: 1.48s; }
.dash-panel:nth-child(39) { animation-delay: 1.52s; }
.dash-panel-compact .dash-panel-title { margin-bottom: 0.4rem; }

/* UI-100: Deep metrics styles (CU detail sections) */
.dp-deep-section {
  border-top: 1px solid var(--glass-border);
  padding-top: 0.5rem; margin-top: 0.5rem;
}
.dp-deep-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  padding: 0.3rem 0;
}
.dp-deep-header:hover { color: var(--text-primary); }
.dp-deep-header .dp-deep-toggle {
  font-size: 0.65rem; color: var(--text-muted); transition: transform 0.2s;
}
.dp-deep-header.expanded .dp-deep-toggle { transform: rotate(90deg); }
.dp-deep-body { display: none; padding: 0.3rem 0; }
.dp-deep-body.expanded { display: block; }
.dp-veracity-score {
  font-size: 1.1rem; font-weight: 700; display: inline-block;
}
.dp-alignment-bar {
  height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden;
  margin: 0.3rem 0;
}
.dp-alignment-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.dp-ethics-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  padding: 0.15rem 0.4rem; border-radius: 4px;
  border: 1px solid var(--glass-border);
}
.dp-mvtt-bar-chart {
  display: flex; gap: 2px; align-items: flex-end; height: 40px; margin: 0.3rem 0;
}
.dp-mvtt-bar {
  flex: 1; border-radius: 2px 2px 0 0; min-width: 4px;
  transition: height 0.3s ease;
}
.dp-ratchet-lock-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 4px;
  background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

/* UI-101: Shared new tab area styles */
.tab-area-toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--glass-bg); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}
.tab-area-toolbar button {
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border);
  color: var(--text-secondary); padding: 0.3rem 0.7rem; border-radius: 4px;
  font-size: 0.75rem; cursor: pointer; transition: background 0.15s;
}
.tab-area-toolbar button:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.tab-area-toolbar button.active {
  background: rgba(255,255,255,0.12); color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}
.tab-area-body {
  flex: 1; overflow-y: auto; padding: 1rem 1.5rem;
}
.tab-area-filter-bar {
  display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap;
}
.tab-area-filter-bar select, .tab-area-filter-bar input {
  background: var(--bg-primary); border: 1px solid var(--glass-border);
  color: var(--text-primary); padding: 0.35rem 0.6rem; border-radius: 4px;
  font-size: 0.75rem; outline: none;
}
.tab-area-filter-bar select:focus, .tab-area-filter-bar input:focus {
  border-color: rgba(59, 130, 246, 0.5);
}

/* UI-057: Code tab styles */
/* UI-088: Misc panel styles */
.repl-output {
  background: var(--bg-primary); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 0.75rem; margin: 0.5rem 0;
  font-family: monospace; font-size: 0.72rem; line-height: 1.5;
  color: var(--text-secondary); max-height: 300px; overflow-y: auto;
  white-space: pre-wrap;
}
.repl-textarea {
  width: 100%; min-height: 80px; resize: vertical;
  background: var(--bg-primary); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 0.6rem; font-family: monospace;
  font-size: 0.78rem; color: var(--text-primary); outline: none;
}
.repl-textarea:focus { border-color: rgba(59, 130, 246, 0.5); }
.action-command-input {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.78rem;
  color: var(--text-primary); font-family: monospace; outline: none;
}
.action-command-input:focus { border-color: rgba(59, 130, 246, 0.5); }
.calendar-event-card {
  padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.72rem;
}
.calendar-event-title { font-weight: 600; color: var(--text-primary); }
.calendar-event-time { color: var(--text-muted); font-size: 0.65rem; }
.executor-output {
  background: var(--bg-primary); border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 0.75rem; margin: 0.5rem 0;
  font-family: monospace; font-size: 0.72rem; color: var(--text-secondary);
  max-height: 300px; overflow-y: auto; white-space: pre-wrap;
}

/* UI-094: Ingestion adapter brand colors */
.ingest-btn-github span { color: #f0f0f0; }
.ingest-btn-notion span { color: #f0f0f0; }
.ingest-btn-slack span { color: #e01e5a; }
.ingest-btn-newsapi span { color: #ff6600; }

/* Feedback/override buttons on CU and word detail */
.dp-feedback-row {
  display: flex; gap: 0.3rem; margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
}
.dp-feedback-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border);
  color: var(--text-secondary); padding: 0.25rem 0.5rem; border-radius: 4px;
  font-size: 0.68rem; cursor: pointer; transition: all 0.15s;
}
.dp-feedback-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.dp-feedback-btn.accept { border-color: rgba(34,197,94,0.3); }
.dp-feedback-btn.accept:hover { background: rgba(34,197,94,0.15); color: #22c55e; }
.dp-feedback-btn.reject { border-color: rgba(239,68,68,0.3); }
.dp-feedback-btn.reject:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.dp-override-select {
  background: var(--bg-primary); border: 1px solid var(--glass-border);
  color: var(--text-primary); padding: 0.25rem 0.4rem; border-radius: 4px;
  font-size: 0.68rem; outline: none;
}

/* UI-104: Session Dropdown */
.session-dropdown {
  background: var(--bg-primary); border: 1px solid var(--glass-border);
  color: var(--text-primary); padding: 0.2rem 0.4rem; border-radius: 4px;
  font-size: 0.7rem; outline: none; cursor: pointer;
  max-width: 120px;
}

/* ── v3.38.0: UI Standardization — Shared Component Classes ───────── */

/* Standardized empty state for all tab panels */
.tab-panel-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 2rem; color: var(--text-muted); text-align: center;
  flex: 1;
}
.tab-panel-empty-icon {
  font-size: 2rem; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem; color: rgba(255,255,255,0.15);
}
.tab-panel-empty h3 {
  font-size: 0.95rem; color: var(--text-secondary); font-weight: 500;
  margin-bottom: 0.3rem;
}
.tab-panel-empty p {
  font-size: 0.78rem; max-width: 320px; line-height: 1.5;
}
.tab-panel-empty .tab-panel-empty-action {
  margin-top: 0.75rem;
}

/* Standardized inline error for all panels */
.panel-error {
  color: var(--error); font-size: 0.78rem; padding: 0.6rem 0.75rem;
  background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.15);
  border-radius: 6px; margin: 0.5rem 0; line-height: 1.5;
}
.panel-error-retry {
  margin-top: 0.4rem; display: inline-block;
  color: var(--text-secondary); font-size: 0.72rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.panel-error-retry:hover { color: var(--text-primary); }

/* Disabled button state for ingest-submit during loading */
.ingest-submit:disabled, .ingest-submit.loading {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
.ingest-submit.loading::after {
  content: ''; display: inline-block; width: 10px; height: 10px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: rgba(255,255,255,0.8);
  border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-left: 0.4rem; vertical-align: middle;
}

/* Standardized count badge for tab headers */
.tab-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; font-size: 0.6rem; font-weight: 700;
  background: rgba(255,255,255,0.08); color: var(--text-muted);
  margin-left: 0.3rem;
}

/* Standardized section header for sub-views */
.panel-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.panel-section-title {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.panel-section-count {
  font-size: 0.65rem; color: var(--text-muted);
  font-family: 'SF Mono', monospace;
}

/* Standardized "back" button for sub-view navigation */
.panel-back-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border);
  color: var(--text-secondary); padding: 0.25rem 0.6rem; border-radius: 4px;
  font-size: 0.68rem; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.panel-back-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.panel-back-btn::before { content: '\2190'; font-size: 0.75rem; }

/* Standardized copy button for any panel content */
.panel-copy-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.72rem; cursor: pointer; padding: 0.15rem 0.3rem;
  border-radius: 3px; opacity: 0; transition: all 0.2s;
}
.panel-copy-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.panel-copy-btn.visible { opacity: 1; }

/* Ingest: input validation feedback */
.ingest-input.invalid {
  border-color: rgba(239,68,68,0.5);
  background: rgba(239,68,68,0.04);
}
.ingest-input.invalid::placeholder { color: rgba(239,68,68,0.5); }

/* Dash: panel error state */
.dash-panel-error {
  color: var(--error); font-size: 0.68rem; padding: 0.5rem;
  background: rgba(239,68,68,0.04); border-radius: 4px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   SOVREN SHELL — Phase 2
   Adapted from sovren-gce.jsx design language
   No green (#00ff88). No purple (#cc00ff).
═══════════════════════════════════════════════════ */

.sovren-app {
  display: flex; flex-direction: row;
  flex: 1; overflow: hidden; min-height: 0;
}

.sovren-nav {
  width: 50px; min-width: 50px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; flex-shrink: 0;
}
.sovren-nav::-webkit-scrollbar { display: none; }

.ntab {
  width: 50px; height: 46px; min-height: 46px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  cursor: pointer; border: none; background: transparent;
  border-left: 2px solid transparent;
  transition: all 0.12s; gap: 2px; padding: 0;
}
.ntab:hover { background: var(--bg-tertiary); }
.ntab.act { border-left-color: var(--tc, var(--sovren-accent)); background: var(--bg-tertiary); }
.ntab.act .ni { color: var(--tc, var(--sovren-accent)); }
.ntab:hover .ni { color: var(--text-secondary); }

.ni { font-size: 13px; color: var(--text-muted); transition: color 0.12s; line-height: 1; }
.nl { font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted);
      letter-spacing: 0.04em; transition: color 0.12s; text-transform: uppercase; }

.sovren-workspace { flex: 1; display: flex; flex-direction: row; overflow: hidden; min-width: 0; }

.ws-left { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.ws-divider {
  width: 4px; min-width: 4px; cursor: col-resize;
  background: var(--glass-border); display: none;
  transition: background 0.15s; flex-shrink: 0;
}
.ws-divider:hover { background: rgba(255,255,255,0.15); }
.ws-divider.dragging { background: var(--sovren-accent); }

.ws-right {
  width: 0; min-width: 0; overflow: hidden;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  transition: width var(--anim); flex-shrink: 0;
}
.ws-right.open { width: 44%; min-width: 320px; }

.ws-right-toolbar {
  min-height: 38px;
  display: flex; align-items: center; flex-wrap: wrap;
  padding: 4px 10px; gap: 6px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-tertiary); flex-shrink: 0;
}
.ws-right-title {
  font-family: var(--sovren-mono); font-size: 9px;
  color: var(--text-secondary); letter-spacing: 0.15em;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-right-mode-btn {
  font-family: var(--sovren-mono); font-size: 7px; letter-spacing: 0.08em;
  padding: 2px 6px; background: transparent; border: 1px solid var(--glass-border);
  color: var(--text-muted); border-radius: 1px; cursor: pointer; transition: all 0.12s;
}
.ws-right-mode-btn:hover { border-color: var(--sovren-accent); color: var(--sovren-accent); }
.ws-right-close {
  width: 18px; height: 18px; border-radius: 1px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: transparent;
  border: 1px solid var(--glass-border); color: var(--text-muted);
  font-size: 9px; transition: all 0.12s;
}
.ws-right-close:hover { background: var(--error); border-color: var(--error); color: white; }

.ws-right-content {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px;
  scrollbar-width: thin; scrollbar-color: var(--glass-border) transparent;
}

/* Product list — persistent right panel */
.ws-product-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; padding: 40px 20px;
  text-align: center; color: var(--text-muted);
}
.ws-product-empty-icon {
  font-size: 28px; margin-bottom: 16px;
  opacity: 0.25; color: var(--sovren-accent);
}
.ws-product-empty-title {
  font-family: var(--sovren-mono); font-size: 9px;
  letter-spacing: 0.15em; margin-bottom: 12px;
  color: var(--text-secondary);
}
.ws-product-empty-text {
  font-size: 11px; line-height: 1.7;
  color: var(--text-muted); max-width: 240px;
}
.ws-product-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; padding-bottom: 7px;
  border-bottom: 1px solid var(--glass-border);
}
.ws-product-header-label {
  font-family: var(--sovren-mono); font-size: 8px;
  color: var(--text-muted); letter-spacing: 0.15em;
}
.ws-product-header-count {
  font-family: var(--sovren-mono); font-size: 8px;
  color: var(--sovren-accent);
}
.ws-product-list {
  display: flex; flex-direction: column; gap: 5px;
}
.ws-product-card {
  padding: 10px 12px; border-radius: 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  cursor: pointer; transition: all 0.12s;
}
.ws-product-card:hover {
  border-color: var(--sovren-accent);
  background: rgba(0, 204, 255, 0.04);
}
.ws-product-card-title {
  font-family: var(--sovren-mono); font-size: 10px;
  color: var(--text-secondary); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-product-card-time {
  font-family: var(--sovren-mono); font-size: 7px;
  color: var(--text-muted); letter-spacing: 0.08em;
}

/* Artifact content styles */
.ws-artifact { font-size: 0.83rem; line-height: 1.7; }
.ws-artifact-header {
  font-family: var(--sovren-mono); font-size: 8px; color: var(--text-muted);
  letter-spacing: 0.15em; padding-bottom: 7px;
  border-bottom: 1px solid var(--glass-border); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.ws-artifact-row {
  display: flex; gap: 7px; padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03); align-items: flex-start;
}
.ws-artifact-badge {
  font-family: var(--sovren-mono); font-size: 7px; padding: 1px 4px;
  border-radius: 1px; min-width: 26px; text-align: center;
  font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.ws-rbar { height: 2px; background: var(--glass-border); border-radius: 1px; margin-top: 3px; }
.ws-rbar-fill { height: 100%; border-radius: 1px; }

.ws-code-block { margin-bottom: 1rem; border: 1px solid var(--glass-border); border-radius: 4px; overflow: hidden; }
.ws-code-header { display: flex; align-items: center; padding: 4px 10px; background: var(--bg-tertiary); font-family: var(--sovren-mono); font-size: 8px; color: var(--text-muted); letter-spacing: 0.1em; }
.ws-code-lang { flex: 1; }
.ws-code-copy { background: none; border: 1px solid var(--glass-border); color: var(--text-muted); border-radius: 2px; cursor: pointer; font-size: 7px; padding: 1px 5px; font-family: var(--sovren-mono); transition: all 0.12s; }
.ws-code-copy:hover { color: var(--text-primary); border-color: var(--sovren-accent); }
.ws-code-block pre { margin: 0; padding: 10px; overflow-x: auto; font-size: 0.75rem; line-height: 1.5; font-family: var(--sovren-mono); }

.ws-card { background: var(--bg-tertiary); border: 1px solid var(--glass-border); border-radius: 2px; padding: 8px 10px; margin-bottom: 6px; }
.ws-card-title a { color: var(--text-primary); text-decoration: none; font-size: 0.82rem; font-weight: 500; line-height: 1.4; }
.ws-card-title a:hover { color: var(--sovren-accent); }
.ws-card-meta { font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.07em; }

/* Phase 3: Right panel toolbar action buttons */
.ws-toolbar-btn {
  font-family: var(--sovren-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  border-radius: 1px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.ws-toolbar-btn:hover {
  border-color: var(--sovren-accent);
  color: var(--sovren-accent);
}
.ws-toolbar-btn:active {
  background: rgba(0,204,255,0.08);
}

/* Phase 3: Response renderer */
.ws-response-body {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.ws-response-body .cu-span {
  display: inline;
}

/* Phase 3: Document renderer typography */
.ws-document {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-primary);
  max-width: 680px;
}
.ws-document-title {
  font-family: var(--sovren-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--glass-border);
  letter-spacing: 0.02em;
}
.ws-document-heading {
  font-family: var(--sovren-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sovren-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 1.4rem 0 0.5rem;
}
.ws-document-para {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}
.ws-document-note {
  font-family: var(--sovren-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
  font-style: italic;
}

/* Phase 4: Connections layer */
.ws-pin-btn {
  border-color: rgba(255, 204, 0, 0.4);
  color: #ffcc00;
}
.ws-pin-btn:hover {
  border-color: #ffcc00;
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.08);
}
.ws-pin-btn.pinned {
  background: rgba(255, 204, 0, 0.12);
  border-color: #ffcc00;
  color: #ffcc00;
}

.ws-pins-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.ws-pin-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.ws-pin-card:hover {
  border-color: rgba(255, 204, 0, 0.4);
}
.ws-pin-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.ws-pin-card-tab {
  font-family: var(--sovren-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 1px 4px;
  border: 1px solid var(--glass-border);
  border-radius: 1px;
  text-transform: uppercase;
}
.ws-pin-card-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-pin-card-time {
  font-family: var(--sovren-mono);
  font-size: 7px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ws-pin-card-preview {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ws-pin-unpin {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.ws-pin-unpin:hover { color: var(--error); }

.ws-pins-empty {
  font-family: var(--sovren-mono);
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 12px;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   PHASE 6: Tab input surfaces
   Each tab gets a pipeline-entry zone above chat.
═══════════════════════════════════════════════════ */

.tab-input-surface {
  display: none;  /* hidden on chat tab, shown by initTabSurface() */
  flex-shrink: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  gap: 8px;
  flex-direction: column;
}
.tab-input-surface.active {
  display: flex;
}

.tab-surface-label {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tab-surface-row {
  display: flex;
  gap: 7px;
  align-items: center;
}

.tab-surface-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 1px;
  padding: 7px 10px;
  color: var(--text-primary);
  font-family: var(--body-font, inherit);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.12s;
  min-height: 36px;
}
.tab-surface-input:focus {
  border-color: var(--tc, var(--sovren-accent));
}

.tab-surface-btn {
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--tc, var(--sovren-accent));
  color: var(--tc, var(--sovren-accent));
  font-family: var(--sovren-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 1px;
  transition: all 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-surface-btn:hover {
  background: var(--tc, var(--sovren-accent));
  color: var(--bg-primary, #0a0a0a);
}
.tab-surface-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tab-surface-drop-zone {
  border: 1px dashed var(--glass-border);
  border-radius: 2px;
  padding: 14px;
  text-align: center;
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.12s;
}
.tab-surface-drop-zone:hover,
.tab-surface-drop-zone.drag-over {
  border-color: var(--tc, var(--sovren-accent));
  color: var(--tc, var(--sovren-accent));
  background: rgba(0, 204, 255, 0.04);
}
.tab-surface-drop-zone input[type="file"] {
  display: none;
}

.tab-surface-status {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  min-height: 14px;
}
.tab-surface-status.running { color: var(--sovren-accent); }
.tab-surface-status.error   { color: var(--error); }
.tab-surface-status.done    { color: var(--success, rgba(255,255,255,0.5)); }

/* ═══════════════════════════════════════════════════
   PHASE 7: Structured tab renderers
═══════════════════════════════════════════════════ */

/* Calendar */
.ws-calendar-event {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: flex-start;
}
.ws-calendar-time {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-accent);
  width: 36px;
  flex-shrink: 0;
  padding-top: 2px;
  letter-spacing: 0.05em;
}
.ws-calendar-title {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
}
.ws-calendar-meta {
  font-family: var(--sovren-mono);
  font-size: 7px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* Tasks checklist */
.ws-checklist { display: flex; flex-direction: column; gap: 4px; }
.ws-task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s;
}
.ws-task-item:hover { background: var(--bg-tertiary); }
.ws-task-item.done .ws-task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.ws-task-check { flex-shrink: 0; margin-top: 2px; cursor: pointer; accent-color: var(--sovren-accent); }
.ws-task-text { font-size: 0.83rem; line-height: 1.5; color: var(--text-primary); }

/* Inbox */
.ws-inbox-message { padding: 8px 0; }
.ws-inbox-subject {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border);
}
.ws-inbox-body { font-size: 0.83rem; line-height: 1.75; color: var(--text-secondary); }

/* CRM contact card */
.ws-contact-card { padding: 8px 0; }
.ws-contact-name {
  font-family: var(--sovren-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.ws-contact-role {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 1px;
}
.ws-contact-company {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ws-contact-fields { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ws-contact-field { display: flex; gap: 8px; align-items: baseline; }
.ws-contact-key {
  font-family: var(--sovren-mono);
  font-size: 7px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  width: 44px;
  flex-shrink: 0;
}
.ws-contact-val { font-size: 0.80rem; color: var(--text-primary); }
.ws-contact-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--glass-border);
  padding-top: 8px;
  margin-top: 4px;
}

/* Finance table */
.ws-finance-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.ws-finance-cell {
  font-family: var(--sovren-mono);
  font-size: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}
.ws-finance-cell:first-child { color: var(--text-primary); font-weight: 600; }
.ws-finance-cell:last-child { text-align: right; }

/* Design node list */
.ws-design-view { display: flex; flex-direction: column; gap: 4px; }
.ws-design-node {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  font-size: 0.80rem;
  color: var(--text-primary);
  transition: border-color 0.12s;
}
.ws-design-node:hover { border-color: var(--sovren-accent); }
.ws-design-node-icon { color: var(--sovren-accent); font-size: 10px; flex-shrink: 0; }

/* Learn notes */
.ws-learn-notes { font-size: 0.83rem; line-height: 1.75; }

/* ═══════════════════════════════════════════════════
   PHASE 8: Live product renderers
═══════════════════════════════════════════════════ */

/* CREATE tab — image */
.ws-create-view { display: flex; flex-direction: column; gap: 10px; }
.ws-create-image-wrap { border-radius: 2px; overflow: hidden; background: var(--bg-tertiary); min-height: 100px; display: flex; align-items: center; justify-content: center; }
.ws-create-image { max-width: 100%; display: block; border-radius: 2px; }
.ws-create-prompt { background: var(--bg-tertiary); border: 1px solid var(--glass-border); border-radius: 2px; padding: 8px 10px; }
/* CREATE tab — video */
.ws-create-video { width: 100%; border-radius: 2px; background: #000; display: block; max-height: 400px; }

/* CODE tab — sandboxed runner */
.ws-code-runner-view { display: flex; flex-direction: column; gap: 0; }
.ws-code-editor {
  width: 100%; min-height: 140px; max-height: 400px;
  background: #0d1117; color: #e6edf3;
  border: 1px solid var(--glass-border); border-radius: 2px;
  padding: 10px; font-family: var(--sovren-mono); font-size: 0.78rem;
  line-height: 1.6; resize: vertical; outline: none;
  tab-size: 2;
}
.ws-code-output {
  background: #030507; border: 1px solid var(--glass-border);
  border-top: none; border-radius: 0 0 2px 2px;
  padding: 8px 10px; min-height: 36px; max-height: 160px;
  overflow-y: auto;
}
.ws-code-iframe { width: 0; height: 0; border: none; position: absolute; }

/* COMPOSER document editor */
.ws-doc-view { display: flex; flex-direction: column; gap: 0; }
.ws-doc-editor {
  flex: 1; min-height: 300px;
  padding: 16px 20px;
  font-size: 0.88rem; line-height: 1.8;
  color: var(--text-primary);
  outline: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: border-color 0.12s;
}
.ws-doc-editor:focus { border-color: rgba(0,204,255,0.2); }
.ws-doc-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  font-style: italic;
}
.ws-doc-editor h1, .ws-doc-editor h2, .ws-doc-editor h3 { color: var(--text-primary); margin: 0.75em 0 0.4em; }
.ws-doc-editor p { margin-bottom: 0.65em; color: var(--text-secondary); }

/* DESIGN canvas */
.ws-design-canvas-view { display: flex; flex-direction: column; gap: 6px; }
.ws-design-canvas { width: 100%; border: 1px solid var(--glass-border); border-radius: 2px; }

/* LEGAL — clause parser with risk badges */
.ws-legal-view { display: flex; flex-direction: column; gap: 0; }
.ws-legal-clause { padding: 10px 12px; margin-bottom: 6px; border-radius: 2px; }

/* HEALTH — chronological timeline */
.ws-health-timeline { display: flex; flex-direction: column; gap: 0; }
.ws-timeline { display: flex; flex-direction: column; gap: 0; padding-left: 14px; border-left: 2px solid var(--glass-border); }
.ws-timeline-entry { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.ws-timeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; position: absolute; left: -20px; }
.ws-timeline-content { flex: 1; }

/* LEARN — visual knowledge map */
.ws-learn-map { display: flex; flex-direction: column; gap: 0; }
.ws-knowledge-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ws-knowledge-cluster { background: var(--bg-tertiary); border: 1px solid; border-radius: 2px; padding: 10px 12px; }
.ws-knowledge-cluster-heading { font-family: var(--sovren-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.ws-knowledge-points { list-style: none; display: flex; flex-direction: column; gap: 4px; padding: 0; }
.ws-knowledge-point { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; padding-left: 8px; border-left: 1px solid var(--glass-border); }

/* CONNECTIONS — edge selector dropdown */
.ws-edge-selector { position: absolute; right: 30px; top: 0; z-index: 100; background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: 2px; padding: 8px; min-width: 200px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.ws-edge-target { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 2px; cursor: pointer; font-size: 0.75rem; transition: background 0.1s; }
.ws-edge-target:hover { background: var(--bg-tertiary); }

/* Phase 9: Envelope details toggle (UX-002) */
.env-details-toggle { margin-top: 6px; border-top: 1px solid var(--glass-border); padding-top: 6px; }
.env-details-summary { font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted);
  letter-spacing: 0.08em; cursor: pointer; list-style: none; padding: 2px 0; }
.env-details-summary:hover { color: var(--text-primary); }
.env-details-summary::marker { display: none; }
.ws-envelope-details { margin-top: 6px; }

/* ═══════════════════════════════════════════════════
   PHASE 10: Pipeline status bar
═══════════════════════════════════════════════════ */
.pipeline-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 6px;
  flex-shrink: 0;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-primary);
}
.pipeline-stage {
  font-family: var(--sovren-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.pipeline-stage.active {
  color: var(--sovren-accent);
  border-color: rgba(0, 204, 255, 0.4);
}
.pipeline-stage.done {
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.1);
}
.pipeline-stage-sep {
  font-family: var(--sovren-mono);
  font-size: 7px;
  color: var(--text-muted);
  opacity: 0.4;
}

/* Tab live badge */
.tab-badge {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  position: absolute;
  top: 6px;
  right: 6px;
  transition: background 0.2s;
}
.ntab.act .tab-badge {
  background: var(--tc, var(--sovren-accent));
  box-shadow: 0 0 4px var(--tc, var(--sovren-accent));
}

/* LEARN structured notes (Phase 10) */
.ws-learn-structured { display: flex; flex-direction: column; gap: 0; }
.ws-learn-section-label {
  font-family: var(--sovren-mono); font-size: 7px; letter-spacing: 0.12em;
  color: var(--text-muted); padding: 8px 0 4px; text-transform: uppercase;
  border-bottom: 1px solid var(--glass-border); margin-bottom: 6px;
}
.ws-learn-key-terms { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ws-learn-term {
  font-size: 0.75rem; color: var(--text-secondary); padding: 3px 6px;
  border-left: 2px solid rgba(0,204,255,0.3);
}
.ws-learn-connections { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ws-learn-connection {
  font-size: 0.75rem; color: var(--text-secondary); padding: 3px 0;
}
.ws-learn-questions { padding-left: 1.2em; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ws-learn-question {
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
}

/* SEARCH results panel */
.ws-search-results { display: flex; flex-direction: column; gap: 0; }
.ws-search-result-card {
  padding: 10px 12px; border-bottom: 1px solid var(--glass-border);
  transition: background 0.1s;
}
.ws-search-result-card:hover { background: var(--bg-tertiary); }

/* CALENDAR event card (chat path) */
.ws-cal-event-card { display: flex; flex-direction: column; gap: 0; }
.ws-cal-event-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04); }
.ws-cal-event-label { font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted);
  letter-spacing: 0.1em; min-width: 78px; flex-shrink: 0; }
.ws-cal-event-value { font-size: 0.80rem; color: var(--text-secondary); font-weight: 500; }

/* TASKS meta card */
.ws-task-meta-card { background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 2px; padding: 6px 0; margin-bottom: 6px; }
.ws-task-meta-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04); }
.ws-task-meta-label { font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted);
  letter-spacing: 0.1em; min-width: 58px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   PHASE 12: VERIFY + REWRITE provenance overlay
═══════════════════════════════════════════════════ */
.ws-prov-view { display: flex; flex-direction: column; gap: 0; }

.ws-prov-legend {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 10px; background: var(--bg-tertiary);
  border: 1px solid var(--glass-border); border-radius: 2px;
  margin-bottom: 8px;
}
.ws-prov-legend-item {
  font-family: var(--sovren-mono); font-size: 7px; letter-spacing: 0.06em;
}

.ws-prov-rewrite-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; gap: 10px; flex-wrap: wrap;
  border: 1px solid rgba(255,0,68,0.25); border-radius: 2px;
  background: rgba(255,0,68,0.05); margin-bottom: 8px;
  font-size: 0.78rem; color: var(--text-secondary);
}

.ws-prov-sentences { display: flex; flex-direction: column; gap: 4px; }

.ws-prov-sentence {
  padding: 8px 10px; border-radius: 2px;
  transition: background 0.1s;
}
.ws-prov-sentence-meta {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.ws-prov-badge {
  font-family: var(--sovren-mono); font-size: 7px; font-weight: 700;
  letter-spacing: 0.08em; padding: 1px 5px; border: 1px solid;
  border-radius: 1px;
}
.ws-prov-tier {
  font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted);
}
.ws-prov-r {
  font-family: var(--sovren-mono); font-size: 7px; color: var(--text-muted);
  margin-left: auto;
}
.ws-prov-text {
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}

/* Envelope verify button */
.envelope-verify-btn {
  font-family: var(--sovren-mono); font-size: 7px; letter-spacing: 0.08em;
  background: none; border: 1px solid rgba(0,204,255,0.3); border-radius: 1px;
  color: var(--sovren-accent); cursor: pointer; padding: 1px 7px;
  transition: background 0.15s, border-color 0.15s;
}
.envelope-verify-btn:hover { background: rgba(0,204,255,0.08); border-color: var(--sovren-accent); }
.envelope-verify-btn:disabled { opacity: 0.5; cursor: default; }

/* ═══════════════════════════════════════════════════
   PHASE 15: CODE tab preview/render toggle
═══════════════════════════════════════════════════ */

.ws-code-view-tabs { display: flex; gap: 0; }
.ws-code-tab-btn {
  font-family: var(--sovren-mono); font-size: 7px; letter-spacing: 0.1em;
  background: none; border: 1px solid var(--glass-border);
  color: var(--text-muted); cursor: pointer; padding: 2px 10px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ws-code-tab-btn:first-child { border-radius: 2px 0 0 2px; }
.ws-code-tab-btn:last-child  { border-radius: 0 2px 2px 0; border-left: none; }
.ws-code-tab-btn.active {
  color: var(--sovren-accent); border-color: rgba(0,204,255,0.4);
  background: rgba(0,204,255,0.06);
}
.ws-code-tab-btn:hover:not(.active) {
  color: var(--text-primary); border-color: rgba(255,255,255,0.2);
}
.ws-code-preview-area {
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
  border-radius: 2px; overflow: hidden;
}
.ws-code-preview-frame {
  width: 100%; min-height: 300px; max-height: 600px;
  border: none; background: #fff; display: block;
}
.ws-code-preview-python { padding: 10px 12px; }
.ws-code-preview-pre {
  margin: 0; font-family: var(--sovren-mono); font-size: 0.75rem;
  line-height: 1.65; white-space: pre-wrap; color: #a8d8a8;
  overflow-x: auto; background: #0a0e16; padding: 10px; border-radius: 2px;
}

/* PROD-007: VERIFY low-coverage banner */
.ws-prov-low-coverage {
  padding: 7px 10px; background: rgba(255,179,0,0.06);
  border: 1px solid rgba(255,179,0,0.25); border-radius: 2px;
  font-family: var(--sovren-mono); font-size: 7px;
  color: var(--text-secondary); line-height: 1.6; margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════
   PHASE 21: Barcode Register — chain of custody
═══════════════════════════════════════════════════ */
.barcode-register {
  margin-top: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  background: var(--bg-tertiary);
  font-family: var(--sovren-mono);
  overflow: hidden;
  font-size: 0;  /* prevent inline-block gaps */
}

.bc-reg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  user-select: none;
  transition: background 0.1s;
}
.bc-reg-header:hover { background: rgba(255,255,255,0.025); }

.bc-reg-icon  { font-size: 9px; color: var(--sovren-accent); flex-shrink: 0; }
.bc-reg-title {
  font-size: 7px; letter-spacing: 0.12em; color: var(--text-muted);
  font-weight: 700; text-transform: uppercase; flex-shrink: 0;
}
.bc-reg-counts { font-size: 7px; color: var(--text-muted); }
.bc-reg-fingerprint {
  margin-left: auto;
  font-size: 8px;
  color: var(--sovren-accent);
  letter-spacing: 0.06em;
  cursor: help;
  opacity: 0.8;
}
.bc-reg-toggle {
  font-size: 8px; color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.barcode-register.bc-collapsed .bc-reg-body { display: none; }
.barcode-register.bc-collapsed .bc-reg-toggle { transform: rotate(-90deg); }

.bc-reg-body {
  padding: 6px 10px;
  max-height: 240px;
  overflow-y: auto;
}
.bc-reg-body::-webkit-scrollbar { width: 3px; }
.bc-reg-body::-webkit-scrollbar-thumb { background: var(--glass-border); }

.bc-reg-section-label {
  font-size: 6px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.bc-reg-sentences { display: flex; flex-direction: column; gap: 0; }

.bc-reg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0;  /* prevent gaps */
}
.bc-reg-idx {
  font-size: 7px;
  color: var(--text-muted);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
  opacity: 0.6;
}
.bc-reg-code {
  font-size: 8px;
  color: rgba(0,204,255,0.75);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.bc-reg-tier {
  font-size: 7px;
  font-weight: 700;
  flex-shrink: 0;
}

.bc-reg-words {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}
.bc-reg-word-pill {
  font-size: 7px;
  color: rgba(0,204,255,0.45);
  padding: 1px 5px;
  border: 1px solid rgba(0,204,255,0.12);
  border-radius: 1px;
  cursor: default;
  transition: color 0.1s, border-color 0.1s;
  letter-spacing: 0.03em;
}
.bc-reg-word-pill:hover {
  color: var(--sovren-accent);
  border-color: rgba(0,204,255,0.35);
}

/* Phase 22: Barcode detail panel */
.barcode-detail-panel {
  position: fixed; z-index: 9999;
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: 4px; padding: 10px 12px; max-width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  font-family: var(--sovren-mono);
}
.bc-detail-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.bc-detail-word {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  font-family: var(--sovren-head); letter-spacing: 0.05em;
}
.bc-detail-pos {
  font-size: 8px; color: var(--text-muted); letter-spacing: 0.08em;
}
.bc-detail-def {
  font-size: 9px; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 6px; border-bottom: 1px solid var(--glass-border);
  padding-bottom: 6px;
}
.bc-detail-field {
  display: flex; gap: 6px; font-size: 8px; margin-bottom: 3px;
  align-items: baseline;
}
.bc-detail-label {
  color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 7px; min-width: 52px; flex-shrink: 0;
}
.bc-detail-barcode {
  font-size: 8px; color: rgba(0,204,255,0.5); margin-top: 6px;
  border-top: 1px solid var(--glass-border); padding-top: 4px;
  letter-spacing: 0.04em;
}

/* ── Phase 24A: Clean right-panel article view ─────────────── */
.ws-clean-article {
  padding: 8px 12px;
}
.ws-clean-para {
  font-size: 0.83rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

/* ── Phase 24A: Concept Player (embedded montage) ───────────── */
.concept-player-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sovren-bg);
  /* Cancel the 12px padding from .ws-right-content so panel fills edge-to-edge */
  margin: -12px;
  width: calc(100% + 24px);
}
.concept-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--sovren-surface);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.concept-player-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: system-ui, sans-serif;
}
.cp-scene-title {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-accent);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.cp-scene-content {
  font-size: 0.82rem;
  color: var(--sovren-text);
  line-height: 1.7;
}

/* ── Concept Player control buttons ───────────────────────────── */
.reel-btn {
  font-family: var(--sovren-mono);
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--sovren-text);
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.reel-btn:hover {
  border-color: var(--sovren-accent);
  color: var(--sovren-accent);
}
.reel-counter {
  font-family: var(--sovren-mono);
  font-size: 9px;
  color: var(--sovren-text2);
  letter-spacing: 0.05em;
}

/* ── Word gallery card — panel-optimised sizing ───────────────── */
.concept-player-canvas .mtg-gallery-card {
  border-radius: 6px;
  overflow: hidden;
  background: var(--sovren-surface);
  border: 1px solid var(--glass-border);
  margin-bottom: 8px;
}
.concept-player-canvas .mtg-gallery-card-img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  display: block;
}
.concept-player-canvas .mtg-gallery-card-content {
  padding: 10px 12px;
}
.concept-player-canvas .mtg-gallery-word {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.concept-player-canvas .mtg-gallery-def {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}
.concept-player-canvas .mtg-gallery-synonyms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.concept-player-canvas .mtg-gallery-syn {
  font-size: 7.5px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--glass-bg);
  color: var(--text-muted);
  font-family: var(--sovren-mono);
}

/* ── SVG infographic card in panel — constrain width ─────────── */
.concept-player-canvas svg {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* ── Truth ribbon in panel ────────────────────────────────────── */
.concept-player-canvas .mtg-truth-ribbon {
  margin-top: 10px;
}

/* ── Phase 27A: Atom Document View ───────────────────────────────── */

.adv-doc {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.adv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--sovren-surface);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.adv-meta {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-text2);
  letter-spacing: 0.05em;
}

.adv-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 12px 14px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  line-height: 1.7;
  color: var(--sovren-text);
  outline: none;
}

.adv-body:focus { outline: none; }

.adv-para { margin-bottom: 12px; }

/* Inline atom word */
.adv-wrd {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.adv-wrd-text {
  font-weight: 400;
  color: var(--sovren-text, #c0d0c0);
}

.adv-wrd-bc {
  font-family: var(--sovren-mono);
  font-size: 7px;
  border-radius: 2px;
  border: 1px solid transparent;
  vertical-align: super;
  cursor: pointer;
  /* Hidden state: zero size, no layout impact */
  opacity: 0;
  max-width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  transition: opacity 0.15s, max-width 0.15s, padding 0.15s, margin 0.15s;
}

.adv-wrd-bc:hover,
.adv-wrd:hover .adv-wrd-bc {
  opacity: 0.8;
  max-width: 60px;
  padding: 0 3px;
  margin-left: 2px;
  border-color: currentColor;
}

/* Atom registry */
.adv-reg-section {
  border-top: 1px solid var(--glass-border);
  padding: 10px 14px;
  margin-top: 12px;
  display: none;  /* Hidden by default — shown when user clicks JSON export */
}

.adv-reg-header {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.adv-reg-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sovren-mono);
  font-size: 8px;
}

.adv-reg-table th {
  text-align: left;
  padding: 3px 6px;
  color: var(--sovren-accent);
  border-bottom: 1px solid var(--glass-border);
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.adv-reg-table td {
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: top;
  color: var(--sovren-text);
}

.adv-reg-bc { color: var(--sovren-accent); white-space: nowrap; }
.adv-reg-word { color: #e0f0e0; font-weight: 600; }
.adv-reg-pos { color: var(--sovren-text2); }
.adv-reg-def { color: var(--sovren-text2); font-family: Georgia, serif; max-width: 200px; }

.adv-dom-badge {
  font-size: 7px;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
}

/* ── Phase 28: Semantic Word Processor ───────────────────────────── */

.swp-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  background: var(--sovren-bg);
}

.swp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--sovren-surface);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.swp-toolbar-label {
  font-family: var(--sovren-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.swp-score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--sovren-surface);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  font-family: var(--sovren-mono);
  font-size: 8px;
  overflow-x: auto;
}

.swp-score-label {
  color: var(--sovren-text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.swp-score-track {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.swp-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s, background 0.4s;
}

.swp-score-val {
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 32px;
}

.swp-sep {
  width: 1px;
  height: 12px;
  background: var(--glass-border);
  flex-shrink: 0;
}

.swp-stat {
  color: var(--sovren-text2);
  white-space: nowrap;
}

.swp-rsp {
  color: var(--sovren-accent);
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
}

.swp-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left: writing surface */
.swp-editor-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--glass-border);
}

.swp-editor-hint {
  font-family: var(--sovren-mono);
  font-size: 7.5px;
  color: var(--sovren-text3);
  padding: 5px 14px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.swp-editor {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  line-height: 1.65;
  color: var(--sovren-text);
  outline: none;
  cursor: text;
}

.swp-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--sovren-text3);
  pointer-events: none;
  font-style: italic;
}

/* Atom-tagged word in editor */
.swp-word {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}

.swp-bc {
  font-family: var(--sovren-mono);
  font-size: 6.5px;
  padding: 0 3px;
  border-radius: 2px;
  border: 1px solid;
  vertical-align: super;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s;
  margin-left: 1px;
}

.swp-bc:hover { opacity: 1; }

/* Right: live atom registry */
.swp-registry {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sovren-surface);
}

.swp-reg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--glass-border);
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.swp-domain-bar {
  display: flex;
  height: 4px;
  gap: 1px;
  padding: 0 10px;
  margin: 5px 0;
  flex-shrink: 0;
}

.swp-dom-seg {
  border-radius: 1px;
  transition: flex 0.3s;
}

.swp-reg-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.swp-reg-entry {
  padding: 5px 7px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s;
  margin-bottom: 2px;
}

.swp-reg-entry:hover { background: rgba(255,255,255,0.03); }

.swp-reg-bc {
  font-family: var(--sovren-mono);
  font-size: 7px;
  display: block;
}

.swp-reg-word {
  font-size: 10.5px;
  font-weight: 600;
  color: #e0f0e0;
  display: block;
}

.swp-reg-def {
  font-size: 8px;
  color: var(--sovren-text2);
  font-family: Georgia, serif;
  line-height: 1.3;
  display: block;
}

.swp-reg-empty {
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-text3);
  padding: 12px 8px;
  text-align: center;
}

/* ── Phase 29C: Word Alternatives Drawer ─────────────────── */

.adv-alt-drawer {
  background: var(--sovren-surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 0;
  min-width: 200px;
  max-width: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}

.adv-alt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: var(--sovren-surface);
  border-bottom: 1px solid var(--glass-border);
  font-family: var(--sovren-mono);
  font-size: 8px;
  color: var(--sovren-text2);
}

.adv-alt-list {
  max-height: 200px;
  overflow-y: auto;
}

.adv-alt-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.adv-alt-item:hover { background: rgba(255,255,255,0.04); }

.adv-alt-word {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #e0f0e0;
}

.adv-alt-tier {
  font-family: var(--sovren-mono);
  font-size: 7.5px;
}

.adv-alt-diff {
  font-family: var(--sovren-mono);
  font-size: 7px;
  white-space: nowrap;
}

/* ── Phase 30: Middle Panel (Ingredients / Bridge) ──────────────────────── */

.ws-mid {
  width: 0; min-width: 0; overflow: hidden;
  background: var(--bg-primary, #0a0a0a);
  border-left: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  display: flex; flex-direction: column;
  transition: width var(--anim, 0.38s cubic-bezier(0.16,1,0.3,1));
  flex-shrink: 0;
}
.ws-mid.open { width: 360px; min-width: 280px; }

.ws-mid-toolbar {
  height: 38px; min-height: 38px;
  display: flex; align-items: center;
  padding: 0 10px; gap: 6px;
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: var(--bg-tertiary, #1a1a1a);
  flex-shrink: 0; flex-wrap: nowrap; overflow: visible;
}
.ws-mid-label {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--sovren-accent, #00ccff); white-space: nowrap; flex-shrink: 0;
}
.ws-mid-count {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 8px; padding: 1px 6px;
  background: rgba(0,204,255,0.1); border: 1px solid rgba(0,204,255,0.25);
  border-radius: 10px; color: var(--sovren-accent, #00ccff);
  min-width: 20px; text-align: center; flex-shrink: 0;
}
.ws-mid-close {
  width: 18px; height: 18px; border-radius: 1px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: transparent;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  color: var(--text-muted, #666); font-size: 9px;
  transition: all 0.12s; flex-shrink: 0;
}
.ws-mid-close:hover { background: var(--error, #ef4444); border-color: var(--error, #ef4444); color: white; }

/* Dot-grid canvas (matches three_panel_model.html aesthetic) */
.ws-mid-canvas {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  background:
    radial-gradient(circle at 20px 20px, rgba(0,204,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 20px 20px, rgba(0,204,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  background-attachment: local;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border, rgba(255,255,255,0.08)) transparent;
}
.ws-mid-canvas.drag-on { background-color: rgba(0,204,255,0.03); outline: 2px dashed rgba(0,204,255,0.2); }

.ws-mid-empty {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 9px; color: rgba(255,255,255,0.15);
  border: 2px dashed rgba(0,204,255,0.1); border-radius: 5px;
  padding: 28px 16px; text-align: center; line-height: 1.8;
  pointer-events: none; margin: 8px 0;
}

/* Ingredient cards */
.ingr-card {
  background: var(--bg-secondary, #111);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 5px; padding: 8px 10px;
  cursor: grab; flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.ingr-card:active { cursor: grabbing; }
.ingr-card:hover {
  border-color: rgba(0,204,255,0.3);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.ingr-card-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 7px; text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.ingr-card-del {
  cursor: pointer; opacity: 0.35; padding: 1px 4px;
  border-radius: 2px; transition: opacity 0.12s;
}
.ingr-card-del:hover { opacity: 1; background: rgba(239,68,68,0.2); }
.ingr-card-body {
  font-size: 12px; line-height: 1.6; color: rgba(240,240,240,0.8);
  word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ingr-card-stat { font-size: 14px; font-weight: 700; color: #67e8f9; font-family: var(--sovren-mono, monospace); }
.ingr-card-bc {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 6.5px; color: rgba(0,204,255,0.45); margin-top: 4px;
  display: none;  /* Phase 34: barcodes hidden on cards — hover-only identity */
}
.ingr-card-use {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 7px; padding: 3px 7px; margin-top: 6px; width: 100%;
  background: rgba(0,204,255,0.06); border: 1px solid rgba(0,204,255,0.2);
  color: rgba(0,204,255,0.8); border-radius: 2px; cursor: pointer; text-align: center;
  transition: background 0.12s;
}
.ingr-card-use:hover { background: rgba(0,204,255,0.12); }

/* Card type accent colors */
.ingr-card.type-text  .ingr-card-head { color: #06b6d4; }
.ingr-card.type-link  .ingr-card-head { color: #eab308; }
.ingr-card.type-stat  .ingr-card-head { color: #67e8f9; }
.ingr-card.type-quote .ingr-card-head { color: #fbbf24; }
.ingr-card.type-atom  .ingr-card-head { color: #00ccff; }
.ingr-card.type-note  .ingr-card-head { color: rgba(255,255,255,0.4); }

/* Inserted ingredient pill in right panel */
.ingr-inserted-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,204,255,0.08); border: 1px solid rgba(0,204,255,0.25);
  border-radius: 3px; padding: 2px 7px;
  font-family: var(--sovren-mono, monospace); font-size: 8px;
  color: rgba(0,204,255,0.9); vertical-align: middle; margin: 2px;
}

/* per-paragraph add button in atom doc view */
.adv-para-add-btn {
  display: inline-block; font-family: var(--sovren-mono, monospace);
  font-size: 7px; padding: 1px 5px;
  background: transparent; border: 1px solid rgba(0,204,255,0.2);
  color: rgba(0,204,255,0.45); border-radius: 2px; cursor: pointer;
  margin-left: 6px; vertical-align: middle;
  opacity: 0; transition: opacity 0.15s;
}
.adv-para:hover .adv-para-add-btn { opacity: 1; }
.adv-para-add-btn:hover {
  border-color: rgba(0,204,255,0.6); color: rgba(0,204,255,1);
  background: rgba(0,204,255,0.06);
}

/* M↔R divider — same appearance as L↔M */
#ws-divider-mr {
  width: 4px; min-width: 4px; cursor: col-resize;
  background: var(--glass-border, rgba(255,255,255,0.08));
  transition: background 0.15s; flex-shrink: 0;
}
#ws-divider-mr:hover { background: rgba(255,255,255,0.15); }
#ws-divider-mr.dragging { background: var(--sovren-accent, #00ccff); }

/* ── Phase 31: Claim Strength Bar in Atom Doc View ─────────────────────── */

.adv-score-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 10px; flex-shrink: 0;
  border-top: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: var(--bg-tertiary, #1a1a1a);
}
.adv-score-track {
  flex: 1; height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden; max-width: 120px;
}
.adv-score-fill {
  height: 100%; background: #22c55e; border-radius: 2px;
  transition: width 0.5s ease, background 0.5s ease;
}
.adv-score-val {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 8px; font-weight: 700; color: #22c55e;
  min-width: 32px; text-align: right;
}

/* ── Phase 34: Middle panel mode toggle ─────────────────────────────── */
.ws-mid-mode-toggle {
  display: flex; gap: 3px; flex-shrink: 0;
}
.ws-mid-mode-btn {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 7px; padding: 2px 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
  border-radius: 2px; cursor: pointer; transition: all 0.12s;
}
.ws-mid-mode-btn.active {
  border-color: var(--sovren-accent, #00ccff);
  color: var(--sovren-accent, #00ccff);
  background: rgba(0,204,255,0.08);
}
.ws-mid-mode-btn:hover:not(.active) {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
}
/* Atom word hover in ingredient cards */
.ingr-atom-word {
  transition: opacity 0.12s;
}
.ingr-atom-word:hover {
  opacity: 0.8;
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
}

/* ── Phase 35: Visual Consistency ─────────────────────────────────────── */

/* Unified content color across all three panels */
.adv-body,
.adv-wrd-text,
.swp-editor,
.ingr-card-body {
  color: var(--text-primary, #f0f0f0);
}

/* ── Phase 35: Middle Panel Atom Workspace ──────────────────────────── */

.ws-mid-input-wrap {
  padding: 7px 10px;
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: var(--bg-secondary, #111);
  flex-shrink: 0;
}

.ws-mid-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--text-primary, #f0f0f0);
  font-size: 12px;
  font-family: Georgia, serif;
  outline: none;
  transition: border-color 0.15s;
}
.ws-mid-input::placeholder { color: rgba(255,255,255,0.2); font-style: italic; }
.ws-mid-input:focus { border-color: rgba(245,158,11,0.5); }

.ws-mid-tiles {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.ws-mid-tiles.drag-on { background: rgba(245,158,11,0.03); outline: 2px dashed rgba(245,158,11,0.15); }

/* Atom tile */
.atom-tile {
  background: var(--bg-secondary, #111);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 5px;
  padding: 8px 10px;
  cursor: grab;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.atom-tile:active { cursor: grabbing; }
.atom-tile:hover {
  border-color: rgba(245,158,11,0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.at-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.at-word {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #f0f0f0);
}
.at-del {
  background: none;
  border: none;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 10px;
  padding: 0 2px;
  transition: color 0.12s;
}
.at-del:hover { color: rgba(239,68,68,0.8); }
.at-bc {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 6.5px;
  color: rgba(0,204,255,0.45);
  display: block;
  margin-bottom: 4px;
}
.at-tier {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 7px;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid;
  display: inline-block;
  margin-bottom: 5px;
}
.at-def {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.at-actions {
  display: flex;
  gap: 4px;
}
.at-btn {
  flex: 1;
  font-family: var(--sovren-mono, monospace);
  font-size: 7px;
  padding: 3px 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}
.at-btn-left:hover {
  border-color: rgba(0,204,255,0.5);
  color: rgba(0,204,255,0.9);
}
.at-btn-right:hover {
  border-color: rgba(34,197,94,0.5);
  color: rgba(34,197,94,0.9);
}

/* Phase 36: Drop target highlight on right panel paragraphs */
.adv-para.drop-target {
  background: rgba(0,204,255,0.04);
  outline: 1px dashed rgba(0,204,255,0.3);
  border-radius: 3px;
}

/* ── Phase 37C: Welcome page redesign ──────────────────────────────── */
.welcome-brand {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--sovren-accent, #00ccff);
  text-transform: uppercase;
}
.welcome-sub {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 8px;
}
.welcome p {
  font-family: Georgia, serif;
  font-size: 11px;
  color: var(--text-secondary, #a0a0a0);
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: 12px;
}
/* ── Phase 38B: Right panel section headings ─────────────────────────── */
.adv-section-head {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sovren-accent, #00ccff);
  padding: 12px 0 4px;
  border-bottom: 1px solid rgba(0,204,255,0.15);
  margin-bottom: 10px;
  margin-top: 8px;
}
.adv-section-head.adv-h1 {
  font-size: 10px;
  letter-spacing: 0.25em;
  border-bottom-width: 2px;
}
/* ── Phase 38C: Right panel citation footnotes ──────────────────────── */
.adv-citations {
  border-top: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  padding: 10px 14px;
  margin-top: 16px;
}
.adv-citations-header {
  font-family: var(--sovren-mono, 'Share Tech Mono', monospace);
  font-size: 7.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sovren-text2, #506050);
  margin-bottom: 8px;
}
.adv-citation-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  flex-wrap: wrap;
}
.adv-citation-item:last-child { border-bottom: none; }
.adv-citation-num {
  font-family: var(--sovren-mono, monospace);
  font-size: 7px;
  color: var(--sovren-accent, #00ccff);
  flex-shrink: 0;
  min-width: 20px;
}
.adv-citation-title {
  font-size: 11px;
  color: var(--text-primary, #f0f0f0);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adv-citation-domain {
  font-family: var(--sovren-mono, monospace);
  font-size: 7.5px;
  color: var(--sovren-text2, #506050);
  flex-shrink: 0;
}
.adv-citation-url {
  font-family: var(--sovren-mono, monospace);
  font-size: 7px;
  color: var(--sovren-accent, #00ccff);
  opacity: 0.6;
  text-decoration: none;
  flex-basis: 100%;
  margin-top: 1px;
  transition: opacity 0.12s;
}
.adv-citation-url:hover { opacity: 1; }
