:root{
  color-scheme:light;
  --navy:#061426;--navy-soft:#0b2d52;--blue:#1469d8;--cyan:#16bfc9;--paper:#f3f7fc;--white:#fff;--ink:#142033;--muted:#65748b;--line:#dbe3ef;--line-strong:#c7d3e3;--focus:0 0 0 3px rgba(20,105,216,.14);--shadow:0 20px 55px rgba(6,20,38,.12)
}
[hidden]{display:none!important}*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;background:var(--paper);color:var(--ink);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;line-height:1.45}button,input,select{font:inherit;color:inherit}button{cursor:pointer}
.topbar{position:sticky;z-index:30;top:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;min-height:72px;padding:0 28px;border-bottom:1px solid rgba(255,255,255,.1);background:linear-gradient(90deg,rgba(6,20,38,.98),rgba(8,35,66,.97));color:#fff;box-shadow:0 5px 24px rgba(6,20,38,.14)}
.brand{display:flex;align-items:center;gap:12px;color:#fff;font-weight:800;text-decoration:none}.brand:visited{color:#fff}.brand-mark{display:grid;width:38px;height:38px;place-items:center;border-radius:12px;background:linear-gradient(135deg,var(--cyan),var(--blue));color:#fff;box-shadow:0 8px 24px rgba(28,200,210,.28)}.brand-mark svg{width:22px;height:22px}.app-identity{display:grid;justify-items:center;line-height:1.15}.app-kicker{margin-bottom:4px;color:#95ecf1;font-size:.71rem;font-weight:850;letter-spacing:.12em}.app-identity strong{font-size:.98rem}.tool-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.back-link{justify-self:end;padding:9px 13px;border-radius:10px;color:#d9e5f6;font-size:.9rem;font-weight:700;text-decoration:none}.back-link:hover,.back-link:focus-visible{background:rgba(255,255,255,.1);color:#fff}
.workspace-shell{display:grid;grid-template-columns:minmax(370px,500px) minmax(0,1fr);min-height:calc(100vh - 72px)}
.control-panel{z-index:2;overflow-y:auto;max-height:calc(100vh - 72px);padding:22px;border-right:1px solid var(--line);background:#f8fbff}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:2px 2px 18px}.panel-heading>div,.section-title{display:flex;align-items:center;gap:11px}.panel-heading h1{margin:0;font-size:1.26rem;letter-spacing:-.025em;line-height:1.15}.step-number{display:inline-grid;min-width:36px;height:30px;place-items:center;border-radius:9px;background:#e6f1ff;color:var(--blue);font-size:.76rem;font-weight:900;letter-spacing:.08em}
.control-section{margin-bottom:12px;overflow:hidden;border:1px solid var(--line);border-radius:15px;background:#fff;box-shadow:0 6px 20px rgba(7,22,45,.035);padding:16px}.accent-section{position:relative}.accent-section::before{position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,var(--blue),var(--cyan));content:""}.control-section h2{margin:0;font-size:.94rem;letter-spacing:-.01em}.section-title{margin-bottom:11px}.hint,.micro-hint,.canvas-hint{color:var(--muted);font-size:.78rem}.hint{margin:4px 0 11px}.micro-hint{margin:0 0 7px}.math-hint{margin-top:10px}.math-hint code,.tool-help-list code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:#f1f5f9;padding:.08rem .28rem;border-radius:.28rem}
.palette-group{padding-top:3px}.palette-group+.palette-group{margin-top:13px;padding-top:12px;border-top:1px solid #e5eaf0}.palette-heading{display:flex;align-items:center;gap:7px;margin-bottom:7px;color:#3c4855;font-size:.78rem}.group-dot{width:8px;height:8px;border-radius:50%;display:inline-block}.components-dot{background:var(--blue)}.links-dot{background:#657482}.instruments-dot{background:var(--cyan)}.instrument-group{margin-left:-5px;margin-right:-5px;padding:12px 5px 4px;border-radius:9px;border-top:1px solid #d8e8ed!important;background:linear-gradient(180deg,#f3fbfc 0,#fff 100%)}
.palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.palette button{min-height:68px;padding:5px;border:1px solid var(--line-strong);border-radius:10px;background:#fff;color:#23354a}.palette-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}.palette-item:hover{border-color:#8ab6e7;background:#f7fbff;box-shadow:0 3px 9px rgba(30,45,60,.08);transform:translateY(-1px)}.palette-icon{display:flex;align-items:center;justify-content:center;width:100%;height:34px;color:#23354a}.palette-icon svg{width:86px;max-width:100%;height:34px;overflow:visible}.palette-icon svg line,.palette-icon svg circle,.palette-icon svg rect,.palette-icon svg path{stroke:currentColor;stroke-width:2;vector-effect:non-scaling-stroke;fill:none}.palette-icon svg circle{fill:#fff}.palette-icon svg path[d$="z"]{fill:currentColor;stroke:none}.palette-icon svg text{fill:currentColor;stroke:none;font:600 10px Arial,sans-serif;text-anchor:middle}.palette-label{font-size:11px;font-weight:700;line-height:1.15}.instruments-palette .palette-item{border-color:#cae1e6}.instruments-palette .palette-item:hover{border-color:#77c6d0;background:#f1fbfc}.instruments-palette .palette-icon{color:#0f6f7f}
.form{display:grid;grid-template-columns:1fr 1fr;gap:9px}.form .wide{grid-column:1/-1}.form label,.field{display:flex;flex-direction:column;gap:4px;color:#4f5d6b;font-size:12px}.form input,.form select,.field select{width:100%;min-height:40px;padding:7px 9px;border:1px solid var(--line-strong);border-radius:9px;outline:0;background:#fbfdff}.form input:focus,.form select:focus,.field select:focus{border-color:var(--blue);box-shadow:var(--focus)}.check{display:flex!important;flex-direction:row!important;align-items:center!important;gap:7px!important}.check input{width:auto}.row{display:flex;gap:7px;margin-top:8px}.row>*{flex:1}.secondary-button,.primary-button{min-height:40px;padding:8px 11px;border-radius:10px;font-weight:800}.secondary-button{border:1px solid var(--line-strong);background:#fff;color:#31506f}.secondary-button:hover{border-color:#98b4d8;background:#f7fbff}.primary-button{border:0;background:linear-gradient(125deg,#0d58b8,#1675dc);color:#fff;box-shadow:0 10px 23px rgba(20,105,216,.22)}.primary-button:hover{filter:brightness(1.05);transform:translateY(-1px)}.danger{color:#a12a2a}.list{display:flex;flex-direction:column;gap:5px;max-height:175px;overflow:auto}.list .item{display:flex;align-items:center;gap:7px;padding:7px 8px;border:1px solid var(--line);border-radius:8px;cursor:pointer;font-size:13px}.list .item.active{border-color:var(--blue);background:#eef5ff}.list .item .mini-badge{display:grid;width:26px;height:22px;place-items:center;border-radius:5px;background:#edf4fd;color:var(--blue);font-size:11px;font-weight:800}.list .item .item-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compact{margin-top:8px;max-height:115px}.status{margin-bottom:8px;padding:8px 9px;border:1px solid #d7e6f7;border-radius:9px;background:#f3f8fe;color:#3e5e7e;font-size:12px}
.quick-card{margin-bottom:9px;padding:10px;border:1px solid var(--line);border-radius:11px;background:#fbfdff}.quick-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.quick-title strong{font-size:13px}.kind-chip{padding:3px 6px;border-radius:999px;background:#eaf4ff;color:var(--blue);font-size:11px}.orientation-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.orientation-grid button{padding:7px;border:1px solid var(--line-strong);border-radius:8px;background:#fff;font-size:18px}.orientation-grid button.active{border-color:var(--blue);background:#eef5ff;color:var(--blue)}.move-pad,.terminal-move-pad{display:grid;grid-template-columns:repeat(3,36px);grid-template-rows:repeat(3,32px);justify-content:center;gap:4px;margin-top:8px}.move-pad button,.terminal-move-pad button{padding:3px;border:1px solid var(--line-strong);border-radius:8px;background:#fff;font-size:16px}.move-pad .center,.terminal-move-pad .center{background:#f4f6f8;cursor:default}.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:9px}.quick-actions .wide{grid-column:1/-1}.advanced{margin-top:9px;padding-top:8px;border-top:1px solid #e2e8ef}.advanced summary{cursor:pointer;color:#4f5d6b;font-size:12px;font-weight:700;user-select:none}.advanced .form{margin-top:9px}.mini-toggle{display:flex;align-items:center;gap:6px;color:#4f5d6b;font-size:12px}.mini-toggle input{width:auto}.object-empty{padding:10px;border:1px dashed #cfd7df;border-radius:8px;color:var(--muted);font-size:12px;text-align:center}
.collapsible{padding:0}.collapsible details{padding:16px}.collapsible summary{display:flex;align-items:center;justify-content:space-between;cursor:pointer;list-style:none}.collapsible summary::-webkit-details-marker{display:none}.collapsible summary .section-title{margin:0}.summary-mark{color:var(--blue);font-size:1.2rem;font-weight:800}.details-body{padding-top:12px}
.instrument-config{margin-top:12px;padding-top:10px;border-top:1px solid #dde3ea}.instrument-subtitle{margin:8px 0 6px;color:#344054;font-size:.82rem;font-weight:700}.instrument-subtitle.small{margin-top:8px;color:#667085;font-size:.75rem;font-weight:600}.terminal-layout-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.terminal-layout-grid button{min-height:54px;border:1px solid var(--line-strong);border-radius:9px;background:#fff;font-size:18px;line-height:1.05}.terminal-layout-grid button:hover{border-color:#7caedc;background:#f7fbff}.terminal-layout-grid button.active{border-color:var(--blue);background:#eef5ff;box-shadow:0 0 0 2px rgba(20,105,216,.11)}.terminal-layout-grid button span{display:inline-block;white-space:nowrap}.terminal-note{margin-top:9px;padding:8px 9px;border:1px solid #dce6ef;border-radius:8px;background:#f8fbfd;color:#475467;font-size:.76rem;line-height:1.35}.terminal-control-card{margin-top:10px;padding:9px;border:1px solid var(--line);border-radius:9px;background:#fff}.length-row{display:grid;grid-template-columns:1fr 34px 52px 34px;gap:6px;align-items:center;margin-top:8px;color:#475467;font-size:12px}.length-row button{padding:5px;border:1px solid var(--line-strong);border-radius:8px;background:#fff}.length-row strong{text-align:center;font-variant-numeric:tabular-nums}.ground-style-row{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}.ground-style-row button{display:flex;align-items:center;justify-content:center;gap:6px;padding:7px;border:1px solid var(--line-strong);border-radius:8px;background:#fff;font-size:11px}.ground-style-row button.active{border-color:var(--blue);background:#eef5ff;color:var(--blue)}.ground-icon{position:relative;display:inline-block;width:28px;height:18px}.ground-icon:before{position:absolute;top:0;left:13px;width:1.5px;height:8px;background:currentColor;content:""}.ground-icon.hatched:after{position:absolute;top:8px;left:4px;width:21px;height:9px;border-top:1.5px solid currentColor;background:repeating-linear-gradient(60deg,transparent 0 4px,currentColor 4px 5px,transparent 5px 8px);content:""}.ground-icon.classic:after{position:absolute;top:8px;left:4px;width:20px;height:10px;background:linear-gradient(currentColor,currentColor) center 0/20px 1.5px no-repeat,linear-gradient(currentColor,currentColor) center 4px/14px 1.5px no-repeat,linear-gradient(currentColor,currentColor) center 8px/8px 1.5px no-repeat;content:""}
.preview-panel{min-width:0;background:#eaf0f7}.preview-toolbar{position:sticky;z-index:10;top:72px;display:flex;min-height:68px;align-items:center;justify-content:space-between;gap:18px;padding:12px 24px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.95);backdrop-filter:blur(14px)}.preview-title{display:flex;align-items:center;gap:11px}.preview-title>div{display:grid}.preview-title strong{font-size:.96rem}.preview-title span:last-child{color:var(--muted);font-size:.78rem}.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.toolbar .spacer{width:1px;height:28px;margin:0 2px;background:var(--line)}.preview-stage{display:grid;place-items:start center;min-height:calc(100vh - 140px);padding:26px}#canvasWrap{position:relative;overflow:hidden;width:100%;max-width:1150px;min-height:650px;border:1px solid #cbd5e2;border-radius:4px;background:#fff;box-shadow:var(--shadow)}#canvas{display:block;width:100%;height:100%;min-height:650px;touch-action:none}.canvas-hint{width:100%;max-width:1150px;margin:10px 0 0;text-align:center}
.project-footer{display:flex;flex-wrap:wrap;justify-content:center;gap:.35rem 1.25rem;padding:.75rem 1.25rem;border-top:1px solid var(--line);background:#f8fafc;color:#526579;font-size:.82rem;line-height:1.45;text-align:center}.project-footer b{color:var(--ink)}.project-footer a{color:var(--blue);font-weight:700;text-decoration:underline;text-underline-offset:.18em}
@media(max-width:1100px){.palette{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace-shell{grid-template-columns:minmax(340px,43vw) minmax(0,1fr)}}
@media(max-width:820px){.topbar{grid-template-columns:1fr auto;min-height:64px;padding:0 16px}.app-identity{display:none}.back-link{font-size:0}.back-link::after{font-size:.85rem;content:"Site ↗"}.workspace-shell{display:block}.control-panel{overflow:visible;max-height:none;padding:16px;border-right:0}.preview-toolbar{top:64px;align-items:flex-start;flex-direction:column;padding:10px 16px}.preview-stage{min-height:auto;padding:14px}.palette{grid-template-columns:repeat(3,minmax(0,1fr))}#canvasWrap,#canvas{min-height:560px}}
@media(max-width:520px){.brand span:last-child{display:none}.palette{grid-template-columns:repeat(2,minmax(0,1fr))}.form{grid-template-columns:1fr}.form .wide{grid-column:auto}.toolbar .spacer{display:none}.toolbar{width:100%}.toolbar button{flex:1 1 auto}.preview-title .step-number{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
