    /* ══════════════════════════════════════════════════════════════════
       Base tokens & reset — same design language as docs/index.html,
       extended with: language switch, export menu, screenshot placeholders,
       collapsible sidebar parts, and a dedicated print stylesheet.
       ══════════════════════════════════════════════════════════════════ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: 'Inter', system-ui, sans-serif;
      font-size: 15px;
      line-height: 1.65;
      color: var(--text);
      background: var(--ground);
    }
    a { color: inherit; text-decoration: none; }
    img { max-width: 100%; display: block; }
    code { font-family: 'JetBrains Mono', monospace; }

    :root {
      --sidebar-bg: #0F172A;
      --sidebar-text: #94A3B8;
      --accent: #0d6efd;
      --accent-dark: #0a58ca;
      --accent-subtle: #EFF6FF;
      --ground: #FFFFFF;
      --surface: #F8FAFC;
      --surface-2: #F1F5F9;
      --text: #0F172A;
      --muted: #64748B;
      --border: #E2E8F0;
      --blue: #2563EB;
      --blue-subtle: #EFF6FF;
      --green: #059669;
      --green-subtle: #ECFDF5;
      --red: #DC2626;
      --red-subtle: #FEF2F2;
      --purple: #7C3AED;
      --purple-subtle: #F5F3FF;
      --teal: #0D9488;
      --teal-subtle: #F0FDFA;
      --amber: #B45309;
      --amber-subtle: #FFFBEB;
      --code-bg: #1E293B;
      --code-text: #E2E8F0;
      --sidebar-width: 292px;
      --topbar-h: 56px;
      --content-max: 860px;
      --radius: 8px;
    }

    .layout { display: flex; min-height: 100vh; }

    /* ── Sidebar ── */
    .sidebar {
      position: fixed; top: 0; left: 0;
      width: var(--sidebar-width); height: 100vh;
      background: var(--sidebar-bg);
      overflow-y: auto; overflow-x: hidden;
      display: flex; flex-direction: column;
      z-index: 100;
      scrollbar-width: thin; scrollbar-color: #334155 transparent;
    }
    .sidebar::-webkit-scrollbar { width: 4px; }
    .sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

    .sidebar-logo {
      display: flex; align-items: center; gap: 10px;
      padding: 20px 18px 16px;
      border-bottom: 1px solid #1E293B;
    }
    .sidebar-logo-icon {
      width: 32px; height: 32px; background: var(--accent); border-radius: 7px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .sidebar-logo-icon i { color: #fff; font-size: 15px; }
    .sidebar-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
    .sidebar-logo-name {
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14.5px;
      color: #F1F5F9; letter-spacing: -0.01em;
    }
    .sidebar-logo-version { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); letter-spacing: 0.04em; }

    /* ── Quick Start / Full Documentation switcher ── */
    .doc-switcher {
      display: flex; gap: 4px; margin: 14px 16px 2px; background: #1E293B; border-radius: 8px; padding: 3px;
    }
    .doc-switcher a {
      flex: 1; text-align: center; padding: 6px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
      color: #94A3B8; transition: background 0.15s, color 0.15s;
    }
    .doc-switcher a.active { background: var(--accent); color: #fff; }
    .doc-switcher a:hover:not(.active) { color: #E2E8F0; }

    .sidebar-nav { padding: 8px 0 24px; flex: 1; }

    .sidebar-part {
      display: flex; align-items: center; justify-content: space-between;
      width: 100%; background: none; border: none; cursor: pointer;
      padding: 14px 18px 6px; text-align: left;
    }
    .sidebar-part-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
      color: #64748B;
    }
    .sidebar-part i.chev { font-size: 9px; color: #475569; transition: transform 0.15s; }
    .sidebar-part[aria-expanded="false"] i.chev { transform: rotate(-90deg); }
    .sidebar-part-links { display: flex; flex-direction: column; overflow: hidden; }
    .sidebar-part-links.collapsed { display: none; }

    .sidebar-link {
      display: flex; align-items: center; gap: 9px;
      padding: 6px 18px 6px 22px;
      color: var(--sidebar-text); font-size: 12.5px; font-weight: 500;
      transition: color 0.15s, background 0.15s, border-color 0.15s;
      border-left: 2px solid transparent;
      cursor: pointer;
    }
    .sidebar-link i { width: 14px; font-size: 11px; opacity: 0.7; flex-shrink: 0; }
    .sidebar-link:hover { color: #E2E8F0; background: rgba(255,255,255,0.04); }
    .sidebar-link.active { color: #fff; border-left-color: var(--accent); background: rgba(13,110,253,0.15); }
    .sidebar-link.active i { opacity: 1; }
    .sidebar-num {
      font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #475569; width: 20px; flex-shrink: 0;
    }
    .sidebar-link.active .sidebar-num { color: var(--accent); }

    /* ── Main area ── */
    .main { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; }

    /* ── Topbar ── */
    .topbar {
      position: sticky; top: 0; z-index: 90; height: var(--topbar-h);
      background: rgba(255,255,255,0.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 28px; gap: 12px;
    }
    .topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
    .topbar-breadcrumb span { color: var(--border); }
    .topbar-breadcrumb .crumb-active {
      color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw;
    }
    .topbar-right { display: flex; align-items: center; gap: 8px; }


    /* ── Export dropdown ── */
    .export-wrap { position: relative; }
    .export-btn {
      display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 6px;
      background: var(--accent); color: #fff; font-weight: 600; font-size: 12.5px; border: none; cursor: pointer;
      transition: background 0.15s;
    }
    .export-btn:hover { background: var(--accent-dark); }
    .export-menu {
      position: absolute; top: calc(100% + 8px); right: 0; width: 232px;
      background: var(--ground); border: 1px solid var(--border); border-radius: 10px;
      box-shadow: 0 12px 32px rgba(15,23,42,0.16);
      padding: 6px; display: none; flex-direction: column; z-index: 200;
    }
    .export-menu.open { display: flex; }
    .export-item {
      display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 7px;
      cursor: pointer; background: none; border: none; text-align: left; width: 100%; font-family: inherit;
    }
    .export-item:hover { background: var(--surface-2); }
    .export-item i { color: var(--accent); font-size: 13px; margin-top: 2px; width: 16px; }
    .export-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
    .export-item-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

    .theme-toggle {
      background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
      padding: 6px 8px; border-radius: 6px; color: var(--muted); transition: background 0.15s, color 0.15s;
    }
    .theme-toggle:hover { background: var(--surface-2); color: var(--text); }
    /* Sun = currently light, Moon = currently dark. No bare ".theme-toggle svg"
       rule here on purpose — it used to force display:block on BOTH icons at
       once (element+class beats a single class in specificity), which is why
       both were visible in light mode; each icon's own visible/hidden state is
       now the only rule controlling it. */
    .icon-sun { display: block; }
    .icon-moon { display: none; }
    [data-theme="dark"] .icon-sun { display: none; }
    [data-theme="dark"] .icon-moon { display: block; }

    .menu-toggle {
      background: none; border: none; cursor: pointer; color: var(--text); font-size: 18px; padding: 4px 8px; border-radius: 6px;
    }
    .menu-toggle:hover { background: var(--surface-2); }

    /* ── Content ── */
    .content { flex: 1; padding: 0 32px 80px; }
    .content-inner { max-width: var(--content-max); margin: 0 auto; }

    .part-marker {
      display: flex; align-items: center; gap: 12px;
      margin: 56px 0 8px; padding-top: 40px;
    }
    .part-marker:first-of-type { padding-top: 0; margin-top: 0; }
    .part-marker-num {
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 13px; color: #fff;
      background: var(--text); border-radius: 6px; padding: 4px 10px; letter-spacing: 0.04em;
    }
    .part-marker-title {
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; color: var(--muted);
      text-transform: uppercase; letter-spacing: 0.08em;
    }
    .part-marker-line { flex: 1; height: 1px; background: var(--border); }

    .doc-section {
      scroll-margin-top: calc(var(--topbar-h) + 16px);
      padding-top: 52px;
    }
    .doc-section + .doc-section { border-top: 1px solid var(--border); }

    .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px; }
    .chapter-num { font-family: 'JetBrains Mono', monospace; color: var(--muted); font-weight: 500; }

    .section-title {
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 27px; line-height: 1.2;
      letter-spacing: -0.02em; color: var(--text); margin-bottom: 12px;
    }
    .section-lead { font-size: 16px; color: var(--muted); line-height: 1.7; margin-bottom: 28px; max-width: 700px; }

    .subsection-title {
      font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16.5px; color: var(--text);
      margin: 30px 0 12px; padding-left: 14px; position: relative;
      display: flex; align-items: center; gap: 8px;
    }
    .subsection-title::before {
      content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
      background: var(--accent); border-radius: 2px;
    }
    .subsection-title i { color: var(--accent); font-size: 14px; }

    .doc-p { font-size: 14.5px; color: var(--text); line-height: 1.78; margin-bottom: 15px; }
    .doc-p:last-child { margin-bottom: 0; }
    .doc-p a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
    .doc-p strong { font-weight: 600; }

    .doc-list { list-style: none; display: flex; flex-direction: column; gap: 9px; padding: 0; margin: 14px 0 20px; }
    .doc-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); line-height: 1.65; }
    .doc-list li::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; margin-top: 8px; }
    .doc-list li strong { font-weight: 600; }

    /* ── Feature / concept cards ── */
    .feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 20px 0; }
    @media (max-width: 680px) { .feature-grid { grid-template-columns: 1fr; } }
    .feature-card { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
    .feature-card-icon {
      width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
      margin-bottom: 10px; font-size: 14px;
    }
    .icon-amber  { background: var(--accent-subtle); color: var(--accent-dark); }
    .icon-blue   { background: var(--blue-subtle);   color: var(--blue); }
    .icon-green  { background: var(--green-subtle);  color: var(--green); }
    .icon-red    { background: var(--red-subtle);    color: var(--red); }
    .icon-purple { background: var(--purple-subtle); color: var(--purple); }
    .icon-teal   { background: var(--teal-subtle);   color: var(--teal); }
    .feature-card-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 5px; }
    .feature-card-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

    /* ── Use-case cards (persona-driven scenarios) ── */
    .usecase-card {
      display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
      border: 1px solid var(--border); background: var(--surface); margin-bottom: 12px;
    }
    .usecase-avatar {
      width: 34px; height: 34px; border-radius: 50%; background: var(--accent-subtle); color: var(--accent-dark);
      display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
    }
    .usecase-role { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 3px; }
    .usecase-text { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

    /* ── Callouts ── */
    .callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border-left: 3px solid; margin: 18px 0; font-size: 13.5px; }
    .callout-amber { background: var(--accent-subtle); border-color: var(--accent); color: #1E3A8A; }
    .callout-blue  { background: var(--blue-subtle);   border-color: var(--blue);   color: #1E3A8A; }
    .callout-green { background: var(--green-subtle);  border-color: var(--green);  color: #064E3B; }
    .callout-red   { background: var(--red-subtle);    border-color: var(--red);    color: #7F1D1D; }
    .callout-icon { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
    .callout-body { flex: 1; line-height: 1.6; }
    .callout-body strong { display: block; font-weight: 600; margin-bottom: 3px; }

    /* ── Roles/permissions table ── */
    .table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 18px 0; overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; font-size: 13px; }
    th { background: var(--surface-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 9px 14px; text-align: left; }
    td { padding: 10px 14px; color: var(--text); border-top: 1px solid var(--border); vertical-align: top; }
    tr:hover td { background: var(--surface); }
    .mono-badge {
      font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 500; background: var(--accent-subtle);
      color: var(--accent-dark); border: 1px solid #BFDBFE; padding: 2px 7px; border-radius: 5px; white-space: nowrap;
    }
    .inline-code {
      font-family: 'JetBrains Mono', monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border);
      padding: 1px 6px; border-radius: 4px; color: var(--text);
    }

    /* ── Screenshot media — captured images, click to enlarge ── */
    .shot-media { margin: 20px 0 26px; }
    .shot-media-frame {
      border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
      cursor: zoom-in; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
    }
    .shot-media-frame:hover { border-color: var(--accent); box-shadow: 0 8px 28px rgba(13,110,253,0.14); }
    .shot-media-img { width: 100%; max-height: 620px; object-fit: contain; display: block; background: var(--ground); }

    /* ── Fullscreen lightbox for screenshot slots ── */
    .lightbox {
      position: fixed; inset: 0; background: rgba(2,6,23,0.92); display: none; align-items: center; justify-content: center;
      z-index: 500; padding: 40px; cursor: zoom-out;
    }
    .lightbox.open { display: flex; }
    .lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); cursor: default; }
    .lightbox-close {
      position: absolute; top: 20px; right: 24px; background: rgba(255,255,255,0.12); border: none; color: #fff;
      width: 38px; height: 38px; border-radius: 50%; font-size: 16px; cursor: pointer; transition: background 0.15s;
    }
    .lightbox-close:hover { background: rgba(255,255,255,0.24); }

    /* ── Concept / "why" panel ── */
    .why-panel {
      border: 1px solid var(--border); border-left: 4px solid var(--text); background: var(--surface);
      border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 18px; margin: 18px 0 22px;
    }
    .why-panel-label {
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 11.5px; text-transform: uppercase;
      letter-spacing: 0.07em; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
    }
    .why-panel-body { font-size: 14px; color: var(--text); line-height: 1.7; }

    /* ── Step list (numbered flow) ── */
    .flow-steps { display: flex; flex-direction: column; gap: 16px; margin: 18px 0; }
    .flow-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
    .flow-num {
      width: 26px; height: 26px; background: var(--accent); border-radius: 50%; display: flex; align-items: center;
      justify-content: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 12px; color: #fff;
      flex-shrink: 0; margin-top: 1px;
    }
    .flow-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 3px; }
    .flow-desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

    /* ── Chapter footer nav (prev/next) ── */
    .chapter-footnote {
      margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--border);
      font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px;
    }
    .chapter-footnote i { color: var(--accent); }

    /* ── Table of contents ── screen-hidden on purpose: the sidebar already
       serves as the on-screen ToC, so this one only exists for the exports
       (PDF via print, and the Markdown download), where there's no sidebar. */
    #toc { display: none; }
    .toc-part { margin-bottom: 26px; }
    .toc-part-title {
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 12.5px; text-transform: uppercase;
      letter-spacing: 0.07em; color: var(--accent-dark); margin-bottom: 10px; padding-bottom: 7px;
      border-bottom: 1px solid var(--border);
    }
    .toc-list {
      list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px;
    }
    .toc-list li a {
      display: flex; align-items: baseline; gap: 9px; padding: 5px 0; font-size: 13.5px; color: var(--text);
      border-bottom: 1px dotted transparent; transition: border-color 0.15s, color 0.15s;
    }
    .toc-list li a:hover { color: var(--blue); border-color: var(--blue); }
    .toc-num {
      font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); flex-shrink: 0; width: 16px;
    }
    @media (max-width: 680px) { .toc-list { grid-template-columns: 1fr; } }

    /* ── Glossary / appendix table styling reuse ── */
    .glossary-term { font-weight: 700; font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; white-space: nowrap; }

    /* ── Footer ── */
    .doc-footer { border-top: 1px solid var(--border); padding: 40px 32px; background: var(--surface); margin-left: var(--sidebar-width); }
    .doc-footer-inner { max-width: var(--content-max); margin: 0 auto; }
    .footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
    .footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .footer-brand-icon { width: 28px; height: 28px; background: var(--accent); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
    .footer-brand-icon i { font-size: 13px; color: #fff; }
    .footer-brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; }
    .footer-meta { font-size: 12.5px; color: var(--muted); line-height: 1.8; max-width: 460px; }
    .footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
    .footer-link { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; transition: color 0.15s; }
    .footer-link:hover { color: var(--text); }
    .footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-top: 22px; border-top: 1px solid var(--border); }
    @media (max-width: 780px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
    .footer-col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 10px; }
    .footer-col a { display: block; font-size: 12.5px; color: var(--text); opacity: 0.8; margin-bottom: 7px; }
    .footer-col a:hover { opacity: 1; color: var(--blue); }
    .footer-bottom { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

    /* ── Responsive ── */
    @media (max-width: 840px) {
      .sidebar { position: fixed; transform: translateX(-100%); transition: transform 0.25s; }
      .sidebar.open { transform: translateX(0); }
      .main { margin-left: 0; }
      .doc-footer { margin-left: 0; }
      .topbar { padding: 0 16px; }
      .content { padding: 0 16px 80px; }
      .menu-toggle { display: flex; }
      .footer-cols { grid-template-columns: 1fr 1fr; }
    }
    @media (min-width: 841px) { .menu-toggle { display: none; } }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { transition: none !important; animation: none !important; }
      html { scroll-behavior: auto; }
    }
    :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

    /* ── Dark mode ── */
    [data-theme="dark"] {
      --ground: #0F172A; --surface: #1E293B; --surface-2: #334155;
      --text: #F1F5F9; --muted: #94A3B8; --border: #1E293B;
      --blue: #60A5FA; --blue-subtle: rgba(37,99,235,0.18);
      --accent: #3B82F6; --accent-dark: #60A5FA; --accent-subtle: rgba(37,99,235,0.14);
      --green: #34D399; --green-subtle: rgba(5,150,105,0.15);
      --red: #F87171; --red-subtle: rgba(220,38,38,0.15);
      --purple: #A78BFA; --purple-subtle: rgba(124,58,237,0.15);
      --teal: #2DD4BF; --teal-subtle: rgba(13,148,136,0.15);
      --amber: #FBBF24; --amber-subtle: rgba(180,83,9,0.15);
      --code-bg: #020617; --code-text: #CBD5E1;
    }
    [data-theme="dark"] .topbar { background: rgba(15,23,42,0.97); border-bottom-color: #1E293B; }
    [data-theme="dark"] .sidebar { background: #020617; }
    [data-theme="dark"] .doc-footer { background: #0a0f1a; border-top-color: #1E293B; }
    [data-theme="dark"] .doc-section + .doc-section { border-top-color: #1E293B; }
    [data-theme="dark"] .feature-card, [data-theme="dark"] .usecase-card, [data-theme="dark"] .why-panel { background: #1E293B; border-color: #334155; }
    [data-theme="dark"] .callout-amber { background: rgba(37,99,235,0.12); color: #93C5FD; }
    [data-theme="dark"] .callout-blue  { background: rgba(37,99,235,0.12); color: #93C5FD; }
    [data-theme="dark"] .callout-green { background: rgba(5,150,105,0.12); color: #6EE7B7; }
    [data-theme="dark"] .callout-red   { background: rgba(220,38,38,0.14); color: #FCA5A5; }
    [data-theme="dark"] .table-wrap, [data-theme="dark"] td { border-color: #334155; }
    [data-theme="dark"] th { background: #0a0f1a; }
    [data-theme="dark"] tr:hover td { background: #1E293B; }
    [data-theme="dark"] .export-menu { background: #1E293B; border-color: #334155; }

    /* ══════════════════════════════════════════════════════════════════
       PRINT / EXPORT stylesheet — this is the "Export as report" path.
       Strips all chrome, prints the currently selected language only,
       expands the content to full page width.
       ══════════════════════════════════════════════════════════════════ */
    @media print {
      .sidebar, .topbar { display: none !important; }
      .main { margin-left: 0 !important; }
      .content { padding: 0 !important; }
      .content-inner { max-width: 100% !important; }
      /* NOTE: .doc-section itself must NOT get page-break-inside:avoid — a
         chapter is routinely taller than one printed page, and "avoid" on a
         block that can't actually fit on one page makes the browser push the
         whole thing onto a fresh page instead, leaving the rest of the
         previous page blank (this was the "blank page before every chapter"
         bug). Sections flow/break naturally; only genuinely one-page-sized
         inner pieces get "avoid" below, so a callout or card never splits
         awkwardly across a page boundary. */
      .doc-section { padding-top: 18px !important; }
      #toc { display: block; page-break-after: always; break-after: page; }
      .part-marker { page-break-before: always; break-before: page; }
      .part-marker:first-of-type { page-break-before: avoid; break-before: avoid; }
      /* Kept to ONLY the two elements guaranteed to be short (a few lines of
         prose) — a long table (Appendix C's checklist), a tall screenshot, or
         a whole feature-grid marked "avoid" can each be taller than a single
         printed page on their own, and the browser's response to an
         un-satisfiable "avoid" is a cascade of near-empty pages while it
         keeps hunting for room (this was the "pages 76-83 are blank" bug). */
      .callout, .why-panel {
        page-break-inside: avoid; break-inside: avoid;
      }
      a { text-decoration: none !important; color: inherit !important; }
      body { font-size: 11.5pt; }
      .lightbox { display: none !important; }
      .shot-media-frame { border-style: solid; cursor: default; }
      .back-to-top { display: none !important; }
    }

    /* ── Back to top ── */
    .back-to-top {
      position: fixed; bottom: 28px; right: 28px; width: 44px; height: 44px; border-radius: 50%;
      background: var(--accent); color: #fff; border: none; cursor: pointer; font-size: 16px;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 6px 20px rgba(13,110,253,0.35);
      opacity: 0; visibility: hidden; transform: translateY(8px);
      transition: opacity 0.2s, transform 0.2s, visibility 0.2s, background 0.15s;
      z-index: 150;
    }
    .back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
    .back-to-top:hover { background: var(--accent-dark); }
    @media (max-width: 840px) { .back-to-top { right: 16px; bottom: 16px; } }

