:root {
  --kb-radius: 10px;
  --kb-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Narrow the content slightly for a calmer, more note-like reading experience */
.md-grid {
  max-width: 1380px;
}

.md-content__inner {
  max-width: 52rem;
  margin-inline: auto;
}

/* Inline text colours */
.text-muted { color: #667085; }
.text-blue { color: #175cd3; }
.text-green { color: #027a48; }
.text-yellow { color: #b54708; }
.text-red { color: #b42318; }
.text-purple { color: #7a5af8; }

/* Inline highlight chips */
.highlight-yellow,
.highlight-blue,
.highlight-green,
.highlight-red,
.highlight-purple {
  display: inline-block;
  padding: 0.1rem 0.42rem;
  border-radius: 0.45rem;
  font-weight: 500;
}

.highlight-yellow { background: rgba(255, 244, 204, 0.95); color: #8a5a00; }
.highlight-blue   { background: rgba(219, 234, 254, 0.95); color: #1d4ed8; }
.highlight-green  { background: rgba(220, 252, 231, 0.95); color: #166534; }
.highlight-red    { background: rgba(254, 226, 226, 0.95); color: #b91c1c; }
.highlight-purple { background: rgba(243, 232, 255, 0.95); color: #7e22ce; }

/* Block highlight regions */
.panel-note,
.panel-reference,
.panel-result,
.panel-warning,
.panel-danger,
.panel-project,
.panel-research {
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  border-radius: var(--kb-radius);
  border: 1px solid transparent;
  box-shadow: var(--kb-shadow);
}

.panel-note {
  background: #f8fafc;
  border-color: #d0d5dd;
}

.panel-reference {
  background: #eff8ff;
  border-color: #b2ddff;
}

.panel-result {
  background: #ecfdf3;
  border-color: #abefc6;
}

.panel-warning {
  background: #fffaeb;
  border-color: #fedf89;
}

.panel-danger {
  background: #fef3f2;
  border-color: #fecdca;
}

.panel-project {
  background: #f5f3ff;
  border-color: #d9d6fe;
}

.panel-research {
  background: #eef4ff;
  border-color: #c7d7fe;
}

/* Keep code blocks soft rather than neon */
.md-typeset pre > code {
  border-radius: 0.7rem;
}

.md-typeset code {
  border-radius: 0.35rem;
  padding: 0.1em 0.32em;
}

/* Gentle tables */
.md-typeset table:not([class]) {
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 0.7rem;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background: rgba(16, 24, 40, 0.04);
}

/* Dark mode tuning */
[data-md-color-scheme="slate"] .text-muted { color: #98a2b3; }
[data-md-color-scheme="slate"] .text-blue { color: #84caff; }
[data-md-color-scheme="slate"] .text-green { color: #6ce9a6; }
[data-md-color-scheme="slate"] .text-yellow { color: #f7b955; }
[data-md-color-scheme="slate"] .text-red { color: #fda29b; }
[data-md-color-scheme="slate"] .text-purple { color: #bdb4fe; }

[data-md-color-scheme="slate"] .highlight-yellow { background: rgba(133, 77, 14, 0.35); color: #fcd34d; }
[data-md-color-scheme="slate"] .highlight-blue   { background: rgba(30, 64, 175, 0.32); color: #93c5fd; }
[data-md-color-scheme="slate"] .highlight-green  { background: rgba(20, 83, 45, 0.38); color: #86efac; }
[data-md-color-scheme="slate"] .highlight-red    { background: rgba(127, 29, 29, 0.38); color: #fca5a5; }
[data-md-color-scheme="slate"] .highlight-purple { background: rgba(88, 28, 135, 0.34); color: #d8b4fe; }

[data-md-color-scheme="slate"] .panel-note {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}
[data-md-color-scheme="slate"] .panel-reference {
  background: rgba(21, 94, 117, 0.22);
  border-color: rgba(103, 232, 249, 0.28);
}
[data-md-color-scheme="slate"] .panel-result {
  background: rgba(20, 83, 45, 0.26);
  border-color: rgba(110, 231, 183, 0.28);
}
[data-md-color-scheme="slate"] .panel-warning {
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.3);
}
[data-md-color-scheme="slate"] .panel-danger {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(252, 165, 165, 0.28);
}
[data-md-color-scheme="slate"] .panel-project {
  background: rgba(76, 29, 149, 0.25);
  border-color: rgba(196, 181, 253, 0.28);
}
[data-md-color-scheme="slate"] .panel-research {
  background: rgba(30, 64, 175, 0.24);
  border-color: rgba(147, 197, 253, 0.28);
}

/* Notion-style section headings */
.section-blue,
.section-orange,
.section-yellow,
.section-red,
.section-purple,
.section-gray {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 0.55rem;
  margin: 0.2rem 0 0.55rem;
  font-weight: 700;
}

.section-blue { background: #dbeafe; color: #1d4ed8; }
.section-orange { background: #ffedd5; color: #c2410c; }
.section-yellow { background: #fef3c7; color: #a16207; }
.section-red { background: #fee2e2; color: #b91c1c; }
.section-purple { background: #ede9fe; color: #6d28d9; }
.section-gray { background: #f3f4f6; color: #374151; }

[data-md-color-scheme="slate"] .section-blue { background: rgba(30,64,175,0.32); color: #93c5fd; }
[data-md-color-scheme="slate"] .section-orange { background: rgba(154,52,18,0.34); color: #fdba74; }
[data-md-color-scheme="slate"] .section-yellow { background: rgba(133,77,14,0.34); color: #fcd34d; }
[data-md-color-scheme="slate"] .section-red { background: rgba(127,29,29,0.36); color: #fca5a5; }
[data-md-color-scheme="slate"] .section-purple { background: rgba(88,28,135,0.34); color: #ddd6fe; }
[data-md-color-scheme="slate"] .section-gray { background: rgba(255,255,255,0.06); color: #d1d5db; }
