:root {
  --bg: #f7f5f1;
  --paper: #fbfaf7;
  --sidebar: #f3f0ea;
  --card: #fffdfa;
  --ink: #1f1f1f;
  --secondary: #5c5c5c;
  --muted: #888888;
  --line: #e7e2da;
  --question: #2e3d4f;
  --accent: #5b6b7c;
  --accent-soft: #edf1f4;
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 8px 20px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.desktop-panels {
  display: grid;
  grid-template-columns: var(--left-panel-width, minmax(210px, 18%)) minmax(0, 1fr) 8px var(--right-panel-width, 260px);
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 200ms ease;
}

.left-panel,
.center-panel,
.right-panel,
.right-resize-column {
  min-width: 0;
}

.left-rail,
.right-rail,
.workspace {
  height: 100vh;
  overflow: auto;
}

.left-rail {
  overflow-x: hidden;
}

.left-rail,
.right-rail {
  background: var(--sidebar);
  color: var(--secondary);
}

.left-panel {
  border-right: 1px solid var(--line);
  transition: border-color 200ms ease;
}

.right-panel {
  min-width: 260px;
  max-width: 480px;
}

.left-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 16px;
  transition: padding 200ms ease;
}

.right-rail {
  padding: 24px 16px;
}

.right-resize-column {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--bg);
}

.right-resize-handle {
  width: 8px;
  height: 100%;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  padding: 0;
  transition: background 160ms ease;
}

.right-resize-handle::before {
  display: block;
  width: 1px;
  height: 100%;
  margin: 0 auto;
  background: var(--line);
  content: "";
  opacity: 0.72;
  transition: background 160ms ease, opacity 160ms ease, width 160ms ease;
}

.right-resize-handle:hover::before,
.right-resize-handle:focus-visible::before,
.is-resizing-right-panel .right-resize-handle::before {
  width: 2px;
  background: var(--accent);
  opacity: 0.72;
}

.right-resize-handle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.is-resizing-right-panel,
.is-resizing-right-panel * {
  cursor: col-resize !important;
  user-select: none;
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--bg);
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-row svg {
  color: var(--muted);
  opacity: 0.5;
}

.brand-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.64);
  color: var(--accent);
  padding: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  border-color: #d7d0c5;
  background: var(--paper);
  color: var(--question);
}

.sidebar-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.left-rail.collapsed {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 22px;
  padding: 22px 12px;
  overflow: hidden;
}

.collapsed-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.72);
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
}

.collapsed-status {
  width: 9px;
  height: 9px;
}

.collapsed-toggle {
  margin-top: 2px;
}

.brand-row h1,
.workspace-header h2,
.rail-section h2,
.right-rail-header h2,
.seminar-card h3,
.debate-panel h3,
.debate-analysis h3,
.sequence-item h3,
.question-climax blockquote,
.question-memory-card h3,
.tension-memory-card h3 {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.brand-row h1 {
  margin: 0;
  color: var(--ink);
  font-size: 42px;
  line-height: 0.95;
}

.eyebrow,
.section-label,
.field-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-label {
  margin-bottom: 10px;
}

.muted,
.mode-copy,
.settings-note {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.6;
}

.rail-section {
  margin-bottom: 32px;
}

.rail-section h2,
.right-rail-header h2 {
  max-width: 100%;
  overflow: hidden;
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-block,
.current-block {
  padding: 0;
}

.chapter-list,
.library-preview-list,
.side-stack,
.seminar-table,
.debate-table,
.debate-sequence {
  display: grid;
  gap: 16px;
}

.chapter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--secondary);
  padding: 10px 8px;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.chapter-row:hover,
.chapter-row.active {
  border-color: var(--line);
  background: rgba(255, 253, 250, 0.72);
  color: var(--ink);
}

.chapter-row strong,
.chapter-row small {
  display: block;
}

.chapter-row strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.chapter-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chapter-label {
  margin-top: 22px;
}

.current-session {
  margin-top: 18px;
}

.current-session dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.current-session div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.current-session dt,
.current-session dd {
  margin: 0;
  font-size: 13px;
}

.current-session dt {
  color: var(--muted);
}

.current-session dd {
  color: var(--ink);
  font-weight: 500;
}

.library-block {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.library-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.library-section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.library-preview-list {
  gap: 8px;
  min-width: 0;
}

.library-preview-book {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.58);
  padding: 10px;
}

.library-preview-book strong,
.library-preview-book small {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.library-preview-book strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-preview-book small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.library-action-button {
  width: 100%;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c9c3b8;
}

.status-dot.reading {
  background: var(--accent);
}

.status-dot.finished,
.status-dot.discussed,
.status-dot.saved {
  background: #65785f;
}

.workspace-status,
.settings-block {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.settings-block {
  margin-top: auto;
  background: var(--sidebar);
  padding-bottom: 4px;
}

.workspace-status dl {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.workspace-status div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.workspace-status dt,
.workspace-status dd {
  margin: 0;
  font-size: 13px;
}

.workspace-status dt {
  color: var(--muted);
}

.workspace-status dd {
  color: var(--ink);
  font-weight: 500;
}

.meter {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e0d6;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.settings-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.setting-field span {
  color: var(--muted);
  font-size: 12px;
}

.setting-field input,
.setting-field select,
.setting-field textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
}

.setting-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.settings-test-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.connection-status {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.connection-status.valid {
  border-color: rgba(92, 123, 92, 0.32);
  color: #4d6d4e;
}

.connection-status.invalid {
  border-color: rgba(145, 88, 73, 0.32);
  color: #875447;
}

.connection-status.testing {
  border-color: rgba(75, 111, 143, 0.34);
  color: var(--accent);
}

.validation-note {
  margin-top: 8px;
}

.validation-note.valid {
  color: #4d6d4e;
}

.validation-note.invalid {
  color: #875447;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 56px 72px 28px;
}

.workspace-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 4vw, 48px);
  line-height: 1.02;
}

.mode-copy {
  max-width: 680px;
  margin-top: 12px;
  font-size: 15px;
}

.current-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.workflow-nav {
  display: flex;
  gap: 8px;
  max-width: 750px;
  width: calc(100% - 144px);
  margin: 0 auto;
  padding: 0 0 28px;
}

.workflow-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.workflow-button:hover,
.workflow-button.active {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.step-number {
  color: var(--accent);
  font-size: 13px;
}

.center-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 72px 80px;
}

.seminar-table,
.debate-table {
  max-width: 740px;
  margin: 0 auto;
}

.seminar-card,
.debate-panel,
.debate-analysis,
.side-card,
.markdown-preview {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.seminar-card,
.debate-panel,
.debate-analysis {
  padding: 28px;
}

.quiet-note {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 8px 0 16px;
}

.quiet-note h3 {
  max-width: 720px;
  margin: 0;
  color: var(--question);
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.18;
}

.marginalia-note {
  background: var(--paper);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading span,
.card-header-line span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 500;
}

.seminar-card h3,
.debate-panel h3,
.debate-analysis h3 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.2;
}

.seminar-card p,
.debate-panel p,
.sequence-item p,
.side-card p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.72;
}

.answer-line {
  margin-top: 22px;
}

.discuss-empty-state p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.65;
}

.discuss-answer-card {
  display: grid;
  gap: 0;
}

.discuss-section {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.discuss-section:first-of-type {
  border-top: 0;
  padding-top: 18px;
}

.discuss-section p:not(.field-label) {
  margin: 0;
}

.evidence-line {
  margin-top: 10px !important;
}

.evidence-line span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.question-worth-pursuing {
  padding-bottom: 14px;
}

.answer-line span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.follow-up-question {
  margin-top: 28px !important;
  color: var(--question) !important;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 28px !important;
  line-height: 1.25 !important;
}

.seminar-card small,
.debate-panel small,
.sequence-item small,
.side-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--secondary);
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 400;
}

.composer {
  display: grid;
  gap: 10px;
}

.composer span {
  color: var(--muted);
  font-size: 13px;
}

.composer textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.7;
}

.seminar-input {
  position: sticky;
  bottom: 0;
  border-radius: 20px;
  background: rgba(247, 245, 241, 0.92);
  padding: 16px 0 0;
  backdrop-filter: blur(12px);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.discussion-actions,
.debate-stage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffdfa;
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.secondary-button {
  background: var(--paper);
  color: var(--ink);
}

.primary-button.compact,
.secondary-button.compact {
  min-height: 34px;
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 13px;
}

.debate-table {
  gap: 24px;
}

.reader-position {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 8px 0 8px;
}

.reader-position h3 {
  color: var(--question);
  font-size: 34px;
}

.debate-input {
  margin-top: 20px;
}

.debate-input textarea {
  min-height: 128px;
}

.debate-input.large textarea {
  min-height: 150px;
}

.debate-flow {
  background: var(--paper);
  border-radius: 20px;
  padding: 32px;
}

.debate-heading {
  margin-bottom: 28px;
}

.debate-sequence {
  gap: 28px;
}

.sequence-item {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.sequence-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.tension-discovery {
  padding: 40px 0;
  text-align: center;
}

.tension-discovery h3 {
  margin: 4px 0 18px;
  color: var(--question);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 42px);
  font-weight: 400;
  line-height: 1.1;
}

.returning-question {
  padding: 48px 0 24px;
  text-align: center;
}

.returning-question blockquote {
  max-width: 680px;
  margin: 0 auto;
  color: var(--question);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4.4vw, 44px);
  font-weight: 400;
  line-height: 1.16;
}

