.triangle-board{max-width:720px;margin:12px auto;color:#243749}
.triangle-board canvas{display:block;touch-action:none;width:100%;height:auto;aspect-ratio:560/205;background:#f1f6ed;border:1px solid #c5d3c5;border-radius:9px;object-fit:contain}
.triangle-board .tri-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:8px 0}
.triangle-board label{display:flex;align-items:center;gap:9px;flex:1;min-width:170px}
.triangle-board input[type=range]{min-width:70px;width:auto;flex:1;accent-color:#37695b}
.triangle-board output{min-width:3em}.tri-status{font-size:.88rem;color:#426453}
#triActions,#triFindings{margin:8px 0}#triList .work-card{margin:8px 0}.triangle-board [hidden]{display:none!important}
#triFindings canvas{max-height:145px}.slide-paper .triangle-board{max-width:570px}
.ggb-board{width:100%;min-width:0;margin:.55rem 0;color:#243749}
.ggb-frame{display:block;width:100%;height:clamp(290px,54vh,530px);border:1px solid #bbc9bd;border-radius:6px;background:white}
.ggb-command,.ggb-editor-inputs{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;margin:.45rem 0}
.ggb-command input{min-width:9rem;flex:1}.ggb-command[hidden]{display:none}
.ggb-keypad{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;max-width:560px;padding:6px;margin:0 0 6px;border:1px solid #cbd6c9;border-radius:6px;background:#eff3ed}
.ggb-keypad[hidden]{display:none}.ggb-keypad .ggb-key{min-width:0;min-height:34px;padding:3px 1px;line-height:1.2;border:1px solid #ced8ce;border-radius:4px;background:white;color:#294d40;font-size:15px;touch-action:manipulation}
.ggb-keypad .ggb-key:active,.ggb-key-toggle[aria-expanded=true]{background:#deeadf;border-color:#789985}
.ggb-note{display:block;color:#466751}.ggb-note:empty,#ggbEditorNote:empty{display:none}
.ggb-note.bad{color:#963e32}.ggb-editor{width:min(940px,94vw);max-height:94vh}
.ggb-editor-inputs label{display:flex;align-items:center;gap:.4rem}.ggb-editor-inputs input{max-width:240px}
.canvas-geometry .ggb-frame{height:310px}.slide-paper .ggb-frame{height:395px}#triFindings .ggb-frame{height:285px}

.ggb-tools,.ggb-object-list,.ggb-object-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.ggb-tools{margin:4px 0}.ggb-tools[hidden],.ggb-objects[hidden]{display:none}
.ggb-objects{margin:5px 0;border:1px solid #cbd6c9;border-radius:6px;padding:5px 8px;background:#f7f9f4}
.ggb-objects summary{cursor:pointer;font-weight:600}
.ggb-object-list{align-items:stretch;margin-top:5px}.ggb-object-row{padding:4px 8px;background:white;border-radius:4px}
.ggb-object-row label{display:inline-flex;align-items:center;gap:4px;font-size:14px}
.ggb-object-row input[type=number]{width:5.4em;min-width:0}
.ggb-object-row input[type=range]{width:clamp(90px,18vw,220px);accent-color:#37695b}
.ggb-student .ggb-tools button,.ggb-student .ggb-key,.ggb-student .ggb-object-row input:not([type=checkbox]){min-height:44px}
.ggb-student .ggb-keypad{max-width:100%}
.ggb-dock{display:contents}
.ggb-full-tools{display:none}
.student-wrap:has(#studentTriangle:not([hidden])>div:not([hidden])>.ggb-board){max-width:none}
.ggb-board.ggb-expanded{
  position:fixed;inset:0;z-index:1000;box-sizing:border-box;display:flex;flex-direction:column;
  width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;
  overflow:hidden;overscroll-behavior:contain;background:#fffefa;color:#243749;font-size:16px;line-height:1.35
}
.ggb-board.ggb-expanded .ggb-tools{
  order:3;align-self:center;flex:0 0 auto;position:relative;z-index:2;max-width:calc(100% - 14px);margin:0 7px max(7px,env(safe-area-inset-bottom));
  align-items:center;gap:3px;flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;padding:3px;
  background:#fafbf7;border:1px solid #d3dacf;border-radius:10px;box-shadow:0 3px 14px #34443a12
}
.ggb-expanded .ggb-tools>*{flex:none}
.ggb-expanded .ggb-tools>.ggb-zoom-actions{display:flex;gap:3px}
.ggb-board.ggb-expanded .ggb-full-tools{display:inline-block}
.ggb-expanded:not(.ggb-controls-open) .ggb-tools>:not(.ggb-full-tools,.ggb-expand-toggle,.ggb-zoom-actions),
.ggb-expanded:not(.ggb-controls-open)>.ggb-objects,.ggb-board.ggb-expanded:not(.ggb-controls-open) .ggb-dock{display:none}
.ggb-board.ggb-expanded::before{content:"";flex:1;pointer-events:none}
.ggb-board.ggb-expanded .ggb-frame{position:absolute;inset:0;min-height:0;min-width:0;width:100%;height:100%!important;border:0;border-radius:0}
.ggb-board.ggb-expanded .ggb-dock{
  display:block;position:relative;z-index:1;align-self:center;order:2;flex:0 1 auto;
  width:min(100%,600px);max-height:48%;overflow:auto;overscroll-behavior:contain;background:#fffefa
}
.ggb-board.ggb-expanded .ggb-objects{margin:0}
.ggb-board.ggb-expanded>.ggb-objects,.ggb-board.ggb-expanded>.ggb-note{position:relative;z-index:1;max-height:25%;overflow:auto}
body:has(.ggb-expanded){overflow:hidden}
.layout-plane:has(.ggb-inline-fullscreen){transform:none;isolation:auto}
.layout-viewport:has(.ggb-inline-fullscreen),[data-layout-key]:has(.ggb-inline-fullscreen){overflow:visible;z-index:1000}
.ggb-zoom summary{display:inline list-item;cursor:pointer;padding:6px;color:#345e51}
.ggb-zoom[open]>div{display:inline-flex;gap:4px;flex-wrap:wrap}
.ggb-student .ggb-zoom summary{display:inline-block;min-height:44px;line-height:32px}
.ggb-student .ggb-zoom summary::after{content:" ▸"}.ggb-student .ggb-zoom[open] summary::after{content:" ▾"}

@media(max-width:560px){
  .ggb-student .ggb-tools{gap:4px}
  .ggb-student .ggb-tools button{padding:4px 8px;font-size:14px}
  .ggb-student .ggb-zoom[open]{display:flex;align-items:center;gap:4px;flex:1 0 100%}
  .ggb-student .ggb-zoom[open]>div{display:flex}
}
