:root{--bg:#1c1e26;--panel:#2b2f3a;--txt:#e8eaf0;--acc:#4c8dff}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{margin:0;height:100%;overscroll-behavior:none;background:var(--bg);color:var(--txt);font-family:system-ui,sans-serif;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body{position:fixed;inset:0;overflow:hidden}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}
svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#home{position:absolute;inset:0;overflow:auto;padding:24px;touch-action:pan-y;padding-bottom:110px}
.homehead{display:flex;align-items:center;gap:12px}
.homehead h1{margin:0;font-size:28px}
.logo{width:34px;height:34px;color:var(--acc)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:22px;margin-top:24px}
.nb{position:relative;cursor:pointer}
.cover{aspect-ratio:3/4;border-radius:6px 14px 14px 6px;display:flex;align-items:center;justify-content:center;padding:14px;text-align:center;font-weight:700;font-size:19px;word-break:break-word;box-shadow:inset 8px 0 0 rgba(0,0,0,.25),0 6px 16px rgba(0,0,0,.4)}
.nb .del{position:absolute;top:6px;right:6px;width:36px;height:36px;border-radius:50%;background:rgba(0,0,0,.45)}
.nb .del svg{width:20px;height:20px}
.empty{margin-top:60px;text-align:center;opacity:.7}
.fab{position:fixed;right:28px;bottom:28px;width:64px;height:64px;border-radius:50%;background:var(--acc);box-shadow:0 6px 18px rgba(0,0,0,.5)}
.fab svg{width:32px;height:32px;stroke:#fff}
#editor{position:absolute;inset:0;touch-action:none}
.top{position:absolute;left:0;right:0;top:0;height:56px;display:flex;align-items:center;gap:4px;padding:0 8px;background:var(--panel);z-index:5;overflow-x:auto}
.grow{flex:1}
.ttl{font-weight:700;font-size:17px;padding:8px 10px;max-width:30vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lbl{min-width:54px;text-align:center;font-size:14px}
.ib{width:46px;height:46px;min-width:46px;border-radius:12px;display:flex;align-items:center;justify-content:center}
.ib svg{width:26px;height:26px}
.ib.on{background:var(--acc);color:#fff}
.ib:active,.chip:active{filter:brightness(1.3)}
.sep{width:1px;height:28px;background:rgba(255,255,255,.18);margin:0 6px;flex:none}
.chip{padding:9px 14px;border-radius:20px;background:rgba(255,255,255,.1);font-size:13px;white-space:nowrap}
.chip[aria-pressed=true],.chip.pri{background:var(--acc);color:#fff}
#stage{position:absolute;left:0;right:0;top:56px;bottom:86px;display:flex;align-items:center;justify-content:center;background:#12141a;touch-action:none}
#cv{touch-action:none;background:#fff;box-shadow:0 4px 24px rgba(0,0,0,.6);display:block}
.bar{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);display:flex;align-items:center;gap:4px;padding:8px 12px;background:rgba(43,47,58,.96);border-radius:32px;box-shadow:0 8px 28px rgba(0,0,0,.55);z-index:6;max-width:98vw;overflow-x:auto}
.row{display:flex;align-items:center;gap:8px}
.row.end{justify-content:flex-end}
.sw{width:32px;height:32px;min-width:32px;border-radius:50%;border:3px solid transparent;box-shadow:0 0 0 1px rgba(255,255,255,.35)}
.sw.on{border-color:#fff;transform:scale(1.15)}
#cc{width:36px;height:36px;min-width:36px;padding:0;border:0;border-radius:50%;background:none}
dialog{border:0;border-radius:18px;background:var(--panel);color:var(--txt);padding:22px;width:min(420px,92vw)}
dialog::backdrop{background:rgba(0,0,0,.6)}
dialog h2{margin:0 0 14px}
dialog form{display:flex;flex-direction:column;gap:16px}
#nbName{padding:12px;border-radius:10px;border:1px solid #555;background:#1c1e26;color:var(--txt);font-size:16px;-webkit-user-select:text;user-select:text}

.homehead .grow{flex:1}
#drawer{position:absolute;right:0;top:56px;bottom:0;width:190px;background:var(--panel);z-index:7;display:flex;flex-direction:column;touch-action:pan-y}
.dh{display:flex;justify-content:space-around;padding:6px 2px;border-bottom:1px solid rgba(255,255,255,.12)}
.dh .ib{width:40px;min-width:40px}
#thumbs{overflow:auto;padding:10px;display:flex;flex-direction:column;gap:12px;flex:1;padding-bottom:100px}
.th{position:relative;border:3px solid transparent;border-radius:8px;cursor:pointer}
.th.on{border-color:var(--acc)}
.th canvas{width:100%;display:block;background:#fff;border-radius:4px}
.th span{position:absolute;left:6px;bottom:4px;background:rgba(0,0,0,.6);border-radius:10px;padding:1px 8px;font-size:12px}
#editor.dr #stage{right:190px}
dialog form>.chip{padding:14px;font-size:15px}
#txt{padding:12px;border-radius:10px;border:1px solid #555;background:#1c1e26;color:var(--txt);font-size:16px;font-family:inherit;-webkit-user-select:text;user-select:text}
