/*
  Markdown Tools. Loaded after the PDF tools' stylesheet (cards, steps,
  segmented switches) and the developer tools' (fields, panes, messages),
  and next to doc.css, which styles the rendered documents themselves.
  Plain CSS, not built by Tailwind; colours come from the site's theme tokens
  so dark mode just works.
*/

/* The editor gets more room than the usual content width. */
.mdt-wide { width: 100%; max-width: 100rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 40rem) { .mdt-wide { padding-inline: 1.5rem; } }
@media (min-width: 64rem) { .mdt-wide { padding-inline: 2rem; } }

.mdt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* Drop-downs in an options row sit beside their label, like the switches. */
.mdt .devt-bar > .devt-option-select, .mdv-bar > .devt-option-select { flex-direction: row; align-items: center; gap: 0.5rem; }
.mdt .devt-bar > .devt-option-select .pdft-label, .mdv-bar > .devt-option-select .pdft-label { margin: 0; font-size: 0.875rem; font-weight: 600; }
.mdt-icon { width: 1.15rem; height: 1.15rem; flex: none; }

/* ---- Icon buttons and menus ---- */

.mdt-tool-btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-base-content);
  cursor: pointer;
  transition: background-color 0.12s;
}
.mdt-tool-btn:hover { background: color-mix(in oklab, var(--color-base-content) 9%, transparent); }
.mdt-tool-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.mdt-tool-btn[aria-pressed="true"] { background: color-mix(in oklab, var(--color-primary) 20%, transparent); }

.mdt-menu { position: relative; }
.mdt-menu > summary { list-style: none; }
.mdt-menu > summary::-webkit-details-marker { display: none; }
.mdt-menu-btn { gap: 0.35rem; flex-wrap: nowrap; }
.mdt-chevron { width: 0.9rem; height: 0.9rem; transition: transform 0.15s; }
.mdt-menu[open] .mdt-chevron { transform: rotate(180deg); }
.mdt-menu-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  z-index: 60;
  min-width: 16rem;
  max-width: min(22rem, calc(100vw - 2rem));
  max-height: min(70vh, 32rem);
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--devt-line);
  border-radius: 0.75rem;
  background: var(--color-base-100);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.3);
}
.mdt-menu-list.is-start { left: 0; }
.mdt-menu-list.is-end { right: 0; }
.mdt-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  color: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.mdt-menu-item:hover, .mdt-menu-item:focus-visible { background: var(--color-base-200); outline: none; }
.mdt-menu-item.is-current { font-weight: 600; background: color-mix(in oklab, var(--color-primary) 12%, transparent); }
.mdt-menu-label { overflow-wrap: anywhere; }
.mdt-menu-hint { font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.mdt-menu-sep { margin: 0.35rem 0; border: 0; border-top: 1px solid var(--devt-line); }
.mdt-menu-heading { padding: 0.35rem 0.65rem 0.15rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* ---- Rendered previews ---- */

.mdt-preview {
  min-height: 12rem;
  max-height: 40rem;
  overflow: auto;
  border: 1px solid var(--devt-line);
  border-radius: var(--r-sm, 0.5rem);
  /* Raw HTML in a document can't escape its box, even with position: fixed. */
  contain: paint;
}
.mdt-preview > .md-doc { min-height: 100%; padding: 1rem 1.25rem; }
.mdt-html .mdt-preview { height: 30rem; max-height: none; }

/* ---- Markdown Editor ---- */

.mde {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--devt-line);
  border-radius: var(--devt-radius);
  background: var(--color-base-100);
}
.mde-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--devt-line);
  border-radius: var(--devt-radius) var(--devt-radius) 0 0;
  background: var(--color-base-200);
}
.mde-top-start, .mde-top-end { display: flex; align-items: center; gap: 0.5rem; }
.mde-top-end { margin-left: auto; }
.mde-format { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; }
.mde-sep { width: 1px; height: 1.25rem; margin: 0 0.3rem; background: var(--devt-line); }
.mde-views span { padding-inline: 0.65rem; }

