/* === Responsive fixes - added for mobile/tablet === */
 @media (max-width: 1024px){
     .container{
         padding:16px;
    }
}
 @media (max-width: 768px){
     :root{--header-frame-inset:0px;--header-content-inset:16px;}
     .header-inner{
         padding-block:0;
         gap:12px;
         min-height:56px;
         border-bottom:none;
    }
     /* Header hide-on-scroll (nav.js's .site-header-group.hide, header.css) stays off on
        mobile - hiding it while scrolling a phone
        screen just makes it harder to get back to nav/search than it's worth. */
     .site-header-group.hide{
         transform:translateY(0);
    }
     .brand-text{
         font-size:14.3px;
         -webkit-text-stroke:.04em currentColor; /* Michroma has only a regular weight. */
    }
     .brand-mark{
         width:36px;
         height:30.6px;
         font-size:13px;
    }
     .brand-mark svg{
         height:28.8px;
    }
     .header-actions .icon-btn{
         width:44px;
         height:44px;
    }
     .header-actions .icon-btn svg{
         width:18px;
         height:18px;
    }
     .nav a, .nav .nav-dropdown-toggle{
         font-size:12.65px;
         letter-spacing:.10em;
    }
     /* Same .header-actions .nav-toggle specificity as header.css's desktop rule (0,2,0) -
        wins on cascade order (this file loads last) with no !important needed. */
     .header-actions .nav-toggle{
         display:grid;
         border:none;
         background:transparent;
         border-radius:0;
    }
     .nav-toggle:hover{
         background:transparent;
         border-color:transparent;
         color:var(--foreground);
    }
     .mobile-search-toggle{
         display:grid;
    }
     /* The sidebar (search box, author card, recent posts, categories) is home-page-only
        already - on mobile it just added a long scroll of stuff the About page already
        covers (author info) and a search box now reachable from the header everywhere.
        Hidden outright rather than reflowed. */
     .sidebar{
         display:none;
    }
     /* Below 769px this reverts from header.css's centered popup+backdrop back to the
        original full-width bar anchored under the header - no dimming behind it, since
        the panel itself already covers close-on-outside-tap via nav.js. */
     .search-backdrop{
         display:none;
    }
     .mobile-search{
         position:fixed;
         top:var(--header-total-h, 64px);
         left:16px;
         right:16px;
         z-index:98;
    }
/* Same restart-on-display technique as .nav.open/.nav-dropdown-menu above - nav.js only
   ever toggles this .open class, so this stays CSS-only. */
     .mobile-search.open{
         display:block;
         animation:mobileNavIn .2s ease;
    }
     .mobile-search .search-box input{
         padding:10px 14px 10px 40px;
         font-size:14px;
    }
     /* The mobile navbar sits flush with the top and side edges. Its contents and the
        separate TOC bar retain their own horizontal insets. */
     .site-header-group{
         padding-top: 0;
         padding-bottom: 1rem;
    }
     /* Matches .site-header-group's own old side padding at this breakpoint (now removed
        above, per request) - the TOC bar keeps the inset the navbar gave up. */
     .mobile-toc-container{
         margin-left:1rem;
         margin-right:1rem;
    }
     /* --header-total-h (header.css) is measured off .site-header-group by nav.js
        (ResizeObserver), not hand-set here - this padding change is enough on its own, no
        variable to keep in sync with it anymore. */
     /* top:100% (not a hardcoded px guess) because .header-inner - .nav's actual containing
        block, not .site-header - now has backdrop-filter (header.css, permanent Blur navbar
        style), and backdrop-filter/filter/transform all make an element the containing block
        for its absolutely-positioned descendants regardless of its own position:static. That
        silently reparented .nav's positioning reference from .site-header to the much
        shorter .header-inner, so top:56px (calibrated against .site-header's old total
        height) left it opening from the wrong point - on mobile widths that pushed it high
        enough to sit back over .header-inner itself, eating the clicks meant for the menu
        button under it. top:100% is correct against either containing block, height changes
        included, since it just means "right at this element's own bottom edge." */
     .nav{
         display:none;
         position:absolute;
         top:100%;
         margin-top:8px;
         left:auto;
         right:16px;
         width:200px;
         background:var(--background);
         border:1px solid var(--border-soft); /* matches .header-inner's own border exactly */
         flex-direction:column;
         align-items:stretch;
         padding:8px 16px;
         gap:0;
         margin-left:0;
         z-index:49;
         box-shadow:var(--shadow);
    }
/* Same restart-on-display technique as the desktop .nav-dropdown-menu (layout/header.css) -
   nav.js only ever toggles the .open class, so this stays CSS-only. */
     .nav.open{
         display:flex;
         animation:mobileNavIn .2s ease;
    }
     @keyframes mobileNavIn{
         from{ opacity:0; transform:translateY(-6px); }
         to{ opacity:1; transform:translateY(0); }
    }
     .nav a, .nav .nav-dropdown-toggle{
         width:100%;
         padding:12px 0;
         border-bottom:0;
    }
     .nav a:last-child, .nav .nav-dropdown:last-child .nav-dropdown-toggle{
         border-bottom:none;
    }
     .nav .nav-dropdown-menu{
         position:static;
         display:none;
         background:transparent;
         border:none;
         border-left:0;
         margin:0;
         padding:0;
    }
     .nav .nav-dropdown.open .nav-dropdown-menu{
         display:flex;
         animation:navDropdownIn .18s ease;
    }
     .nav .nav-dropdown-menu a{
         padding:10px 16px;
         font-size:13.915px;
    }
     .hero{
         padding:24.2px 0 19.36px;
    }
     .hero h1{
         font-size:clamp(22px,6.6vw,28.6px);
    }
     .post-grid{
         gap:16px;
    }
     .single-wrap{
         gap:16px;
    }
     /* Keep the article header's top edge flush with the post frame; spacing for the current
        title-first header is set by .article-header-text. */
     .article-header{
         padding:0 16px 48px;
    }
     /* Matches .article-header's own 16px mobile side inset above - archive.css's 24px is
        a desktop value. */
     .archive-legacy__list{
         padding:32px 16px;
    }
     .article-content{
         padding:10px;
    }
     .article-content pre{
         font-size:12px;
    }
     .article-content pre code{
         padding:8px 40px 8px 10px !important;
    }
     /* .steps-marker/.timeline-marker (components/showcase-shortcodes.css) sit at a
        negative left offset relative to their list (-13px/-5px) - on narrow screens,
        .article-content's own 10px mobile padding above isn't enough clearance on its own,
        so the markers crowd the very edge of the viewport instead of getting the same
        breathing room every other element in the article gets from that padding. These
        override the desktop 24px/16px margin-left (components/showcase-shortcodes.css) with
        smaller values tuned for the narrower screen, landing on roughly the same ~15px of
        real clearance from the viewport edge either way. */
     .steps{
         margin-left:18px;
    }
     .timeline{
         margin-left:10px;
    }
     .share{
         padding:12px 16px;
         gap:6px;
    }
     .share a{
         width:30px;
         height:30px;
         font-size:12px;
    }
     .author-box{
         padding:16px;
         flex-direction:column;
         text-align:center;
         align-items:center;
    }
     .author-box .socials{
         justify-content:center !important;
    }
     .post-nav{
         padding:12px 16px;
         gap:12px;
    }
     .post-nav-title{
         max-width:140px;
    }
     .taxo-search{
         width:100%;
         top:56px;
    }
     /* Mobile browsers have no native PDF plugin for <object>/<embed> to hook into, so
        instead of a broken "plugin not supported" placeholder, swap to a plain download
        link - see the pdf shortcode + components/alert.css. */
     .pdf-embed-object{
         display:none;
    }
     .pdf-embed-open{
         display:block;
    }
     .container.no-sidebar .main{
         padding:0;
    }
     .footer-grid{
        grid-template-columns:1fr;
    }
     /* All three homepage footer panels remain visible in the stacked layout. */
     .footer-inner{
        padding: 0rem;
    }
}
 @media (max-width: 480px){
     :root{--header-content-inset:12px;}
     .header-inner{
         gap:8px;
    }
     .brand{
         gap:8px;
    }
     .brand-text{
         font-size:13px;
         letter-spacing:.10em;
    }
     .container{
         padding:12px;
         gap:16px;
    }
     .card{
         padding:12px;
    }
     .article-meta{
         font-size:11px;
         gap:6px;
    }
     .post-nav{
         grid-template-columns:1fr;
    }
     .post-nav-title{
         max-width:100%;
         white-space:normal;
    }
     .site-header-group{
         padding-bottom: 0.8rem;
    }
     .mobile-toc-container{
         margin-left:0.8rem;
         margin-right:0.8rem;
    }
     .site-footer{
         padding:16px 12px;
         font-size:11px;
    }
     .footer-inner{
        padding: 0rem;
    }
     .footer-grid{
        grid-template-columns:1fr;
    }
     .go-top{
         right:12px;
         bottom:min(80px, 9vh);
         width:36px;
         height:36px;
    }
}
/* display:inline-block (not block) so a table shrinks to its own content instead of always
   stretching full-width - display:block was making even small 2-column tables read as
   oversized. Keeps overflow-x:auto scrolling for genuinely wide tables. vertical-align:top
   avoids the stray baseline-alignment gap inline-block boxes otherwise pick up. */
