/* Glass edges and ambient gradients inspired by the supplied design references.
   Native CSS keeps the coding surface independent of GPU effects. */
:root{font-family:"Segoe UI",Arial,sans-serif;background:#eaf2fa;color:#21374c}
body{background:radial-gradient(ellipse at 0 10%,#c8e9ff 0,transparent 50%),radial-gradient(ellipse at 100% 90%,#dce5ff 0,transparent 50%),#edf3f9;background-attachment:fixed}
header.toolbar{margin:0;padding:10px 18px;min-height:70px;border-radius:0;background:linear-gradient(120deg,#087bdc,#058af4);border:0;box-shadow:none;gap:16px}
.official-logo{width:150px;filter:drop-shadow(0 2px 3px #004c7920)}
.toolbar .robot-identity{padding:5px 12px;background:#003a7155;border:1px solid #ffffff30;border-radius:13px;min-height:38px;backdrop-filter:blur(12px)}
.toolbar #status{font-size:12px;font-weight:500;padding:7px 10px;background:#00478180;border-radius:20px;border:1px solid #ffffff20}
button{font-weight:600;font-size:12px;border-radius:11px;padding:9px 14px;transition:background .18s,box-shadow .18s,transform .18s,border-color .18s}
button:active:not(:disabled){transform:translateY(1px)}
.toolbar .primary{background:linear-gradient(#fff,#e8f6ff);color:#075b9d;border:1px solid #fff;box-shadow:inset 0 1px 0 #fff,0 4px 12px #003b7425;min-width:144px}
.toolbar .primary:hover:not(:disabled){background:#fff;box-shadow:0 6px 18px #003b7440;transform:translateY(-1px)}
.toolbar .stop{background:#fff1f4;border:1px solid #ffcfda;color:#a81745}.toolbar .stop:disabled{background:#ffffffb0;color:#48677c;opacity:.55}
.connection-menu>summary{width:38px;line-height:34px;background:#ffffffd9;border-color:#fff;color:#075b9d;border-radius:11px;box-shadow:0 3px 10px #003b7420}
.connection-menu>div{top:48px;width:205px;padding:8px;border-radius:16px;background:#f8fcfff5;backdrop-filter:blur(24px);border:1px solid white;box-shadow:0 16px 50px #173e7030}
.connection-menu button{text-align:left;border-color:transparent;background:transparent;font-size:13px;padding:12px}.connection-menu button:hover:not(:disabled){background:#e5f3ff;border-color:#c7e6ff}
main{padding:16px 14px}.workspace{gap:16px}.editor-pane,.output-pane{border:1px solid #fff;border-radius:19px;box-shadow:0 8px 30px #15345612,inset 0 1px 0 #fff}
.editor-label,.output-pane>summary{background:linear-gradient(110deg,#ffffffed,#f0f7ffed);border-bottom:1px solid #dce7f1;min-height:48px;padding:13px 18px;color:#365168;font-size:12px;letter-spacing:.2px}
.editor-label{display:flex;align-items:center;gap:10px;font-family:inherit;font-weight:600}.editor-label::before{content:'JS';background:#f5dc72;color:#514215;border:1px solid #ddc466;border-radius:6px;padding:4px 5px;font-size:10px;font-weight:800;letter-spacing:0}
.output-pane{background:#ffffffbf;backdrop-filter:blur(16px)}.output-pane>summary{font-weight:650}.output-body{background:linear-gradient(160deg,#ffffffa0,#f2f8ff70)}.output-body>#clear{border-color:#d9e5ef;background:#ffffffb0;color:#5c7285;font-size:11px;padding:6px 10px}
#output{padding:20px;font-size:13px}#output:empty::before{content:'Ready when you are.\AProgram output will appear here.';white-space:pre-line;color:#74889b;font:13px/1.9 "Segoe UI",sans-serif}
.code-editor{min-height:calc(100dvh - 157px)}.code-editor #code-highlight{min-height:calc(100dvh - 157px)}
.code-editor::before{content:'';position:absolute;top:0;bottom:0;left:0;width:7ch;background:#00000013;border-right:1px solid #ffffff0a;pointer-events:none}
dialog,#robot-settings{border:1px solid #fff;background:linear-gradient(145deg,#fffffffa,#eef6fff5);box-shadow:0 30px 100px #092d5550,inset 0 1px 0 white;border-radius:24px;padding:28px;backdrop-filter:blur(24px)}
dialog::backdrop{background:#0b25475c;backdrop-filter:blur(9px)}dialog h2{color:#173a58;font-size:24px;letter-spacing:-.6px}dialog>p{color:#627b90;font-size:13px}
#robot-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin:24px 0}
.robot-choice{position:relative;min-width:0;padding:26px 16px 20px;gap:18px;border:1px solid #c9dfef;background:radial-gradient(ellipse at 50% 20%,#fff 30%,#eef7ff 100%);box-shadow:inset 0 1px 0 white,0 6px 18px #1e548212;border-radius:20px}
.robot-choice:hover:not(:disabled){transform:translateY(-3px);border-color:#058af4;background:linear-gradient(145deg,#fff,#e2f3ff);box-shadow:0 12px 30px #058af425,inset 0 1px 0 white}.robot-choice strong{font-size:17px;color:#254d6e;letter-spacing:.2px}
.led-ring{width:124px;height:124px;margin:12px;border-radius:50%;background:radial-gradient(circle,#d7e6f2 0,#eef5fa 45%,#ffffff 65%);box-shadow:inset 0 2px 6px #335b7b15,0 3px 10px #466b8e12}
.led-ring i{width:28px;height:28px;border:2px solid #fff;border-radius:50%;box-shadow:inset 0 -3px 5px #00000026,inset 0 2px 3px #ffffff90,0 2px 6px #14355040}
.led-ring i::after{content:'';position:absolute;top:3px;left:4px;width:40%;height:24%;border-radius:50%;background:#ffffff85;pointer-events:none}
#selected-ring .led-ring{width:42px;height:42px;background:transparent;box-shadow:none;margin:0 3px}#selected-ring .led-ring i{width:11px;height:11px;border-width:1px}#selected-ring .led-ring i::after{top:1px;left:1px}
#settings-name-ring .led-ring{width:100px;height:100px;margin:20px auto}#settings-name-ring .led-ring i{width:24px;height:24px}
#robot-settings fieldset{background:#ffffffb0;border-color:#d4e3ef;border-radius:16px}#robot-settings legend{font-size:12px;font-weight:650;color:#55758d;padding:0 8px}#robot-settings input:not([type=checkbox]){border-radius:10px;border-color:#ccdeec;background:#fff;padding:11px}#robot-settings button:not(#settings-close){background:#edf7ff;border-color:#bdddf5;color:#0865ab}#settings-message{padding:10px 12px;border-radius:10px;background:#e6f3ff;color:#255678}#settings-chart{background:#fff;border:1px solid #d4e3ef;border-radius:12px}
@media(max-width:720px){header.toolbar{margin:0;padding:10px 12px;gap:10px;border-radius:0}.official-logo{width:120px}.toolbar-actions{gap:6px}.toolbar .primary{min-width:122px}.toolbar #status{font-size:11px}main{padding:10px 8px}.workspace{gap:10px}.editor-label,.output-pane>summary{padding:11px 14px;min-height:43px}.code-editor,.code-editor #code-highlight{min-height:calc(100dvh - 210px)}dialog,#robot-settings{padding:20px}#robot-list{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.robot-choice{padding:18px 10px}.led-ring{width:108px;height:108px}.led-ring i{width:26px;height:26px}}
@media(prefers-reduced-motion:reduce){button{transition:none!important}.robot-choice:hover:not(:disabled),.toolbar .primary:hover:not(:disabled){transform:none}}
@supports not (backdrop-filter:blur(12px)){.output-pane,dialog,#robot-settings,.connection-menu>div{background:#f7fbff}}
/* Run history and an optional full-width editor; no disclosure arrow. */
.workspace-controls{display:flex;justify-content:flex-end;align-items:center;margin-bottom:10px;gap:8px}.workspace-controls button{padding:7px 12px;background:#ffffffc9;border-color:#d1e2f1;color:#24628d}.mobile-views{display:none;gap:6px}
.workspace[data-view="code"]{grid-template-columns:minmax(0,1fr)}.workspace[data-view="code"]>.output-pane{display:none}
.output-pane{display:flex;flex-direction:column;min-width:0;min-height:0}.output-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:13px 16px;background:linear-gradient(110deg,#ffffffed,#f0f7ffed);border-bottom:1px solid #dce7f1;font-size:12px}.output-heading strong{margin-right:auto;color:#365168}.output-heading label{color:#627b90;font-size:11px}.output-heading select{width:100%;min-width:0;background:#fff;color:#365168;padding:9px;font-size:12px}#run-summary{font-size:11px;color:#627b90}.output-body{min-height:0;flex:1}#output{height:0;min-height:200px;flex:1;max-height:none}.code-editor,.code-editor #code-highlight{min-height:calc(100dvh - 200px)}
@media(max-width:720px){.workspace-controls{justify-content:flex-start}.mobile-views{display:flex}#results-toggle{display:none}.mobile-views button[aria-pressed="true"]{background:#087bdc;color:white;border-color:#087bdc}.workspace{grid-template-columns:minmax(0,1fr)}.workspace[data-view="results"]>.editor-pane{display:none}.workspace[data-view="results"]>.output-pane{display:flex;min-height:calc(100dvh - 190px)}.code-editor,.code-editor #code-highlight{min-height:calc(100dvh - 230px)}}
.simulation-toggle{display:flex;align-items:center;gap:6px;color:#fff;font-size:12px;font-weight:600;white-space:nowrap}.simulation-toggle input{accent-color:#054e95;width:17px;height:17px;margin:0;cursor:pointer}.simulation-toggle:has(input:checked){background:#003a7160;border-radius:10px;padding:7px}
#simulation-panel{padding:12px 14px;border-bottom:1px solid #dce7f1;background:#f8fcff}.simulation-heading{display:flex;align-items:center;flex-wrap:wrap;gap:7px;font-size:12px;color:#365168}.simulation-heading strong{margin-right:auto}#simulation-state{font-size:11px;color:#627b90}#simulation-reset{padding:5px 8px;font-size:11px}#simulation-canvas{display:block;width:100%;height:auto;max-height:320px;aspect-ratio:3/2;object-fit:contain;border-radius:10px;margin:10px 0;border:1px solid #d3e2ed}#simulation-readout{font-size:11px;margin:6px 0;color:#365168}.obstacle-controls{display:flex;gap:10px}.obstacle-controls label{font-size:10px;color:#55758d;flex:1;min-width:0}.obstacle-controls input{width:100%;padding:0;accent-color:#058af4}.simulation-note{font-size:10px!important;line-height:1.5;margin:8px 0 0;color:#627b90}.output-pane:has(#simulation-panel:not([hidden])) #output{min-height:180px}
@media(max-width:720px){.simulation-toggle{font-size:11px}.toolbar-actions{flex-wrap:wrap}#simulation-canvas{max-height:300px}}

#simulation-canvas{aspect-ratio:1;max-height:none;touch-action:none} .obstacle-count{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:11px;color:#365168}.obstacle-count button{padding:5px 9px}.obstacle-count select{min-width:0;flex:1;font-size:11px;padding:5px}.obstacle-controls output{float:right}.obstacle-controls{margin-top:9px}
[hidden]{display:none!important}body[data-page="home"] .workspace-only,body[data-page="home"] #status,body[data-page="workspace"] .home-only{display:none!important}.header-title{font-size:18px;font-weight:650;color:white;margin-right:auto}.programs-page{max-width:1200px;margin:18px auto}.programs-intro{margin-bottom:24px}.programs-intro h1{font-size:32px;color:#254d6e}.programs-intro p{margin:7px 0}.local-storage-note{font-size:12px}.programs-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;align-items:start}.library-card,.create-card,#data-view{padding:25px;background:linear-gradient(145deg,#ffffffed,#edf7ffec);border:1px solid white;border-radius:22px;box-shadow:0 12px 36px #243b5d12}.library-card h2,.create-card h2,#data-view h2{margin:0 0 14px;color:#254d6e;font-size:21px}.library-card label,.create-card label{display:block;font-size:12px;color:#55758d;margin:12px 0 7px}#program-search,#new-program-name{width:100%;margin-bottom:14px}.program-card{display:flex;flex-direction:column;gap:7px;text-align:left;width:100%;padding:18px;margin:10px 0;border:1px solid #d7e7f4;background:#fff;border-radius:14px}.program-card strong{font-size:16px;color:#254d6e;overflow-wrap:anywhere}.program-card span{font-size:11px;color:#627b90}.program-card:hover{box-shadow:0 4px 15px #087bdc18}.create-card .primary{margin-top:10px;width:100%;background:#087bdc;color:#fff}.program-heading{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin:0 0 13px}.program-heading>label{font-size:12px;color:#627b90}#program-title{min-width:100px;width:240px;max-width:100%;font-weight:650}#save-state{font-size:11px;color:#55758d;max-width:430px;overflow-wrap:anywhere}.program-heading nav{margin-left:auto;display:flex;gap:5px}.program-heading button[aria-pressed="true"]{background:#087bdc;color:white;border-color:#087bdc}#programs-home{padding:8px 10px;white-space:nowrap}.data-heading{display:flex;gap:15px;justify-content:space-between;align-items:start}.data-heading p{font-size:13px;margin:0 0 20px}#plot-toggle{white-space:nowrap;background:#087bdc;color:white}.data-controls{display:flex;gap:20px;flex-wrap:wrap}.data-controls label{display:grid;gap:7px;font-size:12px;color:#55758d}.data-controls select{min-width:190px;max-width:100%;background:white}#data-status,#data-inspect{font-size:13px;color:#365168}#data-legend{display:flex;gap:22px;flex-wrap:wrap;font-size:13px;font-weight:650;margin-bottom:10px}#data-chart{width:100%;height:auto;background:#fff;border:1px solid #dce7f1;border-radius:12px}.data-note{font-size:11px}.toolbar{gap:10px}#library-message:empty{display:none}
@media(max-width:720px){.programs-grid{grid-template-columns:1fr}.programs-intro h1{font-size:26px}.library-card,.create-card,#data-view{padding:18px}.program-heading nav{margin-left:0}#program-title{flex:1}.data-heading{flex-wrap:wrap}.data-controls{display:grid;grid-template-columns:minmax(0,1fr);width:100%}.data-controls select{width:100%}#data-chart{min-height:230px;object-fit:fill}.header-title{font-size:14px}}
/* Account entry preview: authentication is not configured. */
#login-page{min-height:100dvh}:is(.login-brand,body[data-page="home"] header.toolbar){display:flex;align-items:center;gap:24px;padding:18px 5vw;background:linear-gradient(120deg,#087bdc,#058af4);color:white}:is(.login-brand,body[data-page="home"] header.toolbar) .official-logo{width:165px;height:auto}:is(.login-brand,body[data-page="home"] header.toolbar)>span{font-size:14px;font-weight:600;border-left:1px solid #ffffff65;padding-left:24px}.login-layout{max-width:1120px;min-height:0;display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:40px;padding:24px 28px}.login-intro h1{font-size:clamp(36px,5vw,60px);line-height:1.08;letter-spacing:-2px;color:#254d6e;margin:18px 0}.login-intro>p:not(.eyebrow){max-width:340px;font-size:17px}.login-features{display:flex;gap:10px;margin-top:28px;flex-wrap:wrap}.login-features span{background:#ffffffb0;border:1px solid white;padding:8px 16px;border-radius:30px;color:#24628d;font-size:12px}.login-card{padding:28px;background:linear-gradient(145deg,#fffffff0,#edf7fff0);border:1px solid white;border-radius:24px;box-shadow:0 18px 60px #243b5d16;backdrop-filter:blur(16px)}.login-card h2{font-size:28px;letter-spacing:-.6px;color:#254d6e;margin:0}.login-card>p{font-size:14px;margin:8px 0 24px}.login-card fieldset{border:0;margin:0;padding:0;min-width:0}.login-card label{display:block;font-size:13px;font-weight:600;color:#365168;margin:18px 0 8px}.login-card input{width:100%;min-height:46px;background:#f3f7fb;border-color:#cbdbe8}.login-card input:disabled{opacity:1;cursor:not-allowed}.login-card .primary{width:100%;margin-top:24px;min-height:46px;background:#087bdc;color:white;font-size:14px}.login-card .login-notice{font-size:12px;line-height:1.6;padding:12px 14px;background:#e5f2ff;border:1px solid #c9e3f9;border-radius:10px;margin:18px 0;color:#365168}.login-preview{border-top:1px solid #d7e7f4;padding-top:20px}.login-preview button{width:100%;min-height:44px;background:white;color:#0865ab;border-color:#bdddf5;font-size:13px}.login-preview button span{margin-left:8px}.login-preview p{font-size:11px;line-height:1.6;margin:12px 0 0}.login-layout .eyebrow{color:#0865ab}
@media(max-width:720px){.login-layout{grid-template-columns:minmax(0,1fr);gap:18px;padding:20px 18px;min-height:0;max-width:480px}.login-intro h1{font-size:36px;letter-spacing:-1px}.login-intro>p:not(.eyebrow){font-size:14px;margin-bottom:0}.login-features{display:none}.login-card{padding:25px}:is(.login-brand,body[data-page="home"] header.toolbar){gap:16px;padding:15px 20px}:is(.login-brand,body[data-page="home"] header.toolbar) .official-logo{width:130px}:is(.login-brand,body[data-page="home"] header.toolbar)>span{padding-left:16px;font-size:12px}}
/* Shared library/settings rhythm. Keep behavior and control IDs unchanged. */
:root{--surface-border:#d8e5f0;--surface-radius:20px;--control-height:44px;--heading-ink:#254d6e}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.programs-page{max-width:1180px;margin:8px auto}.programs-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}.programs-intro h1{font-size:28px;letter-spacing:-1px}.programs-intro .eyebrow{margin-bottom:10px;color:#087bdc}.programs-intro p{font-size:14px}.storage-badge,.account-badge{font-size:11px;font-weight:650;border:1px solid #c9e1f5;background:#e9f5ff;color:#24628d;border-radius:30px;padding:8px 12px;white-space:nowrap}.programs-grid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:stretch;gap:24px}.library-card,.create-card{border-radius:var(--surface-radius);padding:28px;border:1px solid var(--surface-border);background:linear-gradient(145deg,#fff,#f6fbff);box-shadow:0 8px 28px #243b5d0a}.section-title{display:flex;align-items:center;gap:14px;margin-bottom:24px}.section-title .section-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border:1px solid #cee5f8;background:#eaf5ff;color:#087bdc;border-radius:13px;font:700 19px Consolas,monospace}.section-title h2,.section-title h3{margin:0!important;color:var(--heading-ink);font-size:19px!important;letter-spacing:-.3px}.section-title p{margin:5px 0 0!important;font-size:12px!important;color:#627b90}.library-card label,.create-card label,#robot-settings label:not(:has(input[type=checkbox])){font-size:12px;font-weight:650;color:#45647d;margin:0 0 8px;display:block}.library-card input,.create-card input,#robot-settings input:not([type=checkbox]){min-height:var(--control-height);border:1px solid var(--surface-border);border-radius:10px;padding:10px 12px;background:#fff;font-size:14px;min-width:0}.library-card input,.create-card input{margin:0 0 18px!important;width:100%}.program-card{position:relative;margin:0 0 10px;padding:18px 42px 18px 18px;min-height:82px;border-color:var(--surface-border);border-radius:12px;gap:8px;box-shadow:none}.program-card:after{content:'→';position:absolute;right:18px;top:30px;color:#087bdc;font-size:18px}.program-card strong{font-size:15px}.program-card span{font-size:11px}.program-card:hover:not(:disabled){background:#f0f8ff;border-color:#99c9ef}.program-type{display:flex;align-items:center;gap:12px;border:1px solid #d8e8f4;border-radius:12px;background:#eff7fd;padding:16px;margin-bottom:24px}.language-mark{display:grid;place-items:center;width:40px;height:40px;background:#f5df8c;color:#594910;border-radius:10px;font-weight:750}.program-type strong{display:block;color:#254d6e;font-size:14px}.program-type div>span{display:block;margin-top:5px;font-size:11px;color:#627b90}.create-card .primary{min-height:var(--control-height);margin:0;font-size:13px;border-radius:10px;box-shadow:none}.create-hint{font-size:12px;margin:16px 0 0}.local-storage-note{font-size:11px!important;color:#627b90;margin:18px 0}
#robot-settings{width:min(800px,94vw);max-width:800px;max-height:90dvh;padding:26px;border:1px solid #d8e5f0;border-radius:24px;background:#f5f9fd;overflow:auto}.settings-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.settings-heading h2{margin:0;font-size:24px;color:var(--heading-ink)}#robot-settings button{min-height:var(--control-height);font-size:12px;padding:10px 16px;border-radius:10px;white-space:normal}#robot-settings #settings-close{min-height:36px;background:white;border-color:var(--surface-border)}#robot-settings #settings-message{font-size:12px;line-height:1.6;margin:0 0 20px;padding:12px 15px;border:1px solid #d3e6f7;border-radius:10px}#settings-message:empty{display:none}#robot-settings #settings-fields{margin:0;padding:0;border:0;background:none;min-width:0}.settings-card{border:1px solid var(--surface-border);border-radius:16px;background:#fff;padding:22px;margin:0 0 16px}#robot-settings .settings-card .section-title{margin-bottom:18px}#robot-settings .settings-card h3{font-size:15px;color:#254d6e;margin:0 0 16px}#robot-settings .settings-card p{line-height:1.65}#robot-settings .field-hint{font-size:11px;margin:10px 0 0;color:#627b90}.identity-layout{display:grid;grid-template-columns:minmax(0,1fr) 116px;gap:24px;align-items:center}.setting-action{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap}.setting-action input{flex:1;width:140px;max-width:100%;margin:0!important}.setting-action button{flex:0 1 auto}#settings-name-ring .led-ring{margin:0 auto;width:88px;height:88px}#settings-name-ring .led-ring i{width:23px;height:23px}.tuning-card>summary{font-size:14px;color:#254d6e;line-height:2}.account-badge{font-size:10px;margin-left:10px;padding:5px 9px}.tuning-section{border-top:1px solid #e2ebf3;padding-top:20px;margin-top:20px}.settings-pair{display:grid;grid-template-columns:1fr 1fr;gap:16px}.settings-pair input{display:block;width:100%;margin-top:8px}.tuning-section>button{margin-top:14px}.motion-note{padding:12px;border:1px solid #efdfb4;border-radius:10px;background:#fffaf0;color:#765d28;font-size:12px}.sensor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-bottom:16px}.sensor-toolbar label{display:flex;align-items:center;gap:7px;font-size:12px;margin:0}.sensor-toolbar input{margin:0;accent-color:#087bdc}#robot-settings .settings-sensors{margin-top:0}#settings-chart{display:block;width:100%;height:auto;margin:0}
@media(max-width:720px){.programs-page{margin:4px auto}.programs-intro{align-items:flex-start;flex-direction:column;gap:12px}.programs-intro h1{font-size:28px}.programs-grid{grid-template-columns:minmax(0,1fr);gap:16px}.library-card,.create-card{padding:22px}.storage-badge{font-size:10px;padding:6px 10px}#robot-settings{padding:18px}.settings-card{padding:18px}.identity-layout{grid-template-columns:minmax(0,1fr)}#settings-name-ring{grid-row:1}.settings-heading h2{font-size:20px}.settings-pair{gap:10px}.setting-action button{flex:1}.section-title{gap:12px}.section-title h2{font-size:18px!important}}
.settings-chart-legend{display:flex;gap:20px;font-size:12px;font-weight:650;color:#087bdc;margin:0 0 12px}#settings-raw-legend{color:#e36329}#robot-settings #settings-chart{background:#fff;border:1px solid #dce7f1;border-radius:12px;width:100%;height:auto}
/* Compact sign-in content without viewport-height centering. */
.login-layout{align-items:start}.login-intro{padding-top:20px}.login-card>p{margin:6px 0 16px}.login-card label{margin:12px 0 6px}.login-card .primary{margin-top:18px}.login-card .login-notice{margin:14px 0;padding:10px 12px}.login-preview{padding-top:14px}.login-preview p{margin-top:8px}.login-features{margin-top:20px}
@media(max-width:720px){.login-intro{padding-top:0}}

/* Login and Programs share the same brand bar; coding keeps its action toolbar. */
:is(.login-brand,body[data-page="home"] header.toolbar){height:auto;min-height:0;margin:0;justify-content:flex-start;flex-wrap:nowrap;border:0;border-radius:0;box-shadow:none;backdrop-filter:none}
:is(.login-brand,body[data-page="home"] header.toolbar)>span{margin:0;line-height:normal;letter-spacing:normal}

/* One shared row for program identity, views, and editor layout. */
.program-heading{gap:8px;margin-bottom:12px;align-items:center}.program-heading #program-title{width:200px;min-width:100px;flex:0 1 200px}.program-heading #save-state{flex:0 1 180px;font-size:11px}.program-heading nav{margin-left:auto;flex-shrink:0}.program-heading .workspace-controls{margin:0;flex-shrink:0;justify-content:flex-start}.program-heading button{min-height:36px;padding:7px 12px}.program-heading #program-title{min-height:36px;padding:7px 10px}
@media(max-width:720px){.program-heading #program-title{flex:1 1 140px}.program-heading #save-state{flex:0 1 auto}.program-heading nav{margin-left:0}.program-heading .workspace-controls{margin-left:auto}}
/* Compact Programs title and subtitle; wrap naturally on narrow screens. */
.programs-intro>div{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 18px}.programs-intro>div>p{margin:0}.programs-intro{margin-bottom:16px}
/* Fixed header regions prevent individual controls from wrapping unpredictably. */
body[data-page="workspace"] header.toolbar{display:grid;grid-template-columns:150px auto minmax(130px,180px) minmax(120px,1fr) auto;grid-template-areas:"logo home robot status actions";gap:10px 14px;align-items:center}
body[data-page="workspace"] .toolbar>.official-logo{grid-area:logo;width:150px;max-width:100%}
body[data-page="workspace"] #programs-home{grid-area:home;margin:0;white-space:nowrap}
body[data-page="workspace"] .robot-identity{grid-area:robot;margin:0;min-width:0}
body[data-page="workspace"] #selected-robot{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
body[data-page="workspace"] .toolbar #status{grid-area:status;order:0;margin:0;width:auto;max-width:none;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-page="workspace"] .toolbar-actions{grid-area:actions;display:flex;flex-wrap:nowrap;gap:8px;margin:0;justify-self:end;align-items:center}
body[data-page="workspace"] .toolbar-actions .simulation-toggle{white-space:nowrap;flex-shrink:0}
body[data-page="workspace"] .toolbar-actions #run{width:150px;min-width:150px;white-space:nowrap}
body[data-page="workspace"] .toolbar-actions #stop{min-width:70px;white-space:nowrap}
@media(max-width:1100px){body[data-page="workspace"] header.toolbar{grid-template-columns:150px auto minmax(0,1fr);grid-template-areas:"logo home robot" "status actions actions"}body[data-page="workspace"] .robot-identity{justify-self:end;max-width:240px}}
@media(max-width:720px){body[data-page="workspace"] header.toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"logo home" "robot status" "actions actions";gap:10px;padding:10px 12px}body[data-page="workspace"] #programs-home{justify-self:end}body[data-page="workspace"] .toolbar>.official-logo{width:130px}body[data-page="workspace"] .toolbar-actions{justify-self:stretch;display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:6px}body[data-page="workspace"] .toolbar-actions #run{width:100%;min-width:0;padding:8px 6px;font-size:11px}body[data-page="workspace"] .toolbar-actions #stop{min-width:54px;padding:8px}body[data-page="workspace"] .toolbar-actions .simulation-toggle{font-size:11px}}

@media(max-width:720px){body[data-page="workspace"] .robot-identity{justify-self:stretch;max-width:none}}

/* Keep long libraries compact without stretching the new-program card. */
.programs-grid{align-items:start}.program-count{display:inline-block;vertical-align:middle;font-size:11px;font-weight:600;letter-spacing:0;color:#24628d;background:#e8f4ff;border-radius:20px;padding:4px 8px;margin-left:6px}#program-list{max-height:calc(100dvh - 340px);min-height:160px;overflow:auto;scrollbar-gutter:stable;padding:3px 7px 3px 3px;margin:-3px -7px -3px -3px}#program-list:focus-visible{outline:2px solid #087bdc;outline-offset:3px;border-radius:8px}.create-card{position:sticky;top:16px}.create-card #program-name-help{font-size:11px;line-height:1.5;margin:0 0 16px;color:#627b90}.programs-grid .program-card:last-child{margin-bottom:0}
@media(max-width:720px){.create-card{position:static}#program-list{max-height:360px;min-height:0}.programs-grid{gap:16px}}

/* Keep keyboard focus visible on glass, white and blue surfaces. */
:where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #173a58;outline-offset:3px}
.toolbar :focus-visible{outline-color:white}
dialog{max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box}
#save-state,#library-message{overflow-wrap:anywhere}

/* Sensor exploration: compact controls and a dedicated chart surface. */
#data-view{padding:24px;background:#f3f8fc;border-color:#dce8f2}
.data-eyebrow{font-size:10px;font-weight:750;letter-spacing:1.5px;color:#087bdc}
#data-view h2{margin:5px 0 6px;font-size:25px;letter-spacing:-.6px}
.data-heading{align-items:center;gap:20px}.data-heading p{margin:0;max-width:650px;line-height:1.5;color:#627b90}
#plot-toggle{min-height:42px;padding:10px 22px;border-radius:12px;box-shadow:0 4px 12px #087bdc20}
.data-controls{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,2fr);gap:16px;margin:22px 0 18px}
.data-controls label{font-weight:600}.data-controls select{width:100%;min-width:0;min-height:42px;border-radius:10px}
.data-plot-card{padding:18px;background:white;border:1px solid #dce7f1;border-radius:16px;box-shadow:0 6px 20px #243b5d08}
#data-status{margin:0 0 14px;font-size:12px;color:#627b90}
#data-legend{gap:10px;margin-bottom:14px}#data-legend span{padding:9px 14px;background:#f3f8fc;border:1px solid #e3edf5;border-radius:10px;font-variant-numeric:tabular-nums}
#data-chart{display:block;min-height:0;aspect-ratio:1000/420;border:0;border-radius:0}
#data-inspect{min-height:20px;margin:12px 0 0;padding-top:12px;border-top:1px solid #e5edf4;font-variant-numeric:tabular-nums}
#data-view .data-note{margin:12px 0 0;color:#627b90}
@media(max-width:720px){#data-view{padding:16px}.data-controls{grid-template-columns:minmax(0,1fr);gap:12px;margin:16px 0}.data-plot-card{padding:10px}.data-heading{gap:12px}#plot-toggle{width:100%}#data-legend span{padding:7px 9px;font-size:12px}}

.simulation-toggle{flex-direction:column;gap:5px;cursor:pointer;padding:0}
.simulation-toggle:has(input:checked){background:none;padding:0;border-radius:0}
.simulation-toggle input{appearance:none;position:relative;display:block;width:36px;height:20px;margin:0;border:1px solid #ffffff80;border-radius:20px;background:#064f91;box-shadow:inset 0 1px 3px #00356640;transition:background .15s ease}
.simulation-toggle input::after{content:'';position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:white;box-shadow:0 1px 3px #00356650;transition:transform .15s ease}
.simulation-toggle input:checked{background:#5ce0c2;border-color:#a2f3df}
.simulation-toggle input:checked::after{transform:translateX(16px);background:#064f65}
.simulation-toggle:has(input:disabled){opacity:.55;cursor:not-allowed}.simulation-toggle input:disabled{cursor:not-allowed}
@media(prefers-reduced-motion:reduce){.simulation-toggle input,.simulation-toggle input::after{transition:none}}
@media(forced-colors:active){.simulation-toggle input{appearance:auto}.simulation-toggle input::after{display:none}}
.simulation-toggle input{padding:0;min-height:0;box-sizing:border-box}

.editor-titlebar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:16px;border-bottom:1px solid #dce7f1;background:#f7fbff}
.editor-titlebar .editor-label{margin:0;border:0;background:none;min-width:0}
.editor-titlebar .simulation-toggle{color:#365168;font-size:11px;flex-shrink:0;padding:6px 0}
.editor-titlebar .simulation-toggle input{border-color:#7b9bb6}
.editor-titlebar .simulation-toggle input:focus-visible{outline-color:#087bdc}
@media(max-width:720px){body[data-page="workspace"] .toolbar-actions{grid-template-columns:minmax(0,1fr) auto auto}.editor-titlebar{padding-right:12px}}

.simulation-inputs{margin:12px 0;padding:10px 12px;border:1px solid #dce7f1;border-radius:12px;background:#f7fbff;font-size:12px;color:#365168}
.simulation-inputs summary{cursor:pointer;font-weight:600}.simulation-input-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.simulation-input-fields label{display:grid;gap:6px}.simulation-input-fields input{width:100%;min-width:0}.simulation-inputs p{font-size:11px;line-height:1.5;margin:10px 0 0}
@media(max-width:720px){.toolbar-actions #run,.toolbar-actions #stop,.connection-menu>summary,.program-heading button,.simulation-toggle{min-height:44px}.toolbar-actions #stop{min-width:60px}.connection-menu>summary{min-width:44px;display:flex;align-items:center;justify-content:center}.editor-titlebar .simulation-toggle{min-width:64px;justify-content:center}.program-heading .mobile-views button{white-space:nowrap}.simulation-inputs summary{min-height:32px;line-height:32px}}

.robot-identity-text{display:flex;flex-direction:column;gap:4px;min-width:0}.robot-connection-line{display:flex;gap:7px;align-items:center;flex-wrap:wrap;font-size:10px;font-weight:500;line-height:1.3;color:#e6f4ff}
#robot-battery{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}#battery-bars{display:inline-flex;gap:2px;padding:2px;border:1px solid #b9dff5;border-radius:3px}#battery-bars i{width:3px;height:8px;background:#ffffff30}#battery-bars i.filled{background:#a6f0ce}
body[data-page="workspace"] header.toolbar{grid-template-columns:150px auto minmax(160px,210px) minmax(100px,1fr) auto}
@media(max-width:1100px){body[data-page="workspace"] header.toolbar{grid-template-columns:150px auto minmax(0,1fr)}}
@media(max-width:720px){body[data-page="workspace"] header.toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.robot-connection-line{font-size:10px;gap:4px}}

.obstacle-settings .obstacle-count{margin-top:12px}

/* Keep status and error text readable at every header breakpoint. */
body[data-page="workspace"] .toolbar #status{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.4}

@media(max-width:1100px){body[data-page="workspace"] header.toolbar:has(#status[data-expanded="true"]){grid-template-areas:"logo home robot" "actions actions actions" "status status status"}}
@media(max-width:720px){body[data-page="workspace"] header.toolbar:has(#status[data-expanded="true"]){grid-template-areas:"logo home" "robot robot" "actions actions" "status status"}}


/* Standalone file controls share the compact program toolbar. */
.local-save-note{font-size:13px;line-height:1.6;color:#4c6880;margin:0 0 18px;max-width:950px}
.program-file-import{border-top:1px solid #d7e7f4;margin-top:20px;padding-top:16px}
#import-program{width:100%;min-height:44px}.program-file-import .field-hint{line-height:1.5}
.file-status{font-size:12px;color:#365168;overflow-wrap:anywhere;margin:0 0 12px}.file-status:empty{display:none}
.program-heading{grid-template-columns:auto minmax(100px,1fr) auto auto auto auto}
#download-program{white-space:nowrap;min-height:44px}
@media(max-width:1100px){.program-heading{display:flex;flex-wrap:wrap}.program-heading #program-title{flex:1}.program-heading .workspace-controls{margin-left:auto}}
@media(max-width:520px){.program-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title title" "download views" "save layout"}.program-heading>label{display:none}.program-heading #program-title{grid-area:title;width:100%;min-width:0}.program-heading #save-state{grid-area:save}.program-heading #download-program{grid-area:download}.program-heading nav{grid-area:views;justify-content:flex-end}.program-heading .workspace-controls{grid-area:layout;justify-self:end;margin:0}.local-save-note{font-size:12px}}

.program-row{position:relative;margin-bottom:10px}.program-row:last-child{margin-bottom:0}.program-row .program-card{min-width:0;margin:0;padding-right:64px}.program-row .program-card:after{content:none}.program-delete{position:absolute;right:9px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:44px;min-height:44px;padding:0;border:1px solid transparent;background:transparent;color:#aa2446;border-radius:10px}.program-delete:hover:not(:disabled){background:#fff0f3;border-color:#d790a2}

/* HTML projects share the existing editor, runner and output panel. */
#new-program-kind,#web-example{width:100%;margin:0 0 16px;min-height:44px}#project-file-controls{padding:12px 16px;background:#f1f7fc;border-bottom:1px solid #d7e7f4;display:flex;align-items:center;gap:8px;flex-wrap:wrap}#project-file-controls label{font-size:12px}#project-file{min-width:120px;min-height:40px}#project-file-controls details{margin-left:auto;font-size:12px}#project-file-controls summary{cursor:pointer;padding:8px}#file-edit-status{width:100%;font-size:12px;margin:0;overflow-wrap:anywhere}#file-edit-status:empty{display:none}.preview-heading{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:12px;background:#f2f8fc}.preview-heading strong{margin-right:auto}.preview-heading button{min-height:44px}.preview-heading a{font-size:12px}#page-preview{height:420px;background:white;overflow:hidden}#page-preview>iframe{display:block;width:100%;height:100%;border:0}#page-preview>p{padding:16px;font-size:13px}#web-preview-panel{border-bottom:1px solid #d7e7f4}@media(max-width:720px){#page-preview{height:440px}}

.editor-label[data-language]::before{content:attr(data-language)}