.question-climax {
  display: grid;
  min-height: 440px;
  align-content: center;
  gap: 22px;
  padding: 56px 48px;
  text-align: center;
}

.question-climax blockquote {
  max-width: 720px;
  margin: 0 auto;
  color: var(--question);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 400;
  line-height: 1.08;
}

.question-climax small {
  margin-top: 0;
}

.question-climax .debate-stage-actions {
  justify-content: center;
  margin-top: 18px;
}

.continue-panel {
  background: var(--paper);
}

.error-note,
.notice-note {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--secondary);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.right-rail-header {
  margin-bottom: 24px;
}

.right-rail-header h2 {
  font-size: 30px;
}

.right-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 28px;
}

.right-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 6px;
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}

.right-tab.active,
.right-tab:hover {
  border-color: var(--line);
  background: rgba(255, 253, 250, 0.7);
  color: var(--ink);
}

.side-stack {
  gap: 14px;
}

.side-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.72);
  box-shadow: none;
}

.side-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.side-card p {
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.6;
}

.question-memory-card h3,
.tension-memory-card h3 {
  font-size: 20px;
  font-weight: 400;
}

.empty-memory-card {
  border-style: dashed;
  background: transparent;
}

.empty-memory-card h3 {
  color: var(--secondary);
}

.evidence-form,
.evidence-card {
  background: rgba(255, 253, 250, 0.7);
}

.trace-summary,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trace-summary span,
.tag-row em {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  padding: 3px 8px;
  font-size: 12px;
  font-style: normal;
}

.related-question {
  margin-top: 12px !important;
  color: var(--question) !important;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 20px !important;
  line-height: 1.25 !important;
}

.thought-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.thought-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  padding: 4px 8px;
  font-size: 12px;
}

.markdown-preview {
  max-height: 360px;
  overflow: auto;
  background: rgba(255, 253, 250, 0.78);
  padding: 16px;
}

.markdown-preview pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--secondary);
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 31, 31, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 24px;
  animation: modal-backdrop-in 200ms ease both;
}

.modal-backdrop.closing {
  animation: modal-backdrop-out 180ms ease both;
}

.floating-modal {
  width: min(720px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(251, 250, 247, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  padding: 26px;
  animation: modal-window-in 220ms ease both;
  outline: 0;
}

.floating-modal.closing {
  animation: modal-window-out 180ms ease both;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.05;
}

.modal-header p {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.55;
}

.modal-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 250, 0.68);
  color: var(--accent);
  padding: 0;
}

.modal-icon-button:hover,
.modal-icon-button:focus-visible,
.modal-book-card:focus-visible,
.choose-file-button:focus-visible {
  border-color: #d7d0c5;
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.modal-book-list {
  display: grid;
  gap: 10px;
}

.modal-book-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.68);
  color: var(--ink);
  padding: 16px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.modal-book-card span {
  min-width: 0;
}

.modal-book-card:hover,
.modal-book-card.active {
  border-color: #d7d0c5;
  background: rgba(255, 253, 250, 0.92);
}

.modal-book-card strong,
.modal-book-card small,
.modal-book-card em {
  display: block;
}

.modal-book-card strong {
  overflow: hidden;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-book-card small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-book-card em {
  color: var(--secondary);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  text-align: right;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.import-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 320px;
  border: 1px dashed #cfc7bb;
  border-radius: 18px;
  background: var(--bg);
  padding: 32px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.import-drop-zone.active {
  border-color: var(--accent);
  background: var(--paper);
}

.import-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.8);
  color: var(--accent);
}

.import-drop-zone h3 {
  margin: 18px 0 6px;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 400;
  line-height: 1.08;
}

.import-drop-zone p,
.import-drop-zone span,
.import-success {
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.55;
}

.import-drop-zone p {
  margin: 0;
}

.import-drop-zone span {
  margin: 16px 0 10px;
}

.import-success {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.68);
  padding: 10px 12px;
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modal-window-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-window-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1080px) {
  .desktop-panels {
    display: block;
    height: auto;
  }

  .left-rail,
  .right-rail,
  .workspace {
    height: auto;
    overflow: visible;
  }

  .right-panel {
    display: none;
  }

  .right-resize-column {
    display: none;
  }

  .left-panel {
    border-right: 0;
  }

  .left-rail {
    border-bottom: 1px solid var(--line);
  }

  .workspace-header {
    padding: 32px 24px 24px;
  }

  .current-step-pill {
    display: none;
  }

  .workflow-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    padding: 10px 20px;
    background: rgba(247, 245, 241, 0.94);
    backdrop-filter: blur(12px);
  }

  .center-scroll {
    overflow: visible;
    padding: 24px 20px 48px;
  }

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

/* Native macOS window: place traffic lights inside the sidebar without a title strip. */
html.desktop-app .reference-left-rail::before {
  display: block;
  min-height: 44px;
  flex: 0 0 44px;
  content: "";
  -webkit-app-region: drag;
}

html.desktop-app .reference-left-rail.collapsed {
  padding-top: 0;
}

html.desktop-app .reference-left-rail.collapsed::before {
  min-height: 34px;
  flex-basis: 34px;
}

html.desktop-app .reference-collapse {
  z-index: 2;
  -webkit-app-region: no-drag;
}

html.desktop-app .empty-left-rail,
html.desktop-app .collapsed-rail {
  position: relative;
  padding-top: 60px;
}

html.desktop-app .empty-left-rail::before,
html.desktop-app .collapsed-rail::before {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 44px;
  content: "";
  -webkit-app-region: drag;
}

@media (max-width: 560px) {
  .brand-row h1 {
    font-size: 38px;
  }

  .workspace-header h2 {
    font-size: 38px;
  }

  .quiet-note h3,
  .returning-question blockquote,
  .tension-discovery h3 {
    font-size: 32px;
  }

  .seminar-card,
  .debate-panel,
  .debate-analysis {
    padding: 22px;
  }
}