.mde-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: clamp(26rem, calc(100vh - 13rem), 58rem);
  min-height: 0;
}
.mde[data-view="write"] .mde-body, .mde[data-view="preview"] .mde-body { grid-template-columns: minmax(0, 1fr); }
.mde[data-view="write"] .mde-preview, .mde[data-view="preview"] .mde-editor { display: none; }
.mde.has-outline .mde-body { grid-template-columns: 15rem minmax(0, 1fr) minmax(0, 1fr); }
.mde.has-outline[data-view="write"] .mde-body, .mde.has-outline[data-view="preview"] .mde-body { grid-template-columns: 15rem minmax(0, 1fr); }

.mde-editor { min-width: 0; min-height: 0; overflow: hidden; }
.mde-editor .cm-editor { height: 100%; }
.mde[data-view="write"] .cm-content { max-width: 50rem; margin-inline: auto; }

.mde-preview {
  min-width: 0;
  max-height: none;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--devt-line);
  border-radius: 0;
}
.mde-preview > .md-doc { padding: 1.25rem 2rem 30vh; }
.mde[data-view="preview"] .mde-preview { border-left: 0; }
.mde[data-view="preview"] .mde-preview > .md-doc { max-width: 52rem; margin-inline: auto; }

.mde-outline { display: none; }
.mde.has-outline .mde-outline {
  display: block;
  min-height: 0;
  overflow: auto;
  padding: 0.75rem 0.5rem 2rem;
  border-right: 1px solid var(--devt-line);
  font-size: 0.875rem;
}
.mde-outline-title { padding: 0 0.5rem 0.4rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.mde-outline-empty { padding: 0 0.5rem; color: var(--muted); }
.mde-outline ol { margin: 0; padding: 0; list-style: none; }
.mde-outline button {
  display: block;
  width: 100%;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 0.4rem;
  background: none;
  color: inherit;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mde-outline button:hover { background: var(--color-base-200); }
.mde-outline .is-h1 button { font-weight: 600; }
.mde-outline .is-h2 button { padding-left: 1.1rem; }
.mde-outline .is-h3 button { padding-left: 1.7rem; color: var(--muted); }
.mde-outline .is-h4 button, .mde-outline .is-h5 button, .mde-outline .is-h6 button { padding-left: 2.3rem; font-size: 0.8125rem; color: var(--muted); }

.mde-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--devt-line);
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mde-note { color: var(--color-base-content); }
.mde-save { margin-left: auto; }
.mde-save.is-warn { color: color-mix(in oklab, var(--color-warning) 60%, var(--color-base-content)); }

/* Focus mode: the editor fills the window. */
.mde.is-focus { position: fixed; inset: 0; z-index: 1000; border: 0; border-radius: 0; }
.mde.is-focus .mde-top { border-radius: 0; }
.mde.is-focus .mde-body { flex: 1; height: auto; }
html.mde-locked { overflow: hidden; }

@media (max-width: 55.99rem) {
  .mde-body { height: clamp(22rem, 72vh, 44rem); }
  .mde.has-outline .mde-body, .mde.has-outline[data-view] .mde-body { grid-template-columns: minmax(0, 1fr); }
  .mde.has-outline .mde-outline, .mde-outline-btn { display: none !important; }
  .mde-preview > .md-doc { padding: 1rem 1rem 30vh; }
  .mde-top-end { margin-left: 0; }
  .mde-stats { flex-basis: 100%; }
}

/* ---- Markdown to PDF: a page at real size, scaled to fit ---- */

.mdt-stage {
  max-height: 46rem;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--devt-line);
  border-radius: var(--r-sm, 0.5rem);
  background: var(--color-base-200);
  contain: paint;
}
.mdt-sizer { position: relative; overflow: hidden; }
.mdt-sheet {
  box-sizing: border-box;
  transform-origin: top left;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.mdt-sheet > .md-doc { background: transparent; }
.mdt-pdf-panes .mdt-source { min-height: 30rem; }

/* ---- HTML to Markdown: the box formatted text is pasted into ---- */

.mdt-paste {
  min-height: 29rem;
  max-height: 40rem;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--devt-line);
  border-radius: var(--r-sm, 0.5rem);
  font-size: 15px;
  contain: paint;
}
.mdt-paste:focus { outline: none; border-color: var(--color-base-content); box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-base-content) 12%, transparent); }
.mdt-paste:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }

