/* Rendered vault notes */
.markdown {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.markdown > :first-child {
  margin-top: 0;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--text);
  line-height: 1.3;
  margin: 1.8em 0 0.6em;
  scroll-margin-top: 20px;
  font-weight: 620;
}
.markdown h1 {
  font-size: 1.6em;
}
.markdown h2 {
  font-size: 1.25em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}
.markdown h3 {
  font-size: 1.08em;
}
.markdown h4,
.markdown h5,
.markdown h6 {
  font-size: 1em;
  color: var(--text-2);
}
.markdown p,
.markdown ul,
.markdown ol,
.markdown pre,
.markdown blockquote,
.markdown .table-wrap,
.markdown .callout {
  margin: 0 0 1em;
}
.markdown ul,
.markdown ol {
  padding-left: 1.4em;
}
.markdown li {
  margin: 0.25em 0;
}
.markdown li::marker {
  color: var(--text-3);
}
.markdown li.task {
  list-style: none;
  position: relative;
  margin-left: -1.2em;
  padding-left: 1.7em;
}
.markdown li.task .box {
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--text-3);
}
.markdown li.task.done .box {
  border-color: var(--c-done);
  background: var(--c-done) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23071009' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.markdown li.task.done {
  color: var(--text-3);
}
.markdown strong {
  color: var(--text);
  font-weight: 600;
}
.markdown a {
  color: var(--accent);
}
.markdown a:hover {
  text-decoration: underline;
}
.markdown a.wikilink {
  color: #7fb0ff;
  background: rgba(79, 140, 255, 0.08);
  padding: 0 4px;
  border-radius: 4px;
}
.markdown a.wikilink.ticket {
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
}
.markdown .wikilink.missing,
.markdown .embed-missing {
  color: var(--text-3);
  border-bottom: 1px dashed var(--text-3);
}
.markdown code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: #f0c38e;
}
.markdown pre {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #0a0e17;
  border: 1px solid var(--border);
  overflow-x: auto;
  position: relative;
}
.markdown pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.markdown pre code {
  padding: 0;
  background: none;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
}
.markdown blockquote {
  padding: 4px 16px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-3);
}
.markdown .callout {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 140, 255, 0.25);
  background: rgba(79, 140, 255, 0.06);
}
.markdown .callout[data-type='warning'],
.markdown .callout[data-type='caution'] {
  border-color: rgba(245, 165, 36, 0.3);
  background: rgba(245, 165, 36, 0.06);
}
.markdown .callout[data-type='danger'],
.markdown .callout[data-type='bug'] {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.06);
}
.markdown .callout-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  text-transform: capitalize;
}
.markdown .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.markdown th,
.markdown td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.markdown th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.markdown tr:last-child td {
  border-bottom: 0;
}
.markdown img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.markdown hr {
  border: 0;
  height: 1px;
  background: var(--border-strong);
  margin: 2em 0;
}
.markdown mark {
  background: rgba(245, 165, 36, 0.25);
  color: var(--text);
  padding: 0 3px;
  border-radius: 3px;
}

/* Table of contents */
.toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.toc-item {
  text-align: left;
  padding: 5px 10px;
  border-left: 2px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-3);
  transition: color 0.15s, border-color 0.15s;
}
.toc-item:hover {
  color: var(--text);
  border-left-color: var(--accent);
}
.toc-item.level-3 {
  padding-left: 22px;
  font-size: var(--fs-xs);
}