.article-content table{
     display:inline-block;
     vertical-align:top;
     overflow-x:auto;
     -webkit-overflow-scrolling:touch;
     scrollbar-width:thin;
     scrollbar-color:color-mix(in oklab, var(--border) 60%, transparent) transparent;
}
.article-content table::-webkit-scrollbar{
     height:4px;
}
.article-content table::-webkit-scrollbar-thumb{
     background:color-mix(in oklab, var(--border) 60%, transparent);
     border-radius:999px;
}
.article-content table::-webkit-scrollbar-track{
     background:transparent;
}
/* Centers the info table (always the first table in a writeup) - margin:auto needs a real
   block-level box, which inline-block above doesn't support. display:table used to be that
   box, but CSS table auto-layout has a min-content floor that ignores max-width/overflow
   once a cell (e.g. a chart in the "Rated" row) needs more room than the viewport - the
   table grows past it with no way to scroll (confirmed on `access` at mobile width). A bare
   display:block was tried too but stretches every table full-width; width:fit-content keeps
   inline-block's shrink-to-content sizing while staying a real block box, so centering and
   overflow scrolling both work. :first-of-type is positional only - a post whose first table
   shouldn't be centered opts out via .no-center below. */
.article-content table:first-of-type{
     display:block;
     width:fit-content;
     margin-left:auto;
     margin-right:auto;
}
/* Opt-out: add a line with exactly {.no-center} directly under the table in the .md file
   (no blank line before it). Same specificity as :first-of-type above, so it only wins
   because it's declared after it - keep it below if this file is ever reordered. */