/* ---- Table generator ---- */

.mdt-grid-wrap {
  max-height: 34rem;
  overflow: auto;
  border: 1px solid var(--devt-line);
  border-radius: 0.625rem;
}
.mdt-grid { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9375rem; }
.mdt-grid td, .mdt-grid th { padding: 0; border-right: 1px solid var(--devt-line); border-bottom: 1px solid var(--devt-line); }
.mdt-grid tr > :last-child { border-right: 0; }
.mdt-grid tbody tr:last-child > * { border-bottom: 0; }
.mdt-grid-tools td { padding: 0.25rem 0.35rem; background: var(--color-base-200); }
.mdt-grid .mdt-rownum {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 4.75rem;
  min-width: 4.75rem;
  padding: 0 0.35rem 0 0.5rem;
  background: var(--color-base-200);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
.mdt-grid-tools td:first-child { position: sticky; left: 0; z-index: 1; }
.mdt-cell {
  display: block;
  width: 100%;
  min-width: 9rem;
  padding: 0.45rem 0.6rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.mdt-cell:focus { outline: 2px solid var(--color-primary); outline-offset: -2px; background: var(--color-base-100); }
.mdt-cell.is-header { font-weight: 600; }
.mdt-grid thead th { background: color-mix(in oklab, var(--color-base-200) 55%, var(--color-base-100)); }
.mdt-align { display: flex; align-items: center; gap: 2px; }
.mdt-mini {
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.3rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.mdt-mini:hover { background: var(--color-base-300); color: var(--color-base-content); }
.mdt-mini:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.mdt-mini[aria-pressed="true"] { background: var(--color-base-content); color: var(--color-base-100); }
.mdt-mini:disabled { opacity: 0.35; cursor: default; background: transparent; }
.mdt-align .mdt-remove { margin-left: auto; }
.mdt-rownum .mdt-remove { margin-left: 0.2rem; opacity: 0; }
.mdt-grid tr:hover .mdt-rownum .mdt-remove, .mdt-rownum .mdt-remove:focus-visible { opacity: 1; }
@media (hover: none) { .mdt-rownum .mdt-remove { opacity: 1; } }

.mdt-import { border-top: 1px solid var(--devt-line); padding-top: 0.75rem; }
.mdt-import summary { cursor: pointer; font-weight: 600; }
.mdt-import[open] summary { margin-bottom: 0.75rem; }
.mdt-import .devt-actions { margin-top: 0.6rem; }

/* ---- File drop zones (Word to Markdown, the viewer) ---- */

.mdt-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 9rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--devt-line);
  border-radius: var(--devt-radius);
  background: var(--color-base-200);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.mdt-drop:hover, .mdt-drop:focus-within, .mdt-drop.is-dragging {
  border-color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 7%, var(--color-base-100));
}
.mdt-drop[hidden] { display: none; }
.mdt-drop-title { font-size: 1.0625rem; font-weight: 600; }
.mdt-drop-hint { font-size: 0.875rem; color: var(--muted); }

/* ---- Markdown Viewer ---- */

.mdv-empty { min-height: 16rem; }
.mdv { display: flex; flex-direction: column; gap: 0.75rem; }
.mdv[hidden] { display: none; }
.mdv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.mdv-bar .btn { gap: 0.35rem; }
.mdv-bar .btn[aria-pressed="true"] { background: color-mix(in oklab, var(--color-primary) 18%, var(--color-base-200)); }
.mdv-shared {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.625rem;
  background: color-mix(in oklab, var(--t-sky, #2f7aae) 12%, var(--color-base-100));
  font-size: 0.9375rem;
}
.mdv-shared[hidden] { display: none; }
.mdv-tabs { display: flex; gap: 0.25rem; overflow-x: auto; border-bottom: 1px solid var(--devt-line); }
.mdv-tabs[hidden] { display: none; }
.mdv-tab {
  flex: none;
  max-width: 16rem;
  padding: 0.45rem 0.85rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.mdv-tab[aria-selected="true"] { border-bottom-color: var(--color-base-content); color: var(--color-base-content); font-weight: 600; }
.mdv-reader { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.mdv-contents { display: none; }
@media (min-width: 64rem) {
  .mdv-reader.has-contents { grid-template-columns: 14rem minmax(0, 1fr); }
  .mdv-reader.has-contents .mdv-contents {
    display: block;
    position: sticky;
    top: 5.5rem;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow: auto;
    font-size: 0.875rem;
  }
}
.mdv-contents ol { margin: 0; padding: 0; list-style: none; }
.mdv-contents button {
  display: block;
  width: 100%;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 0.4rem;
  background: none;
  color: inherit;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mdv-contents button:hover { background: var(--color-base-200); }
.mdv-contents .is-h2 button { padding-left: 1.1rem; }
.mdv-contents .is-h3 button { padding-left: 1.7rem; color: var(--muted); }
.mdv-page { min-width: 0; border: 1px solid var(--devt-line); border-radius: var(--devt-radius); contain: paint; overflow: hidden; }
.mdv-page > .md-doc { max-width: 52rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
@media (min-width: 40rem) { .mdv-page > .md-doc { padding: 2.5rem 2.5rem 4rem; } }

/* ---- Linter ---- */

.mdl-box {
  min-height: 12rem;
  max-height: 34rem;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--devt-line);
  border-radius: var(--r-sm, 0.5rem);
}
.mdl-results { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.mdl-results li { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--devt-line); }
.mdl-results li:last-child { border-bottom: 0; }
.mdl-problem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.1rem 0.75rem;
  width: 100%;
  padding: 0.35rem 0.4rem;
  border: 0;
  border-radius: 0.4rem;
  background: none;
  color: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.mdl-problem:hover { background: var(--color-base-200); }
.mdl-line { grid-row: span 3; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mdl-rule-name { color: var(--muted); font-size: 0.8125rem; }
.mdl-rule-name code { font-family: var(--devt-mono); color: var(--color-base-content); }
.mdl-context { font-family: var(--devt-mono); font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.mdl-fixable {
  justify-self: start;
  grid-column: 2;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--color-success) 18%, transparent);
  font-size: 0.75rem;
  font-weight: 600;
}
.mdl-more { margin-left: calc(0.4rem + 3.5rem); font-size: 0.75rem; color: var(--muted); text-decoration: underline; }
.mdl-rules { display: grid; gap: 0.35rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); max-height: 24rem; overflow: auto; }
.mdl-rule { align-items: flex-start; font-size: 0.8125rem; line-height: 1.4; }
.mdl-rule code { font-family: var(--devt-mono); font-weight: 600; }

/* ---- Counts (plain text) and changes (formatter) ---- */

/* Label over number, side by side; two columns of pairs on phones. */
.mdt-stats { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; justify-content: start; gap: 0 2rem; margin: 0; }
.mdt-stats dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.mdt-stats dd { margin: 0; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .mdt-stats { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(2, auto); gap: 0.15rem 1.5rem; } }
.mdt-changes { max-height: 26rem; overflow: auto; }
.mdt-changes[hidden] { display: none; }

/* ---- Markdown for other apps ---- */

.mdf-messages { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.mdf-messages[hidden] { display: none; }
.mdf-message .devt-field-head { justify-content: flex-start; }
.mdf-message .devt-copy { margin-left: auto; }
.mdf-message pre { max-height: 14rem; }
/* Slack and Discord previews look like a message in each app. */
.mdf-preview .mdt-preview { max-height: 30rem; }
.mdf-slack .md-doc {
  --md-font: Lato, "Slack-Lato", "Helvetica Neue", Helvetica, "Segoe UI", Tahoma, Arial, sans-serif;
  --md-size: 15px;
  --md-gap: 0.5em;
}
.mdf-slack .md-doc h1, .mdf-slack .md-doc h2 { border: 0; padding: 0; font-size: 1em; }
.mdf-discord .mdt-preview { background: #313338; }
.mdf-discord .md-doc {
  --md-fg: #dbdee1;
  --md-muted: #b5bac1;
  --md-bg: #313338;
  --md-border: #4e5058;
  --md-subtle: #2b2d31;
  --md-link: #00a8fc;
  --md-code-bg: #2b2d31;
  --md-font: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --md-size: 16px;
  --md-gap: 0.4em;
}
.mdf-discord .md-doc h1, .mdf-discord .md-doc h2 { border: 0; padding: 0; }
.mdf-discord .md-doc blockquote { border-left-color: #4e5058; color: var(--md-fg); }

/* ---- Markdown to Slides (the slide canvas itself is in slides.css) ---- */

@media (min-width: 56rem) { .mds-panes { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.mds-panes .devt-text { min-height: 30rem; }
.mds-view .devt-actions { align-items: center; }
.mds-counter { min-width: 7.5rem; font-size: 0.875rem; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
/* One slide at its real size, scaled to the pane's width by tools/slides.js. */
.mds-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm, 0.5rem);
  box-shadow: 0 0 0 1px var(--devt-line), 0 8px 24px -12px rgb(0 0 0 / 0.25);
}
.mds-stage > .md-slide, .mds-thumb-frame > .md-slide { position: absolute; left: 0; top: 0; transform-origin: top left; }
.mds-notes { margin: 0; padding: 0.6rem 0.8rem; border-radius: 0.5rem; background: var(--color-base-200); font-size: 0.875rem; white-space: pre-wrap; }
.mds-notes:empty { display: none; }

.mds-thumbs { display: flex; gap: 0.75rem; margin: 0; padding: 0.25rem 0.1rem 0.6rem; overflow-x: auto; list-style: none; }
.mds-thumb { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.mds-thumb-frame {
  position: relative;
  display: block;
  width: 160px;
  overflow: hidden;
  border-radius: 0.3rem;
  box-shadow: 0 0 0 1px var(--devt-line);
  pointer-events: none;
}
.mds-thumb:hover .mds-thumb-frame { box-shadow: 0 0 0 2px var(--color-base-content); }
.mds-thumb[aria-current="true"] .mds-thumb-frame { box-shadow: 0 0 0 3px var(--color-primary); }
.mds-thumb[aria-current="true"] { color: var(--color-base-content); font-weight: 600; }
.mds-thumb:focus-visible { outline: none; }
.mds-thumb:focus-visible .mds-thumb-frame { box-shadow: 0 0 0 3px var(--color-primary), 0 0 0 5px var(--color-base-100); }
.mds-thumb-number { font-size: 0.75rem; font-variant-numeric: tabular-nums; }

/* Present: the deck fills the screen, one slide at a time. */
.mds-present { position: fixed; inset: 0; z-index: 1000; background: #000000; outline: none; cursor: pointer; }
.mds-present-slide > .md-slide { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.mds-present-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: #2f81f7; transition: width 0.2s; }
.mds-present-hint {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  margin: 0;
  font-size: 0.8125rem;
  color: rgb(255 255 255 / 0.55);
  animation: mds-fade 0.6s 3s forwards;
}
@keyframes mds-fade { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mds-present-bar { transition: none; } }

/* ---- README Generator ---- */

@media (min-width: 56rem) { .mdr-panes { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.mdr-form { display: flex; flex-direction: column; gap: 1rem; }
.mdr-group { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.mdr-group > legend { padding: 0; margin-bottom: 0.6rem; font-weight: 600; }
.mdr-grid { display: grid; gap: 0.75rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.mdr-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.mdr-sections { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.mdr-section { border: 1px solid var(--devt-line); border-radius: 0.625rem; }
.mdr-section-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem 0.45rem 0.75rem; }
.mdr-section-head .devt-check { font-weight: 600; }
.mdr-move { display: flex; gap: 2px; margin-left: auto; }
.mdr-section-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.15rem 0.75rem 0.75rem; }
.mdr-section.is-off { border-style: dashed; }
.mdr-section.is-off .mdr-section-head .devt-check { color: var(--muted); font-weight: 400; }
.mdr-section.is-off .mdr-section-body { display: none; }
/* The README stays in view while the form scrolls. */
@media (min-width: 56rem) { .mdr-output { position: sticky; top: 5rem; align-self: start; } }
.mdr-output .mdt-preview { height: clamp(24rem, calc(100vh - 12rem), 46rem); max-height: none; }
.mdr-output .devt-text { height: clamp(24rem, calc(100vh - 12rem), 46rem); }
