  :root {
    --bg: #f6f3ec;
    --bg-2: #efeadf;
    --bg-elev: #fdfcf8;
    --ink: #1d1813;
    --ink-2: #4a4339;
    --ink-3: #877e6f;
    --ink-4: #b7ad9c;
    --line: #e0d8c6;
    --line-2: #cfc6b1;
    --accent: #2a8b46;
    --accent-bright: #41c363;
    --accent-soft: rgba(65, 195, 99, 0.14);
    --accent-2: #1d6a32;
    --code-bg: #ebe5d4;
    --code-ink: #2a241d;
    --shadow-sm: 0 1px 0 rgba(29,24,19,0.04);
    --shadow: 0 1px 2px rgba(29,24,19,0.06), 0 6px 24px -4px rgba(29,24,19,0.08);
    --shadow-lg: 0 8px 32px -4px rgba(29,24,19,0.18), 0 2px 6px rgba(29,24,19,0.08);
    --note-bg: #fbf3d8;
    --note-border: #c4a64a;
    --note-ink: #5a4a13;
    --important-bg: #fbe7df;
    --important-border: #c8553d;
    --important-ink: #6a261a;
    --tip-bg: #e3ebd9;
    --tip-border: #6b8e23;
    --tip-ink: #2f4111;
    --done: #41c363;
  }

  [data-theme="dark"] {
    --bg: #0e120f;
    --bg-2: #16191644;
    --bg-elev: #1a1f1c;
    --ink: #e8e8df;
    --ink-2: #b3b6ac;
    --ink-3: #7d8077;
    --ink-4: #4d4f48;
    --line: #25292545;
    --line-2: #353a35;
    --accent: #5fd47e;
    --accent-bright: #41c363;
    --accent-soft: rgba(95, 212, 126, 0.16);
    --accent-2: #8cdfa4;
    --code-bg: #181c19;
    --code-ink: #d8dcd0;
    --shadow-sm: 0 1px 0 rgba(0,0,0,0.3);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 24px -4px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 32px -4px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
    --note-bg: #2a2616;
    --note-border: #8a7a40;
    --note-ink: #e6d59a;
    --important-bg: #2e1c14;
    --important-border: #c8553d;
    --important-ink: #f3b9a6;
    --tip-bg: #1d2419;
    --tip-border: #6b8e23;
    --tip-ink: #c2d8a3;
    --done: #5fd47e;
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
    text-rendering: optimizeLegibility;
  }

  /* Subtle paper grain in light mode, less so in dark */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  [data-theme="dark"] body::before { opacity: 0.3; }

  /* === Top bar === */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--accent-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(29,24,19,0.08), inset 0 0 0 1px rgba(0,0,0,0.06);
  }
  .brand-mark svg {
    width: 16px;
    height: 16px;
    color: white;
  }
  [data-theme="dark"] .brand-mark { box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.08); }

  .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 2px;
  }
  .brand-name {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--ink);
  }
  .brand-name .slash {
    color: var(--accent-bright);
    font-weight: 700;
    margin-right: 1px;
  }
  .brand-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 500;
  }

  .topbar-spacer { flex: 1; }

  .topbar-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    white-space: nowrap;
  }
  .topbar-meta strong {
    color: var(--ink);
    font-weight: 500;
  }

  .icon-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-2);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
  }
  .icon-btn:hover {
    background: var(--bg-elev);
    color: var(--ink);
    border-color: var(--line-2);
  }
  .icon-btn svg { width: 16px; height: 16px; }

  .menu-btn { display: none; }

  .progress-bar-outer {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
  }
  .progress-bar-inner {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  /* === Layout === */
  .layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: calc(100vh - 64px);
    position: relative;
    z-index: 1;
  }

  /* === Sidebar === */
  .sidebar {
    border-right: 1px solid var(--line);
    padding: 32px 0 100px;
    background: var(--bg);
    position: sticky;
    top: 64px;
    align-self: start;
    height: calc(100vh - 64px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }

  .sidebar-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 28px 16px;
    font-weight: 500;
  }

  .toc-list {
    list-style: none;
    margin: 0;
    padding: 0 14px;
  }

  .toc-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.4;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-align: left;
    border: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
  }
  .toc-item:hover {
    background: var(--bg-2);
    color: var(--ink);
  }
  .toc-item.active {
    background: var(--accent-soft);
    color: var(--ink);
  }
  .toc-item.active .toc-num {
    color: var(--accent);
    font-weight: 600;
  }
  .toc-item.completed { color: var(--ink-3); }
  .toc-item.completed .toc-title { text-decoration: line-through; text-decoration-color: var(--ink-4); text-decoration-thickness: 1px; }

  .toc-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    flex-shrink: 0;
    width: 24px;
    padding-top: 2px;
  }
  .toc-num.intro { color: var(--ink-4); }

  .toc-title {
    flex: 1;
    word-break: break-word;
  }

  .toc-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 4px;
    border: 1.5px solid var(--line-2);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
  }
  .toc-check:hover { border-color: var(--ink-3); }
  .toc-check.checked {
    background: var(--done);
    border-color: var(--done);
    color: white;
  }
  .toc-check svg {
    width: 10px;
    height: 10px;
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .toc-check.checked svg { opacity: 1; }

  /* === Content === */
  .content {
    padding: 64px 96px 160px;
    width: 100%;
    position: relative;
    min-width: 0;        /* let grid item shrink below intrinsic content size */
  }
  .content > .step-content { min-width: 0; }

  .step-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  .step-eyebrow-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 500;
  }
  .step-eyebrow-line {
    flex: 1;
    height: 1px;
    background: var(--line);
  }

  .step-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(28px, 3.6vw, 42px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 32px;
    max-width: 28ch;
  }
  .step-title em { font-style: normal; color: var(--accent); }

  /* Markdown content styling */
  .md-content {
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--ink-2);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .md-content > *:first-child { margin-top: 0; }
  .md-content > *:last-child { margin-bottom: 0; }

  /* Constrain prose to a comfortable reading measure (~70 chars).
     Media elements (images, tables, code blocks, callouts) escape this
     constraint and use whatever width the page gives them. */
  .md-content > p,
  .md-content > ul,
  .md-content > ol,
  .md-content > h1,
  .md-content > h2,
  .md-content > h3,
  .md-content > h4,
  .md-content > h5,
  .md-content > h6 {
    max-width: 72ch;
  }

  /* Stand-alone images (unwrapped from <p>) get their own block frame */
  .md-content > .md-figure {
    margin: 1.6em 0;
  }
  .md-content > .md-figure img {
    display: block;
  }

  .md-content p {
    margin: 0 0 1.2em;
    color: var(--ink-2);
  }

  .md-content strong { color: var(--ink); font-weight: 600; }

  .md-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
    transition: border-color 0.15s ease;
  }
  .md-content a:hover { border-bottom-color: var(--accent); }

  .md-content h1, .md-content h2, .md-content h3, .md-content h4 {
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 2em 0 0.6em;
  }
  .md-content h2 { font-size: 22px; }
  .md-content h3 { font-size: 18px; }
  .md-content h4 { font-size: 16px; font-weight: 600; }

  .md-content ul, .md-content ol {
    margin: 0 0 1.4em;
    padding-left: 1.5em;
  }
  .md-content li {
    margin: 0.4em 0;
    color: var(--ink-2);
  }
  .md-content li::marker { color: var(--accent); }
  .md-content ul li { list-style: none; position: relative; }
  .md-content ul li::before {
    content: "";
    position: absolute;
    left: -1.1em;
    top: 0.7em;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
  }
  .md-content ol li { padding-left: 0.3em; }

  /* Inline code */
  .md-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86em;
    background: var(--code-bg);
    color: var(--code-ink);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--line);
    font-weight: 500;
  }
  .md-content a code { color: var(--accent); }

  /* Code blocks */
  .code-block {
    margin: 1.6em 0;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  .code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
  }
  .code-lang {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 500;
  }
  .code-copy {
    background: transparent;
    border: 1px solid var(--line-2);
    color: var(--ink-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.15s ease;
  }
  .code-copy:hover {
    background: var(--bg-elev);
    color: var(--ink);
    border-color: var(--ink-3);
  }
  .code-copy.copied {
    background: var(--done);
    color: white;
    border-color: var(--done);
  }
  .code-block pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--code-ink);
    background: var(--code-bg);
  }
  .code-block pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
  }

  /* Images */
  .md-content img,
  .md-content .img-link img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
    cursor: zoom-in;
    display: block;
    background: var(--bg-elev);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  /* Standalone images (not inside tables) display at one consistent width
     so screenshots have visual rhythm regardless of their native size. */
  .md-content > img,
  .md-content > .md-figure img,
  .md-content > .img-link img,
  .md-content > p > img {
    width: 100%;
    max-width: 720px;
  }
  .md-content img:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
  }
  .md-content .img-link {
    margin: 1.6em 0;
  }
  .md-content .img-link figcaption {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    margin-top: 10px;
    text-transform: uppercase;
  }
  .md-content p > img:only-child { margin: 1.6em 0; }

  /* Tables */
  .md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    font-size: 14.5px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-elev);
  }
  .md-content thead { background: var(--bg-2); }
  .md-content th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    letter-spacing: 0.02em;
  }
  .md-content td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
    vertical-align: top;
  }
  .md-content tr:last-child td { border-bottom: none; }
  .md-content table img { margin: 4px 0; }

  /* Callouts */
  .md-content .callout {
    margin: 1.6em 0;
    padding: 16px 20px 16px 22px;
    border-left: 3px solid;
    border-radius: 0 10px 10px 0;
    position: relative;
    max-width: 72ch;
  }
  .md-content .callout > *:first-child { margin-top: 0; }
  .md-content .callout > *:last-child { margin-bottom: 0; }
  .md-content .callout p { margin-bottom: 0.6em; }
  .md-content .callout p:last-child { margin-bottom: 0; }
  .md-content .callout strong:first-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 4px;
  }

  .md-content .callout-note {
    background: var(--note-bg);
    border-color: var(--note-border);
    color: var(--note-ink);
  }
  .md-content .callout-note strong { color: var(--note-ink); }
  .md-content .callout-note a { color: var(--note-ink); border-bottom-color: rgba(0,0,0,0.2); }

  .md-content .callout-important {
    background: var(--important-bg);
    border-color: var(--important-border);
    color: var(--important-ink);
  }
  .md-content .callout-important strong { color: var(--important-ink); }
  .md-content .callout-important a { color: var(--important-ink); border-bottom-color: rgba(0,0,0,0.2); }

  .md-content .callout-tip {
    background: var(--tip-bg);
    border-color: var(--tip-border);
    color: var(--tip-ink);
  }
  .md-content .callout-tip strong { color: var(--tip-ink); }
  .md-content .callout-tip a { color: var(--tip-ink); border-bottom-color: rgba(0,0,0,0.2); }

  /* Horizontal rule */
  .md-content hr {
    border: none;
    height: 1px;
    background: var(--line);
    margin: 2.4em 0;
  }

  /* Step nav (bottom) */
  .step-nav {
    position: sticky;
    bottom: 0;
    margin-top: 64px;
    padding: 18px 0 24px;
    background: linear-gradient(to top, var(--bg) 75%, transparent);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 30;
    max-width: 880px;
  }
  .step-nav-btn {
    flex: 1;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .step-nav-btn:hover:not(:disabled) {
    border-color: var(--ink-3);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
  }
  .step-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .step-nav-btn.next {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    text-align: right;
    flex-direction: row-reverse;
  }
  [data-theme="dark"] .step-nav-btn.next {
    background: var(--accent);
    color: #1a0e09;
    border-color: var(--accent);
  }
  .step-nav-btn.next:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
  }
  .step-nav-arrow { flex-shrink: 0; opacity: 0.6; }
  .step-nav-btn:hover .step-nav-arrow { opacity: 1; }
  .step-nav-text { min-width: 0; flex: 1; }
  .step-nav-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.6;
    display: block;
    margin-bottom: 2px;
  }
  .step-nav-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .complete-btn {
    background: transparent;
    border: 1.5px solid var(--line-2);
    color: var(--ink-2);
    padding: 14px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .complete-btn:hover {
    border-color: var(--done);
    color: var(--done);
  }
  .complete-btn.completed {
    background: var(--done);
    border-color: var(--done);
    color: white;
  }
  .complete-btn svg { width: 14px; height: 14px; }

  /* === Lightbox === */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 10, 0.92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .lightbox.open {
    opacity: 1;
    pointer-events: auto;
  }
  .lightbox img {
    max-width: 95%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  }
  .lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
  }
  .lightbox-close:hover { background: rgba(255,255,255,0.2); }

  /* === Lead-capture modal === */
  .lead-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 10, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .lead-modal.open { opacity: 1; pointer-events: auto; }
  .lead-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    padding: 32px 32px 28px;
    transform: translateY(8px);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .lead-modal.open .lead-card { transform: translateY(0); }
  .lead-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 10px;
  }
  .lead-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
  }
  .lead-desc {
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.55;
    margin: 0 0 22px;
  }
  .lead-form { display: flex; flex-direction: column; gap: 12px; }
  .lead-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .lead-field { display: flex; flex-direction: column; gap: 4px; }
  .lead-field span {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 500;
    letter-spacing: 0.02em;
  }
  .lead-field input {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
  }
  .lead-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .lead-field input.invalid {
    border-color: #c8553d;
  }
  .lead-field-error {
    font-size: 11px;
    color: #c8553d;
    margin-top: 2px;
    min-height: 0;
  }
  .lead-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
  }
  .lead-skip,
  .lead-submit {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .lead-skip {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink-3);
  }
  .lead-skip:hover { color: var(--ink); }
  .lead-submit {
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
  }
  [data-theme="dark"] .lead-submit {
    background: var(--accent);
    color: #0a0d0a;
    border-color: var(--accent);
  }
  .lead-submit:hover { background: var(--accent); border-color: var(--accent); color: white; }
  .lead-submit:disabled { opacity: 0.6; cursor: wait; }
  .lead-foot {
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 16px;
    line-height: 1.4;
    text-align: center;
  }

  @media (max-width: 480px) {
    .lead-card { padding: 24px 20px; max-width: 100%; }
    .lead-row { grid-template-columns: 1fr; }
  }

  /* === Landing page (no src) === */
  .landing {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 32px 120px;
    position: relative;
    z-index: 1;
  }
  .landing-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
  }
  .landing-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin: 0 0 24px;
    max-width: 18ch;
  }
  .landing-title em { font-style: normal; color: var(--accent); }
  .landing-desc {
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-2);
    margin: 0 0 40px;
    max-width: 560px;
  }
  .landing-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
  }
  .landing-form input {
    flex: 1;
    padding: 14px 18px;
    border: 1.5px solid var(--line-2);
    border-radius: 10px;
    background: var(--bg-elev);
    color: var(--ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
    min-width: 0;
  }
  .landing-form input:focus { border-color: var(--accent); }
  .landing-form button {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    background: var(--ink);
    color: var(--bg);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
  }
  .landing-form button:hover { background: var(--accent); color: white; }
  .landing-hint {
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 48px;
  }
  .landing-hint code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--ink-2);
  }
  .landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  .landing-feature {
    background: var(--bg);
    padding: 24px;
  }
  .landing-feature-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 8px;
  }
  .landing-feature-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
  }
  .landing-feature-desc {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.5;
  }

  /* === Loading & error === */
  .state {
    max-width: 600px;
    margin: 0 auto;
    padding: 120px 32px;
    text-align: center;
    position: relative;
    z-index: 1;
  }
  .state-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 16px;
  }
  .state-eyebrow.loading { color: var(--ink-3); }
  .state-eyebrow.error { color: var(--accent); }
  .state-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 28px;
    color: var(--ink);
    margin: 0 0 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .state-desc {
    color: var(--ink-2);
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .state-back {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
    font-size: 14px;
  }

  .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* === Mobile === */
  @media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 0 18px; gap: 12px; }
    .topbar-meta { display: none; }

    .sidebar {
      position: fixed;
      top: 64px;
      left: 0;
      width: 320px;
      max-width: 85vw;
      height: calc(100vh - 64px);
      background: var(--bg);
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      z-index: 40;
      box-shadow: var(--shadow-lg);
      border-right: 1px solid var(--line);
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-backdrop {
      position: fixed;
      inset: 64px 0 0 0;
      background: rgba(0,0,0,0.4);
      z-index: 35;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }
    .sidebar-backdrop.open {
      opacity: 1;
      pointer-events: auto;
    }

    .content {
      padding: 36px 22px 140px;
    }
    .step-title { font-size: 36px; }
    .md-content { font-size: 16px; }

    .step-nav { padding: 16px 0 18px; }
    .step-nav-btn { padding: 12px 14px; font-size: 13px; }
    .complete-btn { padding: 12px 14px; font-size: 13px; }
    .complete-btn span { display: none; }

    .landing { padding: 48px 22px 100px; }
  }

  @media (max-width: 480px) {
    .step-nav { gap: 8px; }
    .step-nav-btn .step-nav-label { display: none; }
  }

  /* Animations */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .step-content {
    animation: fadeUp 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  /* Accessibility */
  *:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  .toc-item:focus-visible { outline-offset: -2px; }

  /* Hide JS-controlled elements during load to prevent flash */
  .hidden { display: none !important; }

.broadcast-toast {
  position: fixed; top: 80px; right: 20px; z-index: 300;
  background: var(--accent); color: white;
  padding: 14px 18px; border-radius: 10px; box-shadow: var(--shadow-lg);
  max-width: 360px; font-size: 14px; font-weight: 500;
  cursor: pointer;
  animation: fadeUp 0.3s ease;
}
.broadcast-toast[hidden] { display: none; }
