/* Independent CG50 front, drawn from geometry and CSS materials. */
#cg50[hidden],#cg50-help[hidden],#model-choices[hidden]{display:none!important}
body.cg50-active #three-stage,body.cg50-active #calculator,body.cg50-active #calculator-assistant,body.cg50-active #assistant-keyboard,body.cg50-active #tutor-takeover{display:none!important}
#cg50{position:fixed;z-index:3;left:50%;top:50%;transform:translate(-50%,-50%);width:var(--cg-width,400px);height:var(--cg-height,850px);overflow:hidden;background:#242629;border-radius:var(--cg-radius,0);box-shadow:0 20px 75px #0008,inset 2px 0 3px #7775,inset -2px 0 4px #0009;touch-action:manipulation;user-select:none}
#cg50-front{position:absolute;width:400px;transform:scale(var(--cg-scale,1));transform-origin:top left;background:radial-gradient(ellipse at 45% 15%,#3d3f41 0,#292b2d 42%,#1b1e20 100%);height:var(--cg-logical-height,850px);color:#e8e8e4;font-family:Arial,sans-serif}
#cg50-front::before{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(96deg,#ffffff02 0 1px,transparent 1px 3px);box-shadow:inset 0 0 20px #0006}
#cg50-bezel{position:absolute;left:16px;width:368px;padding:6px;background:linear-gradient(135deg,#101213,#4d5052 48%,#191b1c);border-radius:7px;box-shadow:0 2px 1px #7775,0 -1px 2px #000,inset 0 0 2px #000;box-sizing:border-box}
#cg50-lcd{width:356px;height:200.25px;position:relative;overflow:hidden;background:#fff;color:#000;border:1px solid #888;box-sizing:border-box;box-shadow:inset 0 0 3px #0005;font-family:'Courier New',monospace}
#cg50-pixels{width:384px;height:216px;transform:scale(.921875);transform-origin:top left;position:relative;background:#fff}
#cg50-status{height:15px;border-bottom:1px solid #000;margin:0 2px;font:11px/14px 'Courier New',monospace;white-space:nowrap;display:flex;gap:6px;align-items:center}
#cg50-status span{border:1px solid #444;line-height:11px;font-size:10px;padding:0 1px}#cg50-status .cg-mode-name{margin-left:auto;border:0;color:#333}
#cg50-screen{height:181px;position:relative;overflow:hidden;padding:0 3px;box-sizing:border-box;font:18px/21px 'Courier New',monospace}
#cg50-soft{height:19px;display:grid;grid-template-columns:repeat(6,1fr);gap:2px;padding:0 2px;box-sizing:border-box}
#cg50-soft button{padding:0;border:1px solid #000;border-radius:0;font:14px/16px 'Arial Narrow',Arial,sans-serif;letter-spacing:-.6px;background:#fff;color:#000;overflow:hidden;white-space:nowrap;box-shadow:none;min-width:0}
#cg50-soft button.cg-menu-soft{background:#000;color:#fff}#cg50-soft button:disabled{border-color:transparent;background:#fff;color:#fff}
#cg50-screen button{border:0;border-radius:0;padding:0;background:none;color:inherit;font:inherit;text-align:left;box-shadow:none}
#cg50-screen .cg-heading{font:18px/21px 'Courier New',monospace;white-space:nowrap;height:22px}
#cg50-screen .cg-line{height:23px;display:flex;align-items:center;gap:2px;white-space:nowrap;overflow:hidden;flex-shrink:0}
#cg50-screen .cg-selected{background:#0000f2;color:#fff!important}
#cg50-screen .cg-value{margin-left:auto;padding-right:5px}
#cg50-screen math-field{border:0;border-radius:0;padding:0;margin:0;min-height:25px;width:100%;font-size:22px;background:transparent;color:inherit;--caret-color:#000;--selection-background-color:#9dc8ff;--contains-highlight-background-color:transparent;--primary:#000;--highlight-text:#000;outline:0}
#cg50-screen math-field::part(virtual-keyboard-toggle),#cg50-screen math-field::part(menu-toggle){display:none}#cg50-screen math-field::part(content){padding:1px 2px}#cg50-screen math-field::part(container){padding:0;border:0}
.cg-entry{position:absolute;bottom:0;left:2px;right:2px;border-top:1px solid #222;background:#fff;min-height:27px}.cg-entry .cg-prefix{font-size:17px;float:left;padding-top:3px}.cg-entry math-field{width:calc(100% - 44px)!important}
.cg-history{max-height:144px;overflow:hidden;font-size:20px;line-height:27px}.cg-history .cg-answer{text-align:right;padding-right:5px;min-height:26px}.cg-history math{font-size:22px}
#cg50[data-screen="home"] #cg50-status{height:24px;position:relative;justify-content:center;margin:0 2px}
#cg50-status .cg-main-title{font:17px/22px ClassWizX,monospace;border:0;padding:0;color:#555}
#cg50-status .cg-battery{position:absolute;left:2px;top:5px;width:8px;height:13px;border:1px solid #111;padding:1px;background:repeating-linear-gradient(to top,#171c86 0 2px,#fff 2px 3px);background-clip:content-box;box-sizing:border-box}
#cg50-status .cg-battery:before{content:'';position:absolute;left:1px;right:1px;top:-3px;height:2px;background:#111}
#cg50[data-screen="home"] #cg50-screen{height:192px;padding:0}
#cg50[data-screen="home"] #cg50-soft{display:none}
#cg50-screen .cg-app-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(3,62px);gap:0;padding:1px 10px 0 1px}
#cg50-screen .cg-app-icon{display:flex;align-items:center;justify-content:center;position:relative;border:1px solid transparent;border-radius:4px;padding:1px;background:#fff;min-width:0;overflow:hidden}
#cg50-screen .cg-app-icon.cg-selected{border-color:#43b1cc;background:#73d5e9;color:#000!important}
.cg-app-art{display:block;width:var(--icon-width);height:56px;pointer-events:none}
.cg-app-picture,.cg-app-caption{display:block;width:100%;background-image:var(--icon-image);background-repeat:no-repeat;background-size:auto;image-rendering:pixelated}
.cg-app-picture{height:38px;background-position:top center}
.cg-app-caption{height:18px;background-position:center -38px;mix-blend-mode:multiply;filter:brightness(.8) contrast(2)}
.cg-home-scroll{position:absolute;right:1px;top:2px;bottom:3px;width:7px;background:#e8e8e8;color:#454545;font:8px/10px Arial;text-align:center}
.cg-home-scroll i{position:absolute;left:1px;right:1px;background:#aaa;border:1px solid #999;box-sizing:border-box}
.cg-scroll-up{position:absolute;top:0;left:0}.cg-scroll-down{position:absolute;bottom:0;left:0}
.cg-mode-splash{position:absolute;inset:0 2px;font:22px/24px ClassWizX,monospace;overflow:hidden}
.cg-equation{background:linear-gradient(110deg,#fff 25%,#fff3d6 63%,#f1c376)}
.cg-equation:before{content:'ax²+bx\a +c=0';white-space:pre;position:absolute;right:10px;top:47px;color:#fff8;font:30px/34px Arial,sans-serif;pointer-events:none}
.cg-system{background:linear-gradient(115deg,#fff 20%,#e7f5f7 55%,#9ac6d5)}
.cg-system:before{content:'';position:absolute;right:12px;top:50px;width:100px;height:110px;background:url('assets/cg50/system-tools.svg') center/contain no-repeat;opacity:.35;pointer-events:none}
.cg-splash-title{color:#0000ff;position:relative}
.cg-splash-options{position:absolute;inset:auto 0 1px}
#cg50-screen .cg-splash-options button{display:block;width:100%;font:inherit;line-height:24px;position:relative}
.cg-system .cg-splash-options{top:24px;bottom:auto}
#cg50-screen .cg-distribution-choice{display:flex;width:100%;height:48px;align-items:flex-start;justify-content:space-between;color:#00f;font:22px/27px ClassWizX,monospace;padding-right:10px}
.cg-distribution-choice canvas{width:70px;height:38px;margin-top:3px;image-rendering:pixelated}
#cg50[data-mode="Distribution"] .cg-heading{color:#00f;font:22px/24px ClassWizX,monospace;height:24px}
#cg50-status{position:relative;padding-left:22px;gap:3px}
#cg50-status .cg-battery{top:1px;left:2px;height:12px}
#cg50-status .cg-mode-name{display:none}
#cg50-status span:not(.cg-main-title):not(.cg-battery){font-family:ClassWizX,monospace;font-size:10px;font-weight:normal}
#cg50[data-screen="home"] #cg50-status .cg-battery{top:5px}
#cg50-screen .cg-data-table{font:16px/20px ClassWizX,monospace}
#cg50-screen .cg-data-table th{background:#fff;border-color:#000}
#cg50-screen .cg-data-table td{border-top:0;border-bottom:0;border-color:#000;height:23px}
#cg50-screen .cg-data-table .cg-row-number{width:36px;border:0;text-align:right;padding-right:2px;padding-left:0}
#cg50-soft button{display:flex;align-items:center;justify-content:center;font:18px/18px Arial,sans-serif;letter-spacing:-.5px}
.cg-soft-label{display:block;flex-shrink:0;transform-origin:center;white-space:nowrap;pointer-events:none}
#cg50-screen table td.cg-selected{background:#000!important;color:#fff!important}
#cg50[data-screen="data"] .cg-entry,#cg50[data-screen="coefficients"] .cg-entry{border-top:0;min-height:26px}
.cg-equation-heading{height:27px;color:#00f;white-space:nowrap;overflow:hidden}
.cg-equation-heading math{font-size:20px}
#cg50-screen .cg-function-row.cg-selected{background:var(--function-color,#00f)}
#cg50-screen table{border-collapse:collapse;width:100%;table-layout:fixed;font:17px/22px 'Courier New',monospace}#cg50-screen td,#cg50-screen th{border:1px solid #999;height:23px;text-align:right;overflow:hidden;white-space:nowrap;padding:0 3px;font-weight:normal}#cg50-screen th{background:#e4e4e4}#cg50-screen td.cg-selected{background:#0000ef;color:#fff}
#cg50-graph{position:absolute;inset:0;width:378px;height:181px;image-rendering:pixelated}
.cg-graph-readout{position:absolute;bottom:0;left:0;right:0;background:#ffffffe8;font:16px/18px 'Courier New',monospace;padding:1px 3px;white-space:pre-line}
#cg50-error{position:absolute;z-index:5;left:18px;right:18px;top:43px;background:#fff;border:2px solid #000;box-shadow:3px 3px #0008;min-height:85px;padding:12px;font:18px/23px 'Courier New',monospace;white-space:pre-line}#cg50-error[hidden]{display:none}
.cg-key{position:absolute;display:flex;align-items:center;justify-content:center;border:1px solid #08090a;border-top-color:#737575;border-radius:6px 6px 9px 9px;background:linear-gradient(#434749,#303335 70%,#25282a);color:#f2f3ef;font:20px/1 Arial,sans-serif;box-shadow:0 3px 1px #070808,0 4px 4px #0009,inset 0 1px 1px #aaa4;transform:translateY(0);transition:transform 70ms,box-shadow 70ms;outline:none;padding:0;touch-action:manipulation;text-shadow:0 1px 1px #000}
.cg-key.cg-number{background:linear-gradient(#f7f6f0,#e3e3dc);color:#1b2023;border-top-color:#fff;font-size:29px;text-shadow:0 1px #fff;border-radius:6px 6px 10px 10px;box-shadow:0 3px 1px #090a0a,0 4px 5px #0008,inset 0 1px 1px #fff}
.cg-key.cg-accent{background:linear-gradient(#648cc1,#4773aa);color:#fff;border-top-color:#adc7e9;font-size:22px}.cg-key.cg-function{border-radius:50%;background:linear-gradient(#d3d6d7,#9a9fa1);color:#131819;text-shadow:0 1px #fff8;font:15px Arial;border-top-color:#f6f7f7}
.cg-key.cg-shift{color:#e2c94f}.cg-key.cg-alpha{color:#f2959c}.cg-key.cg-nav{font-size:13px}.cg-key.cg-arrow{border-radius:4px;background:linear-gradient(130deg,#c2c8cb,#889195 75%,#acb4b7);color:#202528;text-shadow:none;border-color:#323a3e;border-top-color:#e2e7e8;font-size:17px}
.cg-key.cg-pressed,.cg-key:active{transform:translateY(2px);box-shadow:0 1px 1px #000,inset 0 1px 1px #fff2;filter:brightness(.92)}.cg-key:focus-visible{outline:2px solid #d4fa5b;outline-offset:3px}.cg-key.cg-latched{box-shadow:0 0 0 2px #e8d65e,0 3px 3px #000}
.cg-key .cg-shift-label,.cg-key .cg-alpha-label{position:absolute;top:-14px;color:#d6bf63;font:9px/11px Arial,sans-serif;white-space:nowrap;text-shadow:0 1px 1px #000;pointer-events:none}.cg-key .cg-shift-label{left:0}.cg-key .cg-alpha-label{right:0;color:#d98b96}
#cg50-pad{position:absolute;border-radius:50%;background:radial-gradient(circle at 42% 30%,#414a50,#141a1d 65%);box-shadow:0 2px 3px #000,inset 0 1px 2px #929b9e;width:104px;height:104px}
.cg-key.cg-guide-key{outline:3px solid #dfff65;outline-offset:3px;box-shadow:0 0 20px #dfff6588}
#cg50-help-button{position:absolute;right:18px;top:7px;width:44px;height:38px;border:0;background:none;color:#dfff65;font:bold 13px Arial;z-index:7}
#cg50-help{position:absolute;z-index:20;inset:auto 0 0;background:linear-gradient(#393d3e,#222627);border:1px solid #777;border-radius:22px 22px 0 0;box-shadow:0 -10px 40px #0008;padding:18px 18px max(18px,var(--safe-bottom));max-height:75%;overflow:auto;color:#f0f1e9;font:15px/1.45 -apple-system,sans-serif;user-select:text}
#cg50-help h2{font-size:22px;margin:0 0 8px}#cg50-help p{margin:8px 0 14px}#cg50-help button{width:100%;min-height:44px;padding:10px 12px;margin:4px 0;text-align:left;border:1px solid #666;border-radius:10px;background:#454b4c;color:#fff;font:15px -apple-system,sans-serif}#cg50-help button.cg-primary{background:#dfff65;color:#142014;border:0;font-weight:600}
#cg50-guide{position:absolute;left:16px;right:16px;top:var(--cg-guide-top,270px);z-index:12;pointer-events:none;font:12px/15px -apple-system,sans-serif;color:#eeefeb;text-align:center}#cg50-guide:empty{display:none}#cg50-guide button{pointer-events:auto;border:0;border-radius:14px;background:#dfff65;color:#162015;padding:6px 12px;margin-left:6px;font-weight:600}
#model-picker{position:relative;width:72px;height:44px;display:flex;align-items:center;justify-content:center;pointer-events:auto}#model-picker-trigger{font:500 11px -apple-system,sans-serif!important;letter-spacing:1px;background:none!important;border:0;color:#eee!important;width:72px;min-height:44px;padding:0}#model-choices{position:absolute;top:44px;left:0;width:158px;border:1px solid #666;border-radius:12px;background:#282d2e;box-shadow:0 6px 25px #0009;overflow:hidden;z-index:30;padding:4px}#model-choices button{display:block!important;width:100%!important;text-align:left;padding:12px!important;min-height:44px;color:#fff;background:transparent;border:0;font:14px -apple-system,sans-serif;letter-spacing:0}#model-choices button[aria-pressed=true]{background:#41494a}#model-choices button::after{content:none!important}
body.cg50-active .switchbar{z-index:25}body.cg50-active #about{display:none}
@media(prefers-reduced-motion:reduce){.cg-key{transition:none}}

#model-picker-trigger::after{content:none!important}
/* Reference pass: fixed instrument proportions, moulded front, sector replay pad. */
#cg50{border-radius:26px 26px 38px 38px;background:#efefea;overflow:hidden}
#cg50-front{border-radius:26px 26px 38px 38px;background-color:#292b2e;background-image:radial-gradient(ellipse at 25% 10%,#ffffff08,#00000000 45%,#0005 100%),var(--cg-weave);background-size:100% 100%,15.5px 18.3px;box-shadow:inset 0 0 0 5px #e9e9e4,inset 0 0 0 7px #64a0b8,inset 0 0 0 9px #181b1d,inset 0 0 17px 10px #0008}
#cg50-front::before{inset:8px;border-radius:19px 19px 31px 31px;background:linear-gradient(112deg,#fff1,#0000 30%,#0001);box-shadow:inset 0 0 3px #0008}
#cg50-model-mark{position:absolute;top:38px;right:53px;color:#f1f1e9;font:14px 'DIN Alternate',Arial,sans-serif;letter-spacing:.4px}
#cg50-bezel{left:35px!important;width:329px!important;padding:15px 13px 14px!important;background:linear-gradient(180deg,#070809 0,#050505 25%,#2c2d2e 85%,#505153 98%);border-radius:12px!important;box-shadow:inset 0 7px 7px #000,inset 7px 0 7px #6667,inset -6px 0 6px #000,0 2px 2px #000!important}
#cg50-lcd{width:303px;height:170.44px;border-color:#050505;border-radius:1px;box-shadow:0 0 0 3px #090909,inset 0 0 2px #bbb}
#cg50-pixels{transform:scale(.78385)}
.cg-key{background:linear-gradient(110deg,#222527,#191c1e 75%);border:1.3px solid #08090a;border-top-color:#66686a;box-shadow:0 2px 1px #050607,0 3px 4px #0009,inset 0 1px 1px #8885,inset 1px 0 1px #7773;color:#f4f4ec;border-radius:5px}
.cg-key.cg-number{background:linear-gradient(110deg,#f5f5f2,#eeeeeb);color:#202324;box-shadow:0 2.5px 0 #777b7b,0 3px 2px #050708,0 4px 4px #0009,inset 0 1px 1px #fff;border-radius:5px;border:0}
.cg-key.cg-accent{background:linear-gradient(110deg,#384cd6,#2439bf);color:#e9eef1;box-shadow:0 2.5px 0 #0d218f,0 3px 2px #04080c,0 4px 4px #0009,inset 0 1px 2px #bbc6ff9;border:1px solid #11228c}
.cg-key[data-cg-key=EXE]{color:#2442b8}.cg-key.cg-edge-left{border-top-left-radius:13px;border-bottom-left-radius:8px}.cg-key.cg-edge-right{border-top-right-radius:13px;border-bottom-right-radius:8px}
.cg-key.cg-function{background:radial-gradient(ellipse at 34% 20%,#bbbebc 0,#797d7d 35%,#626666 70%,#555858);color:#fff;border:1px solid #bbc0bc;box-shadow:0 0 0 2px #16191a,0 3px 2px 1px #050606,inset 0 1px 1px #fff8;border-radius:50%}
.cg-key .cg-main-label{width:94%;height:91%;display:block;pointer-events:none;overflow:visible;fill:currentColor;font-family:'DIN Alternate','Arial Narrow',Arial,sans-serif;font-weight:500}
.cg-key.cg-function .cg-main-label{width:92%;height:92%;font-weight:500}
.cg-key.cg-number .cg-main-label{height:95%}
.cg-key .cg-shift-label,.cg-key .cg-alpha-label{top:-12px!important;font-family:'DIN Condensed','Arial Narrow',Arial,sans-serif;font-size:9px!important;font-weight:500;line-height:11px;letter-spacing:-.12px;color:#bdb46a}
.cg-key .cg-alpha-label{color:#bb728b}.cg-key .cg-symbol-label{height:11px;width:29px}.cg-key .cg-symbol-label svg{display:block;width:100%;height:100%;fill:currentColor;font-family:'DIN Alternate',Arial,sans-serif;overflow:visible}
.cg-key[data-cg-key=SD] .cg-symbol-label{width:31px}.cg-key[data-cg-key=ALPHA] .cg-symbol-label{width:40px}.cg-key[data-cg-key=COMMA] .cg-symbol-label,.cg-key[data-cg-key=STORE] .cg-symbol-label{width:24px}
#cg50-pad{width:86px!important;height:86px!important;border-radius:50%;background:conic-gradient(from 0deg,#8c8f8d,#c8cbca 12%,#f3f3ef 23%,#b5b9b8 26%,#cdd0cf 38%,#aaaead 49%,#e8e9e6 63%,#a5aaa9 75%,#c6cac8 88%,#8c8f8d);box-shadow:0 0 0 3px #111516,0 4px 4px #000,inset 0 0 0 1px #898d8b}
#cg50-pad::before{content:'';position:absolute;inset:17px;border-radius:50%;background:conic-gradient(#999e9c,#f9faf7 24%,#979d99 48%,#fff 72%,#999e9c);box-shadow:0 0 1px #555}
.cg-pad-horizontal,.cg-pad-vertical{position:absolute;background:linear-gradient(#393e3d,#f9faf4);z-index:1;pointer-events:none}.cg-pad-horizontal{left:9px;right:9px;height:2px;top:42px}.cg-pad-vertical{top:8px;bottom:8px;width:2px;left:42px;background:linear-gradient(90deg,#232827,#fff)}
.cg-pad-centre{position:absolute;z-index:2;left:27px;top:27px;width:32px;height:32px;transform:rotate(45deg);border-radius:10px;background:conic-gradient(from -45deg,#b8bdbb,#f4f6f1 13%,#999e9b 25%,#e7e9e5 39%,#b4b9b5 50%,#fafaf6 67%,#a1a6a2 78%,#daddd7 90%,#b8bdbb);box-shadow:0 0 0 1px #909692,1px 1px 2px #4445}
.cg-key.cg-arrow{background:transparent!important;border:0;box-shadow:none!important;border-radius:0;color:transparent;z-index:3}.cg-key.cg-arrow.cg-pressed,.cg-key.cg-arrow:active{background:#ffffff28!important;filter:none;transform:none}.cg-key.cg-arrow.cg-guide-key{background:#dfff6560!important;outline:none}
.cg-key[data-cg-key=UP]{clip-path:polygon(0% 0%,100% 0%,100% 23%,63% 39%,37% 39%,0 23%)}
.cg-key[data-cg-key=DOWN]{clip-path:polygon(0% 100%,100% 100%,100% 77%,63% 61%,37% 61%,0 77%)}
.cg-key[data-cg-key=LEFT]{clip-path:polygon(0% 0%,0% 100%,23% 100%,39% 63%,39% 37%,23% 0%)}
.cg-key[data-cg-key=RIGHT]{clip-path:polygon(100% 0%,100% 100%,77% 100%,61% 63%,61% 37%,77% 0%)}
#cg50-help-button{position:fixed;top:7px;right:18px}#cg50-guide{top:18px!important;left:20px;right:85px;color:#f7f7ed;text-shadow:0 1px 2px #000;font-size:11px;text-align:left}#cg50-guide button{font-size:10px;padding:5px 8px;margin-top:3px}

#cg50-front{background-image:linear-gradient(#10121640,#10121640),radial-gradient(ellipse at 25% 10%,#ffffff08,#00000000 45%,#0005 100%),var(--cg-weave);background-size:100% 100%,100% 100%,15.5px 18.3px}
body:not(.cg50-active) > #cg50-help-button{display:none}
body > #cg50-help-button{position:fixed;right:calc((100vw - var(--cg-shell-width,100vw))/2 + 12px);top:calc(var(--cg-shell-top,0px) + 7px);z-index:30}
.cg-function-expression{margin-left:3px}.cg-function-expression math{font-size:18px}
.cg-key[data-cg-key=EXE] .cg-main-label{font-weight:700}
#cg50-pad::after{content:'';position:absolute;inset:0;border-radius:50%;background:repeating-conic-gradient(from 12deg,#ffffff06 0deg .35deg,#00000005 .35deg .7deg);pointer-events:none}

/* Full-screen phone presentation, matching Pocket 991's EX and CW fronts. */
#cg50,#cg50-front{border-radius:0;box-shadow:none}
#cg50-front{box-shadow:inset 1px 0 3px #ffffff0d,inset -1px 0 5px #0008}
#cg50-front::before{inset:0;border-radius:0}
#cg50.cg-framed,#cg50.cg-framed #cg50-front{border-radius:22px}
#cg50-bezel{left:16px!important;width:368px!important;padding:6px!important;border-radius:7px!important}
#cg50-lcd{width:356px;height:200.25px}
#cg50-pixels{transform:scale(.921875)}
#cg50-model-mark{display:none}
#cg50-guide{top:4px!important;left:100px;right:65px;font-size:10px;pointer-events:none}
body.cg50-active .switchbar{z-index:25}

#cg50-guide{top:var(--cg-guide-top)!important;left:15px;right:15px;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;font:11px/17px -apple-system,sans-serif}
#cg50-guide>span{overflow:hidden;text-overflow:ellipsis}#cg50-guide button{flex-shrink:0;margin:0;padding:2px 9px;line-height:17px}

/* Full-height mathematics in Graph/Table lists and their active entry. */
.cg-function-list{position:absolute;left:3px;right:3px;top:23px;overflow:hidden}
#cg50-screen .cg-function-row{height:auto;min-height:32px;box-sizing:border-box;padding:6px 2px 5px;overflow:visible;line-height:22px;align-items:center}
.cg-function-row>span:first-child{display:flex;align-items:center;min-width:0;flex:1;white-space:nowrap}
.cg-function-row .cg-value{flex-shrink:0;align-self:center}
.cg-function-row .cg-function-expression{display:inline-flex;align-items:center;min-width:0;margin-left:3px;padding:2px 0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.cg-function-row math{display:inline-block;flex-shrink:0;line-height:normal;padding:3px 0}
#cg50-screen .cg-entry{max-height:88px;overflow:auto;scrollbar-width:none;padding-top:3px;background:#fff}
#cg50-screen .cg-entry math-field::part(content){padding:5px 2px 6px}
#cg50-screen .cg-entry math-field::part(container){overflow:visible}
#cg50-screen .cg-entry{display:flex;align-items:flex-start;gap:2px}
#cg50-screen .cg-entry .cg-prefix{float:none;flex:0 0 auto;min-width:29px;padding-top:7px;font:17px/22px 'Courier New',monospace}
#cg50-screen .cg-entry math-field{flex:1 1 auto;min-width:0;width:0!important}
#cg50-screen .cg-function-row{padding-top:3px;padding-bottom:3px}
.cg-function-row .cg-function-expression{padding-top:1px;padding-bottom:1px}
.cg-function-row math{padding-top:2px;padding-bottom:2px}
/* A parametric relation is two lines, with the same slot and selection colour. */
.cg-function-row>span:first-child:has(.cg-param-pair){flex-wrap:wrap}
.cg-param-pair{display:flex;flex-basis:100%;align-items:center;gap:3px}
.cg-modify-selected{color:#e000dc}
#cg50[data-screen="threeList"] .cg-line{height:auto;min-height:41px;flex-wrap:wrap}
#cg50[data-screen="threeList"] .cg-line small{flex-basis:100%;font-size:13px;white-space:nowrap}
#cg50[data-screen="threeFormula"] .cg-line{height:auto;min-height:29px}

.cg-graph-formula{position:absolute;left:1px;top:0;max-width:370px;white-space:nowrap;overflow:hidden;background:#ffffffe8;font:12px ClassWizX,monospace;line-height:15px}
#cg50-status .cg-graph-status{border:0;font-weight:bold;font-size:12px}

.cg-graph-readout{background:#fff;font-family:ClassWizX,monospace}
/* The guide owns the extra gap below the LCD; its text never covers a key. */
#cg50.cg-guiding #cg50-guide{white-space:normal;align-items:center;justify-content:space-between;text-align:left;gap:10px;font:12px/16px -apple-system,sans-serif;min-height:70px;max-height:82px;color:#fff;text-shadow:none}
#cg50.cg-guiding #cg50-guide>span{overflow:auto;max-height:80px;text-overflow:clip;flex:1;pointer-events:auto}
#cg50.cg-guiding #cg50-guide button{font:600 12px/16px -apple-system,sans-serif;min-height:44px;max-width:110px;padding:7px 10px;border-radius:10px;white-space:normal}
#cg50-help{display:flex;flex-direction:column;overflow:hidden;max-height:82%;box-sizing:border-box;padding:16px 16px max(14px,var(--safe-bottom));font-size:16px;line-height:1.45}
#cg50-help .cg-help-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 2px 10px;flex:1}
#cg50-help .cg-help-footer{flex-shrink:0;border-top:1px solid #788080;padding-top:7px;display:flex;flex-wrap:wrap;gap:6px}
#cg50-help .cg-help-footer button{width:auto;flex:1 1 42%;margin:0;text-align:center;min-height:44px}
#cg50-help input,#cg50-help select{box-sizing:border-box;width:100%;min-height:46px;margin:5px 0 10px;padding:10px;border:1px solid #8b9696;border-radius:9px;background:#f7f7ef;color:#142014;font:16px -apple-system,sans-serif}
#cg50-help button{font-size:16px;line-height:1.35;white-space:normal}#cg50-help h3{font-size:18px}#cg50-help li{margin-bottom:8px}#cg50-help .cg-help-note{padding:10px;background:#222828;border-radius:8px}
#cg50-help :focus-visible,#cg50-guide button:focus-visible{outline:3px solid #dfff65;outline-offset:2px}
