/* Focused MIT Locus theme. Official core red: brand.mit.edu/color. */
:root {
  --paper: #fff;
  --paper-strong: #fff;
  --canvas: #f5f5f5;
  --ink: #171717;
  --ink-soft: #4e4e4e;
  --muted: #727272;
  --line: #e3e3e3;
  --line-strong: #c9c9c9;
  --moss: #750014;
  --moss-dark: #750014;
  --moss-soft: #f8eef0;
  --gold: #8b959e;
  --warm: #f5f5f5;
  --danger: #750014;
  --shadow-sm: none;
  --shadow-lg: none;
  --sans: "Helvetica Neue", Arial, sans-serif;
  --serif: "Helvetica Neue", Arial, sans-serif;
}

.app-shell { min-height: 0; }
.global-header, .admin-header, .reader-toolbar, .chat-panel, .chat-header,
.composer, .notes-panel, .passage-tools, .history-panel, .concept-map-panel,
.concept-map-header, .concept-map-detail, .upload-modal, .action-menu {
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}
.global-header, .admin-header { padding: 0 26px; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: -.04em; }
.header-actions, .admin-header nav { display: flex; align-items: center; gap: 26px; }
.mit-home { display: flex; align-items: center; padding: 0 0 0 26px; }
.mit-home img { display: block; width: 60.444px; height: 32px; }
.header-link-icon { display: none; }
.book-switcher { border-radius: 4px; font-weight: 500; }
.reader-stage { background: #f5f5f5; }
.page-canvas { box-shadow: none; border: 1px solid #e3e3e3; }
.paper-shadow { display: none; }
.reader-footer { background: #fff; }
.tool-button, .zoom-button, .page-input-wrap { border-radius: 4px; }
.tool-button:hover, .tool-button.active, .tool-button[aria-expanded="true"] {
  background: #f8eef0; color: #750014;
}
.eyebrow { color: #727272; letter-spacing: .1em; }
.chat-intro { text-align: left; padding: 48px 0 28px; }
.chat-intro h1 { font-size: 30px; font-weight: 500; line-height: 1.12; letter-spacing: -.035em; }
.intro-copy { max-width: none; margin: 16px 0 24px; font-size: 13px; line-height: 1.65; }
.suggestion-list { max-width: none; gap: 0; }
.suggestion { grid-template-columns: minmax(0, 1fr) 20px; padding: 13px 0; border: 0; border-bottom: 1px solid #e3e3e3; border-radius: 0; background: transparent; }
.suggestion > span { display: none; }
.suggestion strong { font-size: 12px; font-weight: 400; }
.suggestion:hover { background: transparent; border-color: #c9c9c9; color: #750014; box-shadow: none; transform: none; }
.mode-tabs { border: 0; border-bottom: 1px solid #e3e3e3; border-radius: 0; padding: 0; background: transparent; }
.mode-tab { border-radius: 0; height: 34px; }
.mode-tab.active { background: transparent; border-bottom: 2px solid #750014; box-shadow: none; }
.message.user .message-bubble { background: #f3f3f3; color: #171717; border-radius: 5px; font-size: 13px; }
.assistant-card { border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.answer-head { padding: 8px 0 0; }
.answer-engine { display: none; }
.answer-status { font-size: 9px; letter-spacing: .04em; }
.answer-body { padding: 12px 0 16px; }
.answer-body h3 { font-size: 20px; font-weight: 500; line-height: 1.3; }
.claim { font-size: 14px; line-height: 1.8; color: #333; }
.claim-note-action, .claim-block:hover .claim-note-action { color: #727272; }
.claim-note-action:hover { color: #750014; }
.inline-citation { height: auto; min-height: 22px; border: 0; border-radius: 0; padding: 0 3px; background: transparent; color: #750014; font-size: 11px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.inline-citation:hover { background: #f8eef0; }
.answer-body mjx-container { color: #171717; }
.answer-body mjx-container[display="true"] { border: 0; border-radius: 0; background: transparent; padding: 8px 0; }
.source-strip { background: transparent; }
.source-strip summary { padding: 12px 0; font-size: 11px; }
.source-list { padding: 0; gap: 0; }
.source-card { background: transparent; border: 0; border-bottom: 1px solid #e3e3e3; border-radius: 0; padding: 12px 0; }
.source-page { background: #fff; border-color: #e3e3e3; font-size: 11px; }
.source-copy strong { font-size: 11px; }
.source-copy p { font-size: 11px; line-height: 1.5; }
.composer-input-row, .composer-input-row:focus-within { box-shadow: none; background: #fff; border-radius: 6px; border-color: #c9c9c9; }
.composer-input-row:focus-within { border-color: #750014; }
.composer textarea { font-size: 13px; }
.send-button, .primary-button { background: #750014; border-radius: 5px; box-shadow: none; }
.send-button:hover, .primary-button:hover { background: #59000f; box-shadow: none; }
.secondary-button, .row-button { background: #fff; border-radius: 5px; box-shadow: none; }
.history-panel, .passage-tools, .upload-modal, .action-menu { border-radius: 6px; border-color: #e3e3e3; }
.history-entry { background: transparent; border-radius: 3px; border-bottom: 1px solid #e3e3e3; }
.history-entry:hover, .history-entry.active { background: #f5f5f5; border-color: #e3e3e3; }
.note-card, .saved-note-view, .selection-answer, .selection-thinking, .locate-card,
.empty-answer, .thinking-card { background: #fff; border-color: #e3e3e3; border-radius: 5px; box-shadow: none; }
.note-card { border: 0; border-bottom: 1px solid #e3e3e3; border-radius: 0; }
.saved-note-view-head > span, .note-origin, .note-page { color: #750014; }
.selection-answer p { color: #333; font-size: 12px; }
.selection-question-form > div { border-color: #e3e3e3; background: #fff; border-radius: 5px; }
.source-highlight { background: rgba(117, 0, 20, .14); box-shadow: none; }
.source-highlight.pulse { animation: mit-passage-pulse 1.3s ease-out; }
@keyframes mit-passage-pulse {
  0% { background: rgba(117, 0, 20, .07); }
  35% { background: rgba(117, 0, 20, .24); }
  100% { background: rgba(117, 0, 20, .14); }
}
.passage-hit.hovered { background: rgba(117, 0, 20, .07); box-shadow: none; }
.floating-page-label { display: none; }
.note-marker { background: #750014; box-shadow: none; }
.note-marker:hover, .note-marker:focus-visible { box-shadow: none; }
.note-open:hover, .concept-ask:hover:not(:disabled) { background: #f5f5f5; }
.note-card-meta { color: #727272; font-size: 9px; }
.note-origin { background: transparent; font-size: 9px; }
.note-open p, .notes-intro, .saved-note-view-body { font-size: 12px; }
.notes-empty { border: 0; }
.empty-note-mark::after { background: #fff; }
.note-editor input, .note-editor textarea { background: #fff; border-color: #c9c9c9; border-radius: 4px; font-size: 12px; }
.note-editor input:focus, .note-editor textarea:focus { border-color: #750014; box-shadow: none; }
.note-editor-actions button { border-radius: 4px; font-size: 11px; }

/* Graph structure stays neutral; red is reserved for the selected path. */
.concept-map-panel { border-radius: 0; border-color: #e3e3e3; }
.concept-map-canvas { background: #fff; background-image: none; }
.concept-cluster[class] { border: 0; border-radius: 0; background: transparent; }
.concept-cluster > span { color: #727272; font-weight: 500; }
.relation-structure, .relation-step, .relation-flow, .relation-example,
.relation-implementation, .relation-constraint { --relation-color: #8b959e; }
.concept-edge-paths > path[data-source] { stroke: #8b959e; }
.concept-edge-paths > path[data-source].active { stroke: #750014; stroke-width: 2; }
.concept-edge-label rect { fill: #fff; stroke: #e3e3e3; }
.concept-edge-label text { fill: #4e4e4e; font-weight: 500; }
.concept-edge-label.active rect { fill: #fff; stroke: #750014; }
.concept-edge-label.active text, .concept-edge-label.active circle { fill: #750014; }
.concept-node[class], .concept-node.core:hover, .concept-node.core.selected {
  border: 1px solid #c9c9c9; border-radius: 6px; background: #fff;
  color: #171717; box-shadow: none;
}
.concept-node.core { border-color: #750014; }
.concept-node.selected { border-color: #750014; outline: 2px solid #750014; }
.concept-node.connected { border-color: #8b959e; }
.concept-node.dragging { outline: 2px solid #750014; box-shadow: none; }
.concept-node-number, .concept-node.core .concept-node-number { background: transparent; color: #727272; }
.concept-node-copy small, .concept-node.core .concept-node-copy small { color: #727272; font-weight: 500; }
.concept-node-copy strong { font-size: 13px; font-weight: 500; line-height: 1.2; }
.concept-node.core .concept-node-page { color: #727272; }
.concept-edge-legend { background: #fff; border: 0; border-radius: 0; backdrop-filter: none; padding: 5px 0; }
.concept-edge-legend span { font-size: 10px; }
.concept-map-legend { display: none; }
.concept-map-hint { background: #fff; border-radius: 0; backdrop-filter: none; font-size: 10px; }
.concept-detail-index { border: 0; color: #727272; width: auto; height: auto; justify-content: start; }
.concept-map-detail blockquote { background: #fff; border-color: #e3e3e3; border-radius: 0; }
.concept-relation { background: transparent; border-radius: 0; border-bottom: 1px solid #e3e3e3; padding: 9px 0; }
.concept-relation strong { color: #4e4e4e; font-size: 10px; }
.concept-relation-copy em { font-size: 9px; }
.concept-relation small { font-size: 10px; }
.concept-detail-actions button { border-radius: 4px; font-size: 11px; font-weight: 500; }
.concept-map-grounding { background: transparent; padding: 0; color: #727272; }
.concept-map-zoom { background: transparent; border-radius: 4px; }
.concept-map-zoom span, .concept-map-zoom .concept-fit-button { font-size: 11px; }

.admin-screen { background: #fff; }
.admin-header { display: flex; justify-content: space-between; }
.admin-main { padding-top: 48px; }
.admin-title-row h1 { font-size: 36px; font-weight: 500; }
.admin-title-row p:not(.eyebrow) { font-size: 13px; }
.library-stats { gap: 0; margin-top: 36px; margin-bottom: 36px; }
.library-stats article { background: transparent; border: 0; border-right: 1px solid #e3e3e3; border-radius: 0; box-shadow: none; padding: 0 24px; }
.library-stats article:first-child { padding-left: 0; }
.library-stats article:last-child { border-right: 0; }
.library-stats article > span { font-size: 11px; }
.library-stats article > strong { font-size: 27px; font-weight: 500; }
.library-stats article > strong.engine-stat, .library-stats article > strong.scope-stat { font-size: 18px; }
.library-stats article small { font-size: 11px; }
.stat-line { display: none; }
.book-table-card { border: 0; border-top: 1px solid #e3e3e3; border-radius: 0; background: #fff; box-shadow: none; }
.table-toolbar { padding-left: 0; padding-right: 0; }
.table-toolbar p { font-size: 12px; }
.book-cover-mini { background: #f5f5f5; color: #750014; border: 1px solid #e3e3e3; border-radius: 2px; box-shadow: none; }
.book-cover-mini::before, .book-cover-mini i { display: none; }
.book-row { padding-left: 0; padding-right: 0; }
.book-row:hover { background: #fafafa; }
.book-row-main h3 { font-weight: 500; }
.book-row-main p, .book-status, .book-pages, .book-date { font-size: 11px; }
.active-pill, .demo-pill, .ai-pill { background: transparent; color: #727272; border-radius: 0; font-size: 9px; }
.active-pill { color: #750014; }
.status-dot, .status-dot.ready { background: #8b959e; box-shadow: none; }
.row-button { font-size: 11px; }
.library-search, .form-field input, .form-field select { background: #fff; border-radius: 5px; border-color: #e3e3e3; font-size: 12px; }
.upload-dropzone { background: #fafafa; border-color: #c9c9c9; border-radius: 5px; }
.upload-dropzone.dragging { background: #f8eef0; border-color: #750014; }
.modal-intro, .form-field span { font-size: 12px; }
.upload-dropzone small, .activate-toggle small { font-size: 11px; }
.modal-backdrop { backdrop-filter: none; background: rgba(0, 0, 0, .3); }
.toast, .toast.error { background: #212326; box-shadow: none; backdrop-filter: none; border-radius: 5px; }
:is(button, a, select, input, textarea):focus-visible { outline: 2px solid #750014; outline-offset: 3px; box-shadow: none; }

@media (max-width: 980px) {
  .global-header, .admin-header { padding: 0 18px; }
  .header-actions, .admin-header nav { gap: 16px; }
  .mit-home { padding-left: 18px; }
}
@media (max-width: 760px) {
  .global-header { grid-template-columns: 1fr auto; min-height: 104px; padding-top: 10px; padding-bottom: 8px; }
  .current-book { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .header-actions .header-link { display: inline; }
  .brand-name { font-size: 19px; }
  .app-shell { grid-template-rows: 104px minmax(0, 1fr); }
  .document-page { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .concept-map-panel { top: 108px; }
  .library-stats article { padding: 18px 0; border-right: 0; border-bottom: 1px solid #e3e3e3; }
  .admin-title-row { gap: 18px; flex-wrap: wrap; }
  .admin-title-row h1 { font-size: 30px; }
}
