/* Korálkový ateliér – vzhled „vitrína": světlá aplikace, šperk na tmavém sametu. */
:root{
  --bg:#f4f1f6; --surface:#ffffff; --surface2:#eee9f2; --seg:#e7e1ec; --text:#211b29; --muted:#675f72; --muted2:#5e5669;
  --line:#e2dce8; --line2:#cfc5d8; --chart-bg:#eae5ef;
  --accent:#8a2f63; --accent-hover:#74264f; --accent-ink:#ffffff; --accent-soft:#f3e2ec; --accent-soft-ink:#6b2350;
  --stage:#251c2c; --stage-ink:#f2eaf5; --stage-muted:#bfb2c9; --stage-line:rgba(255,255,255,.2); --stage-fill:rgba(255,255,255,.08);
  --ok:#276b43; --ok-bg:#e3f2e8; --err:#a12626; --err-bg:#fbe3e3;
  --shadow:0 1px 3px rgba(33,27,41,.16); --shadow-lg:0 -8px 30px rgba(33,27,41,.18);
  --hdr:60px; --nav-h:65px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#16131b; --surface:#201c27; --surface2:#2a2532; --seg:#2a2532; --text:#ece8f1; --muted:#a49cb0; --muted2:#b3abbe;
    --line:#3a3444; --line2:#4c4558; --chart-bg:#1b1722;
    --accent:#e08ab8; --accent-hover:#eba3c8; --accent-ink:#2a0f1f; --accent-soft:#3a2234; --accent-soft-ink:#f2c0dc;
    --stage:#2b2133;
    --ok:#7fd3a0; --ok-bg:#1d3326; --err:#f3a3a3; --err-bg:#3a1d1d;
    --shadow:0 1px 3px rgba(0,0,0,.5); --shadow-lg:0 -8px 30px rgba(0,0,0,.5);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#16131b; --surface:#201c27; --surface2:#2a2532; --seg:#2a2532; --text:#ece8f1; --muted:#a49cb0; --muted2:#b3abbe;
  --line:#3a3444; --line2:#4c4558; --chart-bg:#1b1722;
  --accent:#e08ab8; --accent-hover:#eba3c8; --accent-ink:#2a0f1f; --accent-soft:#3a2234; --accent-soft-ink:#f2c0dc;
  --stage:#2b2133;
  --ok:#7fd3a0; --ok-bg:#1d3326; --err:#f3a3a3; --err-bg:#3a1d1d;
  --shadow:0 1px 3px rgba(0,0,0,.5); --shadow-lg:0 -8px 30px rgba(0,0,0,.5);
  color-scheme:dark;
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;scroll-padding-top:calc(var(--hdr) + env(safe-area-inset-top,0px))}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.45 "Bricolage Grotesque",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px))}
body.noscroll{overflow:hidden}
h1,h2,h3{margin:0}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.small{font-size:.86rem}
.muted{color:var(--muted)}
.row{display:flex;align-items:center}
.wrap{flex-wrap:wrap}
.gap{gap:8px}
svg.i{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
svg.i.sm{width:14px;height:14px;stroke-width:2.2}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* hlavička a menu */
header.top{position:sticky;top:0;z-index:30;background:var(--bg);padding-top:env(safe-area-inset-top,0px)}
.hrow{max-width:1200px;margin:0 auto;min-height:var(--hdr);display:flex;align-items:center;gap:10px;padding:8px 6px 8px 14px}
.logo{flex:none;width:38px;height:38px;border-radius:12px;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center}
.ttl{flex:1;min-width:0}
.eyebrow{font-size:.75rem;font-weight:600;color:var(--muted);line-height:1.2}
#dname{font-size:1.125rem;font-weight:800;letter-spacing:-.02em;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acct{display:flex;flex-direction:column;align-items:flex-end;gap:2px;min-width:0;text-align:right}
.sync{display:inline-flex;align-items:center;height:24px;padding:0 9px;border-radius:999px;font-size:.75rem;font-weight:700;white-space:nowrap;background:var(--surface2);color:var(--muted)}
.sync[data-state="ok"]{background:var(--ok-bg);color:var(--ok)}
.sync[data-state="off"],.sync[data-state="err"]{background:var(--err-bg);color:var(--err)}
#who{font-size:.72rem;color:var(--muted);max-width:7rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iconbtn{flex:none;width:44px;height:44px;border:0;border-radius:12px;background:transparent;color:var(--text);display:grid;place-items:center;cursor:pointer}
.iconbtn:hover{background:var(--surface2)}
.bottomnav{position:fixed;left:0;right:0;bottom:0;z-index:40;display:flex;background:var(--surface);border-top:1px solid var(--line);padding:4px 6px calc(4px + env(safe-area-inset-bottom,0px))}
.bottomnav button{flex:1;min-width:0;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:0;border-radius:12px;background:transparent;color:var(--muted2);font:inherit;font-size:.6875rem;font-weight:600;cursor:pointer}
.bottomnav button svg.i{width:24px;height:24px}
.bottomnav button.on{color:var(--accent);font-weight:800}

main{max-width:1200px;margin:0 auto;padding:0 12px 16px}
.tab{display:none}
.tab.on{display:block}

/* společné prvky */
.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px;margin-bottom:12px}
.card.plain{background:transparent;border:0;border-radius:0;padding:0;margin:0}
.lbl{font-size:1rem;font-weight:800;letter-spacing:-.01em;margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.lbl h3{font-size:inherit}
.sub{font-size:.8125rem;font-weight:700;color:var(--muted);margin:18px 2px 8px}
.pane>.sub:first-child{margin-top:4px}
.hint{font-size:.85rem;color:var(--muted);margin:8px 0 0;line-height:1.45}
.note{margin:0 0 10px;padding:10px 12px;border-radius:12px;background:var(--accent-soft);color:var(--accent-soft-ink);font-size:.875rem;font-weight:600;line-height:1.4}
.empty{color:var(--muted);font-size:.9rem;padding:6px 0}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 14px;font:inherit;font-size:.9rem;font-weight:600;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:12px;cursor:pointer;text-align:center}
.btn:hover{border-color:var(--line2)}
.btn svg.i{width:18px;height:18px}
.btn.sm{min-height:38px;padding:0 11px;font-size:.85rem}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.btn.big{min-height:52px;padding:0 18px;border-radius:14px;font-size:1rem;font-weight:700}
.btn.wide{width:100%;margin-top:16px}
.btn.on{outline:2px solid var(--accent);outline-offset:1px}
.btn.confirm,.del.confirm{background:#c62828;border-color:#c62828;color:#fff;border-radius:8px}
.del.confirm{font-size:.75rem;padding:2px 6px}
label{display:block;font-size:.875rem;color:var(--muted)}
.field{display:block;font-size:.8125rem;font-weight:700;color:var(--muted);margin:12px 0 0}
.field b{color:var(--text)}
label.inl{display:inline-flex;align-items:center;gap:8px;margin:0;color:var(--text);font-size:.9rem;font-weight:500;min-height:44px}
label.chk input{width:20px;height:20px;accent-color:var(--accent);margin:0}
input[type=number],input[type=text],input[type=password],input:not([type]),select,textarea{display:block;width:100%;min-height:44px;margin-top:6px;font:inherit;font-size:16px;font-weight:400;color:var(--text);background:var(--surface);border:1px solid var(--line2);border-radius:12px;padding:8px 12px}
textarea{min-height:96px;resize:vertical}
input[type=range]{display:block;width:100%;margin:10px 0 4px;accent-color:var(--accent)}
input[type=color]{display:block;width:100%;height:44px;margin-top:6px;border:1px solid var(--line2);border-radius:12px;background:var(--surface);padding:3px}
.fields2{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.fields2 .chk{margin-top:28px}
.inrow{display:flex;gap:8px;align-items:stretch;margin-top:6px}
.inrow input{margin:0;flex:1;min-width:0}
.inrow .btn{flex:none}
.seg{display:flex;gap:4px;padding:4px;background:var(--seg);border-radius:14px}
.seg button{flex:1;min-width:0;min-height:40px;padding:0 6px;border:0;border-radius:10px;background:transparent;color:var(--muted2);font:inherit;font-size:.875rem;font-weight:700;cursor:pointer}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.chip{display:inline-flex;align-items:center;gap:6px;min-height:36px;font:inherit;font-size:.86rem;padding:4px 12px 4px 5px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--text);cursor:pointer}
.chip.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.dot{width:24px;height:24px;border-radius:50%;flex:none;display:inline-block;box-shadow:inset 0 -2px 0 rgba(0,0,0,.22),inset 0 1.5px 0 rgba(255,255,255,.35),0 0 0 1px rgba(0,0,0,.12)}
details.grp{margin-top:12px;border-top:1px solid var(--line);padding-top:4px}
details.grp summary{cursor:pointer;font-weight:700;font-size:.9rem;min-height:40px;display:flex;align-items:center}
.gal{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.ico{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:72px;min-height:64px;font:inherit;font-size:.72rem;padding:8px 3px;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:12px;cursor:pointer}
.ico.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
canvas{display:block}

/* ateliér: vitrína s náhledem */
.dlayout{display:block}
.stagecol{position:sticky;top:calc(var(--hdr) + env(safe-area-inset-top,0px));z-index:20;margin:0 -12px;padding:0 12px 10px;background:var(--bg)}
.stage{position:relative;height:clamp(210px,36vh,300px);border-radius:24px;background:var(--stage);overflow:hidden}
.stage canvas{position:absolute;inset:0;margin:auto;cursor:grab;touch-action:pan-y}
.stage canvas:active{cursor:grabbing}
.schip{position:absolute;left:10px;top:10px;z-index:2;height:44px;display:inline-flex;align-items:center;gap:6px;padding:0 12px 0 10px;border-radius:999px;border:1px solid var(--stage-line);background:var(--stage-fill);color:var(--stage-ink);font:inherit;font-size:.8125rem;font-weight:700;cursor:pointer;max-width:calc(100% - 170px)}
.schip svg.i:first-child{width:16px;height:16px}
.schip span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.viewseg{position:absolute;right:10px;top:10px;z-index:2;height:44px;display:flex;gap:2px;padding:3px;border-radius:999px;border:1px solid var(--stage-line);background:var(--stage-fill)}
.viewseg button{height:36px;padding:0 12px;border:0;border-radius:999px;background:transparent;color:var(--stage-ink);font:inherit;font-size:.8125rem;font-weight:700;cursor:pointer}
.viewseg button.on{background:var(--stage-ink);color:#251c2c}
.stageinfo{position:absolute;left:16px;right:64px;bottom:14px;z-index:2;font-size:.75rem;font-weight:600;color:var(--stage-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.spinbtn{position:absolute;right:8px;bottom:6px;z-index:2;width:44px;height:44px;margin:0;border-radius:50%;background:var(--stage-fill);color:var(--stage-ink);display:grid;place-items:center;cursor:pointer}
.spinbtn input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.spinbtn svg.i{width:18px;height:18px;grid-area:1/1}
#spin:checked~.i-play,#spin:not(:checked)~.i-pause{display:none}
.spinbtn:focus-within{outline:2px solid var(--stage-ink);outline-offset:2px}
.dtabs{margin:2px 0 12px}
.pane{display:none;padding-bottom:8px}
.pane.on{display:block}

/* vzory */
.pgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ptile{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:6px;min-height:88px;padding:10px 4px 8px;border-radius:14px;border:2px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:.8125rem;font-weight:600;cursor:pointer}
.ptile:hover{border-color:var(--line2)}
.ptile.on{border-color:var(--accent)}
.ptile canvas{max-width:100%}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}

/* barvy */
.setgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.setchip{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-height:56px;padding:9px 11px;text-align:left;font:inherit;font-size:.82rem;font-weight:600;border:2px solid var(--line);background:var(--surface);color:var(--text);border-radius:14px;cursor:pointer}
.setchip.on{border-color:var(--accent)}
.setchip .sd{display:flex;padding-right:5px}
.setchip .sd i{width:20px;height:20px;border-radius:50%;margin-right:-5px;border:2px solid var(--surface);box-shadow:inset 0 -2px 0 rgba(0,0,0,.2)}
.palgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px}
.sw{position:relative;display:flex;align-items:center;gap:8px;min-height:44px;padding:6px;text-align:left;font:inherit;font-size:.84rem;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--text);cursor:pointer}
.sw.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.sw .nm{line-height:1.15}
.sw .cd{color:var(--muted);font-size:.76rem}
.sw .ord{position:absolute;top:-6px;right:-6px;width:20px;height:20px;display:grid;place-items:center;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-size:.72rem;font-weight:700}
.sw .del{margin-left:auto;padding:0 4px;color:var(--muted);font-size:1rem}
.addcolor .btn{margin-top:12px}

/* schéma */
.toolrow{display:flex;gap:6px}
.toolbtn{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:58px;padding:4px 2px;border-radius:14px;border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:.75rem;font-weight:600;cursor:pointer}
.toolbtn svg.i{width:20px;height:20px}
.toolbtn.on{border:2px solid var(--accent);background:var(--accent-soft);color:var(--accent-soft-ink);font-weight:700}
.toggles{display:flex;flex-wrap:wrap;gap:0 16px;margin-top:4px}
.chartwrap{overflow:auto;max-height:60vh;background:var(--chart-bg);border-radius:14px;padding:6px;margin-top:8px;touch-action:pan-x pan-y}
.chartwrap.draw canvas{touch-action:none}
table{width:100%;border-collapse:collapse;font-size:.9rem}
td{padding:7px 4px;border-bottom:1px solid var(--line);vertical-align:middle}
td.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.resize{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px}
.resize .small{margin-left:4px}

/* lišta s akcí */
.actionbar{position:sticky;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px));z-index:25;display:flex;align-items:center;gap:12px;margin:8px -12px 0;padding:10px 12px 10px 16px;background:var(--surface);border-top:1px solid var(--line)}
.asum{flex:1;min-width:0}
.asum b{display:block;font-size:.9rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sumdots{display:flex;gap:4px;margin-top:5px}
.sumdots .dot{width:16px;height:16px}

/* navlékání */
.wgrid{display:block;padding-top:8px}
.stephead{font-size:1.75rem;font-weight:800;letter-spacing:-.03em;line-height:1.15}
.pbar{height:8px;margin:12px 0 14px;border-radius:4px;background:var(--line);overflow:hidden}
.pbar i{display:block;height:100%;width:0;border-radius:4px;background:var(--accent);transition:width .2s}
.wcard{padding:16px}
.stepdir{display:inline-flex;align-items:center;min-height:34px;padding:4px 12px;border-radius:999px;background:var(--surface2);font-size:.875rem;font-weight:700}
.beadline{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0 4px}
.beadline i{display:block;width:36px;height:30px;border-radius:9px;box-shadow:inset 0 -3px 0 rgba(0,0,0,.24),inset 0 2px 0 rgba(255,255,255,.35),0 0 0 1px rgba(0,0,0,.14)}
.seq{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 0}
.run{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:3px 12px 3px 4px;border-radius:999px;background:var(--surface2);font-weight:700;font-size:.875rem}
.run .dot{width:22px;height:22px}
.wnav{display:flex;gap:10px;margin:4px 0 6px}
.wnav .btn{flex:1}
.wnav .btn.primary{flex:1.6}
.wchart .chartwrap{max-height:62vh}

/* inspirace */
.phead{padding:10px 2px 4px}
.phead h2{font-size:1.875rem;font-weight:800;letter-spacing:-.03em;line-height:1.1}
.phead p{margin:6px 0 0;color:var(--muted);font-size:.9rem}
.filters{display:flex;gap:6px;overflow-x:auto;margin:0 -12px;padding:10px 12px 12px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.fchip{flex:none;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:.875rem;font-weight:700;cursor:pointer}
.fchip.on{background:var(--text);border-color:var(--text);color:var(--bg)}
.igrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.icard{display:flex;flex-direction:column;align-items:stretch;padding:0;text-align:left;font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;cursor:pointer}
.icard:hover{border-color:var(--line2)}
.ist{position:relative;display:block;height:130px;background:var(--stage)}
.ist canvas{position:absolute;inset:0}
.ist .tag{position:absolute;left:8px;top:8px;display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:999px;background:rgba(255,255,255,.14);color:var(--stage-ink);font-size:.6875rem;font-weight:700}
.itx{display:block;padding:10px 12px 12px}
.itx b{display:block;font-size:.95rem;font-weight:800;letter-spacing:-.01em;line-height:1.2}
.itx .im{display:block;margin-top:3px;font-size:.75rem;color:var(--muted);line-height:1.35}
.icard.feat{grid-column:1/-1}
.icard.feat .ist{height:200px}
.ftx{position:absolute;left:18px;top:18px;bottom:16px;width:min(46%,260px);display:flex;flex-direction:column;align-items:flex-start;gap:6px;color:var(--stage-ink)}
.ftx .eyb{font-size:.75rem;font-weight:700;color:#e6c77a}
.ftx b{font-size:1.375rem;font-weight:800;letter-spacing:-.02em;line-height:1.15}
.ftx .fd{font-size:.8125rem;line-height:1.35;color:var(--stage-muted)}
.ftx .fbtn{margin-top:auto;display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border-radius:12px;background:var(--stage-ink);color:#251c2c;font-size:.875rem;font-weight:700}

/* moje návrhy */
.sgrid{display:block}
.saved{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.saved:last-child{border-bottom:0}
.saved canvas{flex:none;border-radius:6px;background:var(--chart-bg);padding:3px;box-sizing:content-box}
.saved .meta{flex:1;min-width:0}
.saved .meta b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#pwForm .btn{margin-top:14px}
#codeBox+.row{margin-top:10px}

/* panel velikosti */
.sheet{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;justify-content:flex-end}
.scrim{position:absolute;inset:0;border:0;padding:0;background:rgba(24,16,30,.5);cursor:pointer}
.sheetbody{position:relative;width:100%;max-width:640px;max-height:88vh;margin:0 auto;overflow-y:auto;background:var(--surface);border-radius:24px 24px 0 0;padding:8px 16px calc(20px + env(safe-area-inset-bottom,0px));box-shadow:var(--shadow-lg)}
.grab{width:40px;height:5px;border-radius:3px;background:var(--line2);margin:0 auto 6px}
.sheethead{display:flex;align-items:center;margin-bottom:10px}
.sheethead h2{flex:1;font-size:1.375rem;font-weight:800;letter-spacing:-.02em}
.stepper{display:flex;gap:8px;align-items:center;margin-top:10px}
.stepper button{flex:none;width:56px;height:56px;border-radius:16px;border:1px solid var(--line);background:var(--surface2);color:var(--text);font:inherit;font-size:1.5rem;cursor:pointer}
.stepper input{margin:0;min-height:56px;text-align:center;font-size:1.75rem;font-weight:800;letter-spacing:-.02em}
#quickSizes .chip{padding:4px 14px;min-height:40px;font-weight:700}

.bootmsg{max-width:520px;margin:24px auto}

@media (min-width:600px){
  .pgrid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .igrid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .setgrid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width:900px){
  :root{--hdr:64px}
  body{padding-bottom:0}
  header.top{border-bottom:1px solid var(--line);display:flex;align-items:center;max-width:none}
  header.top .hrow{flex:1;max-width:none;padding:8px 8px 8px 24px}
  .hrow{order:0}
  .bottomnav{position:static;order:1;flex:none;gap:4px;padding:0 8px;background:transparent;border:0}
  .bottomnav button{flex:none;flex-direction:row;gap:8px;min-height:44px;padding:0 14px;border-radius:999px;font-size:.9375rem}
  .bottomnav button svg.i{width:20px;height:20px}
  .bottomnav button.on{background:var(--text);color:var(--bg)}
  header.top{flex-wrap:nowrap}
  main{padding:20px 24px 32px}
  .dlayout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:24px;align-items:start}
  .stagecol{top:calc(var(--hdr) + 20px);margin:0;padding:0;background:transparent}
  .stage{height:min(560px,calc(100vh - var(--hdr) - 150px));min-height:360px}
  .actionbar{bottom:0;margin:16px 0 0;border:1px solid var(--line);border-radius:18px}
  .wgrid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
  .igrid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .icard.feat{grid-column:span 2}
  .sgrid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
  .sheet{justify-content:center;padding:24px}
  .sheetbody{border-radius:24px;max-height:86vh;padding-bottom:20px}
  .grab{display:none}
}
@media (max-width:899px){
  header.top{display:block}
}
@media (max-width:380px){
  .actions{grid-template-columns:1fr}
  .toolrow{flex-wrap:wrap}
  .toolbtn{flex-basis:30%}
}
@media (prefers-reduced-motion:reduce){.pbar i{transition:none}}
