/* Shared example window. The iframe viewport owns the demo's scrolling. */
:root { --demo-header:47px; --demo-edge:6px; }
* { box-sizing:border-box; }
html,body { width:100%; height:100%; margin:0; overflow:hidden; }
body { background:#816a58; font-family:Arial,sans-serif; }
.demo-browser-header { position:fixed; inset:0 0 auto; height:var(--demo-header); background:#816a58; z-index:10000; }
.demo-brand { display:block; width:214.2115384615px; height:47px; background:url('../assets/tab-lab-header-left.svg') left bottom / 214.2115384615px 47px no-repeat; }
.demo-browser-content { position:fixed; inset:var(--demo-header) var(--demo-edge) var(--demo-edge); overflow:hidden; border:1px solid #604b3b; border-radius:0 0 9px 9px; background:#e8dfd4; }
.foundry-demo-frame { display:block; width:100%; height:100%; border:0; background:#fff; }
.tablab-demo-shell .foundry-global-nav { position:fixed; inset:0 10px auto auto; height:47px; width:max-content; max-width:none; display:flex; align-items:center; gap:8px; padding:0; border:0; border-radius:0; background:none; box-shadow:none; backdrop-filter:none; transform:none; z-index:10020; }
.tablab-demo-shell .foundry-global-control { position:relative; display:flex; align-items:center; justify-content:center; width:40px; min-width:40px; flex-shrink:0; height:32px; min-height:32px; margin:0; padding:0; border:1px solid #ad927b; border-radius:8px; background:linear-gradient(#9a806a,#725a47); color:#fff9f1; box-shadow:inset 0 1px 0 #ffffff30,0 2px 3px #34271e40; clip-path:none; transform:none; }
.tablab-demo-shell .foundry-global-control::before,.tablab-demo-shell .foundry-global-control::after,.tablab-demo-shell .foundry-global-nav::before,.tablab-demo-shell .foundry-global-nav::after { display:none; }
.tablab-demo-shell .foundry-global-back { width:auto; min-width:174px; gap:8px; padding:0 12px; font:600 14px/1 Arial,sans-serif; letter-spacing:normal; text-transform:none; }
.tablab-demo-shell .foundry-global-control svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:3; filter:none; }
.tablab-demo-shell .foundry-global-home svg { fill:currentColor; stroke:none; }
.tablab-demo-shell .foundry-global-menu span { position:absolute; left:10px; top:15px; width:18px; height:2px; margin:0; background:#fff9f1; border-radius:2px; transform:none; transition:transform .2s,opacity .2s; }
.tablab-demo-shell .foundry-global-menu span:nth-child(1) { transform:translateY(-6px); }
.tablab-demo-shell .foundry-global-menu span:nth-child(3) { transform:translateY(6px); }
.tablab-demo-shell body.foundry-global-open .foundry-global-menu span:nth-child(1) { transform:rotate(45deg); }
.tablab-demo-shell body.foundry-global-open .foundry-global-menu span:nth-child(2) { opacity:0; }
.tablab-demo-shell body.foundry-global-open .foundry-global-menu span:nth-child(3) { transform:rotate(-45deg); }
.tablab-demo-shell .foundry-global-control:focus-visible,.demo-brand:focus-visible { outline:2px solid #fff; outline-offset:2px; }
@media(max-width:540px) {
 :root { --demo-header:88px; --demo-edge:3px; }
 .tablab-demo-shell .foundry-global-nav { top:47px; left:8px; right:8px; width:auto; height:38px; justify-content:flex-end; }
 .tablab-demo-shell .foundry-global-back { margin-right:auto; }
}
@media(prefers-reduced-motion:reduce) { .tablab-demo-shell .foundry-global-menu span { transition:none; } }

.tablab-demo-shell .demo-fullscreen { width:auto; min-width:132px; gap:8px; padding:0 12px; font:600 14px/1 Arial,sans-serif; letter-spacing:normal; text-transform:none; }
.tablab-demo-shell .demo-fullscreen svg { width:18px; height:18px; stroke-width:2; }
.demo-browser-content:fullscreen,.demo-browser-content.demo-expanded { position:fixed; inset:0; width:100%; height:100%; border:0; border-radius:0; background:#fff; }
.demo-fullscreen-return { position:absolute; top:22%; left:0; z-index:10; width:32px; padding:13px 7px; border:1px solid #ad927b; border-left:0; border-radius:0 9px 9px 0; background:linear-gradient(90deg,#725a47,#907660); color:#fff9f1; box-shadow:2px 3px 8px #0003; font:600 14px/1.2 Arial,sans-serif; writing-mode:vertical-rl; cursor:pointer; }
.demo-fullscreen-return:hover { background:#604b3b; }
.demo-fullscreen-return:focus-visible { outline:2px solid white; outline-offset:2px; }
.demo-fullscreen-status { position:fixed; top:50px; right:12px; z-index:10030; padding:8px 12px; border-radius:6px; background:#3d3028; color:white; font-size:14px; }
.demo-fullscreen-status:empty,[hidden] { display:none !important; }
@media(max-width:700px) and (min-width:541px) {
 :root { --demo-header:88px; }
 .tablab-demo-shell .foundry-global-nav { top:47px; height:38px; }
}
@media(max-width:420px) {
 .tablab-demo-shell .foundry-global-nav { gap:5px; }
 .tablab-demo-shell .foundry-global-back { min-width:0; padding:0 8px; font-size:13px; }
 .tablab-demo-shell .demo-fullscreen { min-width:0; padding:0 8px; font-size:13px; gap:5px; }
 .tablab-demo-shell .foundry-global-home,.tablab-demo-shell .foundry-global-menu { width:32px; min-width:32px; }
 .tablab-demo-shell .foundry-global-menu span { left:6px; }
}

.demo-expanded-mode .demo-browser-header,.tablab-demo-shell .demo-expanded-mode .foundry-global-nav { display:none; }

/* Mobile example frame: reserve space explicitly instead of squeezing controls. */
@media(max-width:700px) and (orientation:portrait) {
 :root { --demo-header:76px; --demo-edge:3px; }
 .demo-brand { width:164px; height:36px; background-size:164px 36px; }
 .tablab-demo-shell .foundry-global-nav { inset:0 6px auto; width:auto; height:76px; display:block; }
 .tablab-demo-shell .foundry-global-control { position:absolute; height:36px; min-height:36px; }
 .tablab-demo-shell .foundry-global-back { top:38px; left:0; right:auto; width:auto; min-width:0; margin:0; padding:0 10px; font-size:14px; }
 .tablab-demo-shell .demo-fullscreen { top:38px; right:0; left:auto; width:auto; min-width:0; padding:0 10px; font-size:14px; }
 .tablab-demo-shell .foundry-global-home { top:0; right:42px; left:auto; width:36px; min-width:36px; }
 .tablab-demo-shell .foundry-global-menu { top:0; right:0; left:auto; width:36px; min-width:36px; }
 .tablab-demo-shell .foundry-global-menu span { top:17px; left:8px; }
 .demo-fullscreen-return { width:36px; padding:16px 9px; }
}
@media(max-width:1000px) and (orientation:landscape) {
 :root { --demo-header:47px; --demo-edge:3px; }
 .tablab-demo-shell .foundry-global-nav { inset:0 6px auto auto; width:max-content; height:47px; display:flex; gap:6px; }
 .tablab-demo-shell .foundry-global-control { position:relative; inset:auto; height:40px; min-height:40px; }
 .tablab-demo-shell .foundry-global-back { width:auto; min-width:0; margin:0; padding:0 10px; font-size:14px; }
 .tablab-demo-shell .demo-fullscreen { width:40px; min-width:40px; padding:0; }
 .tablab-demo-shell .demo-fullscreen span { display:none; }
 .tablab-demo-shell .foundry-global-home,.tablab-demo-shell .foundry-global-menu { width:40px; min-width:40px; }
 .tablab-demo-shell .foundry-global-menu span { top:19px; left:10px; }
}
@media(max-width:600px) and (orientation:landscape) {
 .demo-brand { width:172px; background-size:172px 37.75px; }
}
