/* Editor 1.1: a visible stage and a separate scrollable tool panel. */
.gsm-editor{align-items:stretch}
.gsm-canvas-column{display:flex;flex-direction:column;gap:12px;min-width:0}
.gsm-stage-space{display:grid;place-items:center;min-width:0;min-height:0;width:100%}
.gsm-stage-bar{grid-row:1}
.gsm-stage-space{grid-row:2}
.gsm-stage-caption{grid-row:3}
.gsm-viewport{width:100%;touch-action:none;user-select:none;-webkit-user-select:none;outline-offset:2px;flex:none}
.gsm-viewport:focus-visible{outline:3px solid #c75555}
.gsm-stage-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.gsm-view-modes,.gsm-history{display:flex;align-items:center;gap:5px}
.gsm-dialog .gsm-stage-bar button{min-height:44px;padding:8px 10px;border:1px solid var(--gsm-line);border-radius:9px;background:#fff;color:var(--gsm-ink);font-size:12px;line-height:1.2;font-weight:600}
.gsm-dialog .gsm-view-modes button[aria-pressed=true]{background:var(--gsm-red);border-color:var(--gsm-red);color:#fff;-webkit-text-fill-color:#fff}
.gsm-history button[data-action=undo],.gsm-history button[data-action=redo]{min-width:44px;font-size:23px;padding:4px}
.gsm-dialog .gsm-history button:disabled{opacity:.35}
.gsm-stage-caption{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 10px;font-size:11px;line-height:1.35;color:var(--gsm-muted);min-height:30px}
.gsm-stage-caption [data-gesture-hint]{flex-basis:100%;color:var(--gsm-ink);font-weight:600}
.gsm-dialog[data-gesture-mode=view] .gsm-layer{outline-color:#b6b6bd;cursor:default}
.gsm-dialog[data-gesture-mode=view] [data-resize]{display:none}
.gsm-dialog[data-gesture-mode=view] .gsm-viewport{cursor:grab}
.gsm-tools{padding:20px;gap:0;min-width:0;overflow:hidden;background:#fff}
.gsm-tool-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding-bottom:12px;border-bottom:1px solid var(--gsm-line);flex:none}
.gsm-dialog .gsm-tool-tabs button{min-width:0;min-height:44px;padding:8px 3px;background:#f6f6f8;color:var(--gsm-muted);border:1px solid transparent;border-radius:8px;font-size:12px;line-height:1.2}
.gsm-dialog .gsm-tool-tabs button[aria-selected=true]{color:var(--gsm-red);background:#fff3f3;border-color:#e2adad;font-weight:700}
.gsm-tool-panel{padding:18px 0;display:flex;flex-direction:column;gap:14px;min-width:0;min-height:0;overscroll-behavior:contain;touch-action:pan-y}
.gsm-tool-panel h3{font-size:17px}
.gsm-number-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.gsm-number-field{display:flex;flex-direction:column;gap:7px;min-width:0}
.gsm-number-field>label{display:flex;justify-content:space-between;gap:6px;font-size:12px;font-weight:600}
.gsm-number-field>label span{color:var(--gsm-muted);font-weight:400}
.gsm-number{display:flex;border:1px solid #ceced8;border-radius:10px;overflow:hidden;min-height:46px;min-width:0;background:#fff}
.gsm-dialog .gsm-number button{border:0;border-radius:0;background:#f6f6f8;color:var(--gsm-ink);width:46px;min-width:40px;flex:none;padding:8px;font-size:22px;line-height:1}
.gsm-dialog .gsm-number input{display:block;min-width:0;width:100%;flex:1;min-height:44px;padding:8px 2px;border:0!important;border-radius:0!important;background:#fff;color:var(--gsm-ink);text-align:center;font:600 16px/1.4 Arial,sans-serif;font-variant-numeric:tabular-nums;box-shadow:none}
.gsm-dialog .gsm-number input[aria-invalid=true]{background:#fff4f0;box-shadow:inset 0 -2px #bb3b18}
.gsm-number:focus-within{outline:2px solid #c75555;outline-offset:2px}
.gsm-dialog .gsm-number input:focus-visible{outline:0}
.gsm-presets{display:flex;gap:7px}
.gsm-dialog .gsm-presets button,.gsm-dialog .gsm-reset{min-height:44px;padding:8px 12px;background:#fff;border:1px solid var(--gsm-line);border-radius:8px;color:var(--gsm-red);font:600 12px/1.3 Arial,sans-serif}
.gsm-nudge{flex-wrap:wrap;align-items:center;gap:6px}
.gsm-dialog .gsm-nudge .gsm-reset{width:auto;height:auto;font-size:12px}
.gsm-editor-footer{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 24px;border-top:1px solid var(--gsm-line);background:#fff;min-width:0}
.gsm-editor-footer>p{max-width:520px}
.gsm-editor-footer>.gsm-button{min-width:260px;flex:none}
.gsm-gallery{padding:8px;margin:0}
.gsm-gallery [data-photos]{margin-top:0;grid-template-columns:repeat(4,minmax(0,1fr))}
.gsm-gallery button{min-height:62px;touch-action:manipulation}
.gsm-dialog[data-compact=true]{max-height:calc(var(--gsm-vh,100dvh) - 16px)}
.gsm-dialog[data-compact=true][data-step="2"]{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:var(--gsm-vh,100dvh);max-height:var(--gsm-vh,100dvh);border-radius:0;overflow:hidden}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-shell{height:100%;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-head{padding:10px 12px 8px;gap:10px;position:static;flex:none}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-eyebrow{display:none}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-head h2{font-size:18px;letter-spacing:-.35px}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-head p{font-size:11px;margin-top:4px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-close{width:44px;height:44px;border-radius:10px}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-steps{display:none}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-steps button{font-size:10px;min-height:28px;padding:3px 0}
.gsm-dialog[data-compact=true][data-step="2"] .gsm-alert{flex:none;max-height:68px;overflow-y:auto;margin:5px 12px;padding:8px 10px;font-size:12px}
.gsm-dialog[data-compact=true] .gsm-editor{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.gsm-dialog[data-compact=true] .gsm-canvas-column{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:7px;flex:1 1 0;min-height:135px;padding:8px 12px;overflow:hidden}
.gsm-dialog[data-compact=true] .gsm-stage-space{height:100%;overflow:hidden}
.gsm-dialog[data-compact=true] .gsm-viewport{max-width:100%;max-height:100%;margin:0}
.gsm-dialog[data-compact=true] .gsm-stage-bar{gap:4px}
.gsm-dialog[data-compact=true] .gsm-stage-bar button{font-size:11px;padding:7px 8px}
.gsm-dialog[data-compact=true] .gsm-view-modes button{padding:7px 5px}
.gsm-dialog[data-compact=true] .gsm-history button[data-action=undo],.gsm-dialog[data-compact=true] .gsm-history button[data-action=redo]{font-size:22px;padding:4px}
.gsm-dialog[data-compact=true] .gsm-stage-caption{font-size:10px;min-height:27px;gap:3px 8px}
.gsm-dialog[data-compact=true] .gsm-photo-count{display:none}
.gsm-dialog[data-compact=true] .gsm-layer>[data-resize]{display:none}
.gsm-dialog[data-compact=true] .gsm-tools{padding:0;flex:0 1 160px;max-height:40%;min-height:120px;border-top:1px solid var(--gsm-line);display:flex;flex-direction:column;overflow:hidden}
.gsm-dialog[data-compact=true] .gsm-tool-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;padding:0;border-bottom:1px solid var(--gsm-line);background:#fff}
.gsm-dialog[data-compact=true] .gsm-tool-tabs button{font-size:11px;min-height:44px;border:0;border-bottom:3px solid transparent;border-radius:0;background:#fff;padding:8px 1px}
.gsm-dialog[data-compact=true] .gsm-tool-tabs button[aria-selected=true]{border-bottom-color:var(--gsm-red);background:#fff4f4}
.gsm-dialog[data-compact=true] .gsm-tool-panel{padding:10px 14px;gap:9px;overflow-y:auto;flex:1;scrollbar-gutter:stable}
.gsm-dialog[data-compact=true] .gsm-tool-panel h3,.gsm-dialog[data-compact=true] .gsm-desktop-range{display:none}
.gsm-dialog[data-compact=true] .gsm-tool-panel .gsm-hint{font-size:11px;line-height:1.45}
.gsm-dialog[data-compact=true] .gsm-number-field>label{font-size:11px}
.gsm-dialog[data-compact=true] .gsm-number-field{gap:5px}
.gsm-dialog[data-compact=true] .gsm-nudge button{height:44px;width:44px}
.gsm-dialog[data-compact=true] .gsm-nudge .gsm-reset{width:auto;padding:7px 9px;flex:1;font-size:11px}
.gsm-dialog[data-compact=true] .gsm-editor-footer{padding:8px 12px max(8px,env(safe-area-inset-bottom));display:block;flex:none}
.gsm-dialog[data-compact=true] .gsm-editor-footer>p{display:none}
.gsm-dialog[data-compact=true] .gsm-editor-footer>.gsm-button{width:100%;min-width:0;min-height:48px;font-size:14px}
.gsm-dialog[data-compact=true][data-landscape=true] .gsm-editor{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
.gsm-dialog[data-compact=true][data-landscape=true] .gsm-canvas-column{grid-column:1;grid-row:1;min-height:0}
.gsm-dialog[data-compact=true][data-landscape=true] .gsm-tools{grid-column:2;grid-row:1;min-height:0;max-height:none;height:100%;border-top:0;border-left:1px solid var(--gsm-line)}
.gsm-dialog[data-compact=true][data-landscape=true] .gsm-tool-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
.gsm-dialog[data-compact=true][data-landscape=true] .gsm-tool-tabs button{min-height:38px}
.gsm-dialog[data-compact=true][data-landscape=true] .gsm-editor-footer{grid-column:1/-1;grid-row:2}
.gsm-dialog[data-compact=true][data-short=true][data-step="2"] .gsm-head{padding:5px 12px}
.gsm-dialog[data-compact=true][data-short=true][data-step="2"] .gsm-head p,.gsm-dialog[data-compact=true][data-short=true][data-step="2"] .gsm-steps{display:none}
.gsm-dialog[data-compact=true][data-short=true] .gsm-stage-caption [data-photo-caption]{display:none}
.gsm-dialog[data-compact=true][data-short=true] .gsm-stage-caption{min-height:14px;font-size:10px}
.gsm-dialog[data-compact=true][data-short=true] .gsm-canvas-column{gap:4px;padding:5px 10px}
.gsm-dialog[data-compact=true][data-short=true][data-landscape=false] .gsm-canvas-column{min-height:80px}
.gsm-dialog[data-compact=true][data-short=true][data-landscape=false] .gsm-tools{min-height:100px;flex-basis:145px}
.gsm-dialog[data-compact=true][data-short=true][data-exact-editing=true] .gsm-stage-bar,.gsm-dialog[data-compact=true][data-short=true][data-exact-editing=true] .gsm-editor-footer{display:none}
.gsm-dialog[data-compact=true][data-short=true][data-exact-editing=true] .gsm-stage-caption{display:none}
.gsm-dialog[data-compact=false][data-step="2"]{height:min(900px,calc(var(--gsm-vh,100dvh) - 36px));overflow:hidden}
.gsm-dialog[data-compact=false][data-step="2"] .gsm-shell{height:100%;display:flex;flex-direction:column;min-height:0}
.gsm-dialog[data-compact=false][data-step="2"] .gsm-head,.gsm-dialog[data-compact=false][data-step="2"] .gsm-steps{flex:none}
.gsm-dialog[data-compact=false] .gsm-editor{flex:1;min-height:0;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}
.gsm-dialog[data-compact=false] .gsm-canvas-column{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;overflow:hidden}
.gsm-dialog[data-compact=false] .gsm-tools{min-height:0;height:100%}
.gsm-dialog[data-compact=false] .gsm-tool-panel{overflow-y:auto;flex:1}
@media(prefers-reduced-motion:no-preference){.gsm-dialog .gsm-tool-tabs button,.gsm-dialog .gsm-stage-bar button{transition:background-color .12s,border-color .12s}}
