/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #f7f5f1;
  --bg2:         #f0ede8;
  --bg3:         #e8e4de;
  --border:      #ddd9d3;
  --border2:     #c8c4be;
  --text:        #1a1916;
  --text2:       #38352f;
  --text3:       #6e6a64;
  --accent:      #8a6a3a;
  --accent-lt:   #f5efe3;
  --accent2:     #4a7a5a;
  --danger:      #9a4040;
  --danger-lt:   #f8eeee;
  --score-strong: #3a6e4a;
  --score-strong-bg: #eaf2ec;
  --score-viable: #7a6020;
  --score-viable-bg: #fdf5e0;
  --score-challenged: #9a4040;
  --score-challenged-bg: #f8eeee;
  --sidebar-w:   232px;
  --context-w:   228px;
  --mono:        'IBM Plex Mono', monospace;
  --serif:       'Instrument Serif', serif;
  --sans:        'Inter', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--context-w);
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
#sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 0.01em;
}

#new-analysis-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text3);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
#new-analysis-btn:hover { border-color: var(--accent); color: var(--accent); }

#analysis-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.analysis-item {
  position: relative;
  padding: 10px 16px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.analysis-item:hover { background: var(--bg3); border-left-color: var(--border2); }
.analysis-item.active { background: var(--bg3); border-left-color: var(--accent); }
.analysis-item-title {
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.analysis-item-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
}

.analysis-item-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 5px;
  line-height: 1;
}
.analysis-item:hover .analysis-item-delete { opacity: 1; }
.analysis-item-delete:hover { color: var(--danger); }

/* ── Breadcrumb ── */
#breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  cursor: default;
  transition: color 0.15s;
}

.crumb.active {
  color: var(--accent);
  font-weight: 500;
}

.crumb.visited {
  color: var(--text2);
  cursor: pointer;
}

.crumb.visited:hover {
  color: var(--accent);
}

.crumb.future {
  color: var(--border2);
  cursor: default;
}

.crumb-sep {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--border2);
}

/* ── Main Workspace ── */
#workspace {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

#workspace-inner {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
}
.view.active {
  display: flex;
  flex-direction: column;
}

/* ── Seed View ── */
#seed-view {
  align-items: center;
  justify-content: center;
}

#seed-center {
  width: 100%;
  max-width: 540px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seed-label {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

#seed-input {
  background: white;
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: 6px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
#seed-input:focus { border-color: var(--accent); }
#seed-input::placeholder { color: var(--text3); }

/* Constraints */
#constraints-section { display: flex; flex-direction: column; gap: 6px; }

.constraints-toggle {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color 0.15s;
}
.constraints-toggle:hover { color: var(--accent); }

.constraints-hint {
  font-size: 11.5px;
  color: var(--text3);
  line-height: 1.6;
  margin-bottom: 4px;
}

#constraints-input {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 6px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}
#constraints-input:focus { border-color: var(--accent); }
#constraints-input::placeholder { color: var(--text3); }

#run-pipeline-btn {
  align-self: flex-end;
  background: var(--accent);
  border: none;
  color: white;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: 0.04em;
}
#run-pipeline-btn:hover { opacity: 0.85; }

.seed-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ── Pipeline Feed ── */
#pipeline-view {
  display: none;
  flex-direction: column;
}
#pipeline-view.active { display: flex; }

#pipeline-feed {
  padding: 28px 36px 12px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex-shrink: 0;
}


.pipeline-step {
  opacity: 0;
  transform: translateY(6px);
  animation: fadeUp 0.35s forwards;
}

.map-panel {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 6px;
  opacity: 0;
  transform: translateY(6px);
  animation: fadeUp 0.35s forwards;
}

.map-panel-heading {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.map-panel-content {
  font-size: 12px;
  color: var(--fg3);
  white-space: pre-wrap;
  line-height: 1.6;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.step-number {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.08em;
}

.step-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.step-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  margin-left: auto;
}
.step-status.running { color: var(--accent); }
.step-status.running::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 5px;
  animation: pulse 1s infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Step 1 blocks */
.step1-block { display: flex; flex-direction: column; gap: 18px; }
.step1-section { display: flex; flex-direction: column; gap: 8px; }
.step1-section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

.step1-verdict {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text2);
}

.decomp-points { display: flex; flex-direction: column; gap: 5px; }
.decomp-point {
  padding: 9px 14px;
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: 0 5px 5px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
}

/* Summary Cards */
.summary-cards { display: flex; flex-direction: column; gap: 8px; }

