[hidden] { display: none !important; }

:root {
  --ink: #211c17;
  --muted: #4e473f;
  --paper: #efe8dc;
  --panel: #fffdf8;
  --line: #ddd2c2;
  --header: #211c17;
  --cream: #f6f1e7;
  --accent: #a33b24;
  --accent-ink: #fffaf6;
  --focus: #a33b24;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea, summary, .ui-sans, .section-nav, .lang-menu, .stats, .pane-label, .control-label, .site-footer, .disclosure, .partner-card, .feature-grid, .steps, .faq-list {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 80;
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 6px;
}

.skip-link:focus { top: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--header);
  color: var(--cream);
  box-shadow: inset 0 -1px 0 rgba(246, 241, 231, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand svg { display: block; width: 18px; height: 18px; flex: 0 0 auto; }

.section-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.section-nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.section-nav a:hover { background: rgba(246, 241, 231, 0.08); }

.header-end { margin-left: auto; display: flex; align-items: center; }

.lang-menu { position: relative; }

.lang-menu > summary {
  list-style: none;
  cursor: pointer;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(246, 241, 231, 0.28);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--cream);
  white-space: nowrap;
}

.lang-menu > summary::-webkit-details-marker { display: none; }

.lang-menu > summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--cream);
}

.lang-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 148px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(33, 28, 23, 0.16);
}