/* Browser preview: full-screen workspace with functional, independently scrolling rails. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #faf9f6;
}

.app-shell {
  min-height: 100vh;
  padding: 0;
  background: #faf9f6;
}

.marginalia-window {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #faf9f6;
  box-shadow: none;
}

.desktop-panels {
  height: 100vh;
}

.left-panel,
.center-panel,
.right-panel,
.right-resize-column {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.reference-left-rail,
.knowledge-workspace,
.workspace {
  height: 100%;
  min-height: 0;
}

.left-scroll-content,
.knowledge-workspace,
.center-scroll {
  overscroll-behavior: contain;
  scrollbar-color: #c9c3b9 transparent;
  scrollbar-width: thin;
}

.left-scroll-content::-webkit-scrollbar,
.knowledge-workspace::-webkit-scrollbar,
.center-scroll::-webkit-scrollbar {
  width: 7px;
}

.left-scroll-content::-webkit-scrollbar-thumb,
.knowledge-workspace::-webkit-scrollbar-thumb,
.center-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9c3b9;
}

.left-scroll-content {
  height: 100%;
  min-height: 0;
  padding-bottom: 22px;
}

.reference-settings-menu {
  margin-bottom: 0;
}

.knowledge-workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f4f2ed;
  color: var(--secondary);
  padding: 22px 15px 26px;
}

.knowledge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.knowledge-header .eyebrow {
  margin: 0 0 5px;
  color: #77736d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.knowledge-header h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(251, 250, 247, 0.72);
  color: #59636b;
  padding: 0;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: #bdb6ab;
  background: #fbfaf7;
  outline: 0;
}

.knowledge-summary {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
}

.knowledge-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 247, 0.62);
  color: #77736d;
  padding: 4px 8px;
  font-size: 10px;
}

.knowledge-summary strong {
  color: #3f3c37;
  font-weight: 700;
}

.manual-card-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid #cbc2b5;
  border-radius: 8px;
  background: #fbfaf7;
  padding: 12px;
}

.manual-card-editor .section-label,
.preview-heading .section-label {
  margin: 0;
  color: #77736d;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.manual-card-editor input,
.manual-card-editor textarea,
.inline-card-editor input,
.inline-card-editor textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8d2c9;
  border-radius: 6px;
  background: #fffdfa;
  color: #302f2c;
  padding: 8px 9px;
  font-size: 12px;
  outline: 0;
}

.manual-card-editor textarea,
.inline-card-editor textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.5;
}

.manual-card-editor input:focus,
.manual-card-editor textarea:focus,
.inline-card-editor input:focus,
.inline-card-editor textarea:focus {
  border-color: #8797a3;
  box-shadow: 0 0 0 2px rgba(93, 111, 125, 0.1);
}

.manual-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
}

.manual-card-editor .primary-button {
  width: 100%;
  margin-top: 2px;
}

.knowledge-card-list {
  display: grid;
  gap: 10px;
}

.knowledge-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid #a58b5c;
  border-radius: 8px;
  background: rgba(252, 251, 248, 0.78);
  transition: border-color 150ms ease, background 150ms ease;
}

.knowledge-card.saved {
  border-left-color: #6f8b75;
}

.knowledge-card.selected {
  border-color: #a99b86;
  background: #fcfbf8;
}

.knowledge-card-main {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 12px;
  text-align: left;
  white-space: normal;
}

.knowledge-card-main:hover {
  background: rgba(236, 232, 224, 0.42);
}

.card-state {
  display: inline-block;
  margin-bottom: 7px;
  border-radius: 999px;
  background: #eee8dd;
  color: #7a684c;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.knowledge-card.saved .card-state {
  background: #e6ede7;
  color: #58725e;
}

.knowledge-card-main strong {
  display: block;
  overflow: hidden;
  color: #302f2c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-card-main p {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0;
  color: #55524d;
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.knowledge-card-main small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #817d76;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.knowledge-links em {
  border: 1px solid #ddd7ce;
  border-radius: 4px;
  color: #496982;
  padding: 2px 5px;
  font-size: 9px;
  font-style: normal;
}

.knowledge-card-actions {
  display: flex;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding: 7px 9px;
}

.knowledge-card-actions button,
.inline-card-editor button,
.preview-heading button {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #ddd7ce;
  border-radius: 5px;
  background: #fbfaf7;
  color: #5f5b55;
  padding: 3px 7px;
  font-size: 10px;
}

.knowledge-card-actions button:hover,
.inline-card-editor button:hover,
.preview-heading button:hover {
  border-color: #bdb6ab;
  background: #f1eee8;
}

.inline-card-editor {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.inline-card-editor > div {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.knowledge-empty {
  border: 1px dashed #cfc7bb;
  border-radius: 8px;
  background: rgba(251, 250, 247, 0.5);
  padding: 22px 14px;
  text-align: center;
}

.knowledge-empty h3 {
  margin: 8px 0 4px;
  color: #3d3b37;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.knowledge-empty p {
  margin: 0 0 10px;
  color: #77736d;
  font-size: 11px;
  line-height: 1.5;
}

.knowledge-empty button {
  border: 0;
  background: transparent;
  color: #496982;
  font-size: 11px;
}

.obsidian-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 11px;
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.preview-heading strong {
  display: block;
  max-width: 180px;
  margin-top: 4px;
  overflow: hidden;
  color: #3d3a35;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-heading > div:last-child {
  display: flex;
  gap: 5px;
}

.preview-heading button {
  width: 28px;
  padding: 0;
}

.obsidian-preview pre {
  max-height: 210px;
  overflow: auto;
  margin: 10px 0;
  border: 1px solid #e1ddd5;
  border-radius: 6px;
  background: #f5f3ee;
  color: #55514b;
  padding: 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.obsidian-export-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 7px;
}

.obsidian-export-actions button {
  width: 100%;
  min-width: 0;
  font-size: 10px;
}

.export-status,
.settings-help {
  margin: 9px 0 0;
  color: #6f6b65;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell,
  .marginalia-window {
    height: auto;
    min-height: 100vh;
  }

  .desktop-panels {
    height: auto;
  }

  .left-panel,
  .center-panel,
  .right-panel {
    height: auto;
    overflow: visible;
  }

  .reference-left-rail {
    max-height: 52vh;
    overflow: hidden;
  }

  .left-scroll-content {
    max-height: 52vh;
    overflow-y: auto;
  }

  .workspace {
    min-height: 100vh;
  }

  .right-panel {
    display: block;
    min-width: 0;
    max-width: none;
    border-top: 1px solid var(--line);
  }

  .knowledge-workspace {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 24px 18px 34px;
  }

  .right-resize-column {
    display: none;
  }
}

@media (max-width: 560px) {
  .manual-card-grid,
  .obsidian-export-actions {
    grid-template-columns: 1fr;
  }
}

/* Reference redesign: the four supplied Marginalia workspace screens. */
:root {
  --bg: #d7d2c9;
  --paper: #faf9f6;
  --sidebar: #f3f1ec;
  --card: #fcfbf8;
  --ink: #242321;
  --secondary: #5d5b57;
  --muted: #8a8781;
  --line: #ded9d0;
  --question: #27323b;
  --accent: #3e4a53;
  --accent-soft: #ecece8;
  --shadow-soft: 0 1px 2px rgba(35, 31, 25, 0.05);
  --shadow-lift: 0 18px 50px rgba(44, 38, 29, 0.14);
}

body {
  min-width: 320px;
  overflow: hidden;
  background: #d7d2c9;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.36), transparent 44%),
    #d7d2c9;
}

.marginalia-window {
  width: min(1500px, calc(100vw - 32px));
  height: min(1040px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(103, 96, 84, 0.24);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(58, 50, 39, 0.2);
}

.window-titlebar {
  position: relative;
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 240, 0.96);
  padding: 0 22px;
}

.traffic-lights,
.window-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.traffic-lights span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.traffic-red { background: #ee5b4f; }
.traffic-yellow { background: #e7aa24; }
.traffic-green { background: #28ad46; }

.window-title {
  position: absolute;
  left: 50%;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 24px;
  transform: translateX(-50%);
}

.window-tools {
  color: #6c6a66;
}

.desktop-panels {
  grid-template-columns: var(--left-panel-width, 326px) minmax(440px, 1fr) 5px var(--right-panel-width, 300px);
  height: calc(100% - 54px);
  background: var(--paper);
}

.left-panel,
.right-panel {
  background: #f4f2ed;
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 0;
}

.right-resize-column {
  background: #f5f3ee;
}

.right-resize-handle {
  width: 5px;
}

.right-resize-handle::before {
  background: var(--line);
  opacity: 0.55;
}

.reference-left-rail {
  position: relative;
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #f4f2ed;
  color: var(--secondary);
}

.reference-left-rail.collapsed {
  align-items: center;
  gap: 18px;
  padding: 18px 10px;
}

.reference-left-rail.collapsed .collapsed-brand {
  border-radius: 9px;
}

.reference-left-rail .active-dot {
  background: #8e806a;
}

.left-scroll-content {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 12px 8px;
  scrollbar-width: thin;
}

.reference-section {
  margin-bottom: 18px;
}

.reference-section .section-label,
.evidence-header .section-label,
.evidence-passage-section > .section-label,
.connections-section > .section-label {
  margin: 0 0 10px 4px;
  color: #696762;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.current-book-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  min-height: 155px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(250, 249, 246, 0.7);
  padding: 12px;
}

.book-cover {
  display: flex;
  width: 92px;
  height: 132px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
  background: #26332f;
  box-shadow: 0 3px 8px rgba(24, 28, 25, 0.22);
  color: #c2a979;
  padding: 12px 8px;
  text-align: center;
  text-transform: uppercase;
}

.book-cover span {
  overflow: hidden;
  display: -webkit-box;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.book-cover small {
  margin-top: auto;
  color: #c2a979;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
}

.book-cover.compact {
  width: 56px;
  height: 76px;
  flex: 0 0 56px;
  background: #f8f5ee;
  box-shadow: 0 2px 6px rgba(35, 30, 23, 0.13);
  color: #4e4a43;
  padding: 7px 5px;
}

.book-cover.compact span {
  font-size: 8px;
  line-height: 1.35;
  -webkit-line-clamp: 5;
}

.reference-library-book:nth-child(2) .book-cover {
  background: #31434a;
  color: #d5d6d2;
}

.current-book-copy {
  min-width: 0;
  padding-top: 3px;
}

.current-book-copy h2 {
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--ink);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-book-copy p {
  margin: 0 0 5px;
  overflow: hidden;
  color: #74716b;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-ocr-label {
  display: inline-block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.book-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 19px;
}

.book-progress {
  height: 5px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: #ded9d1;
}

.book-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9b896e;
}

.book-progress-row small,
.reference-library-book em {
  color: #77736c;
  font-size: 12px;
  font-style: normal;
}

.reference-chapter-list {
  max-height: 224px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(250, 249, 246, 0.48);
  padding: 5px;
}

.reference-chapter-entry {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: stretch;
}

.reference-chapter {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--secondary);
  padding: 8px 9px;
  text-align: left;
}

.reference-chapter-edit {
  display: grid;
  width: 28px;
  min-width: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8c877e;
  opacity: 0.48;
}

.reference-chapter-entry:hover .reference-chapter-edit,
.reference-chapter-edit:focus-visible {
  background: rgba(232, 228, 220, 0.6);
  opacity: 1;
}

.reference-chapter:hover {
  background: rgba(232, 228, 220, 0.6);
}

.reference-chapter.active {
  border-left-color: #a69478;
  background: #ece8e0;
}

.reference-chapter > span {
  min-width: 0;
}

.reference-chapter strong,
.reference-chapter small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-chapter .chapter-analysis-state {
  margin-top: 4px;
  color: #8a857c;
  font-size: 9px;
  text-transform: capitalize;
}

.reference-chapter .chapter-analysis-state.ready {
  color: #617765;
}

.reference-chapter .chapter-analysis-state.failed {
  color: #9a594b;
}

.reference-chapter .chapter-analysis-state.analyzing {
  color: #58748a;
}

.reference-chapter strong {
  color: #383733;
  font-size: 12px;
}

.reference-chapter small {
  margin-top: 2px;
  color: #79756e;
  font-size: 10px;
}

.reference-chapter svg {
  flex: 0 0 auto;
  color: #8c877e;
}

.reference-library-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: rgba(250, 249, 246, 0.5);
}

.reference-library-book {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
}

.reference-library-book + .reference-library-book {
  border-top: 1px solid var(--line);
}

.reference-library-book > span {
  min-width: 0;
}

.reference-library-book strong,
.reference-library-book small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-library-book strong {
  color: #3c3a36;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 400;
}

.reference-library-book small {
  margin: 3px 0 10px;
  color: #7e7a73;
  font-size: 9px;
}

.reference-menu,
.reference-settings-menu {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
  background: rgba(250, 249, 246, 0.58);
}

.reference-menu button,
.reference-settings-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #55524d;
  padding: 9px 11px;
  text-align: left;
}

