/* Small overrides and utility styles */
pre {
  white-space: pre-wrap;
  word-break: break-word;
}
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
}
input,
textarea,
select,
button {
  font-family: inherit;
}

/* Optional: only if you want a fallback */

#chatBox {
  background: white; /* Light default */
}

html.dark #chatBox {
  background: #0f172a; /* Dark override */
  color: white; /* optional text color */
}

/* Markdown result styling */
.prose h2 {
  margin-top: 1.25rem;   /* space between sections */
  margin-bottom: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35); /* slate-400/35 */
}
.dark .prose h2 {
  border-top-color: rgba(51, 65, 85, 0.75); /* slate-700/75 */
}

.prose table {
  width: 100%;
  border-collapse: separate; /* keeps header rule crisp */
  border-spacing: 0;
  margin: 1rem 0;            /* space before/after tables */
}

.prose thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb; /* slate-200 */
}
.dark .prose thead th {
  border-bottom-color: #334155;     /* slate-700 */
}

.prose tbody td {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e5e7eb;    /* row separators */
  vertical-align: top;
}
.dark .prose tbody td {
  border-top-color: #334155;
}

/* Tighten lists in Summary */
.prose ul { margin: 0.5rem 0; }
.prose ul li { margin: 0.25rem 0; }

/* Hard reset for the Full Textbook Explanation panel */
#chatBox .full-explain,
#chatBox .full-explain * {
  box-sizing: border-box;
}

#chatBox .full-explain {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding-top: 0.25rem !important; /* small, consistent */
}

#chatBox .full-explain ul {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#chatBox .full-explain li {
  margin: 0 !important;
  padding: 0 !important;
}


[x-cloak] { display: none !important; }

.textbook-message {
  white-space: pre-line;
}

.textbook-message ul,
.textbook-message ol {
  white-space: normal;
}

.textbook-message p > strong:first-child {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 0.15rem;
}
