:root,
.theme-dark,
.theme-light,
.published-container {
  color-scheme: dark;
  --site-accent: #7ed3df;
  --site-accent-2: #e7a74d;
  --site-bg: #0a1016;
  --site-bg-2: #0f1720;
  --site-surface: rgba(19, 28, 38, 0.9);
  --site-ink: #ebf1f8;
  --site-muted: #99a8b8;
  --site-border: rgba(153, 168, 184, 0.16);
  --background-primary: #0a1016;
  --background-primary-alt: #0f1720;
  --background-secondary: #131c26;
  --background-secondary-alt: #18232f;
  --background-modifier-border: rgba(153, 168, 184, 0.14);
  --background-modifier-hover: rgba(126, 211, 223, 0.06);
  --background-modifier-form-field: #131c26;
  --text-normal: #ebf1f8;
  --text-muted: #99a8b8;
  --text-faint: #728191;
  --text-accent: #7ed3df;
  --text-accent-hover: #a5e3eb;
  --interactive-accent: #7ed3df;
  --interactive-accent-hover: #a5e3eb;
}

html,
body,
.published-container {
  color: var(--site-ink);
  background:
    radial-gradient(circle at top left, rgba(126, 211, 223, 0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(231, 167, 77, 0.05), transparent 24%),
    linear-gradient(180deg, var(--site-bg) 0%, var(--site-bg-2) 100%);
}

.published-container .theme-toggle-container,
.published-container .theme-toggle {
  display: none;
}

.site-body {
  max-width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 12px 48px;
}

.site-body-right-column,
.site-body-right-column .graph-view-container,
.site-body-right-column .workspace-leaf-content,
.site-body-right-column .published-section {
  max-width: 280px;
}

.markdown-preview-view {
  max-width: min(920px, 100%);
  margin: 0 auto;
}

h1,
h2,
h3 {
  color: var(--site-ink);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 4vw, 4rem);
  line-height: 1.06;
}

.markdown-preview-view p,
.markdown-preview-view li {
  line-height: 1.75;
}

.markdown-preview-view .callout {
  border-radius: 18px;
  border: 1px solid var(--site-border);
  background: linear-gradient(180deg, rgba(24, 35, 47, 0.94), rgba(15, 23, 32, 0.98));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.markdown-preview-view a,
.markdown-preview-view a.internal-link {
  color: var(--text-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.markdown-preview-view strong {
  color: #ffffff;
}

.markdown-preview-view input[type="checkbox"] {
  accent-color: var(--site-accent);
}

.markdown-preview-view mark {
  background: rgba(231, 167, 77, 0.24);
  color: inherit;
}

.markdown-preview-view .mermaid {
  margin: 1.75rem 0 2rem;
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid rgba(126, 211, 223, 0.18);
  background: linear-gradient(180deg, rgba(24, 35, 47, 0.96), rgba(12, 19, 27, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 20px 42px rgba(0, 0, 0, 0.24);
}

.markdown-preview-view .mermaid svg {
  display: block;
  width: max(100%, 920px);
  height: auto;
  margin: 0 auto;
}

.markdown-preview-view .mermaid .label,
.markdown-preview-view .mermaid .nodeLabel,
.markdown-preview-view .mermaid .edgeLabel,
.markdown-preview-view .mermaid text {
  fill: #edf6ff !important;
  color: #edf6ff !important;
  font-size: 18px !important;
  font-weight: 600;
}

.markdown-preview-view .mermaid .edgeLabel rect {
  fill: rgba(10, 16, 22, 0.94) !important;
  opacity: 1 !important;
}

.markdown-preview-view .mermaid .node rect,
.markdown-preview-view .mermaid .node circle,
.markdown-preview-view .mermaid .node ellipse,
.markdown-preview-view .mermaid .node polygon,
.markdown-preview-view .mermaid .node path,
.markdown-preview-view .mermaid .cluster rect {
  fill: #1a3141 !important;
  stroke: #7ed3df !important;
  stroke-width: 2px !important;
}

.markdown-preview-view .mermaid .edgePath path,
.markdown-preview-view .mermaid .flowchart-link,
.markdown-preview-view .mermaid .mindmap-link,
.markdown-preview-view .mermaid .arrowheadPath,
.markdown-preview-view .mermaid .lineWrapper line {
  stroke: #8fdbe4 !important;
  fill: #8fdbe4 !important;
  stroke-width: 2px !important;
}

@media (max-width: 900px) {
  .site-body {
    padding-inline: 8px;
  }

  .markdown-preview-view .mermaid {
    padding: 1rem;
  }

  .markdown-preview-view .mermaid svg {
    width: max(100%, 700px);
  }
}

.course-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--site-accent), #4d93a6);
  color: #081019;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.course-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 78px;
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 720px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  border-radius: 22px;
  border: 1px solid var(--site-border);
  background: rgba(7, 19, 28, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.course-chat-panel.is-open {
  display: flex;
}

.course-chat-header {
  padding: 14px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--site-border);
}

.course-chat-messages {
  padding: 14px 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-chat-message {
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.5;
}

.course-chat-message.user {
  background: rgba(126, 211, 223, 0.12);
}

.course-chat-message.bot {
  background: rgba(153, 168, 184, 0.1);
}

.course-chat-composer {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--site-border);
}

.course-chat-composer textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--site-border);
  background: rgba(17, 39, 56, 0.96);
  color: var(--site-ink);
  padding: 12px;
  font: inherit;
}

.course-chat-composer button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--site-accent-2);
  color: #09131a;
  font-weight: 800;
  cursor: pointer;
}