.reference-menu button:hover,
.reference-settings-menu button:hover {
  background: #ebe7df;
}

.reference-menu button span,
.reference-settings-menu button span,
.reference-settings-menu button em {
  overflow: hidden;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-settings-menu {
  flex: 0 0 auto;
  margin: 8px 0 14px;
  border-radius: 9px;
}

.reference-settings-menu em {
  max-width: 125px;
  color: #817e77;
  text-align: right;
}

.reference-collapse {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #87827a;
  opacity: 0;
  transition: opacity 160ms ease, background 160ms ease;
}

.reference-left-rail:hover .reference-collapse,
.reference-collapse:focus-visible {
  opacity: 1;
}

.reference-collapse:hover {
  background: #e6e1d8;
}

.workspace {
  height: 100%;
  min-width: 0;
  background: #faf9f6;
}

.workflow-nav {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(390px, calc(100% - 80px));
  flex: 0 0 auto;
  gap: 4px;
  margin: 28px auto 8px;
  border: 1px solid #d9d5cd;
  border-radius: 9px;
  background: #f4f2ee;
  padding: 4px;
}

.workflow-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4d4b47;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 500;
}

.workflow-button.active {
  border: 0;
  background: #364047;
  box-shadow: 0 1px 3px rgba(30, 34, 36, 0.22);
  color: #fff;
}

.workflow-button::after,
.step-number {
  display: none;
}

.center-scroll {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 32px clamp(28px, 5vw, 72px) 94px;
}

.seminar-table,
.debate-table {
  display: flex;
  width: min(760px, 100%);
  min-height: 100%;
  flex-direction: column;
  margin: 0 auto;
  padding-bottom: 6px;
}

.seminar-card {
  position: relative;
  border-radius: 8px;
  background: #fbfaf7;
  box-shadow: none;
}

.seminar-card.user-note {
  width: calc(100% - 54px);
  min-height: 64px;
  margin: 18px 0 34px 54px;
  border: 1px solid var(--line);
  padding: 14px 16px;
}

.seminar-card.user-note::before {
  position: absolute;
  top: -16px;
  left: -54px;
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ddd8ce;
  color: #5c5953;
  content: "Y";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.seminar-card.user-note::after {
  position: absolute;
  top: -17px;
  left: 0;
  color: #343330;
  content: "You";
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-100%);
}

.seminar-card.user-note .field-label {
  display: none;
}

.seminar-card.user-note h3 {
  margin: 0;
  color: #292825;
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}

.discuss-answer-card {
  width: calc(100% - 22px);
  margin: 0 0 22px 22px;
  border: 1px solid var(--line);
  padding: 20px 22px 18px 54px;
}

.discuss-answer-card::before {
  position: absolute;
  top: 20px;
  left: 18px;
  color: #4e6373;
  content: "✧";
  font-size: 24px;
}

.discuss-answer-card .panel-heading {
  margin: 0 0 12px;
}

.discuss-answer-card .panel-heading .field-label {
  display: block;
  color: #2c2b29;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  text-transform: none;
}

.discuss-answer-card .panel-heading > span,
.discuss-answer-card .discuss-section > .field-label {
  display: none;
}

.discuss-answer-card .discuss-section {
  margin: 0;
  border: 0;
  padding: 0;
}

.discuss-answer-card .discuss-section > p:not(.field-label):not(.evidence-line) {
  margin: 0 0 18px;
  color: #2b2a27;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.62;
}

.discuss-answer-card .evidence-line {
  margin: 10px 0 0;
  color: #617385;
  font-size: 13px;
  line-height: 1.5;
}

.discuss-answer-card .evidence-line span {
  display: inline;
  margin-right: 6px;
  color: #41617d;
}

.discuss-answer-card > small {
  display: block;
  margin-top: 16px;
  color: #456582;
  font-size: 12px;
}

.discussion-actions {
  display: flex;
  gap: 10px;
  margin: -8px 0 28px 40px;
}

.discussion-actions button {
  min-height: 34px;
  border-radius: 5px;
  padding: 0 14px;
  font-size: 12px;
}

.discussion-actions button:first-child {
  display: none;
}

.discussion-actions .primary-button:disabled {
  display: none;
}

.suggestion-row {
  display: none;
}

.composer.seminar-input {
  position: absolute;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 5;
  display: block;
  width: min(760px, calc(100% - 40px));
  margin-top: auto;
  border: 1px solid #8f8a82;
  border-radius: 8px;
  background: rgba(251, 250, 247, 0.98);
  box-shadow: 0 8px 20px rgba(45, 39, 30, 0.06);
  transform: translateX(-50%);
}

.composer.seminar-input > span {
  display: none;
}

.composer.seminar-input textarea {
  width: 100%;
  min-height: 74px;
  resize: none;
  border: 0;
  background: transparent;
  padding: 24px 82px 18px 20px;
  color: var(--ink);
  outline: 0;
}

.seminar-table > .action-row,
.debate-table > .action-row {
  position: absolute;
  right: max(32px, calc((100% - 760px) / 2 + 12px));
  bottom: 11px;
  z-index: 6;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  pointer-events: none;
}

.seminar-table > .action-row .secondary-button,
.debate-table > .action-row .secondary-button {
  display: none;
}

.seminar-table > .action-row .primary-button,
.debate-table > .action-row .primary-button {
  display: flex;
  width: 56px;
  min-width: 56px;
  height: 48px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: #3d4a53;
  color: #fff;
  padding: 0;
  pointer-events: auto;
}

.send-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.notice-note,
.error-note {
  margin: 18px 0 0;
  font-size: 12px;
}

.debate-analysis {
  position: relative;
  width: calc(100% - 54px);
  margin: 0 0 28px 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 16px;
}

.debate-analysis::before {
  position: absolute;
  top: -15px;
  left: -54px;
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d4cfc6;
  border-radius: 50%;
  background: #faf9f6;
  color: #3e4a52;
  content: "▱";
  font-size: 18px;
}

.debate-analysis .panel-heading {
  margin: -34px 0 14px;
  transform: translateY(-100%);
}

.debate-analysis .panel-heading .eyebrow {
  display: none;
}