.summary-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.summary-card:hover {
  border-color: var(--border2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.summary-card.selected {
  border-color: var(--accent);
  background: var(--accent-lt);
}

.summary-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.summary-card-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.08em;
  min-width: 14px;
  flex-shrink: 0;
}
.summary-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}

.summary-card-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
  margin-bottom: 8px;
}

.summary-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}


.tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--border2);
  color: var(--text3);
  background: var(--bg2);
}

.pipeline-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  padding-bottom: 8px;
}

.pipeline-hint {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--sans);
}

.pipeline-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  font-family: var(--mono);
  font-size: 11px;
  padding: 9px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 500;
}
.action-btn.primary:hover { opacity: 0.85; }
.action-btn.secondary {
  color: var(--text3);
}
.action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Messages (shared by inline and deepdive chat) */
.message { display: flex; flex-direction: column; gap: 5px; animation: fadeUp 0.25s forwards; }
.message-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}
.message-body {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.message.user .message-role { color: var(--accent); }
.message.user .message-body {
  color: var(--text2);
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ── Deep Dive View ── */
#deepdive-view { flex-direction: column; overflow-y: auto; }
#deepdive-view.active { display: flex; }

#deepdive-content {
  padding: 28px 36px 12px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex-shrink: 0;
}

#deepdive-chat {
  padding: 0 36px 28px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

#deepdive-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 14px;
}

#deepdive-chat-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

#deepdive-chat-input {
  flex: 1;
  background: white;
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 6px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
#deepdive-chat-input:focus { border-color: var(--accent); }
#deepdive-chat-input::placeholder { color: var(--text3); }

#deepdive-chat-send {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text3);
  font-family: var(--mono);
  font-size: 11px;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
#deepdive-chat-send:hover { border-color: var(--accent); color: var(--accent); }

.deepdive-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  animation: fadeUp 0.35s forwards;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.deepdive-card-header {
  background: var(--bg2);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.deepdive-card-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1em;
}
.deepdive-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.deepdive-card-body { display: flex; flex-direction: column; }

.deepdive-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.deepdive-section:last-child { border-bottom: none; }

.deepdive-section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.deepdive-section-content {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text2);
  white-space: pre-wrap;
}
.deepdive-section-content.streaming {
  color: var(--text3);
}

/* Scored Summary in deep dive */
.deepdive-scores { background: var(--bg2); }

.deepdive-score-composite {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.deepdive-score-composite.score-exceptional { color: var(--accent); }
.deepdive-score-composite.score-strong    { color: var(--score-strong); }
.deepdive-score-composite.score-viable    { color: var(--score-viable); }
.deepdive-score-composite.score-challenged { color: var(--score-challenged); }

.score-threshold-label {
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.deepdive-score-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-table-row {
  display: grid;
  grid-template-columns: 170px 36px 1fr;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  align-items: baseline;
}
.score-table-label {
  color: var(--text);
  font-weight: 500;
}
.score-table-value {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
}
.score-table-anchor {
  color: var(--text2);
}

/* ── Context Panel ── */
#context-panel {
  background: var(--bg2);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#context-inner {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

#context-empty {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
  font-style: italic;
}

.context-section { display: flex; flex-direction: column; gap: 6px; }

.context-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.context-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.context-label-row .context-label {
  border-bottom: none;
  padding-bottom: 0;
}

.context-edit-btn {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.context-edit-btn:hover { color: var(--accent); }

#context-seed-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
  font-style: italic;
}

#context-constraints-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
}

.stale-note {
  font-size: 11px;
  color: var(--score-challenged);
  line-height: 1.5;
  margin-top: 4px;
}

.stale-regen {
  font-size: 10px;
  padding: 6px 10px;
  margin-top: 4px;
}

.context-summary-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.context-summary-item:last-child { border-bottom: none; }
.context-summary-item:hover .context-summary-title { color: var(--accent); }
.context-summary-item.selected .context-summary-title { color: var(--accent); font-weight: 500; }

.context-summary-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  min-width: 16px;
  padding-top: 1px;
}
.context-summary-title {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text2);
  transition: color 0.15s;
}

#deepdive-trigger { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }

.selected-idea-item {
  font-size: 12px;
  color: var(--text2);
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.selected-idea-item::before {
  content: '→';
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 1px;
}

/* Context footer / settings */
#context-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  cursor: pointer;
  padding: 6px 10px;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.settings-btn:hover { border-color: var(--accent); color: var(--accent); }

#settings-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-title {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
}
.settings-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.settings-close:hover { color: var(--text); }

