.chat-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 200px);
}

.chat-page h1 {
  margin-bottom: 0.25rem;
}

.chat-intro {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  min-height: 280px;
  max-height: 60vh;
}

.chat-msg {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  max-width: 90%;
}

.chat-msg.user {
  margin-left: 0;
  margin-right: auto;
  background: hsl(var(--gold) / 0.12);
  border: 1px solid hsl(var(--gold) / 0.25);
}

.chat-msg.assistant {
  margin-left: auto;
  margin-right: 0;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
}

.chat-msg .role {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.chat-msg .content {
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-rag-block {
  margin-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.6rem;
}

.chat-rag-head {
  font-size: 0.78rem;
  color: hsl(var(--gold-dark));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.chat-ref-group {
  margin-bottom: 0.55rem;
}

.chat-ref-group h4 {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
}

.chat-ref-item {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.35rem;
}

.chat-ref-title {
  font-size: 0.8rem;
  color: hsl(var(--gold-dark));
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.chat-ref-text {
  font-size: 0.87rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-input-wrap {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.chat-experiment-toggle {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
  user-select: none;
  margin-right: 0.25rem;
}

.chat-experiment-toggle input[type="checkbox"] {
  transform: translateY(1px);
}

.chat-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  min-height: 44px;
}

.chat-send {
  padding: 0.6rem 1rem;
  background: hsl(var(--gold));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  align-self: flex-end;
}

.chat-send:hover {
  filter: brightness(1.05);
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.enoch-answer {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.enoch-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.enoch-answer-title {
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.enoch-more-btn {
  padding: 0.45rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  cursor: pointer;
  font-weight: 600;
}

.enoch-more-btn:hover { filter: brightness(1.03); }

.enoch-more-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.enoch-answer-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

.enoch-details-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 500;
}

.enoch-details-modal {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 24px));
  max-height: 80vh;
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  z-index: 501;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.enoch-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.enoch-details-title {
  font-weight: 700;
  color: hsl(var(--gold-dark));
}

.enoch-details-close {
  width: 40px;
  height: 36px;
  border-radius: 0.6rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.enoch-details-body {
  padding: 0.75rem 1rem 1rem;
  overflow: auto;
}

.enoch-verse {
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: hsl(var(--background));
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.enoch-verse-toggle {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
}

.enoch-verse-ref {
  font-weight: 700;
  color: hsl(var(--gold-dark));
  font-size: 0.9rem;
}

.enoch-verse-text {
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.enoch-verse-panel {
  border-top: 1px solid hsl(var(--border));
  padding: 0.6rem 0.75rem 0.75rem;
  background: hsl(var(--card));
}

.enoch-comm {
  border: 1px solid hsl(var(--border));
  border-radius: 0.7rem;
  padding: 0.55rem 0.6rem;
  margin-top: 0.5rem;
  background: hsl(var(--background));
}

.enoch-comm-toggle {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.enoch-comm-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.enoch-comm-preview {
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.enoch-comm-full {
  margin-top: 0.5rem;
  border-top: 1px dashed hsl(var(--border));
  padding-top: 0.5rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  .chat-input-wrap { flex-direction: column; }
  .chat-send { align-self: stretch; }
  .enoch-details-modal { top: 6vh; max-height: 88vh; }
}
