/* Progressive mobile workspace: desktop layout and engine-owned [hidden]
   visibility remain unchanged. Load after configurator.css. */
.mobile-studio-nav,.mobile-panel-title,.mobile-editor-tabs,.mobile-sketch-toggle,.mobile-sketch-zoom{display:none}

@media screen and (max-width:820px){
  .studio-page{--mobile-header-height:60px;--mobile-preview-height:300px;--mobile-nav-height:66px;--mobile-safe-bottom:env(safe-area-inset-bottom,0px);padding-bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 18px)}
  .studio-page .studio-header{position:sticky;top:0;height:calc(60px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px);z-index:30;background:#131411f5;backdrop-filter:blur(16px)}
  .studio-header .header-inner{padding:0 max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));gap:8px}
  .studio-header .brand{gap:5px;min-width:0;flex-shrink:1}
  .studio-header .brand-mark{width:29px;height:42px}
  .studio-header .brand-text{min-width:0}
  .studio-header .brand-text>span{font-size:12px;white-space:normal;line-height:1.15;display:block;max-width:160px}
  .studio-header .brand-text small{display:none}
  .studio-header .studio-back{font-size:11px;margin:0 2px 0 auto;gap:5px;min-height:44px;white-space:nowrap;padding:0 5px;flex-shrink:0}
  .studio-header .language-switch{margin:0;flex-shrink:0}
  .studio-header .language-switch summary{min-width:46px;min-height:44px;font-size:12px;justify-content:center;padding:7px}
  .studio-header .language-options{right:0;max-width:calc(100vw - 24px)}
  .studio-header .language-options button{min-height:46px;font-size:14px}
  .studio-main{width:auto;max-width:none;margin:0;padding:14px max(12px,env(safe-area-inset-right,0px)) 22px max(12px,env(safe-area-inset-left,0px))}
  .studio-intro{margin:0 0 15px}
  .studio-intro .eyebrow,.studio-intro>p{display:none}
  .studio-intro h1{font-size:25px;line-height:1.25;margin:0;letter-spacing:-.3px;max-width:none}
  html[lang=ka] .studio-intro h1{font-size:22px;line-height:1.45}
  .studio-products{margin:0 0 14px;min-width:0}
  .studio-products legend{font-size:12px;margin-bottom:8px}
  .studio-products>div{display:flex;gap:7px;overflow-x:auto;padding:2px 1px 8px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#9e8352 #21221c}
  .studio-products .studio-option{flex:1 0 88px;scroll-snap-align:center}
  .studio-products .studio-option:last-child{flex-basis:125px}
  .studio-products .studio-option>span{min-height:72px;padding:8px 7px;gap:5px;flex-direction:column}
  .studio-products .studio-option b,html[lang=ka] .studio-products .studio-option b{font:500 12px/1.3 var(--sans);text-align:center;white-space:normal}
  .studio-products svg{width:38px;height:25px}
  .studio-layout{display:flex;flex-direction:column;gap:14px;align-items:stretch;isolation:isolate}
  .studio-result{display:contents;position:static}
  .studio-paper{order:1;position:sticky;top:calc(var(--mobile-header-height) + 6px);z-index:12;width:100%;height:40vh;height:40dvh;max-height:360px;min-height:218px;display:flex;flex-direction:column;overflow:hidden;border-radius:9px;box-shadow:0 8px 24px #0007}
  .studio-paper-heading{display:none}
  .studio-viewbar{display:grid;grid-template-columns:1.2fr 1fr 1fr;flex:none;width:calc(100% - 14px);max-width:none;margin:6px 7px 0;padding:0}
  .studio-viewbar button,html[lang=ka] .studio-viewbar button{min-height:44px;font-size:11px;line-height:1.2;padding:7px 5px}
  .drawing-layout-label{font-size:10px;line-height:1.25;padding:4px 9px 0;flex:none}
  .studio-preview{flex:1 1 0;min-height:0;height:auto;max-height:none;aspect-ratio:auto;overflow:hidden}
  .studio-preview>svg{display:block;width:100%;height:100%!important;max-height:100%}
  .mobile-sketch-toggle{position:absolute;top:var(--mobile-sketch-button-top,66px);right:10px;z-index:4;display:grid;place-items:center;min-width:44px;width:44px;min-height:44px;height:44px;padding:10px;background:#faf7eee8;border:1px solid #95815c7a;border-radius:9px;color:#514936;box-shadow:0 2px 9px #72613b1a;touch-action:manipulation}
  .mobile-sketch-toggle svg{width:23px;height:23px;stroke-width:1.7}
  .mobile-sketch-toggle:focus-visible{outline:2px solid #9c7533;outline-offset:-4px}
  .studio-view-settings{display:flex;flex-wrap:nowrap;gap:6px;padding:0 8px;min-height:46px;flex:none;border-top:1px solid #ccbfa83b}
  .studio-check,html[lang=ka] .studio-check{display:flex;align-items:center;gap:6px;font-size:10px;line-height:1.25;min-height:44px;min-width:0;flex:1}
  .studio-check input{width:20px;height:20px;flex-shrink:0}
  .studio-orbit{gap:5px;flex:0 1 45%;min-width:0}
  .studio-orbit label,html[lang=ka] .studio-orbit label{font-size:10px;line-height:1.2;max-width:63px;white-space:normal}
  .studio-orbit input[type=range]{width:100%;min-width:35px;max-width:110px;height:44px;margin:0}
  .studio-orbit button{min-width:44px;width:44px;height:44px;font-size:23px}
  .studio-plan-note{display:none}
  .studio-settings{order:2;width:100%;padding:18px 14px 15px;border-radius:9px}
  .mobile-panel-title{display:block;color:#e7d3ad;font:500 21px/1.3 var(--sans);margin:0 0 18px}
  .studio-controls{display:block}
  .studio-controls .studio-fieldset+.studio-fieldset{margin-top:22px;padding-top:20px;border-top:1px solid #d6bb8d22}
  .studio-controls .studio-fieldset>legend{font-size:14px;margin-bottom:13px}
  .studio-fieldset>legend>span:first-child{display:none}
  .studio-controls .studio-materials{display:block;padding:0!important;border:0!important;margin:0!important}
  .studio-controls .studio-materials>legend{display:none}
  .studio-controls .studio-subgroup{margin:0 0 24px;padding:0}
  .studio-controls .studio-subgroup:last-child{margin-bottom:0}
  .studio-subgroup>legend{font-size:14px;margin-bottom:11px}
  .studio-settings .studio-shapes{grid-template-columns:repeat(3,minmax(0,1fr))}
  .studio-settings .studio-shape>span{min-height:92px;padding:9px 5px}
  .studio-option b,html[lang=ka] .studio-option b{font-size:12px;line-height:1.35}
  .studio-options .studio-option>span{min-height:64px;padding:10px 5px}
  .studio-palette{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .studio-palette .studio-option>span{min-height:72px;gap:7px}
  .studio-palette .studio-option:last-child>span{min-height:46px}
  .studio-swatch{width:18px;height:18px}
  .studio-dimensions{gap:20px 14px}
  .studio-dimension>label,.studio-settings .studio-dimension>label{font-size:13px;min-height:34px;line-height:1.35;margin-bottom:6px}
  .studio-value{min-height:46px}
  .studio-value input{font-size:18px;line-height:1.2;min-height:46px;padding:9px 11px}
  .studio-dimension input[type=range]{height:44px;margin:2px 0 0;padding:0;touch-action:pan-y}
  .studio-dimension small{font-size:11px;line-height:1.45;margin-top:0}
  .studio-hint,.studio-palette-note,.studio-project-note{font-size:12px;line-height:1.55}
  .studio-custom-color input[type=color]{width:64px;height:46px}
  .studio-custom-color label,.studio-custom-color output{font-size:13px}
  .studio-ornaments{grid-template-columns:1fr 1fr}
  .studio-ornaments .studio-option:last-child{grid-column:1/-1}
  .studio-ornaments .studio-option>span{min-height:48px}
  .studio-patterns{grid-template-columns:1fr 1fr;gap:10px}
  .studio-patterns .studio-option>span{min-height:100px;padding:8px;gap:7px}
  .studio-patterns i{height:60px}
  .studio-patterns .studio-custom-pattern>span{min-height:68px}
  .pattern-enlarge,.pattern-editor-open{min-height:48px;font-size:13px;align-items:center}
  .pattern-editor-open{margin-top:8px}
  .studio-reset{min-height:44px;font-size:12px;margin-top:20px;padding:8px 0}
  .studio-stats{order:3;grid-template-columns:1fr 1fr;gap:14px 0;margin:0;padding:9px 0 15px}
  .studio-stats>div{padding:0 12px!important}
  .studio-stats>div:nth-child(odd){padding-left:0!important;border-left:0}
  .studio-stats dt{font-size:11px;min-height:30px;line-height:1.4}
  .studio-page .studio-stats dd{font-size:27px}
  .studio-geometry-note{order:4;margin:0;font-size:11px;line-height:1.55}
  .layout-result{order:5;margin:0;padding:16px 14px}
  #layout-metrics{grid-template-columns:1fr 1fr;gap:17px 12px}
  #layout-metrics dt{font-size:11px}
  #layout-metrics dd{font-size:24px}
  .layout-heading h2{font-size:23px}
  .layout-heading>span{font-size:10px;line-height:1.4}
  .layout-result>p,.layout-positions span,.layout-positions strong,.code-details{font-size:12px}
  .code-details summary{display:flex;align-items:center;min-height:44px}
  .code-details a{display:inline-block;padding:7px 0}
  .studio-actions{order:6;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:9px}
  .studio-actions .gold-button{grid-column:1/-1;min-height:49px}
  .studio-actions .gold-button,.studio-actions .studio-button{font-size:12px;min-height:48px;padding:11px}
  .studio-secondary-actions{order:7;display:flex;margin:0;gap:15px}
  .studio-secondary-actions button{min-height:44px;font-size:12px;line-height:1.4}
  .studio-share{order:8;margin:0}
  .studio-share input{font-size:16px;min-height:46px;max-width:100%}
  .studio-project-note{order:9;margin:0}
  .studio-saved{margin-top:30px}
  .studio-saved-heading h2{font-size:29px}
  .studio-saved-heading>p,.studio-storage-note{font-size:12px;line-height:1.6}
  .studio-saved-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .saved-actions button{min-height:46px;font-size:12px}
  .saved-info{padding:13px}
  .saved-info h3{font-size:18px}
  .saved-info p{font-size:12px}
  .studio-page>.footer{width:calc(100% - 28px);font-size:10px;line-height:1.5;padding:12px 0 20px}

  /* Only matching navigation panels are rendered; [hidden] always wins. */
  .mobile-studio-ready[data-studio-panel=project] [data-mobile-section]:not([data-mobile-section~=project]),
  .mobile-studio-ready[data-studio-panel=dimensions] [data-mobile-section]:not([data-mobile-section~=dimensions]),
  .mobile-studio-ready[data-studio-panel=materials] [data-mobile-section]:not([data-mobile-section~=materials]),
  .mobile-studio-ready[data-studio-panel=pattern] [data-mobile-section]:not([data-mobile-section~=pattern]){display:none!important}
  .mobile-studio-ready .studio-controls>.studio-fieldset{margin:0;padding:0;border:0}
  .mobile-studio-ready #config-controls>.studio-fieldset:has(#width)>legend{display:none}
  .mobile-studio-ready[data-studio-panel=dimensions] .studio-controls>.studio-fieldset:has(#frameStep){margin-top:24px;padding-top:22px;border-top:1px solid #d6bb8d22}
  .mobile-studio-ready .studio-controls fieldset,.mobile-studio-ready .studio-controls input,.mobile-studio-ready .studio-controls button{scroll-margin-top:calc(var(--mobile-header-height) + var(--mobile-preview-height) + 22px);scroll-margin-bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 20px)}
  .mobile-studio-nav{position:fixed;inset:auto 0 0;z-index:40;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:5px max(5px,env(safe-area-inset-right,0px)) calc(5px + var(--mobile-safe-bottom)) max(5px,env(safe-area-inset-left,0px));min-height:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom));background:#171914f5;border-top:1px solid #c4a87045;box-shadow:0 -5px 24px #0006;backdrop-filter:blur(18px)}
  .mobile-studio-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:54px;padding:4px 2px;background:transparent;color:#a4a697;border:1px solid transparent;border-radius:9px;font-size:10px;line-height:1.25;text-align:center;overflow-wrap:anywhere}
  .mobile-studio-nav button svg{width:23px;height:23px;stroke-width:1.55;flex-shrink:0}
  .mobile-studio-nav button[aria-pressed=true]{background:#c2a26b1b;border-color:#c2a26b35;color:#f0d09a}
  .mobile-studio-nav button[data-mobile-target=save]{color:#11170e;background:linear-gradient(145deg,#e6c68c,#caa065);font-weight:650;margin:1px 0 1px 2px}
  .mobile-studio-nav button:focus-visible{outline-offset:-3px}
  html[lang=ka] .mobile-studio-nav button{font-size:9px}
  .mobile-studio-ready #studio-status{position:fixed;inset:auto 12px calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 10px);z-index:39;max-width:640px;margin:0 auto;padding:12px 15px;border:1px solid #b69a614d;border-radius:8px;background:#25271ef5;box-shadow:0 5px 20px #0008;font-size:12px;line-height:1.5;color:#f0d9ad;pointer-events:none;opacity:0;transform:translateY(8px);transition:opacity .15s,transform .15s}
  .mobile-studio-ready.mobile-has-status #studio-status:not(:empty){opacity:1;transform:none}
  .mobile-studio-ready #studio-status:empty{display:none}
  .mobile-field-focus .studio-paper{min-height:110px;height:23dvh;max-height:170px}
  .mobile-field-focus .studio-viewbar,.mobile-field-focus .studio-view-settings,.mobile-field-focus .drawing-layout-label{display:none}
  .mobile-editor-open{overflow:hidden;overscroll-behavior:none}
  .mobile-sketch-expanded{position:fixed;top:var(--mobile-lock-top,0px);left:0;right:0;width:100%;overflow:hidden;overscroll-behavior:none}
  .mobile-sketch-expanded::before{content:'';position:fixed;inset:var(--mobile-header-height) 0 0;background:#11130f;z-index:45}
  .mobile-sketch-expanded .studio-header{position:fixed;top:0;left:0;right:0;z-index:70}
  .mobile-sketch-expanded .studio-layout{isolation:auto}
  .mobile-sketch-expanded .studio-paper{position:fixed;inset:calc(var(--mobile-header-height) + 6px) max(8px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));height:auto;min-height:0;max-height:none;width:auto;z-index:60;margin:0;border-radius:10px;overscroll-behavior:contain}
  .mobile-sketch-expanded .mobile-studio-nav,.mobile-sketch-expanded #studio-status{display:none!important}
  .mobile-sketch-expanded .studio-viewbar{width:calc(100% - 66px);margin:7px 59px 0 7px}
  .mobile-sketch-expanded .mobile-sketch-toggle{top:7px;right:7px;box-shadow:none}
  .mobile-sketch-expanded .studio-preview{min-height:0}
  .mobile-sketch-expanded .studio-preview>svg{transform:translate(var(--sketch-pan-x,0px),var(--sketch-pan-y,0px)) scale(var(--sketch-scale,1));transform-origin:center;user-select:none}
  .mobile-sketch-expanded.mobile-sketch-zoomed .studio-preview{touch-action:none;cursor:grab}
  .mobile-sketch-expanded.mobile-sketch-zoomed .studio-preview:active{cursor:grabbing}
  .mobile-sketch-expanded .mobile-sketch-zoom{display:flex;justify-content:center;gap:8px;flex:none;padding:5px 8px;background:#ebe5d9;border-top:1px solid #b5a27d45}
  .mobile-sketch-zoom button{min-width:44px;min-height:44px;padding:7px 13px;border:1px solid #ab987270;border-radius:7px;background:#faf7ee;color:#514936;font-size:23px;line-height:1;touch-action:manipulation}
  .mobile-sketch-zoom [data-sketch-zoom=reset]{font-size:13px;min-width:72px;font-variant-numeric:tabular-nums}
  .mobile-sketch-expanded .studio-view-settings{padding:5px 10px;min-height:54px}
  .mobile-sketch-expanded .drawing-layout-label{display:block;font-size:11px;padding:8px 12px 0}

  /* The editor fills the usable screen. Its canvas, tabs and footer stay put;
     only the active catalogue/property panel scrolls. */
  #ornament-editor{inset:0;width:100vw;max-width:100vw;height:100vh;height:100dvh;height:var(--mobile-viewport-height,100dvh);max-height:var(--mobile-viewport-height,100dvh);margin:0;padding:0;border:0;border-radius:0;overflow:auto;overscroll-behavior:none;background:#171914;color:#e7decf}
  #ornament-editor[open].mobile-editor-ready{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
  #ornament-editor>.pattern-dialog-heading{grid-row:1;display:flex;align-items:center;min-height:64px;padding:calc(9px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) 9px max(14px,env(safe-area-inset-left,0px));margin:0;border-bottom:1px solid #bba06c33;background:#1b1d17;gap:12px}
  #ornament-editor .pattern-dialog-heading .eyebrow{display:none}
  #ornament-editor .pattern-dialog-heading h2{font:500 21px/1.25 var(--sans);letter-spacing:-.3px}
  #ornament-editor .pattern-dialog-heading button{width:44px;height:44px;min-width:44px;font-size:28px;border-radius:10px}
  #ornament-editor>.editor-help,#ornament-editor>p:not(#ornament-editor-status){display:none}
  #ornament-editor .editor-workspace{grid-row:2;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(140px,min(34dvh,calc(var(--mobile-viewport-height,100dvh) * .34))) 48px minmax(0,1fr);gap:0;align-items:stretch;min-height:0;overflow:hidden;margin:0;padding:0}
  #ornament-editor .mobile-editor-stage{grid-row:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#eee7d9;padding:5px 8px}
  #ornament-editor .mobile-editor-stage-wrapper,#ornament-editor .mobile-editor-panel-wrapper{display:contents}
  #ornament-editor .mobile-editor-stage-wrapper>#custom-pattern-canvas{grid-row:1;grid-column:1;min-height:0;background:#eee7d9;padding:45px 8px 45px}
  #ornament-editor .mobile-editor-stage>:not(#custom-pattern-canvas),#ornament-editor .mobile-editor-stage-wrapper>:not(#custom-pattern-canvas):not(#ornament-catalog-panel):not(.editor-canvas-toolbar):not(#editor-element-list){display:none}
  #ornament-editor .mobile-editor-stage-wrapper>.editor-canvas-toolbar{grid-row:1;grid-column:1;align-self:start;justify-self:end;display:flex;align-items:center;justify-content:flex-end;gap:6px;z-index:2;margin:0;padding:1px 8px;background:#eee7d9e8;color:#4e4a3c;border:0;min-height:44px;border-radius:0 0 0 7px}
  #ornament-editor .editor-canvas-toolbar button{min-width:44px;min-height:44px;font-size:22px;padding:4px 10px;background:#ddd5c4;border:1px solid #b5a484;color:#484638;border-radius:5px}
  #ornament-editor #editor-zoom-value{font-size:12px;min-width:42px;text-align:center}
  #ornament-editor .mobile-editor-stage-wrapper>#editor-element-list{grid-row:1;grid-column:1;align-self:end;display:flex;flex-wrap:nowrap;align-items:center;gap:6px;min-height:44px;max-height:44px;min-width:0;overflow-x:auto;overflow-y:hidden;z-index:2;margin:0;padding:0 7px;background:#e9e1d1eb;scrollbar-width:thin;touch-action:pan-x}
  #ornament-editor #editor-element-list button{min-height:44px;min-width:44px;flex:0 0 auto;font-size:11px;line-height:1.2;padding:6px 10px}
  #ornament-editor #editor-element-list:empty{display:none}
  #ornament-editor #custom-pattern-canvas{min-width:0;min-height:0;flex:1;display:grid;place-items:center;border:0;border-radius:0;touch-action:none;overflow:hidden}
  #ornament-editor #custom-pattern-canvas svg{display:block;width:100%;height:100%!important;max-height:100%;object-fit:contain;touch-action:none}
  #ornament-editor .mobile-editor-tabs{grid-row:2;display:grid;grid-template-columns:1fr 1fr;align-items:stretch;border-top:1px solid #b69b6b33;border-bottom:1px solid #b69b6b33;background:#20231b;padding:0 9px;gap:8px;min-height:48px}
  #ornament-editor .mobile-editor-tabs button{min-height:47px;border:0;border-bottom:2px solid transparent;padding:8px 5px;background:transparent;color:#aaa997;font-size:13px;line-height:1.25}
  #ornament-editor .mobile-editor-tabs button[aria-selected=true]{color:#f0cf95;border-bottom-color:#d7b271}
  #ornament-editor .mobile-editor-tabs button:focus-visible{outline-offset:-4px}
  #ornament-editor .mobile-editor-catalog,#ornament-editor .mobile-editor-properties{grid-row:3;min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;scrollbar-width:thin;padding:14px max(14px,env(safe-area-inset-right,0px)) 20px max(14px,env(safe-area-inset-left,0px));margin:0;border:0;border-radius:0;background:#171914;scroll-padding-top:10px}
  #ornament-editor[data-mobile-editor-panel=catalog] .mobile-editor-properties,#ornament-editor[data-mobile-editor-panel=properties] .mobile-editor-catalog{display:none!important}
  #ornament-editor .editor-properties h3{font:500 16px/1.3 var(--sans)}
  #ornament-editor #selected-element-name{font-size:12px;line-height:1.5;margin:5px 0 12px}
  #ornament-editor #selected-part-details{font-size:12px;line-height:1.55;margin:0 0 10px;overflow-wrap:anywhere}
  #ornament-editor #element-controls{display:grid;grid-template-columns:1fr 1fr;gap:0 12px;min-width:0}
  #ornament-editor #element-controls label{grid-column:1/-1;font-size:13px;line-height:1.35;margin:10px 0 0}
  #ornament-editor #element-controls input[type=range]{grid-column:1/-1;min-height:44px;height:44px;margin:0;touch-action:pan-y}
  #ornament-editor #element-controls input[type=number]{font-size:16px;min-height:44px;max-width:100%}
  #ornament-editor #element-controls button{min-height:46px;font-size:12px;line-height:1.3;margin-top:10px;padding:9px 7px}
  #ornament-editor .editor-count{font-size:12px;line-height:1.5;margin-top:14px}
  #ornament-editor #ornament-catalog-panel input[type=search],#ornament-editor #ornament-catalog-panel input[type=text]{font-size:16px;min-height:46px;width:100%;max-width:100%;margin-bottom:10px;padding:10px 12px;box-sizing:border-box}
  #ornament-editor #ornament-catalog-panel button{min-height:44px;touch-action:manipulation}
  #ornament-editor :is(.ornament-catalog-grid,.catalog-grid,#ornament-catalog-grid,[data-catalog-grid]){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;min-width:0}
  #ornament-editor :is(.ornament-catalog-grid,.catalog-grid,#ornament-catalog-grid,[data-catalog-grid])>button{min-width:0;min-height:104px;padding:7px;font-size:11px;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
  #ornament-editor :is(.ornament-catalog-grid,.catalog-grid,#ornament-catalog-grid,[data-catalog-grid]) svg{width:100%;height:64px;max-width:100%}
  #ornament-editor #catalog-grid .catalog-card img{width:100%;height:76px;object-fit:contain;max-width:100%}
  #ornament-editor :is(.catalog-categories,.ornament-categories,#ornament-categories,#catalog-categories){display:flex;flex-wrap:nowrap;gap:7px;overflow-x:auto;padding:1px 0 10px;margin-bottom:5px;scrollbar-width:thin}
  #ornament-editor :is(.catalog-categories,.ornament-categories,#ornament-categories,#catalog-categories)>button{flex:0 0 auto;padding:8px 12px;font-size:12px;white-space:nowrap}
  #ornament-editor .catalog-heading h3{font:500 18px/1.3 var(--sans);margin-bottom:11px}
  #ornament-editor #catalog-count,#ornament-editor .catalog-credit{font-size:11px;line-height:1.5;margin:8px 0 12px}
  #ornament-editor #catalog-more{width:100%;min-height:46px;font-size:13px;margin-top:12px}
  #ornament-editor .editor-footer{grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;min-height:66px;margin:0;padding:9px max(12px,env(safe-area-inset-right,0px)) calc(9px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));border-top:1px solid #bda26c3b;background:#20231b;z-index:2}
  #ornament-editor .editor-footer>div{display:flex;flex-wrap:nowrap;gap:7px;min-width:0;overflow-x:auto;scrollbar-width:thin}
  #ornament-editor .editor-footer>div button{min-width:60px;min-height:44px;flex:0 0 auto;max-width:100px;font-size:11px;line-height:1.25;padding:6px 8px;border:1px solid #ab956140;border-radius:5px;text-decoration:none;white-space:normal}
  #ornament-editor .editor-footer .gold-button{min-width:94px;min-height:46px;font-size:14px;padding:10px 16px;border-radius:6px}
  #ornament-editor-status:not(:empty){position:absolute;bottom:calc(77px + env(safe-area-inset-bottom,0px));left:12px;right:12px;z-index:5;margin:0;padding:9px 12px;background:#393b2bf5;border:1px solid #b49a6470;border-radius:5px;font-size:11px;line-height:1.4;pointer-events:none}
  #pattern-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 30px);padding:16px;border-radius:10px}
  #pattern-dialog .pattern-dialog-heading h2{font-size:22px}
  #pattern-dialog .pattern-dialog-heading button{min-width:44px;min-height:44px}
  #pattern-dialog>p{font-size:12px}
}

@media screen and (max-width:420px){
  .studio-header .brand-text>span{max-width:120px;font-size:11px}
  html[lang=ka] .studio-header .brand-text>span{font-size:10px}
  .studio-header .studio-back{font-size:10px}
  .studio-main{padding-left:10px;padding-right:10px}
  .studio-settings{padding:16px 12px}
  .studio-settings .studio-shapes{grid-template-columns:repeat(2,minmax(0,1fr))}
  .studio-saved-grid{grid-template-columns:1fr}
  .studio-orbit label{display:none}
  .studio-orbit{flex-basis:40%}
  #ornament-editor .pattern-dialog-heading h2{font-size:19px}
  #ornament-editor .mobile-editor-tabs button{font-size:12px}
  #ornament-editor :is(.ornament-catalog-grid,.catalog-grid,#ornament-catalog-grid,[data-catalog-grid]){gap:7px}
}

@media screen and (max-width:820px) and (max-height:600px){
  .studio-page .studio-header{height:48px;padding-top:0}
  .studio-header .brand-mark{height:37px}
  .studio-paper{height:39dvh;min-height:145px;max-height:230px}
  .drawing-layout-label{display:none}
  .studio-viewbar{margin-top:2px}
  .studio-view-settings{min-height:44px;padding:0 8px}
  .studio-preview{min-height:45px}
  .mobile-studio-nav{min-height:56px;padding-top:3px;padding-bottom:calc(3px + var(--mobile-safe-bottom))}
  .mobile-studio-nav button{min-height:46px;gap:2px;font-size:9px}
  .mobile-studio-nav button svg{height:18px;width:18px}
  .studio-page{--mobile-nav-height:56px}
  #ornament-editor>.pattern-dialog-heading{min-height:49px;padding-top:3px;padding-bottom:3px}
  #ornament-editor .pattern-dialog-heading h2{font-size:18px}
  #ornament-editor .editor-workspace{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:46px minmax(0,1fr)}
  #ornament-editor .mobile-editor-stage,#ornament-editor .mobile-editor-stage-wrapper>#custom-pattern-canvas{grid-column:1;grid-row:1/3;padding:6px}
  #ornament-editor .mobile-editor-stage-wrapper>#custom-pattern-canvas{padding-top:45px;padding-bottom:45px}
  #ornament-editor .mobile-editor-stage-wrapper>.editor-canvas-toolbar,#ornament-editor .mobile-editor-stage-wrapper>#editor-element-list{grid-column:1;grid-row:1/3}
  #ornament-editor .mobile-editor-tabs{grid-column:2;grid-row:1;min-height:46px}
  #ornament-editor .mobile-editor-tabs button{min-height:44px;font-size:11px;padding:6px 3px}
  #ornament-editor .mobile-editor-catalog,#ornament-editor .mobile-editor-properties{grid-column:2;grid-row:2;padding:10px}
  #ornament-editor .editor-footer{min-height:55px;padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom,0px))}
  #ornament-editor :is(.ornament-catalog-grid,.catalog-grid,#ornament-catalog-grid,[data-catalog-grid]){grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(prefers-reduced-motion:reduce){.mobile-studio-nav *,#ornament-editor *,#studio-status{scroll-behavior:auto!important;transition:none!important}}
@media print{.mobile-studio-nav,.mobile-panel-title,.mobile-editor-tabs,.mobile-sketch-toggle,.mobile-sketch-zoom{display:none!important}.studio-page{padding-bottom:0}}

@media(max-width:820px){.studio-products>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:7px}.studio-products .studio-option:last-child{grid-column:1/-1}.studio-products .studio-option>span{min-height:67px;flex-direction:row;gap:8px;justify-content:flex-start;padding:9px 11px}.studio-products .studio-option b{font-size:12px;text-align:left}.studio-products svg{flex-shrink:0;width:36px}}