.settings-note {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.settings-label {
  font-size: 11.5px;
  color: var(--text2);
  flex: 1;
}
.settings-input {
  width: 52px;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 3px;
  outline: none;
  text-align: right;
}
.settings-input:focus { border-color: var(--accent); }

/* ── Economics Grid ── */
.econ-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.econ-card {
  background: var(--bg2);
  border-radius: 6px;
  padding: 10px 12px;
}

.econ-card-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 5px;
}

.econ-card-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* ── Stage 2 (Go Deeper) ── */
.go-deeper-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.stage2-container {
  border-top: 2px solid var(--border2);
}

.first-moves-content {
  margin-top: 8px;
}

.export-bar {
  display: flex;
  justify-content: flex-end;
  padding: 24px 0 48px;
}

.export-dropdown-wrapper {
  position: relative;
}

.export-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  min-width: 160px;
}

.export-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text1);
  font-size: 13px;
  cursor: pointer;
}

.export-option:hover {
  background: var(--bg3);
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Utilities ── */
.hidden { display: none !important; }

/* disabled — @media _print below is the commented-out print block */
@media _print {
  /* Hide everything */
  body * {
    visibility: hidden;
  }

  /* Show only the deepdive content */
  #deepdive-content,
  #deepdive-content * {
    visibility: visible;
  }

  /* Position deepdive content to fill the page */
  #deepdive-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
    background: white;
  }

  /* Hide UI elements within deepdive-content */
  .go-deeper-bar,
  .export-bar,
  .deepdive-chat {
    display: none !important;
  }

  /* Card styling */
  .deepdive-card {
    break-inside: avoid;
    border: none;
    box-shadow: none;
    margin-bottom: 32px;
    padding: 0;
  }

  .deepdive-card-header {
    margin-bottom: 16px;
  }

  .deepdive-card-num {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 4px;
  }

  .deepdive-card-title {
    font-size: 20px;
  }

  /* Sections */
  .deepdive-section {
    break-inside: avoid;
    margin-bottom: 20px;
  }

  .deepdive-section-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
  }

  .deepdive-section-content {
    font-size: 11px;
    line-height: 1.6;
  }

  /* Scored summary */
  .deepdive-scores {
    break-inside: avoid;
  }

  .deepdive-score-composite {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .score-table-row {
    font-size: 10px;
    margin-bottom: 4px;
  }

  /* Economics grid */
  .econ-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }

  .econ-card {
    border: 1px solid #ccc;
    padding: 6px 8px;
    break-inside: avoid;
  }

  .econ-card-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
  }

  .econ-card-value {
    font-size: 10px;
    line-height: 1.4;
  }
}

/* ── Streaming indicator ─────────────────────────────────────────────────── */

.stream-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
}

.stream-progress span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text3);
  animation: dot-fade 1.2s ease-in-out infinite;
}

.stream-progress span:nth-child(2) { animation-delay: 0.3s; }
.stream-progress span:nth-child(3) { animation-delay: 0.6s; }

@keyframes dot-fade {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 0.7; }
}

/* ── Collapsible sections ── */
.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.collapsible-header:hover { color: var(--accent); }

.collapsible-indicator {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.2s ease;
}
.deepdive-section-collapsible.expanded .collapsible-indicator {
  transform: rotate(90deg);
}

.collapsible-body {
  display: none;
  margin-top: 8px;
}
.deepdive-section-collapsible.expanded .collapsible-body {
  display: block;
}

/* ── Mobile ── */
#mobile-header {
  display: none;
}

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 99;
}
#sidebar-overlay.visible { display: block; }

@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
  }

  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.12);
  }
  #sidebar.open { transform: translateX(0); }

  #context-panel { display: none; }

  #mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    flex-shrink: 0;
  }

  #mobile-menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text3);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
  }

  #mobile-new-btn {
    background: none;
    border: 1px solid var(--border2);
    color: var(--text3);
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #mobile-header .logo {
    font-size: 20px;
  }

  #breadcrumb {
    padding: 10px 16px;
  }

  #pipeline-feed {
    padding: 20px 16px 12px;
  }

  #deepdive-content {
    padding: 20px 16px 12px;
  }

  #deepdive-chat {
    padding: 0 16px 24px;
  }

  #seed-center {
    padding: 32px 16px;
  }

  .econ-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline-actions-row .action-btn {
    text-align: center;
  }
}
