/* Gallery's structure stays fixed; palette and explorer are independent choices. */
body[data-design=gallery][data-palette=blue]{--bg:#f5f5f7;--accent:#3478f6;--tint:#e7edf6;--deep:#293b57}
body[data-design=gallery][data-palette=jade]{--bg:#f4f5ef;--accent:#216b58;--tint:#e3ece1;--deep:#244238;--muted:#626e63}
body[data-design=gallery][data-palette=clay]{--bg:#f8f2eb;--accent:#a24e38;--tint:#f0dfd0;--deep:#51372e;--muted:#79695e}
body[data-design=gallery][data-palette=ink]{--bg:#f0f0f2;--accent:#444755;--tint:#e1e2e8;--deep:#30323e;--muted:#6c6d76}
body[data-design=gallery][data-palette]{background:linear-gradient(#fff 0,var(--bg) 900px)}
body[data-design=gallery] .work-item.work-0{--project-bg:var(--tint)}
body[data-design=gallery] .magnet-art,body[data-design=gallery] .work-symbol{color:var(--accent)}
body[data-design=gallery] .category-column a[aria-current]{background:color-mix(in srgb,var(--accent) 10%,transparent)}
.gallery-lab-controls{max-width:1100px;margin:18px auto 0;padding:0 28px;display:flex;justify-content:space-between;gap:18px;font-size:10px;color:var(--muted)}
.gallery-lab-controls>div{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.gallery-lab-controls>div>span{margin-right:5px;font-size:8px;letter-spacing:.12em;text-transform:uppercase}
.gallery-lab-controls a{display:flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid transparent;border-radius:20px}
.gallery-lab-controls a[aria-current]{background:#fff;border-color:var(--line);color:var(--ink)}.gallery-lab-controls i{width:9px;height:9px;border-radius:50%}
.live-carousel{height:485px}.live-carousel .floating-page{width:310px;height:350px;left:50%;right:auto;top:45px;background:var(--surface);border-color:var(--tint);transition:transform .55s cubic-bezier(.22,1,.36,1),opacity .5s,background .5s;transform-origin:center}
.live-carousel .floating-page[data-position=center]{transform:translateX(-50%);z-index:3;opacity:1;box-shadow:0 25px 70px color-mix(in srgb,var(--accent) 18%,transparent)}
.live-carousel .floating-page[data-position=left]{transform:translateX(calc(-50% - 235px)) rotateY(20deg) rotateZ(-12deg) scale(.93);z-index:1;opacity:.65;background:var(--tint)}
.live-carousel .floating-page[data-position=right]{transform:translateX(calc(-50% + 235px)) rotateY(-20deg) rotateZ(12deg) scale(.93);z-index:1;opacity:.65;background:var(--tint)}
.live-carousel .floating-page h3{color:var(--deep)}.live-carousel .floating-page small,.live-carousel .sheet-link b{color:var(--accent)}.live-carousel .sheet-experts i{background:var(--tint)}.live-carousel .sheet-experts i:nth-child(odd){background:var(--accent)}
.live-carousel .object-halo{background:radial-gradient(ellipse,var(--tint),transparent 70%)}.carousel-controls{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:18px;z-index:4;white-space:nowrap}
.carousel-controls button{width:36px;height:36px;border-radius:50%;background:#fff;border:1px solid var(--line);font-size:17px}.carousel-controls span{font-size:10px;color:var(--muted);min-width:140px}
.terminal-workbench{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(0,1.25fr);border:1px solid var(--line);background:var(--surface);border-radius:22px;overflow:hidden;box-shadow:0 25px 90px #22222208;height:720px}
.explorer-pane{min-height:0;min-width:0;display:flex;flex-direction:column;background:var(--bg);border-right:1px solid var(--line)}.explorer-toolbar,.explorer-preview>header{display:flex;justify-content:space-between;align-items:center;padding:16px 22px;border-bottom:1px solid var(--line);font-size:10px;color:var(--muted)}.explorer-toolbar button,.explorer-preview>header button{border:0;background:none;font-size:10px;color:var(--accent)}
.explorer-location{font:11px ui-monospace,monospace;color:var(--accent);padding:20px 22px 12px;overflow-wrap:anywhere}
.explorer-tree{overflow:auto;flex:1;min-height:160px;padding:0 12px 15px;scrollbar-width:thin}
.explorer-tree button{display:flex;width:100%;text-align:left;align-items:center;gap:12px;border:0;background:none;border-radius:8px;padding:12px 10px;font-size:12px;line-height:1.5}
.explorer-tree button>span{flex:1}.explorer-tree small{font:9px ui-monospace,monospace;color:var(--muted)}.explorer-tree b{font-size:10px;font-weight:400}.explorer-tree button:hover,.explorer-tree button[aria-current]{background:color-mix(in srgb,var(--accent) 9%,transparent);color:var(--accent)}
.tree-folders{border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:8px}.tree-note-label{font-size:9px;padding:14px 10px;color:var(--muted)}
.command-log{max-height:145px;overflow:auto;padding:10px 22px;border-top:1px solid var(--line);font:10px/1.8 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.command-log p{margin-bottom:8px;color:var(--deep)}
.command-form{display:flex;align-items:center;gap:10px;padding:15px 20px;background:var(--surface);border-top:1px solid var(--line);font:11px ui-monospace,monospace}.command-form label{color:var(--accent);white-space:nowrap}.command-form input{min-width:0;flex:1;background:transparent;border:0;outline:0;color:var(--ink);font:inherit}.command-form:focus-within{box-shadow:inset 0 0 0 2px var(--accent)}.command-form button{font:9px ui-monospace,monospace;border:1px solid var(--line);background:var(--bg);padding:5px;border-radius:5px}#command-hint{font-size:8px;padding:8px 20px;color:var(--muted)}
.explorer-preview{min-width:0;min-height:0;display:flex;flex-direction:column}.explorer-preview-content{overflow:auto;padding:20px 30px 40px}.explorer-preview-content .topic-title h1{font-size:46px}.explorer-preview-content .topic-title p{font-size:15px}.explorer-preview-content .deep-dive-grid{grid-template-columns:1fr}.explorer-preview-content .deep-dive-grid>a{display:block}.explorer-preview-content .deep-dive-grid h2{margin:16px 0;font-size:26px}.explorer-preview-content .source-preview h1{font-size:38px}.explorer-preview-content .source-preview{padding:25px 0}.explorer-preview-content .topic-shell{padding:0}
.terminal-workbench.console{grid-template-columns:minmax(330px,1fr) minmax(0,1fr)}.console .explorer-pane{background:#202b29;color:#e2e9e6;--line:#ffffff18;--muted:#a4b8af;--accent:#add4bb;--bg:#273531;--deep:#d9e7df;--ink:#e2e9e6}
.console .explorer-toolbar{font-family:ui-monospace,monospace}.console .explorer-location{font-size:12px}.console .explorer-tree{font-family:ui-monospace,monospace}.console .explorer-tree button{font-size:11px;border-radius:0}.console .command-log{max-height:220px;flex:.6;font-size:11px}.console .command-form{background:#17221f}.console .command-form button{color:var(--ink)}
.preview-expanded{grid-template-columns:1fr!important}.preview-expanded .explorer-pane{display:none}.preview-expanded .explorer-preview-content{width:100%;max-width:950px;margin:auto}
@media(max-width:1000px){.gallery-lab-controls{flex-direction:column;align-items:center}.terminal-workbench{grid-template-columns:minmax(280px,.9fr) minmax(0,1fr)}.explorer-preview-content{padding-inline:22px}.explorer-preview-content .topic-title h1{font-size:36px}}
@media(max-width:760px){.gallery-lab-controls{padding:0 18px;gap:8px;font-size:9px}.gallery-lab-controls>div{justify-content:center}.gallery-lab-controls a{padding:4px 6px}.live-carousel{height:405px}.live-carousel .floating-page{width:250px;height:305px;top:35px}.live-carousel .floating-page[data-position=left]{transform:translateX(calc(-50% - 170px)) rotateZ(-12deg) scale(.88)}.live-carousel .floating-page[data-position=right]{transform:translateX(calc(-50% + 170px)) rotateZ(12deg) scale(.88)}.carousel-controls{bottom:8px}.terminal-workbench,.terminal-workbench.console{display:flex;flex-direction:column;height:auto}.explorer-pane{height:520px;border-right:0;border-bottom:1px solid var(--line)}.explorer-preview{max-height:780px}.explorer-preview-content .topic-title h1{font-size:36px}.command-form{padding:14px 12px;gap:7px}.command-form input{font-size:10px}.explorer-preview-content{padding:16px 20px 30px}.carousel-controls span{min-width:120px;font-size:9px}}
