:root{color-scheme:dark;--bg:#080808;--panel:#111111;--line:#303030;--muted:#a3a3a3;--ink:#f5f5f5;--green:#00ff00;--soft:#1c1c1c;--radius:14px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);height:100vh;height:100dvh;overflow:hidden}button,input,textarea,select{font:inherit}button{cursor:pointer}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,canvas:focus-visible{outline:2px solid var(--green);outline-offset:3px}button:disabled{opacity:.3;cursor:default}[hidden]{display:none!important}.header{height:86px;padding:0 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:24px;background:#101010}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);font-size:24px;font-weight:750;line-height:1.1;letter-spacing:-.7px}.brand-cat{width:46px;height:48px;background:var(--green);border-radius:12px;display:grid;place-items:center;transform:rotate(-5deg)}.brand-cat img{width:56px;height:56px;object-fit:contain;transform:rotate(5deg)}.brand-sub{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px;letter-spacing:3.4px;font-weight:600;margin-top:6px}.version{color:var(--green);background:#202020;border-radius:4px;padding:2px 4px;letter-spacing:0}.header-note{display:flex;gap:9px;align-items:center;font-size:12px;color:var(--muted)}.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--green);flex-shrink:0}.header-actions{display:flex;gap:8px;flex-shrink:0}.button{min-height:44px;border:1px solid var(--line);border-radius:9px;padding:10px 18px;font-size:13px;font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:20px;transition:background .15s,transform .15s}.button:hover{transform:translateY(-1px)}.primary{background:var(--green);color:#080808;border-color:var(--green)}.primary:hover{background:#00ff00}.secondary{background:#1b1b1b}.secondary:hover{background:#282828}.full{width:100%}.workspace{height:calc(100dvh - 86px);display:grid;grid-template-columns:354px minmax(0,1fr);max-width:1700px;margin:auto}.editor{background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;min-width:0}.tabs{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid var(--line);padding:12px 16px 0;gap:3px;flex-shrink:0}.tab{border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);padding:8px 1px 12px;font-size:11px;font-weight:600;display:flex;flex-direction:column;gap:5px;align-items:center}.tab>span{font-size:19px;height:24px}.tab.active{color:var(--green);border-bottom-color:var(--green)}.tab:hover{color:#fff}.panel-scroll{overflow:auto;overscroll-behavior:contain;padding:25px 22px;flex:1;min-height:0;scrollbar-width:thin;scrollbar-color:#444444 transparent}.eyebrow{font-size:9px;font-weight:700;letter-spacing:2.2px;color:var(--muted)}h1{font-size:25px;letter-spacing:-1px;line-height:1.15;font-weight:650;margin:10px 0 0}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.count{font-size:10px;color:var(--muted);border:1px solid var(--line);border-radius:5px;padding:3px 6px;margin-top:10px}.muted{font-size:12px;color:var(--muted);line-height:1.7;margin:10px 0 20px}.asset-grid{display:grid;gap:9px}.template-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:25px}.asset{position:relative;min-width:0;aspect-ratio:1;border:1px solid var(--line);border-radius:12px;background:#1c1c1c;display:flex;align-items:center;justify-content:center;padding:7px;transition:border-color .15s,background .15s;overflow:hidden}.asset:hover{background:#282828;border-color:#666666}.asset.active{border-color:var(--green);background:#242424}.asset.active:after{content:'✓';position:absolute;bottom:5px;right:6px;font-size:10px;background:var(--green);border-radius:50%;color:#080808;width:16px;height:16px;display:grid;place-items:center}.asset img{width:100%;height:100%;object-fit:contain;pointer-events:none}.asset .new-tag{position:absolute;top:6px;left:6px;font-size:8px;letter-spacing:.5px;background:var(--green);padding:3px 5px;border-radius:4px;color:#080808;font-weight:750}.sticker-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:16px}.sticker-grid.new-collection{grid-template-columns:repeat(2,minmax(0,1fr))}.search-box{display:flex!important;align-items:center;gap:10px;padding:0 12px;background:#0e0e0e;border:1px solid var(--line);border-radius:9px;margin:20px 0 14px!important}.search-box>span{font-size:25px;color:var(--muted)}.search-box input{width:100%;min-width:0;border:0;background:transparent;height:44px;color:var(--ink);font-size:13px;outline-offset:0}.categories{display:flex;flex-wrap:wrap;gap:6px}.category{background:transparent;border:1px solid var(--line);border-radius:7px;padding:7px 9px;font-size:10px;color:var(--muted);min-height:32px}.category.active{color:var(--green);border-color:#00ff00;background:#242424}.collection-note{font-size:11px;color:#cccccc;line-height:1.7;margin-top:16px;background:#1c1c1c;padding:10px 12px;border-radius:8px}.sidebar-foot{border-top:1px solid var(--line);padding:15px 22px;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted)}.stage{min-width:0;min-height:0;padding:28px 36px 16px;display:flex;flex-direction:column;position:relative;background-image:radial-gradient(#ffffff12 .7px,transparent .7px);background-size:18px 18px}.stage-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;margin-bottom:20px}h2{font-size:28px;font-weight:600;letter-spacing:-1.1px;margin:5px 0 0}.history{display:flex;align-items:center;gap:7px}.icon-button{min-width:38px;min-height:38px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:8px;background:#181818;font-size:22px;line-height:1}.icon-button:hover:not(:disabled){background:#282828}.size-badge{padding:8px 11px;border-radius:6px;font-size:10px;color:var(--muted);border:1px solid var(--line);margin-left:6px}.canvas-area{display:flex;align-items:center;justify-content:center;min-height:0;flex:1;padding:0 2px}.canvas-frame{width:min(100%,calc(100dvh - 300px));aspect-ratio:1;flex-shrink:1;border-radius:5px;box-shadow:0 15px 70px #0007;overflow:hidden;background:#00ff00;line-height:0}.canvas-frame canvas{display:block;width:100%;height:auto;touch-action:none;aspect-ratio:1;cursor:default}.stage-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:16px;flex-shrink:0}.stage-bottom p{margin:0;color:var(--muted);font-size:11px;line-height:1.5}.stage-bottom a{color:#cccccc;font-size:11px;text-decoration:none;white-space:nowrap}.stage-bottom a:hover{color:var(--green)}.object-toolbar{margin:12px auto 0;display:flex;align-items:center;gap:10px;padding:10px 12px;background:#181818;border:1px solid #444444;border-radius:12px;width:min(100%,650px);flex-shrink:0}.object-name{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--green)}.object-toolbar label{font-size:10px;margin:0;display:flex;flex-direction:column;gap:5px;flex:1;min-width:40px}.object-toolbar input{width:100%;height:18px;margin:0;accent-color:var(--green);padding:0}.object-toolbar .icon-button{min-width:34px;min-height:36px}.danger{color:#ff8b82!important}.tool-panel>label,.field-pair label,.text-field label{display:block;font-size:11px;font-weight:600;color:#cccccc;margin:20px 0 8px}.text-field .label-row{display:flex;align-items:center;justify-content:space-between}.text-field .label-row label{margin:14px 0 7px}.text-field textarea{width:100%;min-height:70px;resize:vertical;background:#0e0e0e;border:1px solid var(--line);border-radius:9px;padding:12px;color:#f5f5f5;font-size:15px;line-height:1.45}.text-field textarea::placeholder{color:#858585}.text-field select{padding:2px 5px;font-size:11px;min-height:30px;width:auto}.field-pair{display:grid;grid-template-columns:1.4fr 1fr;gap:10px}.field-pair label{min-width:0}select{width:100%;min-height:43px;display:block;margin-top:8px;padding:8px;background:#1b1b1b;border:1px solid var(--line);border-radius:8px;color:var(--ink);font-size:12px}.swatches{display:flex;gap:10px}.swatch{width:40px;height:40px;border:2px solid #666666;border-radius:9px}.swatch.active{outline:2px solid var(--green);outline-offset:3px}.white{background:#fff}.black{background:#000}.green{background:#00ff00}.mode-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.mode{background:#1b1b1b;border:1px solid var(--line);border-radius:9px;min-height:82px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:var(--muted);font-size:10px}.mode span{font-size:28px}.mode.active,.background.active{border-color:var(--green);background:#242424;color:var(--green)}.background-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background{background:#1b1b1b;border:1px solid var(--line);border-radius:9px;display:flex;align-items:center;gap:8px;padding:10px;min-height:50px;font-size:10px}.background i{width:20px;height:20px;border-radius:5px;display:inline-block;flex-shrink:0}.info-box{border:1px solid var(--line);padding:16px;border-radius:10px;font-size:12px;line-height:1.6;margin:24px 0;color:var(--muted)}.info-box strong{color:var(--ink);font-weight:600}.info-box p{margin:6px 0 0}.text-button{border:0;background:transparent;font-size:11px;padding:15px 4px;text-decoration:underline;text-underline-offset:3px}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);border:1px solid #666666;background:#202020;color:#f5f5f5;padding:13px 20px;border-radius:12px;font-size:13px;box-shadow:0 10px 40px #0005;opacity:0;pointer-events:none;transition:.2s;z-index:50;max-width:90vw}.toast.visible{opacity:1;transform:translate(-50%,0)}
.header-actions .button{min-height:40px;padding:8px 13px;font-size:12px;gap:9px}
@media(max-width:1100px) and (min-width:761px){.workspace{grid-template-columns:320px minmax(0,1fr)}.stage{padding:26px 22px 16px}.header-note{display:none}.object-name{display:none}.size-badge{display:none}}
@media(max-width:760px){.header{height:62px;padding:0 14px;gap:8px}.brand{font-size:20px;gap:8px;white-space:nowrap}.brand-cat{width:36px;height:36px;border-radius:8px;flex-shrink:0}.brand-cat img{width:39px;height:39px}.brand-sub{font-size:8px;letter-spacing:2px;margin-top:4px}.header-note{display:none}.header-actions{gap:6px}.header-actions .button{min-height:36px;padding:6px 9px;font-size:10px;gap:5px}.header-actions #shareBtn{padding:6px 8px}.workspace{height:calc(100dvh - 62px);display:flex;flex-direction:column}.stage{order:0;padding:10px 14px 8px;flex:0 0 auto;max-height:49dvh;min-height:0;border-bottom:1px solid var(--line);gap:5px}.stage-top{margin:0;min-height:29px}.stage-top>div:first-child h2{display:none}.stage-top .eyebrow{font-size:8px;letter-spacing:1.4px}.history{gap:6px}.history .icon-button{min-width:32px;min-height:30px;font-size:20px}.size-badge{display:none}.canvas-area{flex:0 1 auto;min-height:0}.canvas-frame{width:min(100%,31dvh);max-width:370px;min-width:0}.stage-bottom{padding:0;justify-content:center;min-height:15px}.stage-bottom p{font-size:9px}.stage-bottom a{display:none}.editor{order:1;flex:1;min-height:0;border:0;position:relative;padding-bottom:calc(61px + env(safe-area-inset-bottom))}.tabs{position:fixed;bottom:0;left:0;right:0;z-index:20;background:#141414;border-top:1px solid var(--line);border-bottom:0;padding:6px 12px max(5px,env(safe-area-inset-bottom));box-shadow:0 -8px 24px #0002}.tab{padding:3px 1px 5px;border-bottom:0;border-radius:8px;font-size:10px;gap:1px;min-height:50px}.tab.active{background:#242424}.tab>span{height:23px;font-size:18px}.panel-scroll{padding:15px 17px 14px}.sidebar-foot{display:none}.eyebrow{font-size:8px}.tool-panel>.eyebrow{display:none}h1{font-size:21px;margin:0}.count{margin:0}.muted{font-size:11px;line-height:1.5;margin:6px 0 13px}.template-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:12px;gap:8px}.asset{border-radius:10px}.search-box{margin:12px 0 10px!important}.search-box input{height:40px;font-size:16px}.categories{gap:5px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:2px 0 5px}.category{white-space:nowrap;min-height:34px;font-size:10px;padding:7px 10px}.sticker-grid,.sticker-grid.new-collection{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:10px}.collection-note{font-size:10px;margin-top:5px;padding:7px 10px}.object-toolbar{width:100%;padding:5px 7px;gap:7px;margin:1px 0 0;border-radius:8px;min-height:42px}.object-name{display:none}.object-toolbar label{font-size:8px;gap:1px}.object-toolbar .icon-button{min-width:32px;min-height:32px;font-size:19px}.object-toolbar input{height:18px}.text-field textarea{min-height:55px;font-size:16px;padding:9px 11px}.text-field .label-row label{margin-top:8px}.text-field select{margin-top:0}.field-pair select{font-size:16px}.tool-panel>label,.field-pair label{margin-top:14px}.info-box{margin:16px 0}.toast{bottom:calc(76px + env(safe-area-inset-bottom));font-size:12px;padding:10px 16px;width:max-content;text-align:center}.mode{min-height:65px}.mode span{font-size:23px}body.keyboard-open .canvas-frame{width:min(100%,19dvh)}body.keyboard-open .stage-bottom{display:none}}
@media(max-width:360px){.header{padding:0 10px}.header-actions .button{padding:6px 8px;font-size:10px}.brand{font-size:18px;gap:7px}.brand-cat{width:32px;height:32px}.header-actions #shareBtn{display:inline-flex;width:34px;padding:6px}.header-actions #shareBtn .button-label{display:none}.stage{padding-left:10px;padding-right:10px}.panel-scroll{padding-left:12px;padding-right:12px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
.step-footer{padding:14px 22px;border-top:1px solid var(--line);display:flex;gap:8px;flex-shrink:0}.step-footer .button{min-width:0;font-size:11px;padding:10px 9px}.layout-context{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:14px 0 4px;padding:8px 10px;background:var(--soft);border-radius:8px;font-size:10px;color:#cccccc}.layout-context .text-button{font-size:10px;padding:5px 0;color:var(--green);white-space:nowrap}.mode-grid .mode{padding:12px 4px;gap:6px;min-height:130px}.mode-grid .mode-preview{display:grid;place-items:center;width:54px;height:54px;border-radius:6px;background:#00ff00;font-size:22px;color:#101010;overflow:hidden;margin-bottom:3px}.mode-preview img{width:100%;height:100%;object-fit:contain}.mode-grid strong{font-size:10px;font-weight:600}.mode-grid small{font-size:9px;color:var(--muted)}.layout-description,.retained-note{font-size:11px;line-height:1.6;margin:12px 0 18px;color:var(--muted)}.retained-note{background:var(--soft);padding:10px;border-radius:8px;color:#cccccc}.mode.active .mode-preview{box-shadow:0 0 0 2px #ffffff22}
@media(max-width:760px){.step-footer{padding:8px 17px;gap:7px}.step-footer .button{min-height:36px;padding:7px 8px;font-size:10px}.mode-grid .mode{min-height:110px;padding:8px 3px}.mode-grid .mode-preview{width:45px;height:45px}.layout-context{margin-top:9px}.layout-description,.retained-note{font-size:10px;margin:9px 0 12px}}

/* Cult identity: neutral surfaces, exact #00ff00 accents, original gold CTA. */
.brand-cat{overflow:hidden;transform:none;background:var(--green)}
.brand-cat img{width:100%;height:100%;object-fit:cover;transform:none}
.primary:hover{border-color:#fff;box-shadow:0 0 0 1px #fff}
.stage-bottom .cult-promo{display:flex;flex-direction:row;align-items:center;gap:7px;flex-shrink:0;text-decoration:none;line-height:1.2}
.cult-promo>span{font-size:10px;letter-spacing:.7px;color:var(--muted)}
.cult-promo strong{font-size:13px;font-weight:900;letter-spacing:.5px;color:#ffcc00;border-bottom:1px solid #ffcc00;padding-bottom:3px}
.stage-bottom .cult-promo:hover strong{color:#fff;border-color:#fff}
@media(min-width:761px){
  .header{height:68px;padding:0 24px}.brand-cat{width:44px;height:44px}
  .workspace{height:calc(100dvh - 68px);grid-template-columns:304px minmax(0,1fr);max-width:none}
  .tabs{padding:9px 12px 0}.panel-scroll{padding:22px 20px}.step-footer{padding:12px 20px}.sidebar-foot{padding:12px 20px}
  .stage{padding:14px 20px 12px}.stage-top{margin-bottom:12px}.stage-top h2{font-size:23px;margin-top:3px}.stage-top .eyebrow{font-size:8px}
  .canvas-frame{width:min(100%,calc(100dvh - 200px))}
  .stage-bottom{padding-top:12px;gap:16px;min-height:32px}.stage-bottom p{font-size:10px;max-width:330px}
}
@supports(width:1cqw){@media(min-width:761px){
  .canvas-area{container-type:size;padding:0}
  .canvas-frame{width:min(100cqw,100cqh);max-width:100%;max-height:100%}
}}
@media(max-width:760px){
  .brand-cat img{width:100%;height:100%}
  .stage{max-height:52dvh}.stage-bottom{padding-top:2px;min-height:32px}.stage-bottom p{display:none}
  .stage-bottom .cult-promo{display:flex;gap:1px}.cult-promo>span{font-size:8px}.cult-promo strong{font-size:10px;padding-bottom:2px}
  body.keyboard-open .stage-bottom{display:flex}
}
@media(min-width:761px) and (max-height:600px){
  .header{height:58px}.workspace{height:calc(100dvh - 58px)}.brand-cat{width:36px;height:36px}.brand{font-size:20px}
  .stage{padding:10px 16px}.stage-top{margin-bottom:8px}.stage-top h2{font-size:20px}.stage-top .eyebrow{display:none}
  .sidebar-foot{display:none}.stage-bottom{padding-top:8px;min-height:40px}.stage-bottom p{display:none}.stage-bottom{justify-content:center}
}
/* Compact editor: keep related controls together. */
.panel-scroll{padding:15px 16px}
.tool-panel>.eyebrow{display:none}
h1{font-size:21px;line-height:1.15;margin:0}
.count{margin-top:0}
.muted{font-size:11px;line-height:1.45;margin:6px 0 10px}
.tabs{padding-top:7px}
.tab{padding:5px 1px 8px;gap:3px}
.tab>span{font-size:17px;height:21px}
.layout-context{margin:8px 0 6px;padding:5px 8px}
.layout-context .text-button{padding:3px 0}
.text-field+.text-field{margin-top:7px}
.text-field .label-row{min-height:26px;margin-bottom:3px}
.text-field .label-row label{margin:0}
.text-field select{margin:0;min-height:26px;height:26px;padding:2px 5px}
.text-field textarea{display:block;min-height:46px;height:46px;padding:6px 9px;font-size:13px;line-height:1.35}
.tool-panel>label,.field-pair label{margin:11px 0 6px}
.field-pair select{min-height:34px;margin-top:5px;padding:5px 7px}
.swatches{gap:8px}.swatch{width:34px;height:34px}
.template-grid{margin-top:13px;gap:7px}
.search-box{margin:12px 0 9px!important}.search-box input{height:38px}
.categories{gap:5px}.category{min-height:28px;padding:5px 8px}
.collection-note{margin-top:10px;padding:8px 10px;line-height:1.5}
.sticker-grid{margin-top:10px;gap:7px}
.mode-grid .mode{min-height:105px;padding:8px 3px;gap:4px}
.mode-grid .mode-preview{width:43px;height:43px;margin-bottom:2px}
.layout-description,.retained-note{margin:9px 0 12px;line-height:1.5}
.info-box{padding:11px;margin:14px 0;font-size:11px}
.text-button{padding:10px 3px}
.step-footer{padding:10px 16px}.step-footer .button{min-height:36px;padding:7px 8px}
.sidebar-foot{padding:10px 16px}
@media(max-width:760px){
  .panel-scroll{padding:12px 14px}.tab{padding:3px 1px 5px;gap:1px}.tab>span{font-size:18px;height:23px}
  .text-field .label-row{min-height:34px}.text-field select{min-height:34px;height:34px;min-width:44px}
  .text-field textarea{font-size:16px;min-height:48px;height:48px;padding:7px 9px}
  .field-pair select{min-height:40px}.swatch{width:40px;height:40px}
  .category{min-height:34px;padding:7px 10px}.search-box input{height:40px}
  .step-footer{padding:8px 14px}.step-footer .button{min-height:38px}
}

.asset canvas{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.asset-error{opacity:.4}

/* Short text stays compact; extra lines grow up to a scrollable limit. */
.text-field textarea{height:36px;min-height:36px;max-height:140px;padding:7px 9px;line-height:1.3;resize:none;overflow-y:auto}
.text-field+.text-field{margin-top:5px}
#panel-layout>.mode-grid{margin-top:12px}
@media(max-width:760px){.text-field textarea{font-size:16px;padding:6px 9px}}

/* One mobile action bar gives the editing panel more room. */
.step-compact{display:none}
.sticker-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
.sticker-actions .button{font-size:11px;min-height:40px;padding:8px 12px}
@media(max-width:760px){
  .header{height:56px;padding:0 12px}
  .workspace{height:calc(100dvh - 56px)}
  .stage{padding:5px 12px 6px;gap:4px;max-height:none}
  .stage-top{min-height:36px;gap:8px}
  .stage-top>div:first-of-type{display:none}
  .history .icon-button{min-width:36px;min-height:36px}
  .canvas-frame{width:min(100%,26dvh);max-width:320px}
  .stage-bottom{min-height:27px;padding-top:1px}
  .editor{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  .tabs{right:76px;min-height:calc(64px + env(safe-area-inset-bottom));padding:7px 3px calc(7px + env(safe-area-inset-bottom)) 8px;gap:2px;box-shadow:none}
  .tab{min-height:49px;gap:2px;padding:4px 1px;font-size:10px}
  .tab>span{height:21px;font-size:18px}
  .step-footer{position:fixed;right:0;bottom:0;width:76px;z-index:20;min-height:calc(64px + env(safe-area-inset-bottom));padding:7px 8px calc(7px + env(safe-area-inset-bottom)) 3px;background:#141414;gap:0}
  .step-footer .button{height:49px;min-height:49px;padding:3px 5px;border-radius:9px;font-size:10px}
  .step-full{display:none}.step-compact{display:flex;flex-direction:column-reverse;align-items:center;gap:0;line-height:15px}
  .step-compact>span{font-size:21px;line-height:23px}
  #panel-templates>.muted{display:none}
  .panel-scroll{padding:12px}
  .template-grid{margin-top:10px}
  .mode-grid .mode{min-height:90px;padding:6px 3px}
  .mode-grid .mode-preview{width:36px;height:36px}
  .background{min-height:46px}
  .toast{bottom:calc(76px + env(safe-area-inset-bottom))}
  body.keyboard-open .canvas-frame{width:min(100%,19dvh)}
}

/* Labels sit directly above the input; size lives beside the input. */
#textFields{margin-top:10px}
.text-field{display:grid;grid-template-columns:minmax(0,1fr) 48px;gap:3px 7px;align-items:start}
.text-field .label-row{display:contents}
.text-field .label-row label{grid-column:1/-1;grid-row:1;margin:0;line-height:1.25}
.text-field .label-row select{grid-column:2;grid-row:2;width:100%;min-width:0;height:36px;min-height:36px;margin:0;padding:3px 5px}
.text-field textarea{grid-column:1;grid-row:2;margin:0}
.text-field+.text-field{margin-top:9px}
.cat-picker-meta{display:flex;align-items:center;gap:8px}
.cat-browse-controls{display:none}
@media(max-width:760px){
  .cat-browse-controls{display:flex;gap:5px}
  .cat-browse-controls .icon-button{min-width:36px;min-height:36px}
  .template-grid{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:clamp(88px,24vw,112px);gap:8px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:3px;scrollbar-width:thin;scrollbar-color:#555 transparent;margin:7px -3px 0;padding:3px 3px 9px}
  .template-grid .asset{scroll-snap-align:start}
}

/* Mobile: the canvas leads, editing history follows the active heading. */
.mobile-promo{display:none}
@media(max-width:760px){
  .stage{padding:8px 12px;gap:6px}
  .stage-top,.stage-bottom{display:none!important}
  .canvas-frame{width:min(100%,44dvh);max-width:420px}
  .panel-heading{min-height:36px;gap:7px}
  .panel-heading h1{min-width:0}
  .panel-heading .history{margin-left:auto;flex-shrink:0;gap:5px}
  .panel-heading .history .icon-button{width:36px;height:36px;min-width:36px;min-height:36px}
  #panel-templates .panel-heading{gap:6px}
  .cat-picker-meta{gap:5px}
  .cat-browse-controls{gap:4px}
  .cat-browse-controls .icon-button{min-width:30px;width:30px}
  body{--mobile-promo-height:26px}
  .editor{padding-bottom:calc(64px + var(--mobile-promo-height) + env(safe-area-inset-bottom))}
  .tabs{bottom:calc(var(--mobile-promo-height) + env(safe-area-inset-bottom));min-height:64px;padding:7px 3px 7px 8px}
  .step-footer{bottom:calc(var(--mobile-promo-height) + env(safe-area-inset-bottom));min-height:64px;padding:7px 8px 7px 3px}
  .mobile-promo{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:21;justify-content:center;align-items:flex-start;height:calc(var(--mobile-promo-height) + env(safe-area-inset-bottom));padding:0 8px env(safe-area-inset-bottom);background:#141414}
  .mobile-promo .cult-promo{display:flex;flex-direction:row;gap:7px;align-items:center;justify-content:center;min-height:var(--mobile-promo-height);text-decoration:none;line-height:1.2;white-space:nowrap}
  .mobile-promo .cult-promo>span{display:block;font-size:9px;letter-spacing:0}
  .mobile-promo .promo-prefix{display:none}
  .mobile-promo .cult-promo strong{font-size:11px;letter-spacing:.35px;padding:0;border-bottom:0}
  .mobile-promo .cult-promo:hover strong{color:#fff}
  .toast{bottom:calc(76px + var(--mobile-promo-height) + env(safe-area-inset-bottom))}
  body.keyboard-open .canvas-frame{width:min(100%,19dvh)}
}

/* The first mobile step gives the original cat the full screen width. */
@media(max-width:760px) and (orientation:portrait){
  body[data-step="templates"] .stage{padding:0}
  body[data-step="templates"] .canvas-area{padding:0}
  body[data-step="templates"] .canvas-frame{width:100%;max-width:none;border-radius:0}
  body[data-step="templates"] .object-toolbar{width:calc(100% - 24px);margin:0 12px 8px}
}
@media(max-width:760px) and (max-height:700px) and (orientation:portrait){
  body[data-step="templates"] .panel-scroll{padding:8px 12px 0}
  body[data-step="templates"] .template-grid{margin-top:4px;padding-bottom:7px}
}
