/* ═══════════════════════════════════════════════════════════════════════════
   M4BConvert — "How to Convert M4B to MP3" Article Styles
   Extracted from this page's previously-inline <style> block. Reuses the
   shared token system declared in index.css (:root).
   ═══════════════════════════════════════════════════════════════════════════ */

.docs-main {
      flex: 1;
      width: 100%;
      max-width: 1100px;
      margin: 0 auto;
      padding: 2.75rem 1.5rem 5rem;
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      grid-template-rows: auto 1fr;
      grid-template-areas: "header header" "toc article";
      gap: 0 3rem;
      align-items: start;
    }

    /* Page header — spans both columns */
    .docs-page-header {
      grid-area: header;
      max-width: 700px;
      padding-bottom: 2.25rem;
    }

    /* Sidebar TOC */
    .docs-toc {
      grid-area: toc;
      position: sticky;
      top: 76px;
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
    }
    .docs-toc-label {
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--text-dim);
      margin-bottom: 0.6rem;
    }
    .docs-toc a {
      font-size: 0.83rem;
      color: var(--text-muted);
      text-decoration: none;
      padding: 0.4rem 0.6rem;
      border-radius: var(--radius);
      border-left: 2px solid transparent;
    }
    .docs-toc a:hover { color: var(--text); background: var(--bg-hover); }

    /* Article */
    .docs-article { grid-area: article; max-width: 700px; }

    /* Header typography */
    .docs-breadcrumb {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.78rem;
      font-weight: 500;
      color: var(--text-dim);
      text-decoration: none;
      margin-bottom: 1rem;
    }
    .docs-breadcrumb:hover { color: var(--text-muted); }
    .docs-breadcrumb span { display: inline-flex; }

    .docs-eyebrow {
      font-size: 0.72rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent-light);
      margin-bottom: 0.75rem;
    }
    .docs-page-header h1 {
      font-size: clamp(1.7rem, 4vw, 2rem);
      font-weight: 800;
      letter-spacing: -0.02em;
      line-height: 1.18;
      margin-bottom: 0.75rem;
    }
    .docs-lede {
      font-size: 1.02rem;
      color: var(--text-muted);
      line-height: 1.65;
      margin-bottom: 0.75rem;
    }
    .docs-meta {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: 0.78rem;
      color: var(--text-dim);
    }

    /* Sections */
    .docs-section { margin-bottom: 3rem; scroll-margin-top: 80px; }
    .docs-section h2 {
      font-size: 1.3rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      margin-bottom: 0.9rem;
      padding-bottom: 0.7rem;
      border-bottom: 1px solid var(--border);
    }
    .docs-section h3 { font-size: 1rem; font-weight: 600; margin: 1.6rem 0 0.6rem; color: var(--text); }
    .docs-h4 {
      font-size: 0.84rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      margin: 1.3rem 0 0.6rem;
      color: var(--text);
    }
    .docs-section p { font-size: 0.92rem; line-height: 1.72; color: var(--text-muted); margin-bottom: 1rem; }
    .docs-section ul, .docs-section ol { margin: 0 0 1rem 1.2rem; font-size: 0.92rem; line-height: 1.72; color: var(--text-muted); }
    .docs-section li { margin-bottom: 0.4rem; }
    .docs-section strong { color: var(--text); font-weight: 600; }
    .docs-section a { color: var(--accent-light); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
    .docs-section a:hover { border-bottom-color: var(--accent-light); }
    .docs-section code {
      font-family: var(--font-mono);
      font-size: 0.82em;
      background: var(--bg-input);
      border: 1px solid var(--border-soft);
      border-radius: 4px;
      padding: 0.1em 0.4em;
      color: var(--accent-light);
      overflow-wrap: break-word;
    }

    /* Callouts — uniform border, no left accent */
    .docs-callout {
      display: flex;
      gap: 0.75rem;
      padding: 0.95rem 1.1rem;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      background: var(--bg-panel);
      margin: 1.25rem 0;
      font-size: 0.87rem;
      line-height: 1.6;
      color: var(--text-muted);
    }
    .docs-callout > span:last-child { flex: 1; min-width: 0; }
    .docs-callout.tip { border-color: rgba(52,211,153,0.25); background: var(--success-bg); }
    .docs-callout.tip strong { color: var(--success); }
    .docs-callout.warn { border-color: rgba(251,191,36,0.25); background: var(--warn-bg); }
    .docs-callout.warn strong { color: var(--warn); }
    .docs-callout-icon { flex-shrink: 0; margin-top: 0.1rem; }
    .docs-callout.tip .docs-callout-icon { color: var(--success); }
    .docs-callout.warn .docs-callout-icon { color: var(--warn); }

    /* Code blocks */
    .code-block {
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      margin: 1.4rem 0;
      overflow: hidden;
    }
    .code-block-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.6rem 0.9rem;
      background: var(--bg-panel);
      border-bottom: 1px solid var(--border);
    }
    .code-block-label {
      font-family: var(--font-mono);
      font-size: 0.74rem;
      color: var(--text-dim);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .code-block-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
    .copy-btn {
      font-size: 0.74rem;
      font-family: var(--font-sans);
      font-weight: 500;
      color: var(--text-dim);
      background: none;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.25rem 0.6rem;
      cursor: pointer;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
    }
    .copy-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-hover); }
    .copy-btn.copied { color: var(--success); border-color: var(--success); }
    .code-block pre {
      font-family: var(--font-mono);
      font-size: 0.82rem;
      line-height: 1.65;
      color: var(--text-muted);
      padding: 1.15rem 1rem;
      overflow-x: auto;
      tab-size: 2;
    }
    .code-block pre .cm { color: var(--text-dim); font-style: italic; }
    .code-block pre .kw { color: var(--accent-light); }
    .code-block pre .st { color: var(--success); }
    .code-block pre .nm { color: var(--warn); }

    /* Article figures — real screenshots, same-folder, .webp.
       If the file hasn't been added yet, the <img> fails to load and
       onerror swaps in a dashed fallback panel naming the expected file,
       so the article still reads cleanly either way. */
    .docs-figure { margin: 1.75rem 0; }
    .docs-figure img {
      display: block;
      width: 100%;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      background: var(--bg-panel);
    }
    .docs-figure figcaption {
      font-size: 0.8rem;
      color: var(--text-dim);
      margin-top: 0.65rem;
      text-align: center;
      font-style: italic;
      line-height: 1.5;
    }
    .docs-figure-fallback { display: none; }
    .docs-figure.is-missing img { display: none; }
    .docs-figure.is-missing .docs-figure-fallback {
      display: block;
      background: var(--bg-panel);
      border: 1px dashed var(--border-strong);
      border-radius: var(--radius-lg);
      padding: 2.25rem 1.5rem;
      text-align: center;
    }
    .docs-figure-fallback-icon { width: 36px; height: 36px; margin: 0 auto 0.875rem; color: var(--text-dim); }
    .docs-figure-fallback strong {
      display: block;
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-dim);
      margin-bottom: 0.4rem;
    }
    .docs-figure-fallback p { font-size: 0.83rem; color: var(--text-dim); margin: 0; }

    /* CTA panels */
    .cta-box {
      background: var(--bg-panel);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 1.4rem 1.6rem;
      margin: 2rem 0;
      display: flex;
      gap: 1.1rem;
      align-items: flex-start;
    }
    .cta-box-icon {
      flex-shrink: 0;
      width: 38px; height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius);
      background: var(--bg-raised);
      border: 1px solid var(--border);
      color: var(--text-muted);
    }
    .cta-box-title { font-size: 0.98rem; font-weight: 700; color: var(--text); margin-bottom: 0.35rem; }
    .cta-box-body { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
    a.cta-btn,
    .cta-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--primary-ink);
      background: var(--primary);
      text-decoration: none;
      border: none;
      padding: 0.55rem 1.1rem;
      border-radius: var(--radius);
      transition: background 0.15s;
      cursor: pointer;
    }
    a.cta-btn:hover,
    .cta-btn:hover { background: var(--primary-hover); color: var(--primary-ink); border-bottom: none; }

    /* Numbered steps */
    .steps { display: flex; flex-direction: column; gap: 1.4rem; margin-bottom: 1.4rem; }
    .step { display: flex; gap: 1rem; align-items: flex-start; }
    .step-content { flex: 1; min-width: 0; }
    .step-num {
      flex-shrink: 0;
      width: 26px; height: 26px;
      background: var(--bg-raised);
      border: 1px solid var(--border-strong);
      color: var(--text);
      border-radius: 50%;
      font-size: 0.76rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 0.15rem;
    }
    .step-content p { margin-bottom: 0.5rem; }
    .step-content p:last-child { margin-bottom: 0; }

    hr.section-divider { border: none; border-top: 1px solid var(--border-soft); margin: 3rem 0; }

    @media (max-width: 820px) {
      .docs-main {
        /* minmax(0,1fr) lets the column shrink below content min-width,
           preventing long code lines / headings from pushing the page wider */
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "header" "toc" "article";
        padding: 1.5rem 1.1rem 3rem;
      }
      /* Every direct grid child needs min-width:0 so it can shrink */
      .docs-page-header,
      .docs-toc,
      .docs-article {
        min-width: 0;
        max-width: 100%;
      }
      .docs-page-header { padding-bottom: 1.5rem; }
      /* Prevent the long h1 from ever overflowing the column */
      .docs-page-header h1 {
        font-size: 1.4rem;
        overflow-wrap: break-word;
        word-break: break-word;
      }
      .docs-lede { font-size: 0.93rem; }
      .docs-toc {
        position: static;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--bg-panel);
        padding: 1rem 1.25rem;
        margin-bottom: 2rem;
      }
      /* Code blocks: constrain width and allow horizontal touch-scroll */
      .code-block {
        max-width: 100%;
      }
      .code-block pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
      }
      .cta-box { flex-direction: column; }
    }