.debate-analysis .panel-heading h3 {
  color: #353431;
  font-family: Inter, "SF Pro Text", sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.debate-analysis .panel-heading > span {
  display: none;
}

.debate-sequence {
  display: block;
}

.debate-sequence .sequence-item {
  border: 0;
  background: transparent;
  padding: 0;
}

.debate-sequence .sequence-item + .sequence-item {
  margin-top: 14px;
  border-top: 0;
  padding-top: 0;
}

.debate-sequence .sequence-item .field-label {
  display: none;
}

.debate-sequence .sequence-item > p:not(.field-label):not(.evidence-line) {
  margin: 0;
  color: #2b2a27;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.58;
}

.debate-sequence .evidence-line {
  margin: 0;
  color: #536f88;
  font-size: 12px;
  line-height: 1.55;
}

.debate-sequence .evidence-line span {
  display: inline;
  margin-right: 5px;
}

.debate-stage-actions {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 16px;
}

.debate-stage-actions button {
  min-height: 34px;
  border-radius: 5px;
  font-size: 12px;
}

.debate-panel.position-panel {
  width: 100%;
  margin: auto 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.debate-panel.position-panel .panel-heading,
.debate-panel.position-panel .suggestion-row,
.debate-panel.position-panel .action-row > p {
  display: none;
}

.debate-panel.position-panel .composer {
  border: 1px solid #8f8a82;
  border-radius: 8px;
  background: #fbfaf7;
  padding: 0;
}

.debate-panel.position-panel .composer > span {
  display: none;
}

.debate-panel.position-panel textarea {
  min-height: 76px;
  border: 0;
  background: transparent;
  padding: 24px 20px;
}

.debate-panel.position-panel .action-row {
  justify-content: flex-end;
  margin-top: -62px;
  padding: 8px 12px;
}

.reference-right-rail {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f4f2ed;
  padding: 20px 14px;
}

.evidence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #77736d;
}

.source-summary-card,
.passage-card,
.connections-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 249, 246, 0.72);
}

.source-summary-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 15px 13px;
}

.source-summary-card > div {
  min-width: 0;
}

.source-summary-card strong,
.source-summary-card span,
.source-summary-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-summary-card strong {
  color: #3d3b37;
  font-size: 13px;
}

.source-summary-card span {
  margin-top: 4px;
  color: #6b6862;
  font-size: 12px;
}

.source-summary-card small {
  margin-top: 10px;
  color: #858078;
  font-size: 11px;
}

.evidence-passage-section {
  margin-top: 22px;
}

.passage-card {
  padding: 18px 14px 12px;
}

.passage-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 16px;
  color: #3f3c37;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.passage-card p + p {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.passage-card button,
.obsidian-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: #4c4944;
  font-size: 12px;
}

.connections-section {
  margin-top: 22px;
}

.connections-card {
  overflow: hidden;
}

.connections-card button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 12px;
  text-align: left;
}

.connections-card button + button {
  border-top: 1px solid var(--line);
}

.connections-card span {
  min-width: 0;
  overflow: hidden;
  color: #42627c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connections-card small {
  color: #89857e;
  font-size: 10px;
}

.obsidian-button {
  margin-top: 20px;
}

.modal-backdrop {
  background: rgba(50, 47, 42, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.floating-modal {
  width: min(650px, calc(100vw - 40px));
  max-height: min(780px, calc(100vh - 48px));
  border: 1px solid #cfc8bc;
  border-radius: 16px;
  background: rgba(252, 250, 246, 0.97);
  box-shadow: 0 24px 70px rgba(43, 37, 29, 0.25);
  padding: 26px;
}

.floating-modal:has(.settings-modal-section) {
  width: min(570px, calc(100vw - 40px));
}

.modal-header h2 {
  font-size: 31px;
}

.modal-header p {
  color: #5e5a54;
  font-size: 13px;
}

.modal-book-list {
  gap: 9px;
}

.modal-book-card {
  grid-template-columns: 58px minmax(0, 1fr) minmax(160px, auto);
  min-height: 92px;
  gap: 14px;
  border-radius: 8px;
  padding: 10px 12px;
}

.modal-book-card.active {
  border-color: #b7a488;
  box-shadow: inset 0 0 0 1px rgba(183, 164, 136, 0.28);
}

.modal-book-card .book-cover {
  width: 56px;
  height: 72px;
}

.modal-book-copy strong {
  font-size: 19px;
}

.modal-book-progress {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.modal-book-progress b {
  border-radius: 999px;
  background: #eee8dd;
  color: #72624d;
  padding: 4px 9px;
  font-size: 10px;
  text-transform: uppercase;
}

.modal-book-progress > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-book-progress i {
  display: block;
  width: 95px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ddd7ce;
}

.modal-book-progress u {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9b896e;
  text-decoration: none;
}

.modal-footer {
  align-items: center;
  justify-content: space-between;
}

.modal-footer > span {
  color: #77736c;
  font-size: 12px;
}

.modal-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.settings-modal-header {
  justify-content: center;
  text-align: center;
}

.settings-modal-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(250, 249, 246, 0.66);
  padding: 14px 16px;
}

.settings-modal-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: #33312e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.settings-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  color: #4b4945;
  font-size: 12px;
}

.settings-row input,
.settings-row select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid #d7d2ca;
  border-radius: 6px;
  background: #fbfaf7;
  color: #34322f;
  padding: 0 10px;
}

.password-field,
.vault-picker {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 8px;
}

.password-field button {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #5f5b55;
}

.password-field input {
  padding-right: 38px;
}

.vault-picker input {
  flex: 1;
}

.vault-picker button {
  flex: 0 0 auto;
  border: 1px solid #d7d2ca;
  border-radius: 6px;
  background: #fbfaf7;
  padding: 0 12px;
  font-size: 11px;
}

.checkbox-row,
.toggle-row {
  display: flex;
  align-items: center;
  color: #4d4a46;
  font-size: 12px;
}

.checkbox-row {
  gap: 8px;
  margin-top: 10px;
}

.toggle-row {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.toggle-row:last-child {
  padding-bottom: 0;
}

.toggle-row input {
  width: 31px;
  height: 17px;
  accent-color: #3d4a53;
}

.settings-footer {
  justify-content: space-between;
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .app-shell {
    align-items: flex-start;
    padding: 0;
  }

  .marginalia-window {
    width: 100%;
    height: auto;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .desktop-panels {
    display: block;
    height: auto;
  }

  .reference-left-rail {
    height: auto;
    max-height: 46vh;
  }

  .reference-settings-menu,
  .library-preview-section {
    display: none;
  }

  .workspace {
    min-height: calc(100vh - 54px);
  }

  .workflow-nav {
    position: sticky;
    top: 0;
    width: min(390px, calc(100% - 32px));
    margin: 14px auto;
  }

  .center-scroll {
    padding: 22px 18px 24px;
  }
}

@media (max-width: 560px) {
  .window-tools {
    gap: 6px;
  }

  .current-book-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .book-cover {
    width: 66px;
    height: 96px;
  }

  .modal-book-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .modal-book-card .book-cover {
    width: 46px;
    height: 64px;
  }

  .modal-book-progress {
    display: none;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .seminar-card.user-note,
  .debate-analysis {
    width: calc(100% - 42px);
    margin-left: 42px;
  }

  .seminar-card.user-note::before,
  .debate-analysis::before {
    left: -42px;
    width: 30px;
    height: 30px;
  }

  .discuss-answer-card {
    width: 100%;
    margin-left: 0;
    padding-left: 46px;
  }
}

/* Final browser-shell sizing. Keep this last so the removed desktop titlebar leaves no 54px gap. */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #faf9f6;
}

.app-shell {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  background: #faf9f6;
}

.marginalia-window {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #faf9f6;
  box-shadow: none;
}

.desktop-panels {
  width: 100%;
  height: 100%;
}

.left-panel,
.center-panel,
.right-panel,
.right-resize-column,
.reference-left-rail,
.knowledge-workspace,
.workspace {
  height: 100%;
  min-height: 0;
}

@media (max-width: 1080px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell,
  .marginalia-window {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 100vh;
  }

  .desktop-panels,
  .left-panel,
  .center-panel,
  .right-panel {
    height: auto;
  }
}
/* Web v1 integration states */
.conversation-workspace {
  display: flex;
  height: 100%;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.conversation-history {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 8px 22px 0;
  scrollbar-color: #c9c3b9 transparent;
  scrollbar-width: thin;
}

.conversation-history::-webkit-scrollbar {
  width: 7px;
}

.conversation-history::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9c3b9;
}

.conversation-composer {
  position: relative;
  z-index: 5;
  width: 100%;
  flex: 0 0 auto;
  padding-top: 12px;
  background: #faf9f6;
}

.scope-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px 2px;
  color: #74716b;
  font-size: 11px;
  cursor: pointer;
}

.scope-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #58748a;
}

.vault-path-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.vault-path-field button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf9f6;
  color: var(--secondary);
  padding: 0 12px;
  cursor: pointer;
}

.conversation-list {
  display: grid;
  gap: 18px;
  margin-bottom: 0;
}

.discuss-reading-trace {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  border-left: 3px solid #7890a1;
  padding: 20px 22px;
}

