  :root{
    --paper:#141E18;
    --panel:#1B2921;
    --ink:#E9EDE7;
    --ink-soft:#93A296;
    --grid:#2A362F;
    --key:#E3A048;      /* primary-key amber — basics */
    --key-soft:#3A2E1A;
    --row:#6E9AD1;       /* row-select blue — intermediate */
    --row-soft:#1E2A3A;
    --fk:#93A17A;        /* foreign-key olive — advanced/pending */
    --fk-soft:#232B1D;
    --schema:#B98FD9;     /* index/constraint violet — schema */
    --schema-soft:#2A2038;
    --play:#3FBE9E;       /* live/executing teal — playground */
    --play-soft:#16302A;
    --error:#E38080;
    --error-soft:#3A1E1E;
    --term-bg:#111B16;
    --term-ink:#E9EDE7;
    --radius:9px;

    /* Layout — edit these to change global sizing */
    --content-max-w:1680px;      /* sidebar (272px) + main (900px) combined width; caps the shell and Home's banner so nothing stretches edge-to-edge on wide screens, staying flush-left */
    --sidebar-w:272px;           /* sidebar width — also used for the banner's width on pages that have a sidebar, so the two line up */
    --play-output-max-h:500px;   /* fixed height of the Playground results panel — change this one value to make results taller/shorter */

    /* Set by header.js / router.js at runtime (fallback values below are just
       for the instant before JS first measures them):
       --header-row-h  = height of the plain top bar (logo/title/Settings) only
       --hero-bar-h     = height of the query banner, which varies 2-4 lines by page
       Main content sits directly under --header-row-h. On pages with a sidebar,
       the banner is pinned above the sidebar only (width:--sidebar-w) and the
       sidebar is pushed down by --hero-bar-h — main is never affected by it. */
    --header-row-h:60px;
    --hero-bar-h:90px;
  }

  /* Dark is the default; light is an explicit opt-in via the settings toggle */
  :root[data-theme="light"]{
    --paper:#F3F4EE; --panel:#FDFDFB; --ink:#12201A; --ink-soft:#59685F; --grid:#DCDDD3;
    --key:#D98E2B; --key-soft:#F4E7D2;
    --row:#2C5AA0; --row-soft:#DEE7F3;
    --fk:#77835F; --fk-soft:#E6E9DD;
    --schema:#7C4FA6; --schema-soft:#EDE3F5;
    --play:#1F8A73; --play-soft:#DDEEE9;
    --error:#B34848; --error-soft:#F6E4E1;
  }
  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  @media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto;} *{animation-duration:0.01ms !important; animation-iteration-count:1 !important;} }

  body{
    margin:0;
    background:var(--paper);
    color:var(--ink);
    font-family:'IBM Plex Sans',sans-serif;
    font-size:15.5px;
    line-height:1.65;
    transition:background-color .2s ease, color .2s ease;
  }
  h1,h2,h3,.mono-face{ font-family:'IBM Plex Mono',monospace; letter-spacing:-0.01em; margin:0; }
  code,pre{ font-family:'IBM Plex Mono',monospace; }
  a{ color:inherit; }
  ::selection{ background:var(--key-soft); }
  :focus-visible{ outline:2px solid var(--key); outline-offset:2px; }

  /* ---------- global persistent header ---------- */
  #site-header{
    position:sticky; top:0; z-index:100;
    background:var(--panel); border-bottom:1px solid var(--grid);
  }
  .site-header-row{
    display:flex; align-items:center; justify-content:space-between;
    padding:10px 24px; position:relative; gap:16px;
  }
  .site-brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); flex:none; }
  .brand-mark{
    width:26px;height:26px; border-radius:5px; background:var(--term-bg);
    color:var(--term-ink); display:flex; align-items:center; justify-content:center;
    font-family:'IBM Plex Mono',monospace; font-size:10px; font-weight:700; flex:none;
  }
  .brand-title{ font-size:15px; font-weight:600; }
  .site-nav{ display:flex; align-items:center; gap:2px; margin-right:auto; }
  .site-nav a{
    text-decoration:none; color:var(--ink-soft); font-family:'IBM Plex Mono',monospace;
    font-size:12.5px; font-weight:600; padding:7px 12px; border-radius:20px;
    transition:color .15s, background-color .15s;
  }
  .site-nav a:hover{ color:var(--ink); background:rgba(0,0,0,0.03); }
  .site-nav a.active{ color:var(--ink); background:var(--key-soft); }
  .header-right{ display:flex; align-items:center; gap:8px; flex:none; }
  .nav-toggle{
    display:none; background:var(--paper); border:1px solid var(--grid); color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace; font-size:12px; padding:7px 12px; border-radius:20px;
    cursor:pointer; align-items:center; gap:6px; transition:border-color .15s, color .15s;
  }
  .nav-toggle:hover{ border-color:var(--play); color:var(--play); }
  .settings-wrap{ position:relative; }
  .settings-btn{
    background:var(--paper); border:1px solid var(--grid); color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace; font-size:12px; padding:7px 12px; border-radius:20px;
    cursor:pointer; display:flex; align-items:center; gap:6px; transition:border-color .15s, color .15s;
  }
  .settings-btn:hover{ border-color:var(--play); color:var(--play); }
  .settings-panel{
    position:absolute; top:calc(100% + 10px); right:0; min-width:230px;
    background:var(--panel); border:1px solid var(--grid); border-radius:10px;
    box-shadow:0 16px 34px -14px rgba(0,0,0,0.4); padding:14px; display:none; z-index:110;
  }
  .settings-panel.open{ display:block; }
  .settings-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .settings-row + .settings-row{ margin-top:10px; }
  .settings-label{ font-size:12.5px; color:var(--ink-soft); font-family:'IBM Plex Mono',monospace; }
  .settings-select{
    background:var(--paper); border:1px solid var(--grid); color:var(--ink);
    font-family:'IBM Plex Mono',monospace; font-size:12px; padding:5px 8px; border-radius:6px;
    cursor:pointer; transition:border-color .15s;
  }
  .settings-select:hover, .settings-select:focus{ border-color:var(--play); outline:none; }
  @media (max-width:600px){ .site-header-row{ padding:10px 16px; } }

  @media (max-width:820px){
    .site-nav{
      display:none; position:absolute; top:100%; left:0; right:0;
      flex-direction:column; align-items:stretch; gap:0; margin-right:0;
      background:var(--panel); border-bottom:1px solid var(--grid);
      padding:6px 16px 12px; box-shadow:0 16px 34px -14px rgba(0,0,0,0.4); z-index:105;
    }
    .site-nav.open{ display:flex; }
    .site-nav a{ padding:11px 4px; border-radius:0; border-bottom:1px solid var(--grid); }
    .site-nav a:last-child{ border-bottom:none; }
    .nav-toggle{ display:inline-flex; }
  }
  @media (max-width:480px){
    .brand-title{ display:none; }
    .nav-toggle .btn-label, .settings-btn .btn-label{ display:none; }
  }

  /* ---------- shell ---------- */
  /* main sits directly under the header row — it is never affected by the
     banner's height, since the banner is now position:fixed on these pages
     (see .hero-editor-bar below) and takes up no document flow space here. */
  .shell{display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);width:100%;max-width:var(--content-max-w);min-height:calc(100vh - var(--header-row-h));align-items:start;}
  .shell.no-sidebar{ grid-template-columns:1fr; }

  /* ---------- sidebar : table-of-contents-as-a-table, scoped to one section ---------- */
  .sidebar{
    /* pushed down by the fixed banner sitting on top of it; sticks right
       below the banner once you scroll, rather than below the header row */
    margin-top:var(--hero-bar-h);
    position:sticky; top:calc(var(--header-row-h) + var(--hero-bar-h));
    height:calc(100vh - var(--header-row-h) - var(--hero-bar-h)); overflow-y:auto;
    background:var(--panel);
    border-right:1px solid var(--grid);
    padding:0 0 40px;
  }
  /* Mobile: collapse to a single column and let the sidebar sit inline
     above the content instead of pinned to a fixed viewport-height box.
     Placed after the base .sidebar/.shell rules above (same specificity)
     so it actually wins on narrow screens — a rule with equal specificity
     appearing earlier in the file was silently overriding this before. */
  @media (max-width:900px){
    .shell{grid-template-columns:1fr;}
    .sidebar{position:static; height:auto; border-right:none; border-bottom:1px solid var(--grid); margin-top:0;}
  }
  .sidebar-home{
    display:none;
    position:sticky; top:0; z-index:2; background:var(--panel);
    border-bottom:1px solid var(--grid); padding:12px 20px;
    align-items:center; justify-content:flex-end; gap:10px;
  }
  .toc-toggle{
    display:none; background:none; border:1px solid var(--grid); color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; padding:5px 10px; border-radius:16px;
    cursor:pointer; align-items:center; gap:6px; transition:border-color .15s, color .15s;
  }
  .toc-toggle:hover{ border-color:var(--play); color:var(--play); }
  .toc-toggle-icon{ transition:transform .15s ease; display:inline-block; }
  .toc-toggle[aria-expanded="true"] .toc-toggle-icon{ transform:rotate(180deg); }
  @media (max-width:900px){
    .sidebar-home{ display:flex; }
    .toc-toggle{ display:inline-flex; }
    .toc-list{ display:none; }
    .toc-list.open{ display:block; }
  }

  .toc-group{ margin-top:10px; }
  .toc-head{
    display:grid; grid-template-columns:36px 1fr; gap:0;
    padding:4px 20px; font-size:10.5px; letter-spacing:0.08em;
    color:var(--ink-soft); text-transform:uppercase; font-weight:600;
    border-bottom:1px solid var(--grid);
  }
  .toc-group ul{ list-style:none; margin:0; padding:0; }
  .toc-group li a{
    display:grid; grid-template-columns:36px 1fr; align-items:center;
    text-decoration:none; color:var(--ink); font-size:12.5px;
    padding:4px 20px; border-bottom:1px solid transparent;
  }
  .toc-group li:nth-child(even) a{ background:rgba(0,0,0,0.018); }
  .toc-group li a:hover{ background:var(--key-soft); }
  .toc-group li a .idx{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ink-soft); }
  .toc-group.basics .toc-head{ color:var(--key); border-bottom-color:var(--key); }
  .toc-group.intermediate .toc-head{ color:var(--row); border-bottom-color:var(--row); }
  .toc-group.advanced .toc-head{ color:var(--fk); border-bottom-color:var(--fk); }
  .toc-group.schema .toc-head{ color:var(--schema); border-bottom-color:var(--schema); }
  .toc-group.more .toc-head{ color:var(--ink-soft); border-bottom-color:var(--grid); }
  .toc-group.play .toc-head{ color:var(--play); border-bottom-color:var(--play); }
  .toc-group.basics li a:hover{ background:var(--key-soft); }
  .toc-group.intermediate li a:hover{ background:var(--row-soft); }
  .toc-group.advanced li a:hover{ background:var(--fk-soft); }
  .toc-group.schema li a:hover{ background:var(--schema-soft); }
  .toc-group.more li a:hover{ background:rgba(0,0,0,0.04); }
  .toc-group.play li a:hover{ background:var(--play-soft); }

  /* ---------- Playground ---------- */
  #page-playground .category-head{ border-top-color:var(--play); }
  #page-playground .col-tag{ background:var(--play); color:#fff; }
  .category-head.play-head{ padding:10px 0; margin-bottom:16px; }
  .category-head.play-head h2{ font-size:18px; }

  /* Schema reference cards now live in the sidebar (stacked, not a grid) */
  .schema-panel{ display:flex; flex-direction:column; gap:12px; padding:14px 16px; }
  .schema-card{
    background:var(--paper); border:1px solid var(--grid); border-radius:8px; overflow:hidden;
  }
  .schema-card-head{
    background:var(--play-soft); color:var(--play); font-family:'IBM Plex Mono',monospace;
    font-size:12px; font-weight:600; padding:7px 12px;
  }
  .schema-card ul{ list-style:none; margin:0; padding:4px 0; }
  .schema-card li{
    display:flex; justify-content:space-between; gap:10px;
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-soft);
    padding:3px 12px;
  }
  .schema-card li b{ color:var(--ink); font-weight:500; }

  /* ---------- Saved queries (Playground sidebar) ---------- */
  .saved-panel{ padding:0 16px 16px; }
  .saved-panel-head{ display:flex; align-items:center; justify-content:space-between; }
  .saved-head-actions{ display:flex; gap:4px; }
  .saved-icon-btn{
    background:transparent; border:1px solid var(--grid); color:var(--play);
    font-size:11px; width:22px; height:22px; border-radius:4px; cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center; line-height:1; padding:0;
  }
  .saved-icon-btn:hover{ border-color:var(--play); background:var(--paper); }
  label.saved-icon-btn{ cursor:pointer; }
  .saved-list{ list-style:none; margin:0; padding:4px 0; max-height:220px; overflow-y:auto; }
  .saved-empty{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-soft); padding:6px 12px; }
  .saved-item{ display:flex; align-items:center; justify-content:space-between; gap:4px; padding:0 6px 0 0; }
  .saved-item-name{
    flex:1; min-width:0; text-align:left; background:none; border:none; color:var(--ink);
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; padding:6px 6px 6px 12px;
    cursor:pointer; border-radius:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .saved-item-name:hover{ background:var(--play-soft); color:var(--play); }
  .saved-item-actions{ display:flex; gap:1px; flex:none; }
  .saved-item-btn{
    background:none; border:none; color:var(--ink-soft); font-size:11px;
    width:20px; height:20px; border-radius:4px; cursor:pointer; flex:none;
    display:inline-flex; align-items:center; justify-content:center; padding:0;
  }
  .saved-item-btn:hover{ color:var(--play); background:var(--play-soft); }
  .saved-item-btn.saved-item-delete:hover{ color:var(--error); background:var(--error-soft); }
  .saved-add-btn{
    width:100%; margin-top:8px; background:var(--panel); border:1px dashed var(--grid); color:var(--play);
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; font-weight:600; padding:8px; border-radius:6px;
    cursor:pointer; transition:border-color .15s, background .15s;
  }
  .saved-add-btn:hover{ border-color:var(--play); background:var(--play-soft); }

  /* Toolbar + editor stick together as one unit below the sticky header
     so it's always visible alongside the results, instead of scrolling
     out of view. */
  .play-editor-group{ position:sticky; top:var(--header-row-h); z-index:5; background:var(--paper); }
  .edit-toolbar{
    display:flex; align-items:center; gap:6px; padding:0 0 8px; flex-wrap:wrap;
    justify-content:flex-end;
  }
  .edit-tool-btn{
    background:var(--panel); border:1px solid var(--grid); color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; padding:5px 10px; border-radius:5px;
    cursor:pointer; transition:border-color .15s, color .15s;
  }
  .edit-tool-btn:hover{ border-color:var(--play); color:var(--play); }
  .edit-tool-btn.active{ background:var(--play-soft); border-color:var(--play); color:var(--play); }
  .edit-tool-sep{ width:1px; height:18px; background:var(--grid); margin:0 2px; }

  .play-editor-wrap{
    background:var(--paper); padding-top:2px; margin-bottom:16px;
    border-radius:8px; overflow:hidden; border:1px solid #0B120E;
  }
  .play-editor-wrap textarea{
    display:block; width:100%; min-height:220px; resize:vertical;
    background:var(--term-bg); color:var(--term-ink); border:none; outline:none;
    font-family:'IBM Plex Mono',monospace; font-size:13.5px; line-height:1.6;
    padding:14px 16px;
  }
  .play-controls{
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
    background:#0C1512; padding:9px 14px;
  }
  .play-controls .hint{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:#7C8B81; }
  .play-btns{ display:flex; gap:8px; }
  .btn-run{
    background:var(--play); color:#fff; border:none; font-family:'IBM Plex Mono',monospace;
    font-size:12.5px; font-weight:600; padding:6px 16px; border-radius:5px; cursor:pointer;
  }
  .btn-run:hover{ filter:brightness(1.08); }
  .btn-run:disabled{ opacity:0.5; cursor:default; }
  .btn-reset{
    background:none; color:#9AA79E; border:1px solid #2A362F; font-family:'IBM Plex Mono',monospace;
    font-size:12.5px; padding:6px 14px; border-radius:5px; cursor:pointer;
  }
  .btn-reset:hover{ color:var(--term-ink); border-color:var(--play); }

  .play-output{
    margin-top:0; max-height:var(--play-output-max-h); overflow-y:auto;
    border-radius:8px;
  }
  .play-status{
    font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-soft); margin-bottom:8px;
  }
  .play-error{
    background:var(--error-soft); color:var(--error); border-left:3px solid var(--error);
    border-radius:6px; padding:10px 14px; font-family:'IBM Plex Mono',monospace; font-size:12.5px;
    white-space:pre-wrap;
  }
  .result-scroll{ overflow-x:auto; border:1px solid var(--grid); border-radius:8px; }
  table.result-table{ border-collapse:collapse; width:100%; font-size:13px; }
  table.result-table th{
    background:var(--play-soft); color:var(--play); text-align:left; font-family:'IBM Plex Mono',monospace;
    font-size:11.5px; font-weight:600; padding:8px 12px; white-space:nowrap; position:sticky; top:0;
  }
  table.result-table td{
    padding:7px 12px; border-top:1px solid var(--grid); font-family:'IBM Plex Mono',monospace;
    color:var(--ink); white-space:nowrap;
  }
  table.result-table tr:nth-child(even) td{ background:rgba(0,0,0,0.018); }

  /* ---------- main ---------- */
  main{width:100%;max-width:none;min-width:0;padding:0 40px 520px;}

  /* header query editor — persists on every page, in two different modes:

     Default (shell pages: Basics/Intermediate/Advanced/More/Playground):
     position:fixed, width matches the sidebar, pinned directly under the
     header row. Being position:fixed takes it fully out of document flow,
     so it can never push main down — main sits right under --header-row-h
     regardless of how many lines the banner has. The sidebar is pushed
     down to clear it via margin-top (see .sidebar above).

     Home (data-hero-mode="full", set by router.js): reverts to the
     original behaviour — sticky, in-flow, full content width — since
     Home has no sidebar for the banner to pair with. */
  .hero-editor-bar{
    background:var(--term-bg);
    position:fixed; top:var(--header-row-h); left:0; z-index:90;
    width:var(--sidebar-w);
  }
  body[data-hero-mode="full"] .hero-editor-bar{
    position:sticky; top:var(--header-row-h); left:auto;
    width:auto; max-width:var(--content-max-w);
  }
  body[data-hero-mode="none"] .hero-editor-bar{ display:none; }
  @media (max-width:900px){
    .hero-editor-bar{ position:static; width:auto; max-width:none; }
  }
  .hero-editor{
    color:var(--term-ink);
    padding:8px 24px; overflow-x:auto;
  }
  .hero-editor .line{ display:flex; gap:14px; white-space:pre; font-size:12px; line-height:1.4; }
  .hero-editor .ln{ color:#4C5C53; user-select:none; width:12px; text-align:right; flex:none; }
  .hero-editor .kw{ color:var(--key); }
  .hero-editor .str{ color:#9FC98B; }
  .hero-editor .fn{ color:#7FB0E0; }
  .cursor{ display:inline-block; width:6px; height:12px; background:var(--key); margin-left:2px; animation:blink 1s steps(1) infinite; vertical-align:-1px; }
  @keyframes blink{ 50%{ opacity:0; } }

  /* ---------- Standalone pages (Home / Playground) ---------- */
  /* Default: banner is position:fixed (out of flow) here, so content only
     needs to clear the header row. Home overrides this below since its
     banner is in-flow and sits above #page-home. */
  .standalone-page{ min-height:calc(100vh - var(--header-row-h)); background:var(--paper); position:relative; }
  #page-home{ min-height:calc(100vh - var(--header-row-h) - var(--hero-bar-h)); }
  .standalone-body{ max-width:1600px; padding:40px 40px 100px; }
  @media (max-width:760px){
    .standalone-body{ padding:28px 20px 80px; }
  }

  /* ---------- Home ---------- */
  .home-wrap{ max-width:900px; margin:0 auto; padding:20px 40px 40px; }
  @media (max-width:640px){ .home-wrap{ padding:16px 22px 32px; } }
  .home-wrap h1{ font-size:22px; margin:0 0 8px; }
  .home-tagline{
    font-family:'IBM Plex Mono',monospace; color:var(--play); font-weight:600;
    font-size:13px; letter-spacing:0.02em; margin:0 0 14px;
  }
  .home-intro{ color:var(--ink-soft); max-width:74ch; margin:0; font-size:14px; }
  .home-cta{ display:flex; flex-wrap:wrap; gap:12px; margin:22px 0 40px; }
  .btn-primary, .btn-secondary{
    display:inline-block; text-decoration:none; font-family:'IBM Plex Mono',monospace;
    font-weight:600; font-size:13.5px; padding:10px 20px; border-radius:8px;
    transition:filter .15s ease, border-color .15s ease, color .15s ease;
  }
  .btn-primary{ background:var(--key); color:#fff; }
  .btn-primary:hover{ filter:brightness(1.08); }
  .btn-secondary{ background:none; color:var(--ink); border:1px solid var(--grid); }
  .btn-secondary:hover{ border-color:var(--play); color:var(--play); }

  .home-levels{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; }
  @media (max-width:640px){ .home-levels{ grid-template-columns:1fr; } }
  .level-card{
    display:block; text-decoration:none; color:var(--ink);
    background:var(--panel); border:1px solid var(--grid); border-radius:12px;
    padding:16px 18px; border-top:3px solid var(--grid);
    transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  }
  .level-card:hover{ transform:translateY(-2px); box-shadow:0 12px 24px -14px rgba(18,32,26,0.25); }
  .level-card[data-accent="basics"]{ border-top-color:var(--key); }
  .level-card[data-accent="intermediate"]{ border-top-color:var(--row); }
  .level-card[data-accent="advanced"]{ border-top-color:var(--fk); }
  .level-card[data-accent="schema"]{ border-top-color:var(--schema); }
  .tile-tag{
    display:inline-block; font-family:'IBM Plex Mono',monospace; font-size:10.5px; font-weight:600;
    padding:3px 8px; border-radius:4px; margin-bottom:10px; color:#fff;
  }
  .level-card[data-accent="basics"] .tile-tag{ background:var(--key); }
  .level-card[data-accent="intermediate"] .tile-tag{ background:var(--row); }
  .level-card[data-accent="advanced"] .tile-tag{ background:var(--fk); }
  .level-card[data-accent="schema"] .tile-tag{ background:var(--schema); }
  .level-card p{ color:var(--ink-soft); font-size:13px; margin:0; line-height:1.5; }

  .home-roadmap-note{ color:var(--ink-soft); font-size:13px; margin:20px 0 0; }
  .home-roadmap-note a{ color:var(--play); font-weight:600; text-decoration:none; }
  .home-roadmap-note a:hover{ text-decoration:underline; }


  /* ---------- Dialect selector (Home) ---------- */
  .dialect-row{
    display:flex; align-items:center; justify-content:center; gap:8px;
    margin:0 0 20px; flex-wrap:wrap;
  }
  .dialect-row .dl-label{
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-soft); margin-right:4px;
  }
  .dl-pill{
    background:var(--panel); border:1px solid var(--grid); color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:600;
    padding:7px 14px; border-radius:20px; cursor:pointer; transition:all .15s;
  }
  .dl-pill:hover{ border-color:var(--play); color:var(--play); }
  .dl-pill.active{ background:var(--play); border-color:var(--play); color:#fff; }

  /* ---------- Per-code-block dialect pills ---------- */
  .code-tab{ flex-wrap:wrap; row-gap:6px; }
  .code-dialect-pills{ display:flex; gap:4px; margin-right:auto; margin-left:10px; }
  .dpill{
    background:none; border:1px solid #2A362F; color:#7C8B81;
    font-family:'IBM Plex Mono',monospace; font-size:10px; padding:2px 8px; border-radius:10px;
    cursor:pointer; transition:all .15s;
  }
  .dpill:hover{ color:var(--term-ink); }
  .dpill.active{ background:var(--play); border-color:var(--play); color:#fff; }
  .code-block pre[data-dialect]{ display:none; }
  .code-block pre[data-dialect].active-dialect{ display:block; }

  /* ---------- Theme toggle ---------- */
  .theme-toggle{
    display:inline-flex; align-items:center; gap:6px;
    background:var(--panel); border:1px solid var(--grid); color:var(--ink-soft);
    font-family:'IBM Plex Mono',monospace; font-size:11.5px;
    padding:6px 12px; border-radius:20px; cursor:pointer;
    transition:border-color .15s, color .15s;
  }
  .theme-toggle:hover{ border-color:var(--play); color:var(--play); }

  section.category{ padding:0 56px; margin-bottom:60px; scroll-margin-top:calc(var(--header-row-h) + 16px); }
  @media (max-width:900px){ section.category{padding:0 24px;} }

  .category-head{
    display:flex; align-items:center; gap:14px;
    padding:10px 0; margin-bottom:18px;
    border-top:2px solid var(--ink); border-bottom:1px solid var(--grid);
  }
  .category-head .col-tag{
    font-size:11px; font-weight:600; padding:3px 9px; border-radius:4px;
    letter-spacing:0.04em;
  }
  #basics .category-head .col-tag{ background:var(--key); color:#fff; }
  #intermediate .category-head .col-tag{ background:var(--row); color:#fff; }
  #advanced .category-head .col-tag{ background:var(--fk); color:#fff; }
  #schema .category-head .col-tag{ background:var(--schema); color:#fff; }
  #more .category-head .col-tag{ background:var(--ink-soft); color:#fff; }
  #cheatsheet .category-head .col-tag{ background:var(--play); color:#fff; }
  .category-head h2{ font-size:20px; flex:1; }
  .category-head .arrow{ color:var(--ink-soft); font-size:13px; }

  .roadmap-card{
    background:var(--panel); border:1px dashed var(--grid); border-radius:var(--radius);
    padding:22px 24px;
  }
  .roadmap-card p{ color:var(--ink-soft); margin:0 0 16px; max-width:64ch; }
  .roadmap-list{
    list-style:none; margin:0; padding:0;
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
  }
  @media (max-width:560px){ .roadmap-list{ grid-template-columns:1fr; } }
  .roadmap-list li{
    display:flex; align-items:center; gap:8px;
    font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--ink-soft);
    background:rgba(0,0,0,0.03); border-radius:6px; padding:7px 10px;
  }
  .roadmap-list li::before{ content:"○"; font-size:9px; }

  .roadmap-meta{ color:var(--ink-soft); font-size:12px; margin:0 0 22px; }
  .roadmap-subhead{ font-size:14px; margin:0 0 12px; color:var(--ink); }
  .changelog{ list-style:none; margin:0 0 32px; padding:0; display:flex; flex-direction:column; gap:9px; }
  .changelog li{ display:flex; gap:12px; align-items:baseline; padding:10px 12px; background:rgba(0,0,0,0.03); border-radius:8px; }
  .changelog .ver{
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; font-weight:600;
    color:var(--play); background:var(--play-soft); padding:2px 8px; border-radius:4px; flex-shrink:0;
  }
  .changelog .desc{ color:var(--ink-soft); font-size:13px; line-height:1.5; }
  .changelog .desc strong{ color:var(--ink); font-weight:600; }
  .planned-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
  .planned-list li{
    display:flex; gap:12px; align-items:baseline; padding:9px 12px;
    background:rgba(0,0,0,0.015); border:1px dashed var(--grid); border-radius:8px;
    font-size:13px; color:var(--ink-soft);
  }
  .planned-list .num{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-soft); flex-shrink:0; min-width:20px; }
  .planned-list .desc strong{ color:var(--ink); font-weight:600; }

  /* ---------- Practice card (Basics/Intermediate/Advanced/Schema) ---------- */
  .practice-card{
    background:var(--panel); border:1px dashed var(--grid); border-radius:var(--radius);
    padding:18px 20px; margin-top:14px; scroll-margin-top:calc(var(--header-row-h) + 16px);
  }
  .practice-card-head{ display:flex; align-items:center; gap:10px; margin-bottom:6px; }
  .practice-card-head .col-tag{
    background:var(--play); color:#fff; font-size:11px; font-weight:600;
    padding:3px 9px; border-radius:4px; letter-spacing:0.04em;
  }
  .practice-card-head h3{ font-size:15px; }
  .practice-card p{ color:var(--ink-soft); font-size:13px; margin:0 0 12px; }
  .practice-links{ display:flex; flex-wrap:wrap; gap:8px; }
  .practice-link{
    display:inline-flex; align-items:center; gap:8px;
    background:var(--paper); border:1px solid var(--grid); color:var(--ink);
    font-family:'IBM Plex Mono',monospace; font-size:12.5px; font-weight:600;
    padding:8px 14px; border-radius:6px; text-decoration:none; transition:border-color .15s, color .15s;
  }
  .practice-link:hover{ border-color:var(--play); color:var(--play); }
  .practice-link .arrow{ color:var(--play); }

  /* ---------- Exercise panel (Playground, exercise mode) ---------- */
  .exercise-panel{
    background:var(--play-soft); border:1px solid var(--play); border-radius:var(--radius);
    padding:16px 20px; margin-bottom:16px;
  }
  .ex-head{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
  .ex-head .col-tag{
    background:var(--play); color:#fff; font-size:11px; font-weight:600;
    padding:3px 9px; border-radius:4px; letter-spacing:0.04em;
  }
  .ex-head h3{ font-size:15px; flex:1; color:var(--ink); }
  .ex-exit{
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-soft);
    text-decoration:none; padding:4px 8px; border-radius:4px; transition:color .15s;
  }
  .ex-exit:hover{ color:var(--error); }
  .exercise-panel > p{ margin:0 0 14px; color:var(--ink); font-size:14px; line-height:1.55; }
  .ex-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:4px; }
  .ex-solution{
    margin-top:12px; background:var(--term-bg); color:var(--term-ink);
    padding:12px 14px; border-radius:6px; font-size:12.5px; white-space:pre-wrap;
  }
  .ex-feedback{ margin-top:12px; font-size:13.5px; font-weight:600; }
  .ex-feedback:empty{ display:none; }
  .ex-feedback.ex-ok{ color:#9FC98B; }
  .ex-feedback.ex-fail{ color:var(--error); }

  /* ---------- Cheat sheet ---------- */
  .cheat-intro{ color:var(--ink-soft); max-width:76ch; margin:0 0 26px; }
  .cheat-group{ margin-bottom:30px; }
  .cheat-group-head{ font-size:15px; margin-bottom:12px; }
  .cheat-group-head a{ color:var(--play); text-decoration:none; }
  .cheat-group-head a:hover{ text-decoration:underline; }
  .cheat-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  @media (max-width:820px){ .cheat-grid{ grid-template-columns:1fr; } }
  .cheat-item{
    background:var(--panel); border:1px solid var(--grid); border-radius:8px;
    padding:12px 14px 14px;
  }
  .cheat-label{
    display:block; font-family:'IBM Plex Mono',monospace; font-size:11.5px; font-weight:600;
    color:var(--play); margin-bottom:8px; letter-spacing:0.02em;
  }
  .cheat-item pre{
    margin:0; background:var(--term-bg); padding:10px 12px; border-radius:6px;
    overflow-x:auto; font-size:12px;
  }
  .cheat-item pre code{ background:transparent; color:var(--term-ink); }

  .topic{
    background:var(--panel); border:1px solid var(--grid); border-radius:var(--radius);
    padding:16px 20px; margin-bottom:10px; scroll-margin-top:calc(var(--header-row-h) + 16px);
  }
  .topic-head{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
  .row-id{
    font-family:'IBM Plex Mono',monospace; font-size:10.5px; font-weight:600;
    color:#fff; padding:2px 7px; border-radius:4px; flex:none;
  }
  #basics .row-id{ background:var(--key); }
  #intermediate .row-id{ background:var(--row); }
  #advanced .row-id{ background:var(--fk); }
  .topic h3{ font-size:16px; }
  .topic p{ margin:0 0 10px; }
  .topic p:last-child{ margin-bottom:0; }
  .topic ul{ margin:8px 0 0; padding-left:20px; }
  .topic li{ margin-bottom:4px; }
  .note{
    font-size:13px; color:var(--ink-soft); background:rgba(0,0,0,0.028);
    border-left:2px solid var(--grid); border-radius:4px; padding:8px 12px; margin-top:10px;
  }
  .topic code{ background:rgba(0,0,0,0.05); padding:1px 6px; border-radius:4px; font-size:0.87em; }

  /* code blocks : terminal window */
  .code-block{ margin-top:12px; border-radius:8px; overflow:hidden; border:1px solid #0B120E; }
  .code-tab{
    display:flex; align-items:center; justify-content:space-between;
    background:#0C1512; padding:7px 12px; font-family:'IBM Plex Mono',monospace;
    font-size:11px; color:#7C8B81;
  }
  .code-tab span.filename::before{ content:"› "; color:var(--key); }
  .copy-btn{
    background:none; border:1px solid #2A362F; color:#9AA79E; cursor:pointer;
    font-family:'IBM Plex Mono',monospace; font-size:10.5px; padding:3px 9px; border-radius:4px;
    display:flex; align-items:center; gap:5px; transition:border-color .15s, color .15s;
  }
  .copy-btn:hover{ color:var(--term-ink); border-color:var(--key); }
  .copy-btn.copied{ color:#9FC98B; border-color:#9FC98B; }
  pre{ margin:0; background:var(--term-bg); padding:14px 16px; overflow-x:auto; font-size:13px; }
  pre code{ background:transparent; color:var(--term-ink); }
  .hljs-keyword,.hljs-built_in{ color:var(--key); }
  .hljs-string{ color:#9FC98B; }
  .hljs-comment{ color:#5C6C62; font-style:italic; }
  .hljs-number{ color:#7FB0E0; }
  .hljs-operator{ color:#C9D1CB; }

  footer{
    width:calc(100% - var(--sidebar-w));
    margin-left:var(--sidebar-w);

    padding:5px 5px 30px;

    color:var(--ink-soft);
    font-size:12px;
    font-family:'IBM Plex Mono',monospace;

    display:flex;
    justify-content:center;
}

  @media (max-width:900px){ footer{padding:26px 24px 60px;} }