/* Chapter 3 outer UI only. No Canvas resolution, drawing geometry or animation changes. */
body.bio-compact-v3 .wrap{width:100%;max-width:1080px;margin:0 auto}
body.bio-compact-v3 .floating-lang-container{border-radius:999px;gap:4px;padding:5px 7px;z-index:19000}
body.bio-compact-v3 .floating-lang-container .lang-btn{border-radius:999px;min-height:44px;padding:5px 10px}
body.bio-compact-v3 :is(.bio3-controls,.bio3-head-tools,.macro-controls,.label-lab,.choice-row) :is(button,select,input:not([type=range])){font-size:17px;line-height:1.35;min-height:44px;min-width:44px;padding:6px 9px;max-width:100%;white-space:normal}
body.bio-compact-v3 .bio3-bench{display:grid;grid-template-columns:minmax(0,1fr);gap:0;min-width:0;padding:0;align-items:stretch}
.bio3-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid var(--rule);position:relative;z-index:10;isolation:isolate;background:var(--bg-deep,#11261f)}
body.bio-compact-v3 .bio3-head h3{font-size:19px;line-height:1.4;flex:1 1 210px;margin:0;color:var(--teal)}
.bio3-head-tools{display:flex;flex-wrap:wrap;gap:6px;position:relative;z-index:11}
body.bio-compact-v3 .bio3-head-tools button{appearance:none;font-family:inherit;font-weight:700;width:auto;margin:0;cursor:pointer;touch-action:manipulation;border:2px solid var(--rule);border-radius:9px;background:var(--bg-card,#1c3d34);color:var(--white,#f2ecd9)}
body.bio-compact-v3 .bio3-head-tools :is([data-expand],[data-action=fullscreen]){background:var(--yellow,#fde047);color:var(--bg-deep,#11261f);border-color:var(--yellow,#fde047)}
body.bio-compact-v3 .bio3-controls{padding:10px 12px;display:block;min-height:0;min-width:0;border-bottom:1px solid var(--rule);max-height:none}
body.bio-compact-v3 .bio3-controls .local-language{display:none}
body.bio-compact-v3 .bio3-controls [hidden]{display:none}
body.bio-compact-v3 .bio3-controls :is(.control-block,.ps-control):empty{display:none}
.bio3-toolbar{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 12px;min-width:0}
.bio3-group{flex:1 1 195px;min-width:0;max-width:100%;display:flex;flex-direction:column;gap:4px}
body.bio-compact-v3 .bio3-controls .bio3-group-label{font-size:15px;line-height:1.4;color:var(--muted);font-weight:700;margin:0}
body.bio-compact-v3 .bio3-controls :is(.choice-row,.food-row,.lab-actions,.ps-buttons,.molecular-stages,.an-group,.an-row){display:flex;flex-wrap:wrap;gap:6px;margin:0;grid-template-columns:none}
body.bio-compact-v3 .bio3-controls :is(.choice-row,.food-row,.ps-buttons,.molecular-stages,.an-group,.an-row) button{flex:1 1 auto;width:auto;margin:0;text-align:center}
body.bio-compact-v3 .bio3-controls .lab-actions button{flex:1 1 170px;width:auto;margin:0}
body.bio-compact-v3 .bio3-actions-group{flex-basis:100%}
body.bio-compact-v3 .bio3-controls :is(label,select,input,.metric){font-size:17px;line-height:1.4;margin:0}
body.bio-compact-v3 .bio3-controls :is(input,select){width:100%;min-height:44px}
body.bio-compact-v3 .bio3-controls .an-guide{padding:8px;margin:0}
body.bio-compact-v3 .bio3-controls .an-guide :is(strong,p){font-size:16px;line-height:1.4;margin:4px 0}
body.bio-compact-v3 .bio3-controls .an-guide button{margin:4px 0}
body.bio-compact-v3 .bio3-controls :is(.lab-progress,.ps-timeline){display:flex;flex-wrap:wrap;gap:4px;margin:0;padding:0;list-style:none}
body.bio-compact-v3 .bio3-controls :is(.lab-progress,.ps-timeline) li{font-size:15px;line-height:1.4;padding:3px 6px;border-width:1px;margin:0}
body.bio-compact-v3 .bio3-view{padding:12px;display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;align-self:stretch;max-height:none}
.bio3-media{width:100%;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0}
body.bio-compact-v3 .bio3-media canvas{display:block;width:100%;height:auto;margin:0;flex:0 0 auto;aspect-ratio:960/620}
body.bio-compact-v3 .bio3-media .an-stage{width:100%;flex:0 0 auto;aspect-ratio:960/660}
body.bio-compact-v3 .bio3-media .an-stage canvas{height:100%;aspect-ratio:960/660}
body.bio-compact-v3 .bio3-media .ps-original-viewer{width:100%;height:auto;aspect-ratio:1297/769}
body.bio-compact-v3 .bio3-media .photo-box{width:100%;margin:0}
body.bio-compact-v3 .bio3-media .focus-photo{width:100%;height:auto;max-height:620px;object-fit:contain}
body.bio-compact-v3 .bio3-media [hidden]{display:none}
.bio3-caption{width:100%;min-width:0;border-left:4px solid var(--teal);border-radius:8px;background:var(--bg-card,#1c3d34);padding:12px 14px}
body.bio-compact-v3 .bio3-caption :is(p,figcaption,.lab-status,.ps-status,.an-caption){font-size:22px;line-height:1.6;margin:6px 0;min-height:0;max-height:none;overflow:visible}
body.bio-compact-v3 .bio3-caption :is(h3,strong){font-size:24px;line-height:1.4;color:var(--yellow)}
body.bio-compact-v3 .bio3-caption :is(.lab-status,.ps-status,.an-caption){border:0;background:transparent;padding:0;margin:0}
body.bio-compact-v3 .bio3-caption .metric{font-size:22px}
body.bio-compact-v3 .bio3-caption .bio3-control-explanation{margin:8px 0}
body.bio-compact-v3 .bio3-caption :is(.lab-mode-note,.ps-caption,.ps-credits,.an-credit,.credit){display:block;font-size:16px;line-height:1.5;color:var(--muted);padding:0;border:0;margin:6px 0}
body.bio-compact-v3 .bio3-caption .ps-credits strong{font-size:16px;color:var(--muted)}
/* A compact left rail does not compete with the drawing. Caption has its own scroll area. */
body.bio-compact-v3 .bio3-bench.expanded{display:grid;grid-template-columns:244px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px 12px;align-items:stretch;position:fixed;inset:0;z-index:10002;width:100%;height:100vh;height:100dvh;max-width:none;margin:0;border:0;border-radius:0;padding:10px;overflow:hidden;background:var(--bg-base,#11261f)}
body.bio-compact-v3 .bio3-bench.expanded .bio3-head{grid-column:1/-1;grid-row:1;min-height:54px;padding:4px var(--bio3-lang-clearance,180px) 8px 0}
body.bio-compact-v3 .bio3-bench.expanded .bio3-controls{grid-column:1;grid-row:2;overflow:auto;overscroll-behavior:contain;padding:8px;border:1px solid var(--rule);border-radius:10px;max-height:none;touch-action:pan-y}
body.bio-compact-v3 .bio3-bench.expanded .bio3-toolbar{flex-direction:column;gap:10px}
body.bio-compact-v3 .bio3-bench.expanded .bio3-group{flex:0 0 auto;width:100%}
body.bio-compact-v3 .bio3-bench.expanded .bio3-controls .lab-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
body.bio-compact-v3 .bio3-bench.expanded .bio3-view{grid-column:2;grid-row:2;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:8px;height:100%;overflow:hidden;padding:0}
body.bio-compact-v3 .bio3-bench.expanded .bio3-media{height:100%;overflow:hidden}
body.bio-compact-v3 .bio3-bench.expanded .bio3-media>canvas{width:min(100%,calc(var(--bio3-media-h,380px) * 960 / 620));max-height:var(--bio3-media-h,380px);height:auto}
body.bio-compact-v3 .bio3-bench.expanded .bio3-media .an-stage{width:min(100%,calc(var(--bio3-media-h,380px) * 960 / 660));max-height:var(--bio3-media-h,380px)}
body.bio-compact-v3 .bio3-bench.expanded .bio3-media .ps-original-viewer{width:min(100%,calc(var(--bio3-media-h,380px) * 1297 / 769));max-height:var(--bio3-media-h,380px)}
body.bio-compact-v3 .bio3-bench.expanded .bio3-media .photo-box{height:100%;display:flex;align-items:center;justify-content:center}
body.bio-compact-v3 .bio3-bench.expanded .bio3-media .focus-photo{width:auto;height:auto;max-width:100%;max-height:var(--bio3-media-h,380px)}
body.bio-compact-v3 .bio3-bench.expanded .bio3-caption{max-height:min(27dvh,220px);min-height:0;overflow:auto;overscroll-behavior:contain;padding:8px 10px}
body.bio-compact-v3 .bio3-bench.expanded .bio3-caption .an-credit{display:block}
@media(max-aspect-ratio:1/1){
 body.bio-compact-v3 .bio3-bench.expanded{grid-template-columns:minmax(0,1fr);grid-template-rows:auto clamp(130px,20dvh,220px) minmax(0,1fr)}
 body.bio-compact-v3 .bio3-bench.expanded .bio3-head{grid-column:1;grid-row:1}
 body.bio-compact-v3 .bio3-bench.expanded .bio3-controls{grid-column:1;grid-row:2}
 body.bio-compact-v3 .bio3-bench.expanded .bio3-view{grid-column:1;grid-row:3}
 body.bio-compact-v3 .bio3-bench.expanded .bio3-toolbar{flex-direction:row}
 body.bio-compact-v3 .bio3-bench.expanded .bio3-group{flex:1 1 195px;width:auto}
}
@media(max-width:480px){body.bio-compact-v3 .bio3-bench.expanded .bio3-head{padding-right:0;padding-top:62px}}
