.lab-tabbed [data-lab-panel][hidden],.lab-tabs[hidden],.lab-fallback[hidden]{display:none!important}
#lab>.section-head{max-width:100%;margin-bottom:20px}
#lab>.section-head h2{font-size:clamp(2rem,4vw,3.2rem);margin:12px 0}
.lab-use-notice{font-size:.875rem;line-height:1.6;color:var(--muted);max-width:85ch}
.lab-use-notice a,.tool-use-notice a{text-decoration:underline;text-underline-offset:3px}
.lab-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:6px;border:1px solid var(--line);border-radius:16px;background:var(--surface);margin-bottom:16px}
.lab-tabs button{min-width:0;min-height:48px;padding:12px 8px;margin:0;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);font:inherit;font-size:.9375rem;cursor:pointer}
.lab-tabs button[aria-selected=true]{background:var(--accent);color:var(--button-ink);border-color:var(--accent);font-weight:700}
.lab-tabs button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.lab-tabbed>.inference-lab{margin-top:0;padding:24px}
.lab-tabbed [data-lab-panel]{scroll-margin-top:110px}
.lab-tabbed .inference-lab>h3{font-size:clamp(1.5rem,3vw,2rem);margin:8px 0}
.tool-footprint{font-size:.875rem;color:var(--muted);margin:0 0 12px}
.tool-background{margin:0 0 22px;font-size:.9375rem;border-bottom:1px solid var(--line);padding-bottom:14px}
.tool-background summary{cursor:pointer;min-height:36px;padding:8px 0;color:var(--ink)}
.tool-background p{line-height:1.6;margin:12px 0}.tool-background .sg-pipeline{margin:12px 0}
.tool-use-notice{font-size:.875rem;color:var(--muted);margin:16px 0 0}
.lab-tabbed .inference-controls{gap:14px}
.lab-tabbed .inference-controls .caption{font-size:.875rem;line-height:1.55}
.terms-page{max-width:900px;padding-block:48px 64px}
.terms-page h1{font-size:clamp(2rem,5vw,3.5rem);line-height:1.1;margin:20px 0}
.terms-page h2{font-size:1.35rem;margin:30px 0 12px}
.terms-page p,.terms-page li{font-size:1rem;line-height:1.7;max-width:78ch}
.terms-page a{text-decoration:underline;text-underline-offset:3px}
.terms-page .terms-scope{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.terms-page .credits-list{display:grid;gap:18px;padding-left:20px}
.terms-page .credits-list li{padding-left:6px}
@media(max-width:720px){
 header nav{gap:clamp(12px,4vw,28px);flex-wrap:wrap}
 .lab-tabs{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .lab-tabs button{font-size:.875rem;padding:10px 5px}
 .lab-tabbed>.inference-lab{padding:18px}
 .terms-page{padding-block:28px 40px}
}

/* Keep tab labels, file pickers and long terms usable at narrow widths/zoom. */
.inference-layout>*{min-width:0}
.inference-controls input[type=file],.inference-controls select{max-width:100%;min-width:0}
.terms-page,.site-legal{overflow-wrap:anywhere}
.lab-tabs button{overflow-wrap:anywhere}
@media(min-width:721px) and (max-width:1000px){header{flex-wrap:wrap}header nav{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
