/* Unified authored Markdown typography.
   Goldmark owns document semantics; Unified owns readable presentation. */
.tutorial-content, .tutorial-markdown { color: var(--unified-text-muted, rgb(203 213 225)); line-height: 1.7; }
.tutorial-content > :first-child, .tutorial-markdown > :first-child { margin-top: 0; }
.tutorial-content > :last-child, .tutorial-markdown > :last-child { margin-bottom: 0; }
.tutorial-content p, .tutorial-markdown p { margin: 0.9rem 0; }

.tutorial-content h1, .tutorial-content h2, .tutorial-content h3, .tutorial-content h4,
.tutorial-markdown h1, .tutorial-markdown h2, .tutorial-markdown h3, .tutorial-markdown h4 {
  color: var(--unified-text, rgb(241 245 249)); font-weight: 700; line-height: 1.25; scroll-margin-top: 6rem;
}
.tutorial-content h1, .tutorial-markdown h1 { margin: 2rem 0 0.85rem; font-size: 1.65rem; }
.tutorial-content h2, .tutorial-markdown h2 { margin: 1.75rem 0 0.7rem; font-size: 1.35rem; }
.tutorial-content h3, .tutorial-markdown h3 { margin: 1.5rem 0 0.6rem; font-size: 1.1rem; }
.tutorial-content h4, .tutorial-markdown h4 { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
.tutorial-content strong, .tutorial-markdown strong { color: var(--unified-text, rgb(241 245 249)); font-weight: 700; }
.tutorial-content em, .tutorial-markdown em { color: rgb(226 232 240); }

.tutorial-content a, .tutorial-markdown a {
  color: var(--unified-accent, rgb(129 140 248)); font-weight: 600; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 0.2em;
}
.tutorial-content a:hover, .tutorial-markdown a:hover { text-decoration-color: currentColor; }

.tutorial-content ol, .tutorial-markdown ol { list-style-type: decimal; margin: 1rem 0; padding-left: 1.75rem; }
.tutorial-content ul, .tutorial-markdown ul { list-style-type: disc; margin: 0.75rem 0; padding-left: 1.5rem; }
.tutorial-content li, .tutorial-markdown li { margin: 0.35rem 0; padding-left: 0.25rem; }
.tutorial-content ol > li::marker, .tutorial-markdown ol > li::marker { color: rgb(129 140 248); font-weight: 700; }
.tutorial-content ul > li::marker, .tutorial-markdown ul > li::marker { color: rgb(148 163 184); }
.tutorial-content ol ol, .tutorial-markdown ol ol { list-style-type: lower-alpha; }
.tutorial-content ol ol ol, .tutorial-markdown ol ol ol { list-style-type: lower-roman; }

.tutorial-content blockquote, .tutorial-markdown blockquote {
  margin: 1.25rem 0; padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid color-mix(in srgb, var(--unified-accent, rgb(129 140 248)) 65%, transparent); color: rgb(203 213 225);
}
.tutorial-content hr, .tutorial-markdown hr { margin: 1.75rem 0; border: 0; border-top: 1px solid var(--unified-border, rgb(51 65 85)); }
.tutorial-content :not(pre) > code, .tutorial-markdown :not(pre) > code {
  border: 1px solid var(--unified-border, rgb(51 65 85)); border-radius: 0.35rem;
  background: color-mix(in srgb, var(--unified-surface-subtle, #111827) 82%, transparent); padding: 0.1rem 0.35rem;
  color: rgb(226 232 240); font-size: 0.9em;
}
@media (max-width: 640px) {
  .tutorial-content, .tutorial-markdown { line-height: 1.65; }
  .tutorial-content h1, .tutorial-markdown h1 { font-size: 1.4rem; }
  .tutorial-content h2, .tutorial-markdown h2 { font-size: 1.2rem; }
}

/* Unified authored Markdown tables.
   Goldmark owns table semantics; Unified owns responsive presentation. */
.tutorial-content table,
.tutorial-markdown table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--unified-border, rgb(51 65 85));
  border-radius: 0.75rem;
  border-collapse: separate;
  border-spacing: 0;
  background: color-mix(in srgb, var(--unified-surface-subtle, #111827) 72%, transparent);
}

.tutorial-content thead,
.tutorial-markdown thead {
  background: color-mix(in srgb, var(--unified-surface, #1f2937) 78%, transparent);
}

.tutorial-content th,
.tutorial-content td,
.tutorial-markdown th,
.tutorial-markdown td {
  min-width: 8rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--unified-border, rgb(51 65 85));
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.tutorial-content th,
.tutorial-markdown th {
  color: var(--unified-text, rgb(226 232 240));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tutorial-content td,
.tutorial-markdown td {
  color: var(--unified-text, rgb(226 232 240));
}

.tutorial-content tbody tr:last-child td,
.tutorial-markdown tbody tr:last-child td {
  border-bottom: 0;
}

.tutorial-content th:first-child,
.tutorial-content td:first-child,
.tutorial-markdown th:first-child,
.tutorial-markdown td:first-child {
  min-width: 10rem;
}

.tutorial-content th:nth-child(2),
.tutorial-content td:nth-child(2),
.tutorial-markdown th:nth-child(2),
.tutorial-markdown td:nth-child(2) {
  min-width: 14rem;
}

.tutorial-content td:first-child,
.tutorial-markdown td:first-child {
  font-weight: 600;
}

.tutorial-content table a,
.tutorial-markdown table a {
  color: var(--unified-accent, rgb(129 140 248));
  font-weight: 600;
  text-decoration: none;
}

.tutorial-content table a:hover,
.tutorial-markdown table a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.tutorial-content td code,
.tutorial-content th code,
.tutorial-markdown td code,
.tutorial-markdown th code {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tutorial-content table,
  .tutorial-markdown table {
    margin: 1.25rem 0;
    scrollbar-width: thin;
  }

  .tutorial-content th,
  .tutorial-content td,
  .tutorial-markdown th,
  .tutorial-markdown td {
    min-width: 7.5rem;
    padding: 0.7rem 0.8rem;
    font-size: 0.875rem;
  }

  .tutorial-content th:first-child,
  .tutorial-content td:first-child,
  .tutorial-markdown th:first-child,
  .tutorial-markdown td:first-child {
    min-width: 9rem;
  }

  .tutorial-content th:nth-child(2),
  .tutorial-content td:nth-child(2),
  .tutorial-markdown th:nth-child(2),
  .tutorial-markdown td:nth-child(2) {
    min-width: 13rem;
  }
}