.lang-menu a {
  display: block;
  padding: 7px 8px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.lang-menu a:hover { background: #f3ece2; }

.lang-menu a[aria-current="page"] { background: #211c17; color: var(--cream); }

.frame {
  height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) 32px;
  min-width: 0;
}

.first-screen {
  display: grid;
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  height: 100%;
  padding: 8px 14px 6px;
  gap: 6px;
}

.title-block { min-width: 0; }

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.lede {
  margin: 2px 0 0;
  max-width: 100%;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.35;
}

.studio {
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
}

.studio-controls,
.format-bar {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.control-group,
.format-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.control-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-btn {
  appearance: none;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid #d9d0c2;
  background: var(--panel);
  color: var(--ink);
  font-weight: 650;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.tool-btn:hover { border-color: #b7aa98; background: #fff; }

.tool-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.tool-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tool-btn.primary:hover { background: #8d301c; border-color: #8d301c; }

.format-bar { justify-content: space-between; }

.stats {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.stats strong { color: var(--ink); font-weight: 750; }

.panes {
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.pane-label {
  height: 28px;
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: #faf6ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pane-label span { white-space: nowrap; }

#toc-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 0;
}

.editor-wrap,
.preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

#editor {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  resize: none;
  padding: 12px 14px 18px;
  background: #fffdf8;
  color: var(--ink);
  font: 13.5px/1.55 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.toc a {
  display: block;
  text-decoration: none;
  color: #3d3832;
  font-size: 12px;
  line-height: 1.35;
  padding: 3px 6px;
  border-radius: 4px;
}

.toc a:hover { background: #f3ece2; }

.toc a.toc-l1 { font-weight: 750; }
.toc a.toc-l2 { padding-left: 14px; }
.toc a.toc-l3 { padding-left: 24px; }
.toc a.toc-l4 { padding-left: 34px; }
.toc a.toc-l5 { padding-left: 44px; }
.toc a.toc-l6 { padding-left: 54px; }

.toc-empty {
  margin: 0;
  padding: 2px 6px 4px;
  color: var(--muted);
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* theme-export:start */
.markdown-body {
  padding: 18px 22px 32px;
  color: #211c17;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.markdown-body > :first-child { margin-top: 0; }

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  line-height: 1.25;
  scroll-margin-top: 8px;
}

.markdown-body p { margin: 0.7em 0; }

.markdown-body a { text-underline-offset: 2px; }

.markdown-body ul,
.markdown-body ol { margin: 0.6em 0; padding-left: 1.35em; }

.markdown-body li { margin: 0.2em 0; }

.markdown-body li > ul,
.markdown-body li > ol { margin: 0.15em 0; }

.markdown-body .task-list { list-style: none; padding-left: 0.15em; }

.markdown-body .task-item input[type="checkbox"] {
  margin: 0 0.45em 0 0;
  accent-color: currentColor;
  vertical-align: -0.1em;
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.35;
  margin: 1.4em 0;
}

.markdown-body img { max-width: 100%; height: auto; }

.markdown-body table {
  border-collapse: collapse;
  margin: 1em 0;
  max-width: 100%;
}

.markdown-body th,
.markdown-body td {
  padding: 6px 10px;
  vertical-align: top;
}

.markdown-body code,
.markdown-body pre,
.markdown-body .code-lang {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.markdown-body :not(pre) > code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.markdown-body .code-fence {
  position: relative;
  margin: 1em 0;
  border-radius: 8px;
  overflow: hidden;
}

.markdown-body .code-lang {
  position: absolute;
  top: 7px;
  right: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.markdown-body .code-fence pre {
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  max-width: 100%;
}

.markdown-body .code-fence.has-lang pre { padding-top: 28px; }

.markdown-body .code-fence code {
  font-size: 13px;
  background: transparent;
  padding: 0;
  white-space: pre;
}

.markdown-body[data-theme="editorial"] {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 17.5px;
  line-height: 1.7;
  background: #fbf6ee;
  color: #241c16;
}

.markdown-body[data-theme="editorial"] h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.45em;
}

.markdown-body[data-theme="editorial"] h2 {
  font-size: 22px;
  margin: 1.3em 0 0.4em;
  padding-bottom: 0.15em;
  border-bottom: 1px solid #e4d3bf;
}

.markdown-body[data-theme="editorial"] h3 { font-size: 18px; margin: 1.15em 0 0.3em; }

.markdown-body[data-theme="editorial"] blockquote {
  margin: 1.1em 0;
  padding: 0.1em 0 0.1em 0.95em;
  border-left: 3px solid #a33b24;
  color: #4d3b30;
  font-style: italic;
}

.markdown-body[data-theme="editorial"] a { color: #8d301c; }

.markdown-body[data-theme="editorial"] :not(pre) > code {
  background: #f0e4d4;
  color: #3d2618;
}

.markdown-body[data-theme="editorial"] .code-fence {
  background: #f6efe4;
  border: 1px solid #eadccb;
}

.markdown-body[data-theme="editorial"] .code-lang { color: #8a5a3a; }

.markdown-body[data-theme="editorial"] th,
.markdown-body[data-theme="editorial"] td { border-bottom: 1px solid #eadfce; }

.markdown-body[data-theme="editorial"] th { font-weight: 700; text-align: inherit; }

.markdown-body[data-theme="github"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #ffffff;
  color: #1f2328;
}

.markdown-body[data-theme="github"] h1,
.markdown-body[data-theme="github"] h2 {
  padding-bottom: 0.3em;
  border-bottom: 1px solid #d1d9e0;
  font-weight: 650;
}

.markdown-body[data-theme="github"] h1 { font-size: 32px; margin: 0 0 0.6em; }
.markdown-body[data-theme="github"] h2 { font-size: 24px; margin: 1.2em 0 0.5em; }
.markdown-body[data-theme="github"] h3 { font-size: 20px; margin: 1.1em 0 0.4em; }

.markdown-body[data-theme="github"] a { color: #0969da; }

.markdown-body[data-theme="github"] blockquote {
  margin: 0 0 1em;
  padding: 0 1em;
  color: #59636e;
  border-left: 0.25em solid #d1d9e0;
}

.markdown-body[data-theme="github"] :not(pre) > code {
  background: #eff2f5;
  border-radius: 6px;
  font-size: 85%;
}

.markdown-body[data-theme="github"] .code-fence {
  background: #f6f8fa;
  border-radius: 6px;
}

.markdown-body[data-theme="github"] .code-lang { color: #59636e; }

.markdown-body[data-theme="github"] table { width: 100%; }

.markdown-body[data-theme="github"] th,
.markdown-body[data-theme="github"] td { border: 1px solid #d1d9e0; }

.markdown-body[data-theme="github"] th { background: #f6f8fa; font-weight: 650; }

.markdown-body[data-theme="github"] tbody tr:nth-child(2n) { background: #f6f8fa; }

.markdown-body[data-theme="academic"] {
  font-family: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", Georgia, serif;
  font-size: 17px;
  line-height: 1.85;
  background: #fbfbf8;
  color: #161616;
  counter-reset: academic-h2;
}

.markdown-body[data-theme="academic"] h1 {
  margin: 0 0 0.8em;
  text-align: center;
  font-size: 24px;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.markdown-body[data-theme="academic"] h2 {
  margin: 1.25em 0 0.35em;
  font-size: 19px;
  font-weight: 700;
}

.markdown-body[data-theme="academic"] h2::before {
  counter-increment: academic-h2;
  content: counter(academic-h2) ". ";
}

.markdown-body[data-theme="academic"] h3 { font-size: 17px; font-style: italic; font-weight: 700; }

.markdown-body[data-theme="academic"] p { text-align: justify; }

.markdown-body[data-theme="academic"] a { color: #12315c; }

.markdown-body[data-theme="academic"] blockquote {
  margin: 1em 2em;
  color: #222;
  font-style: normal;
}

.markdown-body[data-theme="academic"] :not(pre) > code,
.markdown-body[data-theme="academic"] .code-fence {
  background: #f1f1ec;
}

.markdown-body[data-theme="academic"] .code-fence { border: 1px solid #dddcd4; }

.markdown-body[data-theme="academic"] th,
.markdown-body[data-theme="academic"] td { border: 1px solid #cfcfc6; }

.markdown-body[data-theme="academic"] th { background: #f3f3ee; }

.markdown-body[data-theme="minimal"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  background: #ffffff;
  color: #161616;
}

.markdown-body[data-theme="minimal"] h1 {
  margin: 0 0 0.55em;
  font-size: 30px;
  font-weight: 640;
  letter-spacing: -0.035em;
}

.markdown-body[data-theme="minimal"] h2 {
  margin: 1.5em 0 0.35em;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.markdown-body[data-theme="minimal"] h3 {
  margin: 1.2em 0 0.3em;
  font-size: 15px;
  font-weight: 700;
  color: #3a3a3a;
}

.markdown-body[data-theme="minimal"] a { color: #161616; }

.markdown-body[data-theme="minimal"] blockquote {
  margin: 1.2em 0;
  padding: 0;
  border: 0;
  color: #3f3f3f;
}

.markdown-body[data-theme="minimal"] :not(pre) > code { background: #f4f4f4; }

.markdown-body[data-theme="minimal"] .code-fence { background: #f7f7f7; }

.markdown-body[data-theme="minimal"] .code-lang { color: #6b6b6b; }

.markdown-body[data-theme="minimal"] th { border-bottom: 1px solid #161616; font-weight: 700; }

.markdown-body[data-theme="minimal"] td { border-bottom: 1px solid #e6e6e6; }

.markdown-body[data-theme="minimal"] hr { opacity: 0.7; }

@media print {
  @page { margin: 14mm; size: auto; }
  .markdown-body { background: #fff !important; }
}
/* theme-export:end */

.site-footer {
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.below-fold {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.below-fold h2,
#guide,
#faq,
#partners {
  scroll-margin-top: 60px;
}

.below-fold h2 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.guide-intro {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.55;
  max-width: 68ch;
}

.steps {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.steps li,
.feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px 14px;
  min-width: 0;
}

.steps h3,
.feature-grid h3 {
  margin: 0 0 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.steps p,
.feature-grid p,
.faq-list p {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #3c372f;
}

.step-index {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 34px;
}

.faq { margin-bottom: 28px; }

.faq-list { border-top: 1px solid var(--line); }

.faq-list details { border-bottom: 1px solid var(--line); }

.faq-list summary {
  cursor: pointer;
  padding: 12px 2px;
  font-weight: 700;
  font-size: 16px;
}

.faq-list details p { padding: 0 0 14px; max-width: 72ch; }

.partners h2 { margin-bottom: 10px; }

.disclosure {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff6df;
  border: 1px solid #e4d2a4;
  border-radius: 8px;
  color: #3f3420;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.partner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.partner-card {
  display: block;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.partner-card:hover { border-color: #c4b39d; }

.partner-card strong {
  display: block;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 18px;
}

.partner-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.not-found {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 42px 20px 32px;
}

.not-found h1 {
  margin: 0 0 8px;
  font-size: 36px;
  letter-spacing: -0.03em;
}

.not-found ul { padding-left: 1.2em; }

.not-found a { color: var(--accent); }

body.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-404 .site-footer { margin-top: auto; }

@media print {
  @page { margin: 14mm; size: auto; }

  .skip-link,
  .site-header,
  .page-title,
  .lede,
  .studio-controls,
  .format-bar,
  .editor-pane,
  .pane-label,
  .toc,
  .site-footer,
  .below-fold,
  .partners,
  .ad-partner {
    display: none !important;
  }

  body { background: #fff !important; }

  .frame,
  .first-screen,
  .studio,
  .panes,
  .preview-pane,
  .preview-scroll {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }
}

@media (max-width: 900px) {
  .section-nav { display: none; }
  .frame { height: auto; display: block; }
  .first-screen { height: auto; }
  .studio { height: auto; }
  .panes { grid-template-columns: 1fr; }
  .editor-wrap,
  .preview-scroll { height: 48vh; min-height: 240px; }
  .page-title { white-space: normal; font-size: 26px; }
  .steps,
  .feature-grid,
  .partner-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
