/* Scoped to #gr-lab and .gr-* only; the page's own global CSS (`*{margin:0;padding:0}`, `.hero`, `input[type=range]`) is neither edited nor relied on. */
#gr-lab,#gr-lab *{box-sizing:border-box}
#gr-lab{max-width:1100px;margin:16px auto;padding:20px 24px;background:#f5f4ed;color:#193336;font:15px/1.5 'Noto Sans JP',system-ui,sans-serif;border-radius:14px}
:where(#gr-lab) p{margin:0 0 8px}
:where(#gr-lab) dl,:where(#gr-lab) dd{margin:0}
:where(#gr-lab) h3{margin:8px 0 4px}
#gr-lab [hidden]{display:none!important}
#gr-lab button,#gr-lab input,#gr-lab select{font:inherit;color:inherit}
#gr-lab button,#gr-lab select{border:1px solid #bbcec5;background:#fffefa;border-radius:9px;min-height:40px;padding:7px 12px;cursor:pointer}
#gr-lab :focus-visible{outline:3px solid #bd761f;outline-offset:3px}
#gr-lab button:disabled,#gr-lab input:disabled,#gr-lab select:disabled{cursor:default;opacity:.7}
#gr-lab button[aria-pressed=true]{background:#087f78;color:white;border-color:#087f78}
.gr-title-row{display:flex;align-items:center;gap:10px;justify-content:space-between}
#gr-lab .gr-title-row h1{font-size:28px;line-height:1.3;margin:0;min-width:0;font-weight:800;color:#193336}
.gr-title-row #openGuide{background:#193336;color:white;border:0;font-size:13px;font-weight:700;flex-shrink:0;min-height:44px;white-space:nowrap}
.gr-subtitle{margin:7px 0 12px;font-size:14px;color:#556d66}
.gr-mode-label{font-size:12px;margin-right:10px}
#gearType{min-width:250px;margin-bottom:12px}
.gr-workbench{display:grid;grid-template-columns:1.4fr 1fr;gap:16px;align-items:start}
.gr-visual{position:relative;border:1px solid #bbcec5;border-radius:13px;overflow:visible;background:#e8eee3}
.gr-diagram-caption{display:flex;justify-content:space-between;padding:10px 12px 0;font-size:11px;color:#587066}
.gr-title-mascot{flex:0 0 auto;display:block}
.gr-drawing{display:block;width:100%;height:300px;touch-action:pan-y}
.gr-drawing [data-control]:not([data-control=""]){cursor:ns-resize}
/* 3D depth view: one-finger vertical drags keep scrolling the page (pan-y); two-finger / explicit touch-rotate mode set touch-action:none from JS. */
#gr-lab canvas.gr-depth{width:100%;height:300px;touch-action:pan-y;cursor:grab;background:#0a1829;outline-offset:-3px}
#gr-lab canvas.gr-depth.gr-dragging{cursor:grabbing}
.gr-depth-tools{display:flex;gap:7px;flex-wrap:wrap;padding:6px 12px 0}
.gr-depth-tools button{min-height:44px;font-size:12px}
.gr-depth-notice{margin:0;padding:4px 12px 0;font-size:12px;color:#94452b}
.gr-depth-notice:empty{display:none}
.gr-diagram-note{margin:0;padding:2px 12px 7px;font-size:11px;color:#587066}
.gr-results{display:grid;grid-template-columns:1fr 1.2fr;background:#fffefa;border-top:1px solid #bbcec5;border-bottom:1px solid #bbcec5;padding:10px 12px;gap:6px;min-height:80px}
.gr-results span{font-size:12px;display:block}
.gr-results p{margin:0}
.gr-results strong{font-size:26px;font-weight:650;font-variant-numeric:tabular-nums}
.gr-results small{font-size:12px;margin-left:3px}
.gr-meaning{font-size:12px;padding:7px 12px;margin:0;min-height:48px}
.gr-primary{background:#fffefa;padding:12px;border:1px solid #bbcec5;border-radius:12px}
.gr-field{padding:5px 0 7px}
.gr-field-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.gr-field-head label{font-size:13px}
.gr-field-head>span{display:flex;align-items:center;gap:5px;flex-shrink:0}
.gr-field-head input[type=number]{width:86px;min-height:32px;border:1px solid #97b5a9;border-radius:6px;padding:3px 6px;background:#fff}
.gr-field-head small{font-size:11px;min-width:16px}
#gr-lab input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:28px;background:transparent;border-radius:0;accent-color:#087f78;cursor:pointer;margin:3px 0 0;padding:0;touch-action:pan-y}
#gr-lab input[type=range]::-webkit-slider-runnable-track{height:6px;border-radius:3px;background:#c4d6cd}
#gr-lab input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:24px;height:24px;margin-top:-9px;border-radius:50%;background:#087f78;border:2px solid #fff;box-shadow:0 1px 4px #0005;transform:none}
#gr-lab input[type=range]::-moz-range-track{height:6px;border-radius:3px;background:#c4d6cd}
#gr-lab input[type=range]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:#087f78;border:2px solid #fff;transform:none}
#gr-lab input[aria-invalid=true]{border-color:#b34d2d;background:#fff2eb}
.gr-playback,.gr-buttons{display:flex;gap:7px;flex-wrap:wrap}
.gr-playback button{flex:1;white-space:nowrap}
.gr-clock{font-size:11px;color:#5e706a;min-height:32px;margin:7px 0}
.gr-input-status{font-size:12px;min-height:0;margin:4px 0;color:#94452b}
.gr-input-status:not(:empty){min-height:38px}
#gr-lab details{border-top:1px solid #bdcdc5;padding:12px 0;margin-top:12px}
#gr-lab summary{font-weight:650;cursor:pointer;min-height:24px}
#parameterDetails{background:#fffefa;border:1px solid #bdcdc5!important;border-radius:10px;padding:13px!important}
#gr-lab h3{font-size:14px}
#gr-lab .gr-hint{font-size:12px;color:#5e706a}
.gr-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.gr-metrics div{background:#fffefa;padding:10px;border:1px solid #bdcdc5;border-radius:8px}
.gr-metrics dt{font-size:12px}
.gr-metrics dd{font-size:17px;margin:5px 0 0;font-variant-numeric:tabular-nums}
.gr-guide{position:absolute;top:7px;left:6px;z-index:4;width:280px;max-width:calc(100% - 12px);display:flex;gap:3px;align-items:start;pointer-events:none;filter:drop-shadow(0 4px 8px #19333620)}
.gr-guide>img{flex:0 0 45px;margin-top:14px}
.gr-guide>div{border:1px solid #90b1a2;border-radius:13px;background:#fffef6;padding:9px 9px 9px 10px;flex:1;min-width:0;pointer-events:auto}
.gr-guide small{font-size:10px;color:#52786b;display:block;padding-right:20px}
.gr-guide p{font-size:12px;line-height:1.5;margin:2px 0 0}
.gr-guide #closeGuide{float:right;border:0;background:none;min-height:40px;padding:0;width:40px;line-height:40px;margin:-9px -9px 0 0;font-size:22px}
.gr-guide #guideUse{font-size:11px;min-height:30px;padding:4px 8px;margin-top:5px}
.gr-boot{font-size:12px;border-left:3px solid #b97d2d;padding-left:10px;margin:14px 0}
.gr-boot:empty{display:none}
#gr-lab a{color:#006c66}
#shareURL{width:100%;min-height:38px}
#stageResults{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.gr-stage-card{background:#fffefa;border-radius:8px;padding:10px;font-size:12px}
#compareContainer{display:grid;gap:8px}
#compareContainer article{border:1px solid #bdcdc5;border-radius:8px;padding:10px}
#gr-lab #canvas{display:none}
/* Original hero text moved below the lab (text unchanged) + the hero anchor kept for shared Studio/objective scripts. */
.gr-original-intro{max-width:1100px;margin:12px auto 0;padding:0 24px}
.gr-original-intro .hero-badge{background:rgba(0,123,255,.1);color:#0b4a8f;border-color:rgba(0,123,255,.3)}
.gr-original-intro .hero-sub{display:block!important;color:#3d5a52;max-width:none;font-size:.9rem}
.gr-original-intro .ns-qa{margin:12px 0!important;max-width:none!important}
.hero.gr-hero-anchor{padding:0!important;margin:0;background:none!important;min-height:0}
.hero.gr-hero-anchor:has(.hero-inner>*){padding:14px 0!important;background:linear-gradient(135deg,#001F3F 0%,#003875 60%,#0056a8 100%)!important}
@media(max-width:650px){
 #gr-lab{margin:0;padding:8px 12px 22px;border-radius:0}
 .gr-original-intro{padding:0 12px}
 .gr-title-mascot{width:40px;height:46px}
 .gr-guide small{padding-right:30px}
 .gr-title-row{gap:8px}
 #gr-lab .gr-title-row h1{font-size:18px;line-height:1.25}
 .gr-title-row #openGuide{font-size:11px;padding:7px 8px;min-width:69px}
 .gr-subtitle{font-size:11px;margin:6px 0 8px;line-height:1.5}
 .gr-mode-label{display:none}
 #gearType{width:100%;min-width:0;min-height:34px;padding:5px 9px;font-size:12px;margin-bottom:8px}
 .gr-workbench{display:block}
 .gr-drawing{height:150px}
 #gr-lab canvas.gr-depth{height:220px}
 .gr-depth-tools{padding:5px 9px 0}
 .gr-diagram-caption{font-size:10px;padding:5px 9px 0}
 .gr-diagram-note{font-size:9px;padding:0 9px 4px;min-height:17px}
 .gr-results{padding:6px 10px;min-height:62px}
 .gr-results span{font-size:10px}
 .gr-results strong{font-size:21px}
 .gr-results small{font-size:10px}
 .gr-meaning{min-height:38px;font-size:10px;padding:5px 9px}
 .gr-input-column{margin-top:7px}
 .gr-primary{padding:5px 10px}
 .gr-field{padding:3px 0}
 .gr-field-head label{font-size:12px}
 .gr-field-head input[type=number]{width:72px;min-height:30px;padding:2px 5px;font-size:13px}
 .gr-field-head small{min-width:13px}
 #gr-lab input[type=range]{height:27px;margin-top:0}
 .gr-guide{top:4px;width:278px}
 .gr-guide p{font-size:11px;line-height:1.4}
 .gr-guide>div{padding:7px 9px}
 .gr-playback{margin-top:8px;gap:6px}
 .gr-playback button{font-size:12px;padding:6px}
 .gr-clock{font-size:10px}
 .gr-metrics{grid-template-columns:repeat(2,1fr)}
 .gr-metrics dd{font-size:15px}
 #stageResults{grid-template-columns:1fr}
}
@media(max-width:380px){#gr-lab .gr-title-row h1{font-size:16px;line-height:1.3}}
@media(prefers-reduced-motion:reduce){#gr-lab{scroll-behavior:auto}}
