/* Tabs and code-tabs ported from the old zzo theme's SCSS components. */
 .tab{
     position:relative;
     margin:2rem 0;
     padding:0;
     border:1px solid var(--border-soft);
     border-radius:0;
     background:var(--card);
     overflow:hidden;
}
 .tab__links{
     display:flex;
     display:-webkit-box;
     display:-moz-box;
     align-items:center;
     -webkit-box-align:center;
     justify-content:flex-start;
     flex-wrap:nowrap;
     -webkit-flex-wrap:nowrap;
     height:36px;
     border-bottom:1px solid var(--border-soft);
     background:var(--card);
     padding:0 4px;
     gap:0;
     overflow-x:auto;
     overflow-y:hidden;
     -webkit-overflow-scrolling:touch;
     scrollbar-width:thin;
     scrollbar-color:var(--border) transparent;
}
 .tab__links::-webkit-scrollbar{
     height:3px;
}
 .tab__links::-webkit-scrollbar-thumb{
     background:var(--border);
}
 .tab__link{
     border:none;
     cursor:pointer;
     font-size:13px;
     font-family:var(--mono);
     text-transform:capitalize;
     padding:0.5rem 0.75rem;
     color:var(--muted-foreground);
     background:var(--card);
     border-bottom:1px solid var(--border-soft);
     flex-shrink:0;
     -webkit-flex-shrink:0;
     white-space:nowrap;
}
 .tab__link.active{
     background:var(--card);
     border:1px solid var(--border-soft);
     border-bottom:1px solid var(--card);
     border-top:1px solid var(--border);
     color:var(--foreground);
     margin-bottom:-1px;
}
 .tab__link:hover{
     color:var(--foreground);
     background:var(--bg-elev);
}
 .tab__link:focus-visible{
     outline:2px solid var(--foreground);
     outline-offset:-2px;
}
 .tab__content{
     display:none;
     border-radius:0;
     background:var(--card);
     margin:0;
     padding:0.75rem;
     border-top:1px solid color-mix(in oklab, var(--border) 35%, transparent);
}
/* tabs.html's own inline script (not content.js) toggles .active via style.display, so this
   is a CSS-only addition: an @keyframes animation restarts automatically the moment an
   element goes from display:none to displayed, unlike a transition (which needs the element
   already rendered at its start value) - no JS change needed to fade the incoming panel in. */
 .tab__content.active{
     display:block;
     animation:tabPaneIn .25s ease;
}
 .codetab{
     position:relative;
     margin:16px 0;
     border:0;
     border-radius:2px;
     overflow:hidden;
     background:var(--code-bg);
}
 .codetab__links{
     position:absolute;
     top:0;
     left:0;
     height:28px;
     z-index:2;
     display:flex;
     display:-webkit-box;
     display:-moz-box;
     align-items:center;
     -webkit-box-align:center;
     justify-content:flex-start;
     background:var(--code-header-bg);
     border:0;
     width:100%;
     padding-inline-end:32px; /* Keep tab labels clear of the active panel's copy button. */
     overflow-x:auto;
     overflow-y:hidden;
     -webkit-overflow-scrolling:touch;
     scrollbar-width:thin;
     scrollbar-color:var(--border) transparent;
     flex-wrap:nowrap;
     -webkit-flex-wrap:nowrap;
}
 .codetab__links::-webkit-scrollbar{
     height:3px;
}
 .codetab__links::-webkit-scrollbar-thumb{
     background:var(--border);
}
 .codetab__link{
     height:28px;
     flex-shrink:0;
     -webkit-flex-shrink:0;
     white-space:nowrap;
     border:none;
     cursor:pointer;
     font-size:11px;
     font-family:var(--mono);
     text-transform:capitalize;
     padding:0.25rem 0.75rem;
     background:var(--code-header-bg);
     color:var(--muted-foreground);
     border-bottom:none;
     transition:all 0.2s ease-in;
}
 .codetab__link:first-child{
     border-radius:0;
}
 .codetab__link.active{
     background:var(--code-bg);
     color:var(--foreground);
     border:0;
     margin-bottom:0;
}
 .codetab__link:hover{
     background:var(--code-bg);
     color:var(--foreground);
}
 .codetab__link:focus-visible{
     outline:2px solid var(--foreground);
     outline-offset:-2px;
}
 .codetab__content{
     display:none;
     padding-top:28px;
     background:var(--code-bg);
}
/* Same fade-in-on-display technique as .tab__content.active above - codes.html's own inline
   script drives this one, also via style.display, so this stays CSS-only too. */
 .codetab__content.active{
     display:block;
     animation:tabPaneIn .25s ease;
}
/* Tab labels serve as the header. Position the active block's copy button in that bar. */
.codetab__content > .codeblock{ position:static; margin:0; border:0; border-radius:0; }
.codetab__content > .codeblock > .codeblock__header{ display:none; }
 @keyframes tabPaneIn{
     from{ opacity:0; transform:translateY(4px); }
     to{ opacity:1; transform:translateY(0); }
}
 .codetab__content pre, .codetab__content .highlight, .codetab__content .chroma{
     margin:0 !important;
     border:none !important;
     background:transparent !important;
     border-radius:0 !important;
     box-shadow:none !important;
}
 @media (max-width:768px){
     .tab__links{
         height:auto;
         min-height:36px;
    }
     .tab__link, .codetab__link{
         padding:0.4rem 0.6rem;
         font-size:12px;
    }
    .codetab__link{ padding:3px 0.6rem; font-size:11px; }
}
/* Compact, borderless code frames. The wrapper clips its header and body to 2px corners. */
 .codeblock{
     margin:16px 0;
     border:0;
     border-radius:2px;
     overflow:hidden;
     background:var(--code-bg);
}
 .codeblock__header{
     display:flex;
     align-items:center;
     justify-content:space-between;
     gap:8px;
     min-height:28px;
     padding:4px 40px 4px 10px; /* Reserve the right edge for the compact copy control. */
     background:var(--code-header-bg);
     border:0;
     font-family:var(--mono);
     font-size:11px;
     line-height:1.4;
}
 .codeblock__title{
     font-weight:600;
     color:var(--foreground);
     overflow:hidden;
     text-overflow:ellipsis;
     white-space:nowrap;
}
 .codeblock__lang{
     font-size:11px;
     color:var(--muted-foreground);
     text-transform:lowercase;
     flex-shrink:0;
}
 .codeblock__body{
     margin:0;
     padding:0;
     background:transparent;
}
 /* .codeblock prefix (not just .codeblock__body) so these outrank syntax/code.css's
    .article-content pre/.chroma/div.highlight on specificity (0,3,0) vs (0,2,0), instead of
    depending on tabs.css loading after code.css in styles.html's cascade order - a future
    reorder of those <link> tags would otherwise silently flip which one wins. background
    stays !important since code.css's own background rules are too (fighting Chroma's
    generated markup); margin/border don't need it, since code.css never marks those. */
 .codeblock .codeblock__body .highlight{
     margin:0;
     border:none !important; /* The codeblock owns the frame, including table line numbers. */
     background:transparent !important;
}
 .codeblock .codeblock__body pre{
     margin:0;
     border:none;
     background:transparent !important;
     padding:0;
}
 .codeblock .codeblock__body .chroma{
     margin:0;
     background:transparent !important;
}
 /* Footer credit line (codeimporter shortcode) - GitHub Gist embed convention,
    "file hosted with <3 by GitHub", below the code rather than in the header bar. */
 .codeblock__footer{
     padding:6px 10px;
     background:var(--code-header-bg);
     border:0;
     font-family:var(--mono);
     font-size:11px;
     color:var(--muted-foreground);
}
 .codeblock__footer a{
     color:var(--foreground);
     font-weight:600;
}
