:root {
  color-scheme: dark;
  --bg: #0c0d0d;
  --surface: #121414;
  --surface-2: #181b1a;
  --surface-hover: #202321;
  --ink: #f3f5ef;
  --muted: #a4aaa1;
  --line: #2a2e2b;
  --line-strong: #3a403b;
  --accent: #d6ff3f;
  --accent-strong: #e3ff7c;
  --accent-soft: rgba(214,255,63,.09);
  --danger: #ff756e;
  --warning: #d6ff3f;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.22);
  --shadow: 0 18px 48px rgba(0,0,0,.28);
  --ease-standard: cubic-bezier(.2,0,0,1);
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
html, body { margin: 0; max-width: 100%; }
html { overflow-x: clip; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, table { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(2.4rem, 6vw, 5.5rem); line-height: 1; letter-spacing: -.05em; font-weight: 700; }
h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.app-shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(12,13,13,.94); backdrop-filter: blur(12px); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; font-size: 18px; font-weight: 750; cursor: pointer; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--accent); color: #080808; font-size: 14px; font-weight: 900; }
.site-nav { display: flex; align-items: stretch; align-self: stretch; gap: 28px; margin-left: auto; }
.site-nav .tab { position: relative; border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.site-nav .tab:hover, .site-nav .tab.active { color: var(--ink); }
.site-nav .tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.nav-cta { min-height: 40px; border: 1px solid var(--accent); border-radius: var(--radius-md); background: transparent; color: var(--accent); padding: 9px 17px; font-size: 13px; font-weight: 750; cursor: pointer; transition: background-color 120ms var(--ease-standard), color 120ms var(--ease-standard); }
.nav-cta:hover { background: var(--accent); color: #080808; }
.site-main { min-height: calc(100vh - 164px); }
.screen { display: none; padding: clamp(54px, 8vw, 100px) 0; }
.screen.active { display: block; animation: page-in .35s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

.intro-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .58fr); gap: clamp(40px, 8vw, 110px); align-items: center; min-height: 560px; }
.intro-copy { display: grid; gap: 28px; }
.intro-copy h2 { max-width: 800px; }
.intro-copy > p:not(.eyebrow) { max-width: 660px; color: #b5b5af; font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.75; }
.eyebrow, .panel-kicker { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.intro-actions, .actions, .split-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.process-panel { border-left: 1px solid var(--line); padding-left: clamp(24px, 4vw, 48px); }
.process-panel h3 { margin: 10px 0 24px; font-size: clamp(1.5rem, 2vw, 2rem); }
.steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; padding: 17px 0 17px 46px; border-top: 1px solid var(--line); color: var(--muted); counter-increment: steps; }
.steps li::before { content: "0" counter(steps); position: absolute; left: 0; top: 18px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.steps strong { display: block; color: var(--ink); font-weight: 650; }
.docs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 72px; background: var(--line); border-block: 1px solid var(--line); }
.docs-grid .doc-panel { background: var(--bg); padding: 32px; }
.doc-panel h3 { margin-bottom: 12px; }
.doc-panel p, .doc-panel li { color: var(--muted); }
.doc-panel code { color: var(--ink); font-size: .9em; }

.page-head { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 70px); padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.page-head h2 { font-size: clamp(2.2rem, 5vw, 4.7rem); }
.page-head p { max-width: 680px; color: var(--muted); font-size: 17px; }
.two-column { display: grid; grid-template-columns: minmax(300px, 500px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-sm); }
.form-panel, .output-panel, .edit-unlock { display: grid; gap: 22px; }
.output-panel { background: transparent; }
.field { display: grid; gap: 8px; }
label { color: var(--ink); font-size: 13px; font-weight: 700; }
.input { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 10px 12px; background: #0e1010; color: var(--ink); outline: none; transition: border-color 120ms var(--ease-standard), box-shadow 120ms var(--ease-standard); }
.input:focus, .text-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214,255,63,.1); }
.file-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.dropzone { display: grid; place-items: center; gap: 3px; min-height: 150px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: #0e1010; cursor: pointer; text-align: center; padding: 20px; transition: border-color 160ms var(--ease-standard), background-color 160ms var(--ease-standard); }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone span { font-size: 16px; font-weight: 700; }
.dropzone small, .file-meta, .hint, .empty, .credential-card { color: var(--muted); font-size: 13px; }
.compact-dropzone { min-height: 100px; }
.credential-card { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: #0e1010; padding: 13px 15px; }

.primary, .secondary { min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color 120ms var(--ease-standard), border-color 120ms var(--ease-standard), color 120ms var(--ease-standard), transform 120ms var(--ease-standard); }
.primary { background: var(--accent); color: #080808; }
.primary:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.secondary:hover:not(:disabled) { border-color: var(--ink); }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .35; }
.full { width: 100%; }
.split-actions > * { flex: 1 1 160px; }
.status { min-height: 20px; color: var(--muted); }
.status.err { color: var(--danger); }
.downloads { display: grid; gap: 10px; }
.download { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding: 16px 0; }
.download strong, .download code { display: block; overflow-wrap: anywhere; }
.download small { color: var(--muted); }
.warning { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding-top: 16px; }

.edit-credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.text-workspace { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.text-workspace[hidden], .render-document-sidebar[hidden], .rendered-page[hidden] { display: none; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.editor-page-navigation, .editor-page-title { padding: 15px 20px; border-bottom: 1px solid var(--line); }
.editor-page-navigation-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-page-navigation-head .secondary { padding: 7px 11px; }
.editor-page-navigation-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.editor-page-tab, .render-page-tab, .copy-list-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; padding: 7px 11px; transition: background-color 120ms var(--ease-standard), border-color 120ms var(--ease-standard), color 120ms var(--ease-standard); }
.editor-page-tab[aria-selected="true"], .render-page-tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.text-editor { display: block; width: 100%; min-height: 56vh; resize: vertical; border: 0; border-bottom: 1px solid var(--line); padding: 22px; background: #0b0b0b; color: var(--ink); font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; outline: none; }
.text-workspace > .status, .text-workspace > .downloads { margin: 12px 20px; }

#render .two-column { grid-template-columns: 1fr; }
#render .form-panel { max-width: 760px; }
.render-output-panel { min-height: 65vh; padding: clamp(24px, 4vw, 48px); background: var(--surface); }
.render-document-layout { display: grid; grid-template-columns: minmax(190px,240px) minmax(0,1fr); gap: clamp(28px,5vw,64px); align-items: start; }
.render-document-sidebar { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 124px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding-right: 10px; }
.render-document-sidebar[hidden] + .markdown-body { grid-column: 1/-1; }
.render-page-navigation { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.render-page-navigation-links, .render-navigation-links { display: grid; gap: 7px; margin-top: 9px; }
.render-page-tab { width: 100%; min-height: 38px; text-align: left; }
.render-navigation { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.render-navigation-links a { display: block; border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; line-height: 1.35; text-decoration: none; padding: 5px 7px; }
.render-navigation-links a:hover { background: var(--surface-hover); }
.render-navigation-links a:hover { color: var(--accent); }
.markdown-body { min-width: 0; line-height: 1.75; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body pre, .markdown-format-docs pre { border: 1px solid var(--line); background: #090909; overflow-x: auto; padding: 16px; }
.markdown-body blockquote { margin-left: 0; border-left: 2px solid var(--accent); padding-left: 16px; color: var(--muted); }
.markdown-body table { width: 100%; border-collapse: collapse; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 9px; text-align: left; }
.markdown-body img { max-width: 100%; height: auto; }
.markdown-body li { position: relative; padding-right: 68px; }
.copy-list-item { position: absolute; right: 0; top: 1px; font-size: 12px; padding: 4px 7px; }
.copy-list-item:hover { border-color: var(--accent); color: var(--accent); }
.clipboard-fallback { position: fixed; left: -9999px; top: 0; }
.markdown-format-docs { display: grid; gap: 20px; max-width: 880px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); }
.footer-inner div { display: flex; gap: 14px; align-items: baseline; }
.footer-inner strong { color: var(--ink); }
.footer-inner button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.footer-inner button:hover { color: var(--accent); }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, .dropzone:focus-within { outline: 3px solid rgba(214,255,63,.45); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 940px) {
  .header-inner { min-height: auto; padding: 18px 0 0; flex-wrap: wrap; gap: 16px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; gap: 24px; min-height: 46px; }
  .nav-cta { margin-left: auto; }
  .intro-layout, .two-column { grid-template-columns: 1fr; }
  .process-panel { max-width: 650px; }
  .docs-grid { grid-template-columns: 1fr; }
  .render-document-layout { grid-template-columns: 1fr; }
  .render-document-sidebar { position: static; max-height: none; overflow: visible; padding-right: 0; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 28px, 1180px); }
  .nav-cta { display: none; }
  .intro-layout { min-height: auto; }
  .screen { padding: 52px 0; }
  .process-panel { border-left: 0; border-top: 1px solid var(--line); padding: 30px 0 0; }
  .docs-grid { margin-top: 48px; }
  .edit-credential-grid { grid-template-columns: 1fr; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; }
  .download { grid-template-columns: 1fr; }
  .footer-inner, .footer-inner div { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; }
}
