/* Chaos Code Studio: restrained neon-cathedral styling, mobile-first */
body.chaos-code-page{background:radial-gradient(circle at 0% 0%,#27102d 0,transparent 50%),radial-gradient(circle at 95% 4%,#102d28 0,transparent 44%),#0b0b13;color:#f4e8f6}
.chaos-code-shell{width:min(1480px,96%);margin:0 auto;padding:1.3rem .4rem 4rem}
.studio-links,.studio-hero-links,.studio-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem}
.studio-links{margin:1rem 0;color:#b2b6c7;font-size:.9rem}
.studio-links a,.studio-hero-links a{color:#ccf5df}
.studio-hero{background:linear-gradient(130deg,#210e26e8,#091a1ad9);padding:clamp(1.3rem,4vw,3rem);border:1px solid #b3368c88;border-radius:20px;box-shadow:0 0 38px #ff2f6c12;margin-bottom:1.35rem}
.studio-hero h1{font-size:clamp(1.8rem,4vw,3.8rem);line-height:1.1;margin:.35rem 0 .6rem;letter-spacing:.04em}
.studio-hero h1>span:first-child{color:#ff57b6}
.studio-hero .eyebrow,.studio-panel .eyebrow{font-weight:700;letter-spacing:.13em;color:#a9fbd7;font-size:.72rem}
.studio-hero p{max-width:75ch;line-height:1.5}
.studio-hero-links a{padding:.45rem .7rem;border:1px solid #8cdabf66;border-radius:9px;text-decoration:none}
.studio-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:1rem}
.studio-panel{min-width:0;border:1px solid #784c7a;border-radius:18px;background:#15111df5;padding:1rem;box-shadow:0 6px 24px #0005}
.studio-panel-heading{display:flex;justify-content:space-between;gap:.5rem;align-items:center;flex-wrap:wrap}
.studio-panel h2{margin:.35rem 0;font-size:1.45rem;color:#fae7f5}
.studio-panel h3{margin:1.2rem 0 .55rem;font-size:1rem}
.studio-chip{border:1px solid #66d6ad77;color:#b5f7d7;border-radius:20px;padding:.25rem .55rem;font-size:.7rem}
.studio-note,.studio-hint,.studio-footer{color:#c6becf;font-size:.9rem;line-height:1.5}
.studio-code-label,.studio-panel label{display:block;font-weight:700;margin:.65rem 0 .25rem}
.studio-controls{display:grid;grid-template-columns:1fr 1.4fr;gap:.8rem}
.studio-repository{border:1px solid #458f75aa;border-radius:13px;padding:.75rem;margin:.8rem 0 1.1rem;background:#10211944}
.studio-repository h3{margin:.2rem 0 .3rem}
.studio-repo-fields{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:.7rem;align-items:end}
.studio-repo-fields label{min-width:0}
.studio-repo-fields input{box-sizing:border-box;display:block;width:100%;max-width:100%;padding:.7rem;border:1px solid #93648a;border-radius:9px;background:#090c16;color:#fff;font:inherit}
#studio-repo-output{max-height:260px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:520px){.studio-repo-fields{grid-template-columns:minmax(0,1fr) 88px}}
.studio-panel textarea,.studio-panel select,.studio-panel input[type=file]{box-sizing:border-box;display:block;max-width:100%;width:100%;padding:.7rem;border:1px solid #93648a;border-radius:9px;background:#090c16;color:#f1f1f4;font:inherit}
.studio-panel textarea{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;line-height:1.55;tab-size:2;resize:vertical}
#studio-code{min-height:300px}
#studio-steps{min-height:116px}
#studio-mermaid{min-height:130px;background:#0d1b20;border-color:#3a7775}
.studio-panel textarea:focus,.studio-panel input:focus,.studio-panel select:focus{outline:2px solid #85f8c7;outline-offset:2px}
.studio-actions{margin:.8rem 0;align-items:stretch}
.studio-actions button{font:inherit;cursor:pointer;border-radius:9px;padding:.6rem .7rem;color:#fff;background:#69224e;border:1px solid #f483c3a8;min-height:42px}
.studio-actions button:first-child{background:#a52b69}
.studio-actions button:focus-visible,.studio-hero-links a:focus-visible{outline:3px solid #b2ffd7;outline-offset:2px}
.studio-actions button:disabled{opacity:.45;cursor:not-allowed}
.studio-status{min-height:2rem;border-left:3px solid #6ab99e;background:#0c2220;padding:.55rem .75rem;border-radius:3px;line-height:1.45}
.studio-results{white-space:pre-wrap;overflow-wrap:anywhere;max-height:320px;overflow:auto;border-radius:10px;border:1px solid #604c70;background:#090b15;padding:.9rem;line-height:1.6;color:#d6f7e5}
.studio-diagram-scroll{overflow:auto;max-height:950px;border:1px solid #653a61;border-radius:12px;background:#0c1019;margin:.75rem 0}
.studio-preview{min-height:190px;min-width:100%;display:grid;place-items:center}
.studio-preview svg{display:block;max-width:none}
.studio-footer{margin:1.2rem 0;text-align:center}
@media(max-width:970px){.studio-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:580px){.chaos-code-shell{width:100%;padding:1rem .7rem 3rem}.studio-controls{grid-template-columns:1fr}.studio-panel{padding:.8rem}.studio-actions button{flex:1 1 9rem}}
@media(prefers-reduced-motion:reduce){.studio-panel *{scroll-behavior:auto}}


/* Added code review and JSON shape panels retain compact, accessible stacking. */
#studio-diff-before,#studio-diff-after{min-height:115px}
#studio-schema{min-height:220px}
#studio-json-data{min-height:108px}
#studio-diff-output{min-height:110px}
#studio-schema-output{min-height:80px}


/* Supervised server-backed review stays separate from local scratch edits. */
.studio-dev-submit{margin-top:13px;padding:13px;border:1px solid #8bd5ab79;border-radius:11px;background:linear-gradient(120deg,#202039,#10271f)}
.studio-dev-submit label{display:grid;gap:8px;font-size:.85rem;color:#d8ffe8}
.studio-dev-submit input{box-sizing:border-box;width:100%;min-height:40px;padding:9px 11px;border:1px solid #5e977a;border-radius:8px;background:#080e16;color:#f9eaf5;font:inherit}
.studio-dev-submit button{min-height:42px;width:100%;margin:10px 0;border:1px solid #8cf9bb;border-radius:9px;background:#21513d;color:#eafff2;font:inherit;font-weight:800;cursor:pointer}
.studio-dev-submit button:disabled{opacity:.52;cursor:not-allowed}
.studio-dev-submit button:focus-visible{outline:2px solid #ff9ecf;outline-offset:3px}


/* Explicit manual candidate-test packet: prepared on device, no implicit CI. */
.studio-candidate-check{margin:15px 0;padding:14px;border-radius:12px;background:linear-gradient(110deg,#192237,#181122);border:1px solid #6488a9}
.studio-candidate-check h4{color:#b4ffdf;font-size:.95rem;margin:0 0 10px}
.studio-candidate-check p{margin:8px 0;line-height:1.5}
.studio-candidate-fields{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin-top:12px}
.studio-candidate-fields label{display:grid;gap:6px;flex:1 1 185px;color:#f3dff4;font-size:.8rem}
.studio-candidate-fields label:last-child{flex-basis:100%}
.studio-candidate-fields select,.studio-candidate-fields textarea{width:100%;min-width:0;box-sizing:border-box;background:#0c101b;border:1px solid #6e8b9c;border-radius:9px;color:#edfdf4;padding:9px 11px;font:400 .8rem/1.55 ui-monospace,Consolas,monospace}
.studio-candidate-fields button{min-height:41px;border:1px solid #80eaba;border-radius:9px;background:#24443c;color:#e6fff0;padding:8px 12px;font:inherit;font-weight:800;cursor:pointer}
.studio-candidate-fields button:disabled{opacity:.47;cursor:not-allowed}
.studio-candidate-fields textarea{resize:vertical;min-height:92px;overflow-wrap:anywhere;word-break:break-all}
.studio-candidate-fields :is(button,textarea,select):focus-visible{outline:2px solid #ffb8df;outline-offset:2px}
#studio-candidate-status{margin-top:12px}
@media(max-width:400px){.studio-candidate-check{padding:11px}.studio-candidate-fields button{width:100%}}