.article-content table.no-center{
     display:inline-block;
     margin-left:0;
     margin-right:0;
}
/* thead/tbody are left at their spec-default display (table-header-group/table-row-group) -
   an earlier display:table override made each its own independent layout, so thead's short
   header row computed narrower columns than tbody's real data, leaving a gap. The defaults
   share one column layout across the whole table instead. */
 pre, table, .highlight{
     max-width:100%;
}
@media(min-width:1025px) {
  .container:not(.no-sidebar) {padding-top:16px;}
  .container:not(.no-sidebar) .main {padding-top:0;}
  .container:not(.no-sidebar) .sidebar {padding-top:0;}
  .container:not(.no-sidebar) .sidebar > .author-card {padding-top:0;}
}

@media(max-width:768px) {
  :root {--mobile-reading-inset:1rem;--frame-border:var(--border-soft);}
  /* The mobile TOC shares the fixed header group, so its bottom padding, the post
     container's top padding, and the title block's top padding otherwise stack into a
     noticeably large blank band before the article title. Keep a little separation while
     tightening that combined gap on posts only. */
  .site-header-group:has(.mobile-toc-container) {padding-bottom:8px;}
  .container.no-sidebar:has(.article-single) {padding-top:6px;}
  .article-single .article-header-text {padding-top:14px;}
  .mobile-toc-nav {font-size:15px;}
  .header-inner {margin-inline:0;width:100%;}
  .mobile-toc-container {margin-inline:var(--mobile-reading-inset);}
  .container.no-sidebar:has(.article-single) {padding-inline:var(--mobile-reading-inset);}
  .article-single .article-header {padding-inline:10px;}
  .article-single .article-header--editorial:has(:is(.article-tags--mobile,.article-topics-toggle)) {padding-bottom:24px;}
  .article-single .article-header-text {padding-inline:0;max-width:100%;}
  .go-top {width:44px;height:44px;font-size:22px;right:calc(var(--mobile-reading-inset) + 8px);bottom:var(--go-top-bottom,max(20px,calc(env(safe-area-inset-bottom) + 16px)));}
}
@media(max-width:480px) {
  :root {--mobile-reading-inset:.8rem;}
}