.reading-trace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reading-trace-header > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334955;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reading-trace-header small {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.reading-trace-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.reading-trace-step {
  display: grid;
  min-width: 0;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  color: #aaa59d;
  font-size: 11px;
  line-height: 1.4;
}

.reading-trace-step svg {
  margin-top: 1px;
}

.reading-trace-step.complete {
  color: #6f806f;
}

.reading-trace-step.active {
  color: #334955;
  font-weight: 600;
}

.streaming-clarification {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.streaming-clarification > p:last-child {
  margin: 10px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
}

.streaming-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: #58748a;
  vertical-align: -0.12em;
  animation: streaming-caret 0.9s steps(1) infinite;
}

.reading-trace-delay {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@keyframes streaming-caret {
  50% { opacity: 0; }
}

.center-scroll {
  overflow: hidden;
  padding-bottom: 18px;
}

.mode-workspace {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.mode-workspace[hidden] {
  display: none !important;
}

.roundtable-mode-workspace {
  min-width: 0;
  flex: 1;
}

.conversation-composer .composer.seminar-input {
  position: relative;
  bottom: auto;
  left: auto;
  width: 100%;
  margin: 0;
  transform: none;
}

.conversation-composer > .action-row {
  position: absolute;
  right: 12px;
  bottom: 11px;
  z-index: 6;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  pointer-events: none;
}

.conversation-composer > .action-row .secondary-button {
  display: none;
}

.conversation-composer > .action-row .secondary-button.composer-cancel-button {
  display: inline-flex;
  height: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  pointer-events: auto;
}

.conversation-composer > .action-row .primary-button {
  display: flex;
  width: 56px;
  min-width: 56px;
  height: 48px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: #3d4a53;
  color: #fff;
  padding: 0;
  pointer-events: auto;
}

.conversation-list .seminar-card > p:not(.field-label) {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
}

.evidence-link-button {
  display: block;
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line, #ddd8cf);
  background: transparent;
  color: var(--blue, #58748a);
  text-align: left;
  cursor: pointer;
}

.evidence-link-button:hover,
.connection-link-button:hover,
.inline-retry:hover {
  color: #263a47;
}

.connection-link-button {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line, #ddd8cf);
  background: transparent;
  color: var(--blue, #58748a);
  text-align: left;
  cursor: pointer;
}

.connection-link-button small {
  overflow: hidden;
  color: #77746d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-notice {
  padding: 10px 12px;
  border-left: 3px solid #8da0ad;
  background: #eeece6;
  color: #66645f;
  font-size: 12px;
  line-height: 1.45;
}

.obsidian-connection-inspector .knowledge-links {
  margin-top: 16px;
}

.inline-retry {
  margin-left: 8px;
  border: 0;
  background: transparent;
  color: var(--blue, #58748a);
  text-decoration: underline;
  cursor: pointer;
}

.spin {
  animation: marginalia-spin 1s linear infinite;
}

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

.empty-workspace {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 40px;
}

.empty-workspace-content {
  max-width: 520px;
  text-align: center;
}

.empty-workspace-content h2 {
  margin: 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 500;
}

.empty-workspace-content p:not(.eyebrow) {
  color: #6e6d68;
  line-height: 1.65;
}

.empty-workspace-content .discussion-actions {
  justify-content: center;
  margin-top: 24px;
  margin-left: 0;
  margin-bottom: 0;
}

.empty-workspace-content .discussion-actions button:first-child,
.conversation-workspace .discussion-actions button:first-child {
  display: inline-flex;
}

.empty-left-rail .settings-block {
  margin-top: auto;
}

.import-analysis-state {
  display: grid;
  min-height: 330px;
  padding: 52px 40px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.import-analysis-state h3 {
  margin: 8px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.import-analysis-state p,
.import-analysis-state small {
  color: #77746d;
}

.import-metadata-review {
  display: grid;
  gap: 14px;
  padding: 34px 40px;
}

.import-metadata-review h3 {
  overflow: hidden;
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-metadata-review label {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #696761;
}

.import-metadata-review input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d7d1c7;
  border-radius: 6px;
  background: #fffdf9;
  color: #24231f;
}

.import-metadata-review .discussion-actions {
  justify-content: flex-end;
  margin: 10px 0 0;
}

.import-metadata-review .discussion-actions button:first-child {
  display: inline-flex;
}

.text-action-button {
  border: 0;
  background: transparent;
  color: #58748a;
  text-decoration: underline;
  cursor: pointer;
}

.paste-markdown-import {
  display: grid;
  gap: 14px;
  padding: 30px 40px;
}

.paste-markdown-import label {
  display: grid;
  gap: 6px;
  color: #686660;
}

.paste-markdown-import input,
.paste-markdown-import textarea {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d7d1c7;
  border-radius: 6px;
  background: #fffdf9;
  color: #24231f;
}

.paste-markdown-import textarea {
  min-height: 190px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.paste-markdown-import .discussion-actions {
  justify-content: flex-end;
  margin: 4px 0 0;
}

.paste-markdown-import .discussion-actions button:first-child {
  display: inline-flex;
}

.import-progress-track {
  width: min(420px, 100%);
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7e2d8;
}

.import-progress-track span {
  display: block;
  height: 100%;
  background: #667f91;
  transition: width 220ms ease;
}

.settings-inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 2px 166px;
}

/* The model's own thinking: present but quiet, and never mistaken for evidence. */
.reasoning-stream {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.reasoning-details {
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.reasoning-details > summary {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.reasoning-details > summary::-webkit-details-marker {
  display: none;
}

.reasoning-details > summary::before {
  content: "\25B8 ";
}

.reasoning-details[open] > summary::before {
  content: "\25BE ";
}

.reasoning-text {
  margin: 8px 0 0;
  max-height: 220px;
  overflow-y: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.scope-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Same card geometry as a book answer, on a secondary surface: these are the
   reader's own notes, not the book. */
.knowledge-answer-card {
  width: calc(100% - 22px);
  margin: 0 0 22px 22px;
  border: 1px solid var(--line);
  background: var(--sidebar);
  padding: 20px 22px 18px 54px;
}

.knowledge-answer-card::before {
  position: absolute;
  top: 20px;
  left: 18px;
  color: var(--muted);
  content: "\2756";
  font-size: 20px;
}

.conversation-search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px 12px;
  color: var(--muted);
}

.conversation-search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.conversation-search-field input:focus {
  outline: none;
}

.conversation-search-results {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  margin-top: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

.conversation-search-hit {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
}

.conversation-search-hit:hover {
  background: var(--accent-soft);
}

.conversation-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.conversation-search-meta strong {
  font-size: 12px;
  font-weight: 500;
}

.conversation-search-meta small {
  color: var(--muted);
  font-size: 10px;
}

.conversation-search-excerpt {
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reading-coverage {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.knowledge-note-list {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.restore-confirm {
  margin-top: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 12px 14px;
}

.restore-confirm > p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.restore-confirm .settings-help {
  margin-top: 6px;
}

.restore-confirm .settings-inline-actions {
  margin-top: 10px;
  padding-left: 0;
}

.settings-inline-actions > span {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}

.connection-status.invalid {
  color: #9a5547;
}

.connection-status.valid {
  color: #56725f;
}

.workspace-right-rail {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #f6f3ec;
}

.right-workspace-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 14px 16px 8px;
  border-bottom: 1px solid #e2ddd3;
}

.right-workspace-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #73716b;
  cursor: pointer;
}

.right-workspace-tabs button.active {
  border-color: #d8d1c5;
  background: #fffdf9;
  color: #30424f;
}

.evidence-inspector {
  height: calc(100% - 58px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
}

.evidence-inspector .knowledge-header h2 {
  overflow-wrap: anywhere;
  font-size: 25px;
}

.evidence-source-card,
.evidence-passage-card {
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #ddd7cc;
  border-radius: 7px;
  background: #fffdf9;
  overflow: hidden;
}

.evidence-passage-card {
  flex-direction: column;
}

.evidence-source-card div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.evidence-source-card strong,
.evidence-source-card span,
.evidence-source-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-source-card small,
.evidence-source-card span {
  color: #77746d;
}

.evidence-passage-card p {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.evidence-expand-button {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: #516f86;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.evidence-expand-button:hover {
  color: #304957;
  text-decoration: underline;
}

.evidence-passage-card.highlighted {
  border-color: #8097a7;
  box-shadow: 0 0 0 3px rgba(88, 116, 138, 0.12);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.evidence-open-button {
  width: 100%;
  margin-top: 12px;
}

.evidence-context-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.evidence-context-list button {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #ded8cd;
  border-radius: 6px;
  background: #fffdf9;
  text-align: left;
  cursor: pointer;
}

.evidence-context-list small {
  color: #7a7770;
  line-height: 1.4;
}

.modal-book-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 170px;
  align-items: center;
}

.modal-book-open {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.modal-book-open strong,
.modal-book-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-book-open .book-analysis-summary,
.modal-book-open .book-parse-warning {
  font-size: 11px;
}

.modal-book-open .book-analysis-summary {
  color: #58748a;
}

.modal-book-open .book-parse-warning {
  color: #9a604f;
}

.modal-book-editor {
  display: grid;
  gap: 6px;
}

.modal-book-editor input {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #d8d2c8;
  border-radius: 5px;
  background: #fffdf9;
}

.modal-book-actions {
  display: flex !important;
  justify-content: flex-end;
  gap: 6px;
}

.modal-book-actions button {
  min-width: 30px;
  min-height: 28px;
  border: 1px solid #d9d3c9;
  border-radius: 4px;
  background: #fffdf9;
  cursor: pointer;
}

.modal-library-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  color: #77746d;
  text-align: center;
}

.local-save-error {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: flex;
  max-width: min(420px, calc(100vw - 40px));
  align-items: center;
  gap: 8px;
  border: 1px solid #c9a99f;
  border-radius: 6px;
  background: #fff8f5;
  color: #7d3f32;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(55, 43, 35, 0.12);
  font-size: 13px;
}

.local-save-error span { flex: 1; }
.local-save-error button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px; }

@media (max-width: 900px) {
  .settings-inline-actions { padding-left: 0; align-items: flex-start; flex-direction: column; }
  .modal-book-card { grid-template-columns: 54px minmax(0, 1fr); }
  .modal-book-progress { grid-column: 2; }
  .right-workspace-tabs { position: sticky; top: 0; z-index: 2; background: #f6f3ec; }
}

/* Roundtable keeps the book primary and makes every added perspective visibly secondary. */
.workflow-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(520px, calc(100% - 80px));
}

.roundtable-center-scroll {
  display: flex;
  min-height: 0;
  overflow: hidden;
  padding-top: 4px;
  padding-bottom: 16px;
}

.roundtable-workspace {
  display: flex;
  width: min(780px, 100%);
  height: 100%;
  min-height: 0;
  flex-direction: column;
  margin: 0 auto;
  color: #262521;
}

.roundtable-participants {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  border-bottom: 1px solid #e3ded5;
  padding: 8px 2px 14px;
}

.roundtable-participants > strong {
  font-size: 12px;
  font-weight: 650;
}

.participant-chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.participant-chip,
.participant-add {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #dcd6cc;
  border-radius: 7px;
  background: #fffdf9;
  color: #35332f;
  padding: 0 13px;
  font-size: 13px;
  white-space: nowrap;
}

.participant-chip.book-chip {
  font-weight: 600;
}

.participant-add {
  width: 34px;
  padding: 0;
  cursor: pointer;
}

.participant-add:hover {
  border-color: #9ca8ae;
  color: #344753;
}

.roundtable-participants > p {
  display: inline-flex;
  grid-column: 2;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin: 0;
  color: #77736c;
  font-size: 11px;
}

.roundtable-history {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 8px 16px;
  scrollbar-color: #c9c3b9 transparent;
  scrollbar-width: thin;
}

.roundtable-history::-webkit-scrollbar {
  width: 7px;
}

.roundtable-history::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9c3b9;
}

.roundtable-empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  color: #77736c;
  text-align: center;
}

.roundtable-empty-state svg {
  margin-bottom: 14px;
  color: #58748a;
}

.roundtable-empty-state h2 {
  margin: 0;
  color: #2b2925;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.roundtable-empty-state p {
  max-width: 440px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.roundtable-round {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.roundtable-round-label {
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #e4dfd6;
  padding: 2px 0 7px;
  color: #7d7870;
  font-size: 11px;
}

.roundtable-round-label span,
.roundtable-round-label em {
  border-radius: 5px;
  padding: 3px 7px;
  font-style: normal;
  font-weight: 600;
}

.roundtable-round-label span {
  background: #eee8dd;
  color: #7b674a;
}

.roundtable-round-label em {
  margin-left: auto;
  background: #e7eff4;
  color: #547187;
}

.roundtable-message {
  border: 1px solid #ded8cf;
  border-radius: 8px;
  background: #fffdfa;
  padding: 14px 17px;
  box-shadow: 0 1px 2px rgba(58, 50, 39, 0.035);
}

.roundtable-message > header,
.roundtable-message > footer,
.roundtable-identity {
  display: flex;
  align-items: center;
}

.roundtable-message > header {
  justify-content: space-between;
  gap: 12px;
}

.roundtable-message > header time,
.roundtable-message > footer time {
  color: #8b867e;
  font-size: 11px;
}

.roundtable-identity {
  gap: 9px;
}

.roundtable-identity svg {
  color: #46545d;
}

.roundtable-message > p {
  margin: 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.68;
  white-space: pre-wrap;
}

.roundtable-user-message {
  margin-left: 34px;
  background: #fcfbf8;
}

.roundtable-user-message header {
  display: flex;
  justify-content: space-between;
}

.roundtable-user-message p {
  margin-bottom: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}

.roundtable-book-message {
  border-left: 2px solid #607b8e;
}

.roundtable-skill-message {
  border-left: 2px solid #76937b;
}

.grounding-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 650;
}

.grounding-label.text-grounded {
  background: #f3ead8;
  color: #8b7042;
}

.grounding-label.skill-grounded {
  background: #e5f0e5;
  color: #54745b;
}

.skill-basis {
  display: block;
  margin: 7px 0 -4px 26px;
  color: #51805d;
  font-size: 11px;
}

.roundtable-message > footer {
  min-height: 27px;
  gap: 12px;
}

.roundtable-evidence {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.roundtable-evidence > span {
  color: #747069;
  font-size: 11px;
}

.roundtable-evidence button {
  min-height: 24px;
  border: 1px solid #d8d2c8;
  border-radius: 5px;
  background: #fffefa;
  color: #506b80;
  padding: 0 8px;
  font-size: 11px;
  cursor: pointer;
}

.roundtable-evidence button:hover {
  border-color: #8097a7;
  background: #f2f6f8;
}

.roundtable-save-message {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #65635d;
  cursor: pointer;
}

.roundtable-save-message:hover {
  background: #efebe4;
}

.roundtable-save-message.saved {
  color: #5c7b64;
  cursor: default;
}

.roundtable-difference {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -2px 10px 2px 24px;
  border-left: 2px solid #bbb1c8;
  background: #f8f6f8;
  padding: 10px 13px;
  color: #59545d;
}

.roundtable-difference svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: #7d6a91;
}

.roundtable-difference strong {
  font-size: 11px;
  text-transform: uppercase;
}

.roundtable-difference p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.roundtable-progress,
.roundtable-error {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  border: 1px solid #ddd8cf;
  border-radius: 7px;
  background: #f8f6f1;
  padding: 11px 13px;
  font-size: 12px;
}

.roundtable-progress div {
  display: grid;
  gap: 2px;
}

.roundtable-progress span {
  color: #807c75;
  font-size: 11px;
}

.roundtable-error {
  color: #864d42;
}

.roundtable-error span {
  min-width: 0;
  flex: 1;
}

.roundtable-error button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}

.roundtable-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  padding: 2px 0 12px;
}

.roundtable-actions button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid #dcd6cc;
  border-radius: 6px;
  background: #fffdf9;
  color: #383632;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
}

.roundtable-actions button:hover,
.roundtable-actions button.active {
  border-color: #9aaab4;
  background: #edf3f6;
  color: #344a59;
}

.roundtable-composer {
  position: relative;
  flex: 0 0 auto;
  min-height: 94px;
  border: 1px solid #938e85;
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 8px 25px rgba(59, 53, 44, 0.07);
}

.roundtable-composer textarea {
  width: 100%;
  min-height: 92px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #292824;
  padding: 20px 82px 30px 22px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.roundtable-composer textarea::placeholder {
  color: #aaa69f;
}

.composer-target {
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 16px;
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfd0dc;
  border-radius: 5px;
  background: #eef4f7;
  color: #4e6e84;
  padding: 0 7px 0 9px;
  font-size: 11px;
  font-weight: 600;
}

.composer-target button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 2px;
  cursor: pointer;
}

.roundtable-paperclip {
  position: absolute;
  bottom: 13px;
  left: 20px;
  color: #88847d;
}

.roundtable-send {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  width: 52px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #3b4952;
  color: #fff;
  cursor: pointer;
}

.roundtable-send:disabled {
  background: #90999e;
  cursor: default;
}

.roundtable-send.cancel {
  background: #786b64;
}

.roundtable-modal-backdrop {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(58, 53, 46, 0.16);
  padding: 24px;
  backdrop-filter: blur(5px);
}

.roundtable-modal {
  width: min(510px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid rgba(174, 167, 157, 0.78);
  border-radius: 16px;
  background: rgba(251, 249, 244, 0.96);
  box-shadow: 0 22px 55px rgba(53, 46, 38, 0.2);
  padding: 24px;
}

.roundtable-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.roundtable-modal h2 {
  margin: 0;
  font-family: inherit;
  font-size: 17px;
}

.roundtable-modal > header > button {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6f6b64;
  cursor: pointer;
}

.roundtable-modal > header > button:hover {
  background: #ebe7df;
}

.roundtable-modal-label {
  margin: 15px 0 7px;
  color: #76716a;
  font-size: 11px;
  font-weight: 650;
}

.participant-picker-list {
  display: grid;
  overflow: hidden;
  border: 1px solid #ded8ce;
  border-radius: 7px;
}

.participant-picker-row {
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid #e3ded5;
  background: #fffdf9;
  color: #35322e;
  padding: 8px 12px;
  text-align: left;
}

.participant-picker-row:last-child {
  border-bottom: 0;
}

button.participant-picker-row {
  cursor: pointer;
}

button.participant-picker-row:hover:not(:disabled) {
  background: #f2efe9;
}

.participant-picker-row.selected {
  border: 1px solid #d8d2c8;
  border-radius: 7px;
}

.participant-picker-row.fixed {
  border: 1px solid #ded8ce;
  border-radius: 7px;
}

.participant-picker-row > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.participant-picker-row > span:has(small) {
  display: grid;
  gap: 2px;
}

.participant-picker-row small {
  color: #89847c;
  font-size: 10px;
}

.participant-picker-row:disabled {
  color: #aaa69f;
}

.import-skill-entry {
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  border: 1px solid #ded8ce;
  border-radius: 7px;
  background: #fffdf9;
  color: #35322e;
  padding: 0 13px;
  cursor: pointer;
}

.import-skill-entry span {
  margin-left: auto;
  font-size: 20px;
}

.picker-notice,
.participant-limit-note,
.declarative-safety-note,
.ignored-file-note {
  color: #77736c;
  font-size: 10px;
  line-height: 1.45;
}

.picker-notice {
  color: #915447;
}

.skill-drop-zone {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  border: 1px dashed #d0c8bd;
  border-radius: 9px;
  background: #fffdf9;
  padding: 28px;
  text-align: center;
}

.skill-drop-zone > span {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d2c8;
  border-radius: 50%;
  color: #45413c;
}

.skill-drop-zone h3 {
  margin: 15px 0 5px;
  font-size: 17px;
}

.skill-drop-zone p,
.skill-drop-zone small {
  margin: 0;
  color: #77736c;
}

.skill-drop-zone small {
  margin-top: 7px;
  font-size: 11px;
}

.skill-file-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.skill-file-actions button,
.add-imported-skill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d8d1c7;
  border-radius: 6px;
  background: #fffdf9;
  color: #34312d;
  padding: 0 13px;
  cursor: pointer;
}

.imported-skill-preview {
  margin-top: 15px;
  border: 1px solid #ded8ce;
  border-radius: 8px;
  background: #fffdf9;
  padding: 16px;
}

.imported-skill-preview > header div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.imported-skill-preview > header small {
  border-radius: 5px;
  background: #e5f0e5;
  color: #54745b;
  padding: 4px 8px;
}

.imported-skill-preview > p {
  color: #5f5b55;
  font-size: 12px;
  line-height: 1.55;
}

.imported-skill-preview > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.imported-skill-preview > div span {
  border: 1px solid #ddd7cc;
  border-radius: 5px;
  background: #f8f5ef;
  padding: 4px 7px;
  font-size: 10px;
}

.add-imported-skill {
  margin-top: 14px;
  margin-left: auto;
  border-color: #3c4a53;
  background: #3c4a53;
  color: #fff;
}

.knowledge-card-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.knowledge-card-provenance {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #6f6b64;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-card-provenance.skill {
  color: #56775f;
}

.knowledge-card-provenance.book {
  color: #526f84;
}

@media (max-width: 1080px) {
  .workflow-nav {
    width: min(520px, calc(100% - 32px));
  }

  .roundtable-center-scroll {
    min-height: 720px;
    padding: 4px 18px 18px;
  }
}

@media (max-width: 620px) {
  .workflow-nav {
    width: calc(100% - 20px);
    gap: 2px;
    padding: 3px;
  }

  .workflow-button {
    min-width: 0;
    gap: 6px;
    padding: 0 8px;
    font-size: 12px;
  }

  .roundtable-center-scroll {
    min-height: 760px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .roundtable-participants {
    grid-template-columns: 1fr;
  }

  .roundtable-participants > p {
    grid-column: 1;
    justify-content: flex-start;
  }

  .roundtable-message,
  .roundtable-user-message {
    margin-left: 0;
    padding: 13px;
  }

  .roundtable-message > p {
    font-size: 15px;
  }

  .roundtable-round-label {
    flex-wrap: wrap;
  }

  .roundtable-round-label em {
    width: 100%;
    margin-left: 0;
  }

  .roundtable-actions {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .roundtable-actions button {
    flex: 0 0 auto;
  }

  .roundtable-modal-backdrop {
    padding: 10px;
  }

  .roundtable-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .skill-file-actions {
    flex-direction: column;
  }
}
/* First-run language choice shares the product's quiet, paper-like visual language. */
.language-loading,
.language-entry {
  align-items: center;
  background: #eeece6;
  color: #252521;
  display: flex;
  min-height: 100dvh;
  justify-content: center;
  padding: 24px;
}

.language-loading span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.language-entry-panel {
  background: #faf9f5;
  border: 1px solid #d8d3c9;
  border-radius: 8px;
  box-shadow: 0 18px 52px rgba(46, 44, 39, 0.13);
  max-width: 540px;
  padding: 44px;
  text-align: center;
  width: 100%;
}

.language-entry-panel h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 500;
  margin: 8px 0 2px;
}

.language-entry-zh {
  color: #6c6a64;
  font-size: 17px;
  margin: 0 0 30px;
}

.language-entry-options {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.language-entry-options button {
  align-items: flex-start;
  background: #fffefa;
  border: 1px solid #d8d3c9;
  border-radius: 7px;
  color: #272723;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 92px;
  padding: 20px;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.language-entry-options button:hover,
.language-entry-options button:focus-visible {
  background: #f4f6f5;
  border-color: #71828a;
  box-shadow: 0 7px 20px rgba(47, 62, 69, 0.08);
  outline: none;
}

.language-entry-options strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 600;
}

.language-entry-options span {
  color: #76746e;
  font-size: 13px;
  margin-top: 7px;
}

.language-entry-panel > small {
  color: #77746d;
  display: block;
  line-height: 1.5;
  margin-top: 24px;
}

html[lang="zh-CN"] .user-note::before {
  content: "你";
}

html[lang="zh-CN"] .user-note::after {
  content: "你";
}

@media (max-width: 560px) {
  .language-entry-panel {
    padding: 32px 22px;
  }

  .language-entry-options {
    grid-template-columns: 1fr;
  }
}

/* Let the reading surface continue behind the controls instead of ending at shelves. */
.workspace {
  position: relative;
  overflow: hidden;
}

.workflow-nav {
  position: absolute;
  z-index: 20;
  top: 20px;
  left: 50%;
  margin: 0;
  background: rgba(244, 242, 238, 0.9);
  box-shadow: 0 10px 28px rgba(45, 42, 36, 0.1);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  transform: translateX(-50%);
}

.center-scroll,
.roundtable-center-scroll {
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

.conversation-workspace {
  position: relative;
}

.conversation-history {
  padding-top: 104px;
  padding-bottom: 152px;
}

.conversation-composer {
  position: absolute;
  z-index: 15;
  bottom: 18px;
  left: 50%;
  width: min(736px, calc(100% - 24px));
  padding: 0;
  background: transparent;
  transform: translateX(-50%);
}

.scope-toggle {
  width: max-content;
  margin: 0 0 7px 2px;
  border: 1px solid rgba(217, 213, 205, 0.86);
  border-radius: 999px;
  background: rgba(251, 250, 247, 0.9);
  padding: 5px 9px;
  box-shadow: 0 5px 16px rgba(45, 42, 36, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.conversation-composer .composer.seminar-input {
  background: rgba(251, 250, 247, 0.94);
  box-shadow: 0 12px 34px rgba(45, 39, 30, 0.12);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}

.roundtable-workspace {
  position: relative;
  padding-top: 96px;
}

.roundtable-history {
  padding-bottom: 184px;
}

.roundtable-actions {
  position: absolute;
  z-index: 14;
  right: 0;
  bottom: 126px;
  left: 0;
  margin: 0;
  padding: 0;
}

.roundtable-composer {
  position: absolute;
  z-index: 15;
  right: 8px;
  bottom: 18px;
  left: 8px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: 0 12px 34px rgba(45, 39, 30, 0.12);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}

@media (max-width: 1080px) {
  .workflow-nav {
    top: 14px;
    width: min(520px, calc(100% - 32px));
  }

  .conversation-history {
    padding-top: 92px;
    padding-bottom: 142px;
  }

  .conversation-composer {
    bottom: 12px;
  }

  .roundtable-workspace {
    padding-top: 88px;
  }

  .roundtable-actions {
    bottom: 120px;
  }

  .roundtable-composer {
    bottom: 12px;
  }
}

@media (max-width: 620px) {
  .workflow-nav {
    width: calc(100% - 20px);
  }

  .conversation-composer {
    width: calc(100% - 12px);
  }

  .roundtable-composer {
    right: 4px;
    left: 4px;
  }
}
