#gratingShapeEditor{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:0;background:#0d0d0e;color:#eee;overflow:hidden}
#gratingShapeEditor[open]{display:flex;flex-direction:column}#gratingShapeEditor::backdrop{background:#080809}
.gse-header{height:auto;min-height:76px;flex:none;display:flex;justify-content:space-between;align-items:center;padding:14px 22px;background:#121213;border-bottom:1px solid #333;gap:16px}.gse-header strong{font-size:17px}.gse-header p{font-size:11px;color:#a1a1a7;margin:3px 0 0}.gse-header button{width:auto;padding:9px 15px}
.gse-body{display:grid;grid-template-columns:300px minmax(240px,1fr) minmax(220px,.85fr);gap:18px;padding:18px;flex:1;min-height:0}.gse-tools{overflow:auto;padding:0 14px 24px 0;scrollbar-width:thin}.gse-tools label{font-size:11px;display:block;margin:8px 0}.gse-tools input,.gse-tools select{width:100%;padding:7px;margin-top:5px;background:#181819;border:1px solid #38383c;border-radius:6px;color:#eee}.gse-tools input[type=color]{height:36px}.gse-tools .workspace-group{margin-top:12px}.gse-tools .toggle{display:flex}.gse-tools .toggle input{width:auto}.gse-tools button{padding:8px 10px}.gse-tools summary{cursor:pointer;font-size:12px}.gse-tools #colorWorkspace{margin-top:10px}.gse-tools #gLightingEditor>summary{font-size:12px}.gse-tools #gAuroraPreset,.gse-tools #gLightHandles,.gse-tools #gLightHandles+span{display:none}.gse-tools #gLightingEditor>.toggle{display:none}
.gse-view{min-width:0;min-height:0;display:flex;flex-direction:column;padding:14px;border:1px solid #303034;border-radius:12px;background:#111112}.gse-view-heading{display:flex;flex-direction:column;gap:3px;flex:none;margin-bottom:12px}.gse-view-heading strong{font-size:14px}.gse-view-heading span{color:#97979d;font-size:11px}.gse-view>.field-help{flex:none;font-size:11px;margin:12px 0 0}
#gseShapeStage{width:100%;max-width:calc(100dvh - 210px);aspect-ratio:1;position:relative;margin:auto;background:#08090b;border:1px solid #29292b;border-radius:10px;touch-action:none;overflow:hidden}#gseShapeCanvas{display:block;width:100%;height:100%}#gsePoints{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}#gsePoints .gse-point-handle{pointer-events:all;stroke:white;stroke-width:.4;cursor:move}#gsePoints .gse-point-outline{fill:none;stroke:#ffffff70;stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none;stroke-dasharray:4 3}#gsePoints .selected .gse-point-outline{stroke:white}#gsePointList .selected{outline:2px solid #fff;outline-offset:2px}
.gse-effect-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:12px;background:#09090a;border-radius:10px;overflow:hidden}#gseEffectCanvas{display:block;max-width:100%;max-height:100%;width:auto;height:100%;object-fit:contain}
#gratingShapeEditor[data-points-mode=true] #gPaintStops,#gratingShapeEditor[data-points-mode=true] #gPaintStrip,#gratingShapeEditor[data-points-mode=true] #gPaintAdd{display:none}
@media(max-width:1000px){.gse-body{grid-template-columns:250px minmax(180px,1fr) minmax(170px,.8fr);gap:10px;padding:10px}.gse-header{padding:12px}.gse-view{padding:10px}}
@media(max-width:700px){#gratingShapeEditor{overflow:auto}.gse-header{position:sticky;top:0;z-index:3}.gse-header strong{font-size:13px}.gse-header button{font-size:11px;white-space:nowrap}.gse-body{display:grid;grid-template-columns:1fr 1fr;flex:none;overflow:visible}.gse-tools{grid-column:1/-1;order:2;overflow:visible;padding:10px}.gse-view{min-height:280px}.gse-effect-stage{height:310px;flex:none}#gseShapeStage{max-width:100%;margin:auto}.gse-view-heading strong{font-size:12px}.gse-view-heading span{font-size:10px}.gse-view>.field-help{font-size:10px}}
.grating-width-curve{margin-top:16px;padding-top:14px;border-top:1px solid #ffffff15}.grating-width-curve h4{display:flex;justify-content:space-between;margin:0 0 10px;font-size:13px}.grating-width-curve output{color:#77dfff}.grating-width-curve canvas{display:block;width:100%;height:auto;border:1px solid #ffffff25;border-radius:12px;touch-action:none;cursor:crosshair}.grating-width-curve .quiet{margin-top:6px}

.g-preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
.g-preset{display:flex;flex-direction:column;gap:3px;align-items:flex-start;text-align:left;padding:9px 10px;border:1px solid #343941;border-radius:9px;background:#1a1c20;cursor:pointer}
.g-preset:hover{border-color:#ddceb1;background:#22242a}
.g-preset strong{font-size:12px;color:#eae6de}
.g-preset small{font-size:9px;color:#8f959d;line-height:1.4}
@media(max-width:560px){.g-preset-grid{grid-template-columns:1fr}}
