
*{box-sizing:border-box}body{margin:0;background:#f3efe7;color:#223e3b;font:15px system-ui,sans-serif}button,select,input,textarea{font:inherit}button{cursor:pointer;border:1px solid #d5ded6;border-radius:8px;background:#fff;color:#23433d;padding:8px 11px;font-weight:650;min-height:38px}button:hover{background:#f1e8d3}button:disabled{opacity:.4;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #dcae5e;outline-offset:2px}.primary{background:#a73143;color:white;border-color:#a73143}.primary:hover{background:#8f2637}.dark{background:#245c51;color:white;border-color:#245c51}.dark:hover{background:#19493f}header{background:#153d35;color:#fff;padding:12px 20px;display:flex;align-items:center;gap:15px;flex-wrap:wrap}header h1{font: bold 23px Georgia,serif;margin:0;color:#f8e6b8}header small{color:#d0e2d8;display:block;font-size:12px}.tools{display:flex;gap:6px;flex-wrap:wrap;margin-left:auto}.tools button{background:#28584e;color:#fff;border-color:#47776b;font-size:13px}.tools .primary{background:#a73143;border-color:#a73143}.layout{display:grid;grid-template-columns:240px minmax(0,1fr) 260px;gap:12px;padding:12px;max-width:1800px;margin:auto;align-items:start}.panel{background:#fffdf9;border:1px solid #e2ddd0;border-radius:12px;overflow:hidden}.panel h2{font-size:16px;margin:0;padding:13px 12px 8px}.panel p{font-size:13px;color:#63736b;margin:4px 12px 12px}.tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:8px}.tabs button{font-size:13px}.tabs .active{background:#245c51;color:white}.library{padding:8px;max-height:calc(100vh - 320px);min-height:230px;overflow:auto;display:grid;grid-template-columns:1fr 1fr;gap:7px;align-content:start}.library-heading{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:6px;margin:10px 0 2px;padding:7px 4px 5px;border-bottom:1px solid #d8ddd4;color:#245c51;font-size:13px;font-weight:750;line-height:1.25}.library-extra-heading{background:#e6eee6;border-radius:7px;padding:10px 6px;margin-top:18px;font-size:14px;border-bottom:0}.library-heading:first-child{margin-top:0}.library-heading small{color:#66786f;font-weight:500;font-size:11px;flex-shrink:0}.library-empty{grid-column:1/-1;color:#63736b;padding:12px 4px;font-size:13px}.tile{display:flex;flex-direction:column;align-items:center;padding:4px;gap:4px;font-size:11px;line-height:1.2;text-align:center;overflow:hidden}.tile canvas{width:100%;height:auto;border-radius:5px;background:#cbd9df}.wide{grid-column:1/-1}.tile.wide canvas{aspect-ratio:16/9}.category{margin:0 8px;width:calc(100% - 16px)}select,input[type=text],textarea{border:1px solid #d4d9ce;border-radius:7px;background:white;padding:8px;color:#243e39;width:100%}main{min-width:0}.stagebar,.stagefoot{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:10px}.stagebar strong{margin-right:auto}.stage{padding:10px;background:#d9dfd4;border-top:1px solid #d9ded6;border-bottom:1px solid #d9ded6}.stage canvas{display:block;width:100%;height:auto;background:#163c39;box-shadow:0 3px 12px #183d3d30;touch-action:none;cursor:grab}.stage canvas:active{cursor:grabbing}.stagefoot{font-size:13px;color:#506b62}.stagefoot button{margin-left:auto}.help{margin-top:12px;padding:15px 17px;background:#fff9e8;border:1px solid #e7d8b4;border-radius:10px;font-size:14px;line-height:1.5}.help strong{color:#835026}.controls{padding:0 12px 12px}.field{display:block;margin:10px 0;font-size:13px;font-weight:650}.field input[type=range]{width:100%;accent-color:#a73143}.field span{float:right;font-weight:400;color:#6c786d}.check{display:flex;align-items:center;gap:7px;margin:10px 0;font-size:13px}.check input{width:18px;height:18px;accent-color:#245c51}.two{display:grid;grid-template-columns:1fr 1fr;gap:5px}.two button{font-size:12px;padding:6px}.layers{padding:8px 12px 12px;max-height:180px;overflow:auto;display:flex;flex-direction:column;gap:4px}.layers button{text-align:left;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layers .active{border-color:#b14d55;background:#f9e6e4}.line{border-top:1px solid #e4e1d8}.status{min-height:24px;color:#3b695d;font-size:12px;padding:3px 12px}.hidden{display:none!important}dialog{border:0;border-radius:15px;background:#fffdf9;color:#243e39;padding:15px;max-width:95vw;width:960px;box-shadow:0 20px 80px #0007}dialog::backdrop{background:#12312cdd}dialog canvas{width:100%;display:block;touch-action:manipulation}dialog .stagebar{padding:0 0 10px}.previewHelp{font-size:13px;margin:10px 0 0}footer{text-align:center;font-size:12px;color:#677c71;padding:10px} @media(max-width:1050px){.layout{grid-template-columns:190px minmax(0,1fr) 218px;gap:7px;padding:7px}.tools{margin-left:0}}@media(max-width:950px){.layout{grid-template-columns:1fr 1fr}.layout main{grid-column:1/-1;grid-row:1}.library{max-height:330px}.help{display:none}header{padding:10px}.panel h2{font-size:15px}.stage{padding:4px}.tools button{font-size:12px;padding:6px}.layout aside{min-width:0}}@media(max-width:430px){.layout{grid-template-columns:1fr}.layout main{grid-column:1}.library{grid-template-columns:repeat(3,1fr);max-height:280px}.tile.wide{grid-column:auto}.two{grid-template-columns:1fr 1fr}}
#shareDialog{max-width:min(95vw,590px)}#shareDialog label{display:block;margin:12px 0;font-size:14px;line-height:1.5}#shareDialog .share-row{display:flex;gap:6px;align-items:center}#shareDialog .share-row input{min-width:0}#shareDialog .share-row button{flex-shrink:0}#shareDialog .notice{background:#fff2d8;padding:10px;border-radius:8px;font-size:13px;line-height:1.5}#shareStatus{font-size:14px;line-height:1.5;min-height:22px}#shareDialog .check{display:flex;align-items:flex-start}#shareDialog .check input{flex-shrink:0} 
#printSheet{border:1px solid #ddd8c9;border-radius:12px;background:white;color:#23433d;padding:16px;margin:14px 0;text-align:center}#printSheet h2{font: bold 24px Georgia,serif;margin:8px 0 12px;padding:0}#printSheet .print-brand{font-size:11px;letter-spacing:.18em;font-weight:700;color:#426359;margin:0}#printSheet .print-card{display:block;width:100%;height:auto;border:1px solid #d9dfd4;border-radius:6px}#printSheet .print-qr{width:132px;height:132px;image-rendering:pixelated;margin:8px auto 2px;display:block}#printSheet .print-instruction{font-weight:700;margin:12px 0 4px}#printSheet .print-link{display:block;overflow-wrap:anywhere;color:#23433d;font-size:12px;line-height:1.45}#printSheet .print-expiry{font-size:12px;color:#52645d;margin:10px 0 0}#printSheet .print-divider{height:1px;background:#d9dfd4;margin:14px 0}#printSheet .print-subtitle{font-size:13px;margin:0 0 8px}#printShare{width:100%;margin-top:3px}#shareDialog{max-height:90vh;overflow:auto}
@media print{@page{size:A4 portrait;margin:15mm}body.ccs-print{background:white!important;margin:0!important;overflow:visible!important;color:#111}body.ccs-print > :not(#shareDialog){display:none!important}body.ccs-print #shareDialog{display:block!important;position:static!important;inset:auto!important;transform:none!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:white!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;overflow:visible!important}body.ccs-print #shareDialog::backdrop{display:none!important}body.ccs-print #shareDialog > :not(.share-body),body.ccs-print .share-body > :not(#shareResult),body.ccs-print #shareResult > :not(#printSheet){display:none!important}body.ccs-print #printSheet{display:block!important;border:1px solid #b8c9bd;border-radius:0;margin:0 auto;padding:9mm;width:100%;max-width:180mm;break-inside:avoid;page-break-inside:avoid;print-color-adjust:exact;-webkit-print-color-adjust:exact}body.ccs-print #printSheet h2{font-size:25pt;margin:4mm 0 6mm}body.ccs-print #printSheet .print-card{width:100%;border-radius:0}body.ccs-print #printSheet .print-qr{width:43mm;height:43mm;margin:3mm auto}body.ccs-print #printSheet .print-link{font-size:10pt;color:#111;text-decoration:none}body.ccs-print #printSheet .print-expiry{font-size:10pt}body.ccs-print #printSheet .print-instruction{font-size:12pt}body.ccs-print #printSheet .print-subtitle{font-size:10pt}body.ccs-print #printSheet .print-divider{margin:5mm 0}}
.stage{position:relative}.number{float:right;width:76px;padding:3px 4px;margin-left:6px;border:1px solid #d4d9ce;border-radius:5px;font-size:13px}.field span{display:none}.swatches{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;margin-top:6px}.swatches button{padding:2px;min-height:32px}.swatches button.active{outline:2px solid #a73143}.swatches canvas{width:100%;display:block}.layers{max-height:260px}.layers button{touch-action:none;cursor:grab}.layers button.dragover{border-top:3px solid #a73143}.stage textarea{position:absolute;z-index:5;resize:none;text-align:center;border:2px solid #e6b75c;background:#fffdf4;color:#153d35;box-shadow:0 2px 10px #0004}.stagefoot button{margin-left:0}#objectActions,#effectsDialog,#newDialog{max-width: min(94vw,460px)}#objectActions button,#newDialog button{margin:4px}#effectsDialog label{display:flex;gap:8px;align-items:center;margin:10px 0}.tile canvas{background:#e6ece8}
/* Cardaloo design system. Shared layout, theme-specific colors. */
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color-scheme:light;--ink:#222943;--muted:#626a7d;--brand:#6c55cd;--accent:#6c55cd;--accent-deep:#5944b1;--accent-soft:#f0ecfb;--accent-border:#dcd4f7;--surface:#fff;--page:#f5f4f8;--line:#e2e2ea;--stage:#e8e8f0;--hero:#222943;--focus:#6c55cd}
body[data-theme="christmas"]{--accent:#19705b;--accent-deep:#125444;--accent-soft:#e4f1eb;--accent-border:#cbe1d6;--page:#f3f5f4;--line:#dce5e1;--stage:#e0e8e4;--hero:#173d34;--focus:#19705b}
body[data-theme="birthday"]{--accent:#6c55cd;--accent-deep:#5641b1;--accent-soft:#f1edfc;--accent-border:#ddd4f6;--page:#f7f5fa;--line:#e7e1ef;--stage:#e7e1f1;--hero:#322752;--focus:#6c55cd}
body[data-theme="easter"]{--accent:#397c59;--accent-deep:#285d42;--accent-soft:#e5f3e6;--accent-border:#cfe6d3;--page:#f5f8ef;--line:#e1e9da;--stage:#e2ecd8;--hero:#355646;--focus:#397c59}
body{background:var(--page);color:var(--ink);font:14px system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,select,input,textarea{color:var(--ink);font-family:inherit}
button{border:1px solid var(--line);border-radius:9px;color:var(--ink);background:white;min-height:38px;font-weight:600;padding:8px 12px;transition:background .13s,border-color .13s,box-shadow .13s}
button:hover{border-color:var(--accent-border);background:var(--accent-soft)}button:disabled{opacity:.45;cursor:default}
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.primary,.dark{background:var(--accent);border-color:var(--accent);color:white}
.primary:hover,.dark:hover{background:var(--accent-deep);border-color:var(--accent-deep)}
header{background:#fff;color:var(--ink);padding:12px clamp(12px,2vw,26px);border-bottom:1px solid var(--line);display:flex;align-items:center;column-gap:18px;row-gap:10px;min-height:76px}
header .brand{display:flex;flex-direction:column;flex-shrink:0;align-items:flex-start;gap:2px}
header .brand img{width:190px;height:auto;display:block}
header .brand small{color:var(--muted);font-size:11px;padding-left:4px}
.theme-switch{background:var(--accent-soft);border-color:var(--accent-border);color:var(--accent-deep);display:flex;gap:8px;align-items:center;white-space:nowrap}
.theme-dot{background:var(--accent);width:9px;height:9px;border-radius:50%;display:inline-block}
.tools{gap:5px;align-items:center}.tools button{font-size:12px;background:white;border-color:var(--line);color:var(--ink);min-height:35px;padding:7px 9px}
.tools button:hover{background:var(--accent-soft);border-color:var(--accent-border)}
.tools .primary{background:var(--accent);border-color:var(--accent);color:white}
.tools .primary:hover{background:var(--accent-deep)}
.layout{max-width:1900px;grid-template-columns:250px minmax(0,1fr) 270px;gap:14px;padding:16px;min-height:calc(100vh - 145px)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:0 1px 3px #22294306}
.panel h2{font-size:14px;letter-spacing:-.01em;padding:15px 13px 7px;color:var(--ink);font-weight:750}
.panel p,.library-empty{color:var(--muted);font-size:12px;line-height:1.45}
.tabs{padding:9px;gap:5px}.tabs button{font-size:12px;padding:8px 5px;min-height:34px;border-color:transparent;background:#f6f6f9}
.tabs .active{background:var(--accent);color:#fff}
.library{padding:8px;gap:6px;max-height:calc(100vh - 265px);min-height:245px;scrollbar-color:var(--accent-border) transparent}
.library-heading{color:var(--accent-deep);border-bottom:1px solid var(--line)}.library-heading small{color:var(--muted)}
.library-extra-heading{background:var(--accent-soft)}
.tile{border:1px solid var(--line);border-radius:8px;background:#fff;font-size:11px;gap:5px;padding:5px}
.tile canvas{border-radius:5px;background:var(--accent-soft)}
.stagebar,.stagefoot{padding:10px 12px;gap:7px}
.stage-title{display:flex;flex-direction:column;gap:2px;margin-right:auto}
.stage-title .tag{font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-deep)}
.stage-title strong{font-size:16px;color:var(--ink)}
.stage{background:var(--stage);border-color:var(--line);padding:clamp(10px,1.5vw,24px)}
.stage canvas{box-shadow:0 6px 24px #22294322;border-radius:2px;background:var(--hero)}
.stagefoot{color:var(--muted);font-size:12px}
.stagefoot #selection{flex:1;min-width:100px;text-align:center}.stagefoot button{font-size:12px}
.field{font-size:12px;color:var(--ink)}select,input[type=text],input[type=search],textarea,.number{border:1px solid var(--line)!important;color:var(--ink);border-radius:8px;background:#fff}
.field input[type=range],.check input{accent-color:var(--accent)}
.layers button{border-color:var(--line)}.layers .active{background:var(--accent-soft);border-color:var(--accent)}
.layers button.dragover{border-top-color:var(--accent)}
.swatches button.active{outline-color:var(--accent)}
.line{border-color:var(--line)}.status{color:var(--accent-deep);font-size:12px;padding:7px 13px}
.stage textarea{border-color:var(--accent)!important;background:white;color:var(--ink)}
.site-footer{padding:10px 20px 12px;color:var(--muted);font-size:12px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);background:#fff}
.site-footer .family{display:flex;align-items:center;gap:7px}.site-footer .family a{display:flex;align-items:center}
.site-footer img{width:119px;height:39px;object-fit:contain}
.site-footer nav{display:flex;gap:17px}.site-footer a{color:var(--muted);text-decoration:none}.site-footer a:hover{color:var(--accent-deep);text-decoration:underline}
dialog{background:white;color:var(--ink);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:0 22px 80px #22294335}
dialog::backdrop{background:#22294366;backdrop-filter:blur(5px)}
#themeDialog{width:min(960px,94vw);max-width:94vw;max-height:91vh;overflow:auto;border:0;padding:30px;box-shadow:0 24px 90px #22294355;color:#222943}
#themeDialog::backdrop{background:#22294355;backdrop-filter:blur(9px)}
.welcome-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.welcome-header img{width:210px;display:block}
.welcome-copy{margin:25px 0 20px}.welcome-copy .eyebrow{margin:0 0 7px;color:#6c55cd;letter-spacing:.06em;font-weight:700;font-size:12px}
.welcome-copy h1{font-size:clamp(24px,3.2vw,35px);margin:0 0 7px;letter-spacing:-.04em;line-height:1.15}
.welcome-copy>p:last-child{color:#626a7d;margin:0;font-size:15px}
.theme-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.theme-choice{display:block;padding:0;text-align:left;border:1px solid #e0e0e8;border-radius:13px;overflow:hidden;background:#fff;white-space:normal;min-width:0;box-shadow:0 1px 3px #2229430a}
.theme-choice:hover,.theme-choice:focus-visible{border-color:var(--world);background:var(--world-soft);box-shadow:0 0 0 2px var(--world-soft)}
.theme-choice[data-world="christmas"]{--world:#19705b;--world-soft:#e4f1eb}
.theme-choice[data-world="birthday"]{--world:#6c55cd;--world-soft:#f0ecfb}
.theme-choice[data-world="easter"]{--world:#397c59;--world-soft:#e5f3e6}
.theme-choice canvas{width:100%;height:auto;display:block;border-bottom:3px solid var(--world);aspect-ratio:16/9}
.world-info{padding:15px;display:flex;flex-direction:column;gap:8px}
.world-info strong{font-size:18px;color:#222943;line-height:1.2;letter-spacing:-.025em}
.world-info span:not(.world-action){font-size:12px;color:#626a7d;line-height:1.4;font-weight:500;min-height:34px}
.world-action{font-size:12px;font-weight:750;color:var(--world);margin-top:5px}
.welcome-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:20px;color:#626a7d;font-size:12px}
.welcome-footer button{background:white;color:#222943;border-color:#e1e1e9}
#effectsDialog input{accent-color:var(--accent);width:18px;height:18px}
#shareDialog .notice{background:var(--accent-soft);border:1px solid var(--accent-border)}
#shareDialog a{color:var(--accent-deep)}
@media(max-width:1250px){.layout{grid-template-columns:210px minmax(0,1fr) 235px;gap:9px;padding:10px}header{gap:9px}.tools button{font-size:11px;padding:6px 8px}.theme-switch{font-size:12px}}
@media(max-width:1000px){.layout{grid-template-columns:1fr 1fr;gap:12px;min-height:0}.layout main{grid-column:1/-1;grid-row:1}.library{min-height:180px;max-height:350px}.tools{width:100%;margin-left:0}.stage{padding:12px}.stage canvas{width:100%;height:auto}.site-footer{margin-top:10px}.theme-switch{margin-left:auto}}
@media(max-width:620px){header{padding:10px}.layout{grid-template-columns:1fr;padding:8px}.layout main{grid-column:1}.stagebar{padding:8px}.stage-title strong{font-size:14px}.stagebar button{font-size:11px;padding:6px 8px}.stagefoot{padding:8px;gap:5px}.stagefoot #selection{flex-basis:100%;order:9;text-align:left}.library{grid-template-columns:repeat(3,1fr);max-height:290px;min-height:150px}.tile.wide{grid-column:auto}.site-footer{justify-content:center;text-align:center;gap:6px}.site-footer nav{padding:5px 10px}#themeDialog{padding:18px;max-height:92vh}.welcome-header img{width:165px}.welcome-copy{margin:18px 0 15px}.theme-list{grid-template-columns:1fr;gap:9px}.theme-choice{display:grid;grid-template-columns:40% 1fr;align-items:stretch}.theme-choice canvas{height:100%;object-fit:cover;border-bottom:none;border-right:3px solid var(--world)}.world-info{padding:10px;gap:4px}.world-info strong{font-size:16px}.world-info span:not(.world-action){min-height:0;font-size:11px}.world-action{font-size:11px;margin-top:4px}.welcome-footer{padding-top:12px}.welcome-footer button{font-size:11px}.welcome-footer span{font-size:10px}}
body.choosing-theme>header,body.choosing-theme>.layout,body.choosing-theme>.site-footer{filter:blur(5px);pointer-events:none;user-select:none}

body[data-theme=christmas] .tools .primary{background:#a73143;border-color:#a73143}body[data-theme=christmas] .tools .primary:hover{background:#8f2637}
body[data-theme=easter] .tools .primary{background:#6755ad;border-color:#6755ad}body[data-theme=easter] .tools .primary:hover{background:#564699}
#themeError:empty{display:none}#themeError{color:#a73143;font-size:13px;margin:12px 0 0}

/* Cardaloo 1.1: richer, deeper themed chrome while keeping the card itself bright. */
body[data-theme="christmas"]{--page:#cbd9d1;--surface:#edf2ee;--line:#c4d2c9;--stage:#36594e;--hero:#173d34;--header:#153b32;--header-muted:#d4e5dd;--nav-edge:#ffffff29;--nav-hover:#ffffff1c;--panel-tint:#dce8df;--tile:#f2f6f3;--workspace-border:#294d40;--footer:#20443a}
body[data-theme="birthday"]{--page:#d5cce6;--surface:#f1edf6;--line:#cfc4e1;--stage:#554571;--hero:#322752;--header:#322752;--header-muted:#e0d9f0;--nav-edge:#ffffff2a;--nav-hover:#ffffff1e;--panel-tint:#e3dbef;--tile:#f6f3fa;--workspace-border:#44355e;--footer:#40345c}
body[data-theme="easter"]{--page:#d4e0c0;--surface:#eef3e5;--line:#c8d5b6;--stage:#67866a;--hero:#355646;--header:#3a5a46;--header-muted:#deebd7;--nav-edge:#ffffff30;--nav-hover:#ffffff1e;--panel-tint:#e1ebd3;--tile:#f1f6e9;--workspace-border:#527454;--footer:#3a5a46}
body{background:var(--page)}
header{background:var(--header,#222943);border-bottom:1px solid #0002;color:#fff;box-shadow:0 3px 12px #22294312}
header .brand small{color:var(--header-muted,#d8dbe5)}
header .theme-switch{background:#ffffff16;border-color:var(--nav-edge,#ffffff30);color:#fff}
header .theme-switch:hover{background:#ffffff2b;border-color:#ffffff50}
header .theme-dot{background:#fff}
.tools button{background:#ffffff12;color:#fff;border-color:var(--nav-edge,#ffffff30)}
.tools button:hover{background:var(--nav-hover,#ffffff20);border-color:#ffffff55}
.tools .primary{background:#6c55cd;border-color:#6c55cd;box-shadow:0 1px 3px #0002}
body[data-theme="birthday"] .tools .primary{background:#8b6eed;border-color:#8b6eed}
body[data-theme="birthday"] .tools .primary:hover{background:#7757de}
body[data-theme="easter"] .tools .primary{background:#7761bc;border-color:#7761bc}
body[data-theme="easter"] .tools .primary:hover{background:#6650aa}
.tools #clear{background:#ffffff21;border-color:#ffffff45}
.tools #clear:hover{background:#ffffff32}
.panel{background:var(--surface);border-color:var(--line);box-shadow:0 2px 6px #2229430b}
.tabs{background:var(--panel-tint);margin:5px 8px 7px;border:1px solid var(--line);border-radius:9px;padding:5px}
.tabs button{background:transparent;border-color:transparent}
.tabs button:hover{background:#ffffff80}
.tabs .active{background:var(--accent);color:#fff;box-shadow:0 1px 2px #0001}
.tile{background:var(--tile);border-color:var(--line)}
.tile canvas{background:var(--panel-tint)}
.tile:hover{background:var(--accent-soft);border-color:var(--accent)}
.stage{background:var(--stage);border-color:var(--workspace-border);padding:clamp(12px,1.8vw,26px)}
.stage canvas{box-shadow:0 8px 28px #15221e50}
.stagebar,.stagefoot{background:var(--surface)}
.stagefoot{border-top:1px solid var(--line)}
select,input[type=text],input[type=search],textarea,.number{background:var(--tile)}
.layers button,.two button{background:var(--tile)}
.layers .active{background:var(--accent-soft)}
.site-footer{background:var(--footer,#222943);color:var(--header-muted,#d8dbe5);border-top:1px solid #0001}
.site-footer a{color:#e4e7ef}.site-footer a:hover{color:#fff}
#themeDialog{background:#f0edf6;color:#222943;border:1px solid #dcd5e7}
#themeDialog .welcome-copy .eyebrow{color:#6c55cd}
.theme-choice{background:#faf9fc;border-color:#d7d1e0}
.theme-choice:hover{background:var(--world-soft)}
#themeDialog::backdrop{background:#151a3180;backdrop-filter:blur(8px)}
.empty-card-tile{display:flex;gap:10px;align-items:center;justify-content:flex-start;text-align:left;background:var(--accent-soft);border:1px dashed var(--accent);color:var(--accent-deep);padding:10px 11px;min-height:48px;font-size:13px;grid-column:1/-1!important}
.empty-card-tile:hover{background:var(--panel-tint);border-style:solid}
.empty-card-symbol{display:grid;place-items:center;width:27px;height:27px;border:1px solid var(--accent-border);background:var(--tile);color:var(--accent);font-weight:700;border-radius:7px;line-height:1;font-size:19px;flex-shrink:0}
.export-wrap{position:relative;display:inline-flex;align-items:center}
#exportButton{display:flex;gap:6px;align-items:center;white-space:nowrap}
.export-menu{position:absolute;z-index:40;top:calc(100% + 7px);right:0;min-width:235px;padding:5px;display:flex;flex-direction:column;gap:4px;background:var(--surface,#fff);border:1px solid var(--line,#dedfe5);border-radius:10px;box-shadow:0 10px 28px #17213433}
.tools .export-menu button{display:flex;flex-direction:column;align-items:flex-start;gap:3px;width:100%;color:var(--ink);background:var(--tile,#f6f6f9);border-color:transparent;text-align:left;padding:10px}
.tools .export-menu button:hover,.tools .export-menu button:focus-visible{background:var(--accent-soft);border-color:var(--accent-border)}
.export-menu strong{font-size:13px;font-weight:700}
.export-menu small{font-size:11px;color:var(--muted);font-weight:400;line-height:1.3}
@media(max-width:600px){.tools{gap:5px}.tools #clear{font-size:11px}.tile.wide.empty-card-tile{grid-column:1/-1!important}.stage{padding:9px}.site-footer{padding:10px}}


/* Version 1.3: clearer inspector, editor-only transformation controls, layers. */
@font-face{font-family:"Cardaloo UI";src:url("assets/fonts/OpenSans-Regular.woff") format("woff");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Cardaloo UI";src:url("assets/fonts/OpenSans-Semibold.woff") format("woff");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"Cardaloo UI";src:url("assets/fonts/OpenSans-Bold.woff") format("woff");font-weight:700;font-style:normal;font-display:swap}
.layout,.site-footer,dialog{font-family:"Cardaloo UI",system-ui,-apple-system,"Segoe UI",sans-serif}
.layout main{min-width:0;display:flex;flex-direction:column;gap:14px}
.properties-panel{overflow:hidden}
.properties-panel h2{font-weight:700;font-size:15px;letter-spacing:-.035em;padding:16px 14px 11px}
.properties-panel .no-selection{margin:2px 14px 16px;line-height:1.65;font-size:13px}
.properties-panel .controls{padding:0 11px 11px}
.object-name{background:var(--panel-tint);border:1px solid var(--line);border-radius:10px;padding:10px 11px;display:grid;gap:3px}
.object-name span{font-size:10px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.07em}
.object-name strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:700;color:var(--ink)}
.property-group{border:1px solid var(--line);border-radius:11px;background:var(--tile);margin:9px 0 0;padding:10px 10px 8px;min-width:0}
.property-group h3,.property-group .group-caption{font-size:12px;font-weight:700;margin:0 0 9px;letter-spacing:.015em;color:var(--accent-deep)}
.property-group .group-caption{display:block;float:none}
.property-group .field{margin:8px 0 11px;font-weight:600;font-size:12px;line-height:1.45}
.property-group .field:last-child{margin-bottom:3px}
.property-group select,.property-group textarea,.property-group .number{background:var(--surface);border-color:var(--line);border-radius:7px}
.property-group .number{font-size:12px;font-weight:600;height:29px;line-height:29px}
.property-group input[type=range]{height:22px;margin:4px 0 0;accent-color:var(--accent);cursor:pointer}
.property-group #variant{margin-top:6px}
.property-group .two{gap:6px}
.property-group .two button{background:var(--surface);font-size:11px;font-weight:600;min-height:35px;padding:6px 3px}
.property-group .two button:hover{background:var(--accent-soft)}
.property-group .two .subtle-danger{color:#a33845}
.property-group .check{font-size:12px;line-height:1.45;font-weight:400}
.property-group .check input{flex-shrink:0}
.stagefoot{min-height:49px;gap:8px}
.stagefoot #test{margin-left:auto}
.object-handles{position:absolute;inset:0;pointer-events:none;z-index:4}
.direct-handle{pointer-events:auto;position:absolute;transform:translate(-50%,-50%);display:grid;place-items:center;min-width:34px;width:34px;height:34px;min-height:34px;padding:0;border-radius:10px;border:1px solid #dce4e6;box-shadow:0 2px 8px #16212c50;color:#263443;background:#fff;touch-action:none}
.direct-handle:hover{background:#e9eff1;border-color:#b4c5ca;box-shadow:0 2px 9px #16212c60}
.direct-handle.delete-handle{color:#aa3b47}
.direct-handle.delete-handle:hover{color:#9a2635;background:#fff0f1;border-color:#edbac1}
.rotate-handle{cursor:url("assets/rotate-cursor.svg") 12 12,grab}
.stage canvas.rotation-cursor,.stage canvas.rotating,.rotate-handle.rotating{cursor:url("assets/rotate-cursor.svg") 12 12,grabbing!important}
.rotate-handle.rotating{background:#e2eee9;border-color:#579c83}
.layer-panel{min-width:0}
.layer-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 13px 5px}
.layer-title{display:flex;align-items:center;gap:8px;color:var(--accent-deep);min-width:0}
.layer-title h2{margin:0;padding:0;font-size:15px;font-weight:700;letter-spacing:-.02em}
.layer-count{font-size:11px;font-weight:700;color:var(--accent-deep);background:var(--accent-soft);border:1px solid var(--accent-border);border-radius:999px;padding:2px 8px}

.layer-panel .layer-help{margin:2px 13px 8px;padding:0;font-size:11px}
.layer-panel .layers{padding:0 10px 11px;max-height:240px;min-height:60px;gap:5px;overscroll-behavior:contain;position:relative}
.layers .layer-row{display:grid;grid-template-columns:30px minmax(0,1fr) 39px 39px;align-items:center;gap:4px;min-height:44px;padding:3px;background:var(--tile);border:1px solid var(--line);border-radius:8px;flex-shrink:0}
.layers .layer-row.active{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent)}
.layers .layer-row.dragover{border:2px dashed var(--accent);background:var(--panel-tint)}
.layers .layer-row button{margin:0;border:0;background:transparent;min-height:36px;height:36px;border-radius:6px;font-weight:600}
.layers .layer-row button:hover:not(:disabled){background:var(--panel-tint);color:var(--accent-deep)}
.layers .layer-grip{touch-action:none;cursor:grab;display:grid;place-items:center;padding:0;color:var(--muted);font-size:18px;letter-spacing:-.18em}
.layers .layer-grip:active{cursor:grabbing}
.layers .layer-select{display:flex;align-items:center;gap:8px;text-align:left;padding:2px 3px;cursor:pointer;touch-action:manipulation;min-width:0}
.layers .layer-select canvas{width:38px;height:34px;display:block;flex-shrink:0;background:var(--surface);border:1px solid var(--line);border-radius:6px}
.layers .layer-select span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.layers .layer-arrow{cursor:pointer;color:var(--accent-deep);text-align:center;font-size:18px;padding:0;touch-action:manipulation}
.layers .layer-arrow:disabled{opacity:.23;cursor:default}
.layers .layer-empty{padding:10px;margin:0;background:var(--tile);border:1px dashed var(--line);border-radius:8px;text-align:center}
.status-toast{position:fixed;z-index:50;bottom:20px;right:20px;max-width:min(400px,calc(100vw - 40px));border:1px solid var(--accent-border);background:var(--surface);color:var(--ink);font-size:13px;font-family:"Cardaloo UI",system-ui,sans-serif;line-height:1.5;box-shadow:0 6px 25px #11182726;padding:11px 16px;border-radius:10px;pointer-events:none}
@media(pointer:coarse){.direct-handle{width:42px;height:42px;min-height:42px;min-width:42px;border-radius:12px}.layers .layer-row{grid-template-columns:34px minmax(0,1fr) 43px 43px;min-height:50px}.layers .layer-row button{height:42px;min-height:42px}}
@media(max-width:620px){.layout main{gap:8px}.layer-heading{padding:10px 10px 3px}.layer-title h2{font-size:14px}.layer-panel .layer-help{margin:2px 10px 7px}.layer-panel .layers{padding:0 7px 8px;max-height:205px}.properties-panel .controls{padding:0 9px 9px}.stagefoot{min-height:43px}.direct-handle{border-radius:8px}}

/* Eight themed workspaces: each retains the Cardaloo header structure. */
body[data-theme="newyear"]{--accent:#80622d;--accent-deep:#5f481e;--accent-soft:#f8edd2;--accent-border:#d9c695;--ink:#262c43;--muted:#5a6277;--page:#c9cbdc;--surface:#eaebf2;--line:#c8cadb;--stage:#3c4968;--hero:#172340;--header:#222d4d;--header-muted:#e4dfd6;--nav-edge:#ffffff30;--nav-hover:#ffffff24;--panel-tint:#e1dfeb;--tile:#f0f0f6;--workspace-border:#35435e;--footer:#222d4d;--focus:#aa873c}
body[data-theme="halloween"]{--accent:#994f28;--accent-deep:#743b24;--accent-soft:#fae5d3;--accent-border:#e6b995;--ink:#30263c;--muted:#63556a;--page:#cbbdd5;--surface:#f1e7df;--line:#d7c4ce;--stage:#665376;--hero:#312642;--header:#392a50;--header-muted:#f1d9ca;--nav-edge:#ffffff30;--nav-hover:#ffffff24;--panel-tint:#e7d5d8;--tile:#f6eee8;--workspace-border:#5a486c;--footer:#392a50;--focus:#b46a3b}
body[data-theme="summer"]{--accent:#187e89;--accent-deep:#165e69;--accent-soft:#e0f1ed;--accent-border:#a2d0ce;--ink:#26424a;--muted:#516c71;--page:#aed4d3;--surface:#edf4eb;--line:#b7d6d1;--stage:#588f9a;--hero:#24586a;--header:#275e70;--header-muted:#d6f0eb;--nav-edge:#ffffff35;--nav-hover:#ffffff20;--panel-tint:#d8e8db;--tile:#f1f6f0;--workspace-border:#47818e;--footer:#275e70;--focus:#187e89}
body[data-theme="invitations"]{--accent:#9b586c;--accent-deep:#764254;--accent-soft:#f6e0e4;--accent-border:#e2b9c3;--ink:#443447;--muted:#6e5b6a;--page:#dfc8ce;--surface:#f6edea;--line:#decbd0;--stage:#a5849a;--hero:#64475c;--header:#674a61;--header-muted:#f4e3e4;--nav-edge:#ffffff35;--nav-hover:#ffffff24;--panel-tint:#ecdcdf;--tile:#f9f1ee;--workspace-border:#916f86;--footer:#674a61;--focus:#9b586c}
body[data-theme="creative"]{--accent:#6c55cd;--accent-deep:#5542aa;--accent-soft:#ede8fb;--accent-border:#d4c9f2;--ink:#30354b;--muted:#5b6076;--page:#cbcadd;--surface:#eeeef5;--line:#cbcada;--stage:#727a99;--hero:#424968;--header:#383c60;--header-muted:#e2e3f1;--nav-edge:#ffffff30;--nav-hover:#ffffff20;--panel-tint:#dedfeb;--tile:#f4f4fa;--workspace-border:#656c8a;--footer:#383c60;--focus:#6c55cd}
body[data-theme="newyear"] .tools .primary{color:#272b41;background:#e7bf71;border-color:#e7bf71}
body[data-theme="newyear"] .tools .primary:hover{background:#f0d293}
body[data-theme="halloween"] .tools .primary{background:#df9659;color:#30213b;border-color:#df9659}
body[data-theme="halloween"] .tools .primary:hover{background:#efae74}
body[data-theme="summer"] .tools .primary{background:#e1b958;color:#253e49;border-color:#e1b958}
body[data-theme="summer"] .tools .primary:hover{background:#f1cd7d}
body[data-theme="invitations"] .tools .primary{background:#c08699;border-color:#c08699;color:#36273a}
body[data-theme="invitations"] .tools .primary:hover{background:#d7a3b3}
body[data-theme="creative"] .tools .primary{background:#8b76e4;border-color:#8b76e4}
body[data-theme="creative"] .tools .primary:hover{background:#9d88f1}
#themeDialog{width:min(1000px,94vw)}
.carousel-caption,.carousel-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}
.carousel-caption{margin:0 0 10px}
.carousel-caption>strong{font-size:13px;color:#61598a;letter-spacing:.015em}
.carousel-controls{display:flex;align-items:center;gap:8px;color:#626a7d;font-size:12px;font-weight:600}
.carousel-controls button{display:grid;place-items:center;width:38px;height:38px;min-height:38px;padding:0;font:700 24px/1 "Cardaloo UI",sans-serif;border:1px solid #d9d3e5;background:#fff;color:#5543a9;border-radius:10px}
.carousel-controls button:hover:not(:disabled){background:#e8e0f8;border-color:#cabde9}
.carousel-controls button:disabled{opacity:.35}
#themePosition{font-variant-numeric:tabular-nums;min-width:56px;text-align:center}
.theme-list{touch-action:pan-y}
.theme-choice[data-world="newyear"]{--world:#80622d;--world-soft:#f8edd2}
.theme-choice[data-world="halloween"]{--world:#994f28;--world-soft:#fae5d3}
.theme-choice[data-world="summer"]{--world:#187e89;--world-soft:#e0f1ed}
.theme-choice[data-world="invitations"]{--world:#9b586c;--world-soft:#f6e0e4}
.theme-choice[data-world="creative"]{--world:#6c55cd;--world-soft:#ede8fb}
.theme-choice{height:100%;display:flex;flex-direction:column}
.theme-choice .world-info{flex:1;width:100%}
.theme-choice .world-action{margin-top:auto;padding-top:5px;color:var(--world)}
.carousel-bottom{margin-top:11px;color:#626a7d;font-size:11px}
.carousel-bottom .carousel-more{min-height:34px;padding:5px 10px;background:transparent;color:#5946ad;border:1px solid #d9cde9;white-space:nowrap;font-size:12px}
.carousel-bottom .carousel-more:hover{background:#e9e1f8}
.world-filter{display:flex;flex-direction:column;gap:4px;margin:8px 8px 5px;padding:8px;background:var(--panel-tint);border:1px solid var(--line);border-radius:9px}
.world-filter span{font-size:11px;color:var(--accent-deep);font-weight:700}
.world-filter select{width:100%;font-size:12px;padding:8px;background:var(--surface);border-color:var(--line);border-radius:7px}
@media(max-width:620px){
 #themeDialog{padding:16px}
 .carousel-caption{margin-bottom:8px}.carousel-caption>strong{font-size:12px}
 .carousel-controls{gap:6px}.carousel-controls button{width:40px;height:40px;min-height:40px}
 .theme-choice{display:grid;grid-template-columns:38% 1fr;align-items:stretch}
 .theme-choice .world-info{padding:9px;gap:4px}.theme-choice .world-info strong{font-size:14px}
 .theme-choice canvas{height:100%;min-height:90px;object-fit:cover;border-bottom:0;border-right:3px solid var(--world)}
 .carousel-bottom{gap:8px;align-items:center}.carousel-bottom .carousel-more{font-size:11px;padding:5px 8px}
}

/* 1.4.1: compact header branding and a sidebar that fills the editor row. */
header .brand {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
}
header .brand .brand-mark {
  width:44px;
  height:auto;
  flex:none;
}
.brand-copy {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
}
header .brand .brand-wordmark {
  width:137px;
  height:auto;
}
header .brand .brand-copy small {
  padding:0;
  font-size:10.5px;
  line-height:1.25;
  letter-spacing:-.015em;
  white-space:nowrap;
}
.carousel-bottom {justify-content:flex-end}

/* The library's contents scroll inside the available row height. Size
   containment prevents hundreds of thumbnails from inflating the grid row. */
@media (min-width:621px) {
  .layout > .design-panel {
    align-self:stretch;
    display:flex;
    flex-direction:column;
    min-width:0;
  }
  .design-panel > :not(.library-scroll) {flex-shrink:0}
  .design-panel > .library-scroll {
    flex:1 1 0px;
    min-height:245px;
    max-height:none;
    contain:size;
    overflow:auto;
    overscroll-behavior:contain;
  }
}
@media (min-width:621px) and (max-width:1000px) {
  /* Tablet: the two sidebars occupy their own row below the card. */
  .design-panel > .library-scroll {min-height:350px}
}
@media (max-width:620px) {
  /* Stacked mobile layout: don't bury the properties below long libraries. */
  header .brand {gap:7px}
  header .brand .brand-mark {width:36px}
  header .brand .brand-wordmark {width:115px}
  header .brand .brand-copy small {font-size:9.5px}
}

/* Wintergrüße */
body[data-theme="winter"]{--accent:#397c98;--accent-deep:#2b5b70;--accent-soft:#dceff7;--accent-border:#aacbd9;--ink:#294657;--muted:#536d7b;--page:#c7dde7;--surface:#edf5f8;--line:#c2d9e4;--stage:#7393ac;--hero:#325064;--header:#314f65;--header-muted:#dceef6;--nav-edge:#ffffff30;--nav-hover:#ffffff20;--panel-tint:#dce9f0;--tile:#f4f9fc;--workspace-border:#57798e;--footer:#314f65;--focus:#397c98}
body[data-theme="winter"] .tools .primary{background:#66a2be;color:#1e384a;border-color:#66a2be}
body[data-theme="winter"] .tools .primary:hover{background:#8fc4d9}
.theme-choice[data-world="winter"]{--world:#397c98;--world-soft:#dceff7}


/* Card fonts: live sample in the existing inspector. */
.property-group .font-sample{display:block;float:none;margin-top:6px;padding:9px 8px;font-size:18px;line-height:1.4;color:var(--ink);border:1px solid var(--line);background:var(--surface);border-radius:7px;font-weight:400;overflow-wrap:anywhere}
/* Online sharing: always-visible heading, independent scrolling content. */
@media screen {
#shareDialog{width:min(590px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:calc(100vh - 28px);max-height:calc(100dvh - 28px);inset:0;margin:auto;padding:0;border-radius:16px;overflow:hidden;background:var(--surface)}
#shareDialog[open]{display:flex;flex-direction:column}
#shareDialog .share-header{display:flex;justify-content:space-between;align-items:center;flex:none;padding:17px 20px 15px;gap:14px;background:var(--panel-tint);border-bottom:1px solid var(--line)}
#shareDialog .share-header h2{font-size:21px;font-weight:700;line-height:1.25;letter-spacing:-.035em;margin:3px 0 0;color:var(--ink)}
#shareDialog .share-eyebrow{font-size:10px;font-weight:700;letter-spacing:.085em;color:var(--accent-deep)}
#shareDialog #closeShare{min-width:38px;min-height:38px;display:grid;place-items:center;padding:0;font-size:17px;flex:none;background:var(--surface)}
#shareDialog .share-body{padding:18px 20px 20px;overflow:auto;min-height:0;flex:1 1 auto;overscroll-behavior:contain;scrollbar-color:var(--accent-border) transparent}
#shareDialog .share-body p{font-size:13px;line-height:1.55;margin:0 0 12px}
#shareDialog .notice{margin:12px 0;padding:12px 13px;border-radius:9px;line-height:1.55}
#shareDialog .check{gap:9px;align-items:flex-start;font-size:13px;line-height:1.55;margin:17px 0}
#shareDialog .check input{flex-shrink:0;margin:3px 0 0}
#shareDialog #publishCard{width:100%;min-height:42px;font-weight:700}
#shareDialog .share-row{gap:7px;margin-bottom:12px}
#shareDialog .share-row input{flex:1 1 0;min-width:0;width:0;font-size:12px;padding:10px 8px}
#shareDialog .share-row button{min-height:39px;font-size:12px}
#shareDialog #shareResult>label{font-size:12px;font-weight:700;margin:14px 0 5px}
#shareDialog #shareStatus{margin:12px 0 0;min-height:0;color:var(--accent-deep);font-size:12px}
#shareDialog #shareStatus:empty{display:none}
#shareDialog #printSheet{padding:16px;margin:15px 0}
#shareDialog #printSheet p{margin:8px 0 0}
}
@media screen and (max-width:620px){#shareDialog .share-header{padding:13px 14px 12px}#shareDialog .share-header h2{font-size:19px}#shareDialog .share-body{padding:14px}#shareDialog .share-row button{padding:8px}}
@media print{body.ccs-print #shareDialog .share-body{display:block!important;overflow:visible!important;padding:0!important;max-height:none!important}body.ccs-print #shareDialog{display:block!important}}

/* 1.5.1: size containment belongs to the scroll viewport, never the card grid.
   Grid tracks must grow to their full content size; the viewport scrolls. */
.library-scroll{min-width:0;min-height:230px;overflow:auto;overscroll-behavior:contain;scrollbar-color:var(--accent-border) transparent;scrollbar-gutter:stable}
.library-scroll > .library{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:max-content;
 align-items:stretch;align-content:start;
 min-width:0;min-height:0;max-height:none;height:auto;overflow:visible;
}
.library-scroll .tile{min-width:0;max-width:100%;align-self:stretch;justify-content:flex-start;white-space:normal}
.library-scroll .tile canvas{
 display:block;flex:none;width:100%;max-width:100%;height:auto;min-height:0;
 aspect-ratio:96 / 86;object-fit:contain;
}
.library-scroll .tile.wide canvas{aspect-ratio:16 / 9}
.library-scroll .tile>span:not(.empty-card-symbol){min-width:0;max-width:100%;flex:none;overflow-wrap:anywhere;line-height:1.3}
.library-scroll .empty-card-tile{flex-direction:row}
.library-scroll .library-heading{min-width:0}
@media(max-width:620px){
 .library-scroll{min-height:150px;max-height:290px}
 .library-scroll > .library{grid-template-columns:repeat(2,minmax(0,1fr))}
 .library-scroll > .library[data-library-view=assets]{grid-template-columns:repeat(3,minmax(0,1fr))}
 .library-scroll > .library[data-library-view=text]{grid-template-columns:minmax(0,1fr)}
}
/* Active navigation always has dark background and white type. */
.tabs button:not(.active):hover,.tabs button:not(.active):focus-visible{
 background:var(--accent-soft);color:var(--accent-deep);border-color:var(--accent-border)
}
.tabs button.active,.tabs button.active:hover,.tabs button.active:focus-visible{
 background:var(--accent-deep);color:#fff;border-color:var(--accent-deep)
}
.tabs button.active:hover{box-shadow:inset 0 0 0 1px #ffffff44,0 1px 2px #0001}
/* Consistent line icons and a clear new-card action. */
.tools>button,#exportButton{display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.toolbar-icon{display:block;width:17px;height:17px;flex:none}
.toolbar-chevron{display:block;width:13px;height:13px;flex:none}
.tools #clear{background:var(--new-card-bg,#f1b444);border-color:var(--new-card-bg,#f1b444);color:var(--new-card-ink,#292c37);font-weight:750;box-shadow:0 1px 4px #0002}
.tools #clear:hover,.tools #clear:focus-visible{background:var(--new-card-hover,#ffd27a);border-color:var(--new-card-hover,#ffd27a);color:var(--new-card-ink,#292c37)}
body[data-theme=newyear],body[data-theme=summer],body[data-theme=halloween]{--new-card-bg:#c0a9f5;--new-card-hover:#d6c5ff;--new-card-ink:#302342}
@media(max-width:1250px){.tools>button,#exportButton{gap:4px}.toolbar-icon{width:15px;height:15px}}
@media(pointer:coarse){.tools>button,#exportButton{min-height:40px}}

/* 1.7.2 – Original theme chooser, with just the requested text changes. */
#themeDialog .carousel-caption{justify-content:flex-end}
#themeDialog .welcome-promise{font-weight:700}

/* 1.8.1 – Preserve complete 16:9 card artwork in the compact mobile chooser. */
@media(max-width:620px){
 .theme-choice canvas{width:100%;height:auto;min-height:0;align-self:center;object-fit:contain;border:0}
}

/* The artwork fills its workspace: no colored frame on any screen or theme. */
.stage{padding:0;background:var(--surface);border:0}
.stage canvas{border-radius:0;box-shadow:none}

/* 1.11 – Mobile workspace: one card, one visible tool panel, a persistent dock.
   These rules only apply while the responsive mode is active; desktop retains
   the original three-column workspace. */
.mobile-dock,.mobile-expand,.mobile-library-title{display:none}
@media screen {
 body.mobile-layout{
  height:100vh;height:var(--mobile-viewport-height,100dvh);min-height:0;
  display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:none;
  padding-top:env(safe-area-inset-top,0px);
  background:var(--page);
 }
 body.mobile-layout>header{
  flex:none;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;
  gap:5px 10px;padding:7px max(10px,env(safe-area-inset-right,0px)) 8px max(10px,env(safe-area-inset-left,0px));
  align-items:center
 }
 .mobile-layout header .brand{min-width:0;gap:6px}
 .mobile-layout header .brand .brand-mark{width:31px;flex:none}
 .mobile-layout header .brand .brand-wordmark{width:112px;max-width:100%;height:auto}
 .mobile-layout header .brand .brand-copy{min-width:0}
 .mobile-layout header .brand .brand-copy small{display:none}
 .mobile-layout .theme-switch{
  margin:0;min-width:0;max-width:100%;min-height:36px;
  gap:5px;padding:5px 8px;font-size:12px;white-space:nowrap;
 }
 .mobile-layout #activeTheme{overflow:hidden;text-overflow:ellipsis;max-width:42vw}
 .mobile-layout .theme-dot{width:7px;height:7px;flex:none}
 .mobile-layout header .tools{
  grid-column:1/-1;display:flex;flex-wrap:nowrap;gap:5px;
  width:100%;min-width:0;margin:0;overflow-x:auto;overflow-y:hidden;
  scrollbar-width:none;overscroll-behavior-x:contain;
 }
 .mobile-layout header .tools::-webkit-scrollbar{display:none}
 .mobile-layout .tools>button,.mobile-layout #exportWrap{flex:1 0 44px;min-width:44px}
 .mobile-layout .tools>button,.mobile-layout #exportButton{
  height:44px;min-height:44px;min-width:44px;padding:0 5px;gap:2px;border-radius:9px
 }
 .mobile-layout #exportButton{width:100%}
 .mobile-layout .tools>button>span,.mobile-layout #exportButton>span{display:none}
 .mobile-layout .toolbar-icon{width:21px;height:21px}
 .mobile-layout .toolbar-chevron{width:10px;height:10px}
 .mobile-layout .tools button:focus-visible{outline-offset:-3px}
 .mobile-layout .layout{
  flex:1 1 0;display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr);gap:7px;align-items:stretch;
  width:100%;max-width:none;min-height:0;margin:0;
  padding:7px max(7px,env(safe-area-inset-right,0px)) 7px max(7px,env(safe-area-inset-left,0px));overflow:hidden
 }
 .mobile-layout .layout main{display:contents}
 .mobile-layout .card-panel{
  grid-row:1;grid-column:1;min-width:0;display:flex;flex-direction:column;align-self:start;
  border-radius:11px;box-shadow:0 1px 3px #2229430b
 }
 .mobile-layout .card-panel .stagebar{
  min-height:44px;flex:none;gap:5px;padding:3px 7px;
 }
 .mobile-layout .stage-title .tag{display:none}
 .mobile-layout .stage-title strong{font-size:14px;line-height:1.3}
 .mobile-layout .stage-title{min-width:0;margin-right:auto}
 .mobile-layout .stagebar #play{font-size:12px;min-height:36px;padding:5px 9px}
 .mobile-layout .mobile-expand{
  display:grid;place-items:center;flex:none;width:37px;height:36px;min-height:36px;padding:0;
  border-color:var(--accent-border);background:var(--accent-soft);color:var(--accent-deep)
 }
 .mobile-layout .mobile-expand svg{width:20px;height:20px}
 .mobile-layout .mobile-expand[aria-pressed=true] svg{transform:rotate(180deg)}
 .mobile-layout .card-panel .stage{flex:none;min-width:0;padding:0;border:0}
 .mobile-layout .card-panel .stage canvas{width:100%;height:auto;aspect-ratio:16/9;max-width:100%;display:block}
 .mobile-layout .card-panel .stagefoot{
  flex:none;padding:3px 7px;gap:5px;min-height:39px;flex-wrap:nowrap;
  overflow-x:auto;scrollbar-width:none;white-space:nowrap
 }
 .mobile-layout .stagefoot::-webkit-scrollbar{display:none}
 .mobile-layout .stagefoot button{min-height:34px;font-size:11.5px;padding:5px 8px;flex:none}
 .mobile-layout .stagefoot #test{margin-left:auto}
 .mobile-layout .stagefoot #objectMenu{display:none}
 .mobile-layout .stagefoot #snowLabel{flex:none;display:flex;align-items:center;gap:5px;font-size:12px;min-height:34px}
 .mobile-layout .stagefoot #snowLabel.hidden{display:none!important}
 .mobile-layout .stagefoot input[type=checkbox]{width:18px;height:18px;margin:0}
 /* A single scroll surface per tool panel. No competing nested scroller.
    This makes categories, search and every tile reachable by touch. */
 .mobile-layout .layout #designPanel,.mobile-layout .layout #propertiesPanel,.mobile-layout .layout #layerPanel{
  grid-row:2;grid-column:1;display:none;min-height:0;min-width:0;max-height:none;
  overflow:auto;overscroll-behavior:contain;scrollbar-gutter:auto;
  align-self:stretch;border-radius:11px;scroll-padding:10px
 }
 .mobile-layout[data-mobile-panel=design] #designPanel,
 .mobile-layout[data-mobile-panel=properties] #propertiesPanel,
 .mobile-layout[data-mobile-panel=layers] #layerPanel{display:block}
 .mobile-layout #designPanel>h2,.mobile-layout #designPanel>.tabs{display:none}
 .mobile-layout .mobile-library-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 4px;min-height:33px}
 .mobile-layout .mobile-library-title strong{font-weight:750;font-size:14px}
 .mobile-layout .mobile-library-title span{font-size:11px;color:var(--muted);text-align:right}
 .mobile-layout #libhint{margin:3px 10px 4px;padding:0;font-size:11px;line-height:1.3}
 .mobile-layout #designPanel>.library-scroll{
  display:block;flex:none;contain:none;height:auto;min-height:0;max-height:none;overflow:visible;scrollbar-gutter:auto
 }
 .mobile-layout .library-scroll>.library{height:auto;min-height:0;max-height:none;overflow:visible;padding:6px 8px 10px;gap:6px}
 .mobile-layout .library-scroll>.library[data-library-view=templates],
 .mobile-layout .library-scroll>.library[data-library-view=backgrounds]{grid-template-columns:repeat(2,minmax(0,1fr))}
 .mobile-layout .library-scroll>.library[data-library-view=assets]{grid-template-columns:repeat(3,minmax(0,1fr))}
 .mobile-layout .library-scroll>.library[data-library-view=text]{grid-template-columns:1fr}
 .mobile-layout .library-scroll .tile.wide:not(.empty-card-tile){grid-column:auto}
 .mobile-layout .library-scroll .tile{padding:5px;min-height:44px;font-size:11px}
 .mobile-layout .library-scroll .tile.wide canvas{aspect-ratio:16/9}
 .mobile-layout .library-scroll .empty-card-tile{grid-column:1/-1!important;min-height:40px}
 .mobile-layout .library[data-library-view=text]>button{min-height:44px;text-align:left;padding:9px 11px;font-size:14px}
 .mobile-layout .library-heading{padding:5px 2px;min-height:25px;font-size:12px}
 .mobile-layout #category{margin:4px 8px;width:calc(100% - 16px);height:40px;font-size:16px;padding:6px}
 .mobile-layout #assetOptions{padding:3px 8px 0!important}
 .mobile-layout #assetOptions input[type=search]{font-size:16px;min-height:40px}
 .mobile-layout #assetOptions label{font-size:12px;margin:5px 0!important;min-height:28px}
 .mobile-layout #assetOptions label input{width:19px;height:19px}
 .mobile-layout .world-filter{margin:4px 8px;padding:6px}
 .mobile-layout .world-filter select{font-size:16px;min-height:40px}
 .mobile-layout #propertiesPanel h2{font-size:15px;padding:10px 11px 6px}
 .mobile-layout #propertiesPanel .controls{padding:0 8px 8px}
 .mobile-layout #propertiesPanel .no-selection{font-size:13px;margin:5px 12px 14px}
 .mobile-layout .object-name{margin:0 0 6px;padding:8px 10px}
 .mobile-layout .property-group{margin-bottom:7px;padding:8px 10px}
 .mobile-layout .property-group h3{font-size:12px;margin:0 0 7px}
 .mobile-layout .property-group .field{font-size:13px}
 .mobile-layout .property-group input:not([type=range]):not([type=checkbox]):not([type=color]),.mobile-layout .property-group select,.mobile-layout .property-group textarea{font-size:16px;min-height:40px}
 .mobile-layout .property-group input[type=range]{height:30px;touch-action:pan-y}
 .mobile-layout .property-group button{min-height:43px}
 .mobile-layout .property-group .check{min-height:32px;font-size:13px}
 .mobile-layout .property-group .check input{width:20px;height:20px}
 .mobile-layout .swatches{gap:5px}
 .mobile-layout .swatches button{min-height:44px}
 .mobile-layout .property-group #sizeNumber,.mobile-layout .property-group #rotNumber,.mobile-layout .property-group #speedNumber,.mobile-layout .property-group #delayNumber{height:34px;min-height:34px;width:82px}
 .mobile-layout .layer-heading{padding:9px 10px 3px}
 .mobile-layout .layer-panel .layers{min-height:0;max-height:none;padding:0 7px 8px;overflow:visible}
 .mobile-layout .layer-panel .layer-help{margin:3px 10px 6px;font-size:11px}
 .mobile-layout .layers .layer-row{grid-template-columns:34px minmax(0,1fr) 42px 42px;min-height:49px;gap:3px}
 .mobile-layout .layers .layer-row button{min-height:42px;height:42px}
 .mobile-layout .layers .layer-select span{font-size:13px}
 .mobile-layout .mobile-dock{
  flex:none;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;
  padding:5px max(4px,env(safe-area-inset-right,0px)) 4px max(4px,env(safe-area-inset-left,0px));
  background:var(--surface);border-top:1px solid var(--accent-border);
  box-shadow:0 -3px 14px #22294312;z-index:10
 }
 .mobile-layout .mobile-dock button{
  position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;
  padding:5px 0 4px;min-width:0;min-height:51px;background:transparent;
  border:1px solid transparent;border-radius:9px;color:var(--muted);font-size:10px;
  font-weight:650;line-height:1.15;white-space:nowrap;letter-spacing:-.035em
 }
 .mobile-layout .mobile-dock button svg{height:22px;width:22px;flex:none}
 .mobile-layout .mobile-dock button[aria-pressed=true]{color:var(--accent-deep);background:var(--accent-soft);border-color:var(--accent-border);font-weight:750}
 .mobile-layout .mobile-dock button[aria-pressed=true] svg{stroke-width:2.1}
 .mobile-layout .mobile-dock button:active{background:var(--panel-tint)}
 .mobile-layout .mobile-selection-dot{display:none;position:absolute;right:calc(50% - 17px);top:5px;width:8px;height:8px;border:1px solid var(--surface);border-radius:50%;background:var(--accent)}
 .mobile-layout.has-selection .mobile-selection-dot{display:block}
 .mobile-layout .site-footer{
  flex:none;margin:0;gap:6px;padding:0 max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));
  min-height:26px;font-size:10px;align-items:center;justify-content:space-between;flex-wrap:nowrap
 }
 .mobile-layout .site-footer>span,.mobile-layout .site-footer .family>span{display:none}
 .mobile-layout .site-footer .family img{width:77px;height:25px}
 .mobile-layout .site-footer nav{padding:0;gap:12px;white-space:nowrap}
 .mobile-layout .site-footer a{display:flex;min-height:26px;align-items:center}
 .mobile-layout .status-toast{bottom:calc(93px + env(safe-area-inset-bottom,0px));right:8px;max-width:calc(100vw - 16px);font-size:12px;padding:9px 11px}
 .mobile-layout[data-mobile-expanded=true] .card-panel>.stage,
 .mobile-layout[data-mobile-expanded=true] .card-panel>.stagefoot,
 .mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .card-panel>.stage,
 .mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .card-panel>.stagefoot{display:none}
 .mobile-layout[data-mobile-expanded=true] .mobile-expand{background:var(--accent-deep);color:white}
 .mobile-layout.mobile-keyboard .site-footer{display:none}
 .mobile-layout.mobile-keyboard .mobile-dock{padding-bottom:4px}
 .mobile-layout #preview{max-width:calc(100vw - 14px);max-height:calc(100dvh - 14px);padding:8px;border-radius:13px}
 .mobile-layout #preview .stagebar{gap:4px;padding:6px 3px}
 .mobile-layout #preview .stagebar strong{flex:1;min-width:90px;font-size:12px}
 .mobile-layout #preview .stagebar button{min-height:38px;font-size:12px;padding:6px 8px}
 .mobile-layout #previewCanvas{width:100%;height:auto;aspect-ratio:16/9}
 .mobile-layout #preview .previewHelp{font-size:12px;line-height:1.4}
 .mobile-layout dialog input[type=text],.mobile-layout dialog input[type=search],.mobile-layout dialog textarea,.mobile-layout dialog select{font-size:16px}
 .mobile-layout #effectsDialog button,.mobile-layout #newDialog button,.mobile-layout #objectActions button{min-height:44px}
 body.choosing-theme>.mobile-dock{filter:blur(5px);pointer-events:none;user-select:none}
}
@media screen and (max-width:350px){
 .mobile-layout .mobile-dock button{font-size:9px;letter-spacing:-.045em}
 .mobile-layout header .brand .brand-mark{width:27px}
 .mobile-layout header .brand .brand-wordmark{width:98px}
 .mobile-layout .theme-switch{font-size:11px;padding:5px 6px}
 .mobile-layout .stagefoot button{font-size:10.5px;padding:4px 6px}
}
/* In phone landscape, show card and the selected tool side-by-side. The
   canvas fits inside the available stage without changing its aspect ratio. */
@media screen and (orientation:landscape) and (max-width:850px), screen and (orientation:landscape) and (max-width:1000px) and (max-height:550px){
 body.mobile-layout>header{grid-template-columns:auto auto minmax(0,1fr);gap:7px;padding-top:5px;padding-bottom:5px}
 .mobile-layout header .tools{grid-column:3;gap:4px}
 .mobile-layout header .brand .brand-mark{width:27px}
 .mobile-layout header .brand .brand-wordmark{width:95px}
 .mobile-layout #activeTheme{max-width:20vw}
 .mobile-layout .tools>button,.mobile-layout #exportWrap{flex:1 0 44px}
 .mobile-layout .layout{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
 .mobile-layout .card-panel{grid-column:1;grid-row:1;align-self:stretch;min-height:0}
 .mobile-layout .card-panel .stage{flex:1 1 0;min-height:0;container-type:size;display:flex;align-items:center;justify-content:center}
 .mobile-layout .card-panel .stage canvas{width:min(100cqw,177.777778cqh);height:auto}
 .mobile-layout .layout #designPanel,.mobile-layout .layout #propertiesPanel,.mobile-layout .layout #layerPanel{grid-row:1;grid-column:2}
 .mobile-layout[data-mobile-expanded=true] .layout,
 .mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .layout{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}
 .mobile-layout[data-mobile-expanded=true] .card-panel,
 .mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .card-panel{grid-row:1;grid-column:1}
 .mobile-layout[data-mobile-expanded=true] .layout #designPanel,.mobile-layout[data-mobile-expanded=true] .layout #propertiesPanel,.mobile-layout[data-mobile-expanded=true] .layout #layerPanel,
 .mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .layout #designPanel,.mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .layout #propertiesPanel,.mobile-layout.mobile-keyboard:not(.mobile-inline-edit) .layout #layerPanel{grid-row:2;grid-column:1}
 .mobile-layout .mobile-dock{padding-top:3px;padding-bottom:3px}
 .mobile-layout .mobile-dock button{min-height:43px;flex-direction:row;gap:5px;font-size:11px}
 .mobile-layout .mobile-dock button svg{width:19px;height:19px}
 .mobile-layout .mobile-selection-dot{right:calc(50% + 19px);top:4px}
 .mobile-layout .site-footer{min-height:22px}
 .mobile-layout .site-footer .family img{height:22px}
 .mobile-layout .site-footer a{min-height:22px}
 .mobile-layout .status-toast{bottom:calc(70px + env(safe-area-inset-bottom,0px))}
}
/* Avoid mobile shell/overflow declarations when printing the QR sheet. */
@media print{body.mobile-layout{display:block!important;height:auto!important;overflow:visible!important;padding:0!important}}
@media screen {
 .mobile-layout .mobile-expand{display:inline-flex;width:auto;gap:4px;padding:4px 7px;font-size:11px;white-space:nowrap}
 .mobile-layout .mobile-expand svg{width:17px;height:17px;flex:none}
 .mobile-layout .mobile-library-title span:empty{display:none}
}

/* Keep the search and category side-by-side, leaving room for artwork. */
@media screen{
 .mobile-layout[data-mobile-panel=design][data-mobile-library=assets] #designPanel{
  display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);grid-auto-rows:max-content;align-content:start;column-gap:0
 }
 .mobile-layout[data-mobile-library=assets] #designPanel>.mobile-library-title,
 .mobile-layout[data-mobile-library=assets] #designPanel>#worldFilter,
 .mobile-layout[data-mobile-library=assets] #designPanel>.library-scroll{grid-column:1/-1}
 .mobile-layout[data-mobile-library=assets] #designPanel>#category{margin:3px 3px 2px 8px;width:calc(100% - 11px);min-width:0}
 .mobile-layout[data-mobile-library=assets] #assetOptions:not(.hidden){display:contents}
 .mobile-layout[data-mobile-library=assets] #assetSearch{width:calc(100% - 11px)!important;min-width:0;margin:3px 8px 2px 3px}
 .mobile-layout[data-mobile-library=assets] #assetOptions label{grid-column:1/-1;margin:1px 8px 0!important;min-height:28px;font-size:11px}
 .mobile-layout[data-mobile-library=assets] #libhint{display:none}
 .mobile-layout[data-mobile-library=assets] .library-scroll>.library{padding-top:3px}
 .mobile-layout[data-mobile-library=assets] .library-heading{padding-top:3px;padding-bottom:3px;min-height:20px}
 .mobile-layout #worldFilter:not(.hidden){flex-direction:row;align-items:center;gap:6px;padding:3px 6px}
 .mobile-layout #worldFilter:not(.hidden) select{flex:1;min-width:0}
 .mobile-layout .direct-handle{width:36px;height:36px;min-width:36px;min-height:36px;border-radius:10px}
 .mobile-layout #play{font-variant-emoji:text}
}

.mobile-play-icon{display:none}
@media screen{
 .mobile-layout #play{display:inline-flex;align-items:center;justify-content:center;gap:4px}
 .mobile-layout #play .desktop-play-icon{display:none}
 .mobile-layout #play .mobile-play-icon{display:block;flex:none;width:13px;height:13px}
 .mobile-layout .mobile-expand[aria-pressed=true]:hover,
 .mobile-layout .mobile-expand[aria-pressed=true]:focus-visible{background:var(--accent-deep);color:#fff;border-color:var(--accent-deep)}
}

/* Native share: the card actions reflect device-specific priorities. */
#shareDialog .share-actions{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
 margin:12px 0 10px;align-items:stretch;
}
#shareDialog .share-actions>.share-action{
 display:inline-flex;align-items:center;justify-content:center;text-align:center;gap:7px;
 min-width:0;width:100%;min-height:44px;padding:10px 9px;margin:0;
 line-height:1.25;font-size:13px;font-weight:700;border-radius:9px;
 border:1px solid var(--accent-border);background:var(--accent-soft);
 color:var(--accent-deep);text-decoration:none;cursor:pointer;
}
#shareDialog .share-actions>.share-action svg{width:18px;height:18px;flex:none}
#shareDialog .share-actions>.share-action:hover:not(:disabled){background:var(--panel-tint);border-color:var(--accent)}
#shareDialog .share-actions>.share-action:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#shareDialog .share-actions:not(.native-first)>#printShare,
#shareDialog .share-actions.native-first>#nativeShare{
 grid-column:1/-1;min-height:46px;font-size:14px;
 color:#fff;background:var(--accent);border-color:var(--accent);
}
#shareDialog .share-actions:not(.native-first)>#printShare:hover:not(:disabled),
#shareDialog .share-actions.native-first>#nativeShare:hover:not(:disabled){
 background:var(--accent-deep);border-color:var(--accent-deep)
}
#shareDialog .share-actions:not(.has-native-share)>#openPublic{grid-column:1/-1}
#shareDialog .share-actions .print-label-short{display:none}
#shareDialog .share-actions.native-first .print-label-short{display:inline}
#shareDialog .share-actions.native-first .print-label-long{display:none}
#shareDialog #nativeShareStatus{font-size:12px;line-height:1.45;color:var(--accent-deep);margin:0 0 12px}
#shareDialog #nativeShareStatus:empty{display:none}

/* 1.11.3 – Phone theme chooser: one large preview, reachable world
   navigation, and a simple footer. The desktop chooser keeps three cards. */
#welcomeTitle:focus{outline:none}
@media screen{
 .mobile-layout #themeDialog{
  width:min(460px,calc(100vw - 22px));max-width:calc(100vw - 22px);
  max-height:calc(100vh - 22px);max-height:calc(100dvh - 22px);
  padding:16px;border-radius:17px;overflow:auto;scrollbar-width:thin;
  overscroll-behavior:contain;
 }
 .mobile-layout #themeDialog .welcome-header{align-items:center;gap:10px}
 .mobile-layout #themeDialog .welcome-header img{width:156px;height:auto}
 .mobile-layout #themeDialog #closeThemes{width:42px;min-width:42px;height:42px;min-height:42px;padding:0;font-size:18px}
 .mobile-layout #themeDialog .welcome-copy{margin:17px 0 15px}
 .mobile-layout #themeDialog .welcome-copy h1{font-size:clamp(23px,6.45vw,28px);line-height:1.18;letter-spacing:-.04em;margin:0 0 7px}
 .mobile-layout #themeDialog .welcome-copy>p:last-child{font-size:14px;line-height:1.45}
 .mobile-layout #themeDialog .theme-carousel{display:flex;flex-direction:column;min-width:0}
 .mobile-layout #themeDialog .theme-list{
  order:0;display:grid;grid-template-columns:minmax(0,1fr);gap:0;
  touch-action:pan-y;
 }
 .mobile-layout #themeDialog .theme-choice{
  display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;
  width:100%;height:auto;min-width:0;padding:0;overflow:hidden;border-radius:14px;
  box-shadow:0 2px 8px #2229430d;
 }
 .mobile-layout #themeDialog .theme-choice canvas{
  display:block;width:100%;height:auto;max-width:none;min-height:0;aspect-ratio:16/9;
  object-fit:contain;align-self:stretch;flex:none;border:0;border-bottom:3px solid var(--world);
 }
 .mobile-layout #themeDialog .theme-choice .world-info{
  display:flex;flex:1;width:100%;min-width:0;padding:13px 14px 14px;gap:7px;
 }
 .mobile-layout #themeDialog .world-info strong{font-size:21px;line-height:1.2;letter-spacing:-.03em}
 .mobile-layout #themeDialog .world-info span:not(.world-action){
  font-size:14px;line-height:1.45;min-height:0;font-weight:500;
 }
 .mobile-layout #themeDialog .theme-choice .world-action{
  display:flex;align-items:center;justify-content:center;text-align:center;
  margin-top:4px;padding:9px 11px;min-height:42px;width:100%;
  color:var(--world);background:var(--world-soft);border-radius:8px;
  font-size:14px;font-weight:750;line-height:1.3;
 }
 .mobile-layout #themeDialog .carousel-caption{order:1;justify-content:center;margin:12px 0 0}
 .mobile-layout #themeDialog .carousel-controls{justify-content:center;gap:13px;font-size:14px}
 .mobile-layout #themeDialog .carousel-controls button{width:46px;height:46px;min-height:46px;font-size:27px;border-radius:11px}
 .mobile-layout #themeDialog #themePosition{min-width:70px}
 .mobile-layout #themeDialog .carousel-bottom{display:none}
 .mobile-layout #themeDialog .welcome-footer{
  flex-direction:column;justify-content:center;align-items:center;gap:12px;
  padding-top:13px;font-size:12px;
 }
 .mobile-layout #themeDialog .welcome-footer button{width:100%;min-height:44px;font-size:14px;padding:9px 12px}
 .mobile-layout #themeDialog .welcome-footer .welcome-promise{font-size:12px;text-align:center;line-height:1.45}
}
@media screen and (max-width:350px){
 .mobile-layout #themeDialog{padding:13px}
 .mobile-layout #themeDialog .welcome-header img{width:142px}
 .mobile-layout #themeDialog .welcome-copy{margin:13px 0 12px}
 .mobile-layout #themeDialog .welcome-copy h1{font-size:22px}
 .mobile-layout #themeDialog .theme-choice .world-info{padding:11px 12px 12px;gap:6px}
 .mobile-layout #themeDialog .world-info strong{font-size:20px}
 .mobile-layout #themeDialog .world-info span:not(.world-action){font-size:13px}
 .mobile-layout #themeDialog .carousel-caption{margin-top:9px}
 .mobile-layout #themeDialog .welcome-footer{gap:9px;padding-top:11px}
}
/* On short landscape phone screens a horizontal hero card is more useful
   than a very tall image. Keep all artwork in its original proportions. */
@media screen and (orientation:landscape) and (max-width:1000px) and (max-height:550px){
 .mobile-layout #themeDialog[open]{
  display:grid;grid-template-columns:140px minmax(0,1fr);align-items:center;gap:9px 12px;
  width:min(720px,calc(100vw - 22px));padding:12px 14px;border-radius:14px;
 }
 .mobile-layout #themeDialog .welcome-header{grid-column:1;grid-row:1}
 .mobile-layout #themeDialog .welcome-header img{width:128px}
 .mobile-layout #themeDialog #closeThemes{position:absolute;right:12px;top:10px;width:35px;min-width:35px;height:35px;min-height:35px}
 .mobile-layout #themeDialog .welcome-copy{grid-column:2;grid-row:1;margin:0;padding-right:36px}
 .mobile-layout #themeDialog .welcome-copy h1{font-size:23px;margin-bottom:3px}
 .mobile-layout #themeDialog .welcome-copy>p:last-child{font-size:13px}
 .mobile-layout #themeDialog .theme-carousel{grid-column:1/-1;grid-row:2}
 .mobile-layout #themeDialog .theme-choice{display:grid;grid-template-columns:50% minmax(0,1fr);align-items:center}
 .mobile-layout #themeDialog .theme-choice canvas{width:100%;height:auto;align-self:center;border:0;border-right:3px solid var(--world)}
 .mobile-layout #themeDialog .theme-choice .world-info{padding:10px 12px;gap:6px}
 .mobile-layout #themeDialog .world-info strong{font-size:20px}
 .mobile-layout #themeDialog .world-info span:not(.world-action){font-size:13px}
 .mobile-layout #themeDialog .theme-choice .world-action{min-height:38px}
 .mobile-layout #themeDialog .carousel-caption{margin-top:7px}
 .mobile-layout #themeDialog .carousel-controls button{width:42px;height:42px;min-height:42px}
 .mobile-layout #themeDialog #themeError{grid-column:1/-1}
 .mobile-layout #themeDialog .welcome-footer{grid-column:1/-1;flex-direction:row;justify-content:space-between;padding-top:0;gap:10px}
 .mobile-layout #themeDialog .welcome-footer button{width:auto;min-height:40px;font-size:13px}
 .mobile-layout #themeDialog .welcome-footer .welcome-promise{text-align:right;font-size:11px}
}
/* Fit the complete first chooser screen, including its promise, on common
   iPhone-sized viewports without shrinking the image or descriptive text. */
@media screen and (orientation:portrait){
 .mobile-layout #themeDialog .welcome-copy{margin-top:12px;margin-bottom:12px}
 .mobile-layout #themeDialog .theme-choice .world-info{padding:11px 14px 12px;gap:6px}
 .mobile-layout #themeDialog .world-info span:not(.world-action){min-height:2.9em}
 .mobile-layout #themeDialog .carousel-caption{margin-top:10px}
 .mobile-layout #themeDialog .welcome-footer{gap:9px;padding-top:10px}
}
/* Separate the accent rule from the canvas so the artwork itself keeps
   exactly its 16:9 content ratio. */
@media screen{
 .mobile-layout #themeDialog .theme-choice canvas{border:0}
 .mobile-layout #themeDialog .theme-choice .world-info{border-top:3px solid var(--world)}
}
@media screen and (max-width:350px) and (max-height:620px) and (orientation:portrait){
 .mobile-layout #themeDialog{padding:10px 12px}
 .mobile-layout #themeDialog .welcome-header img{width:128px}
 .mobile-layout #themeDialog .welcome-copy{margin:8px 0}
 .mobile-layout #themeDialog .welcome-copy h1{font-size:21px;line-height:1.11;margin-bottom:5px}
 .mobile-layout #themeDialog .welcome-copy>p:last-child{font-size:13px}
 .mobile-layout #themeDialog .theme-choice .world-info{padding:8px 11px 9px;gap:5px}
 .mobile-layout #themeDialog .world-info strong{font-size:19px}
 .mobile-layout #themeDialog .theme-choice .world-action{margin-top:2px;min-height:40px;padding:7px 10px}
 .mobile-layout #themeDialog .carousel-caption{margin-top:7px}
 .mobile-layout #themeDialog .carousel-controls button{width:44px;height:44px;min-height:44px}
 .mobile-layout #themeDialog .welcome-footer{gap:7px;padding-top:8px}
 .mobile-layout #themeDialog .welcome-footer button{font-size:13px}
 .mobile-layout #themeDialog .welcome-footer .welcome-promise{font-size:11px}
}
@media screen and (orientation:landscape) and (max-width:1000px) and (max-height:550px){
 .mobile-layout #themeDialog[open]{width:min(700px,calc(100vw - 22px));padding:10px 14px;gap:6px 12px}
 .mobile-layout #themeDialog .theme-choice .world-info{border-top:none;border-left:3px solid var(--world)}
}
@media screen and (orientation:landscape) and (max-width:1000px) and (max-height:550px){
 .mobile-layout #themeDialog .theme-choice .world-info{align-self:stretch;justify-content:center}
}
