  :root { --ui-bg:#eef0f4; --ui-panel:#fff; --ui-ink:#1d2330; --ui-mute:#667085; --ui-line:#d8dce6; --ui-acc:#3b5bdb; }
  @media (prefers-color-scheme: dark) {
    :root { --ui-bg:#14171f; --ui-panel:#1c2030; --ui-ink:#e8ebf3; --ui-mute:#9aa3b8; --ui-line:#2e3448; --ui-acc:#7c93ff; }
  }
  * { box-sizing:border-box; }
  body { margin:0; background:var(--ui-bg); color:var(--ui-ink); font:14px/1.4 system-ui, sans-serif; display:flex; min-height:100vh; }
  #panel { width:310px; flex:none; background:var(--ui-panel); border-right:1px solid var(--ui-line); padding:14px; overflow:auto; height:100vh; position:sticky; top:0; }
  #panel h1 { font-size:17px; margin:0 0 2px; }
  #panel h2 { font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--ui-mute); margin:16px 0 8px; }
  #panel p.tip { color:var(--ui-mute); font-size:12px; margin:4px 0 0; }
  .row { display:flex; gap:6px; align-items:center; margin:6px 0; flex-wrap:wrap; }
  .row label { flex:1 1 100px; color:var(--ui-mute); font-size:12px; }
  .row input[type=range] { flex:2 1 120px; }
  .row input[type=text], .row select { flex:2 1 120px; padding:6px 8px; border:1px solid var(--ui-line); border-radius:6px; background:transparent; color:inherit; font:inherit; }
  .row input[type=color] { width:38px; height:28px; padding:0; border:1px solid var(--ui-line); border-radius:6px; background:none; }
  button { font:inherit; padding:7px 11px; border:1px solid var(--ui-line); background:transparent; color:inherit; border-radius:7px; cursor:pointer; }
  button:hover { border-color:var(--ui-acc); }
  button.pri { background:var(--ui-acc); border-color:var(--ui-acc); color:#fff; font-weight:600; }
  button.on { background:var(--ui-acc); color:#fff; border-color:var(--ui-acc); }
  button.sm { padding:4px 9px; font-size:12px; }
  #none { color:var(--ui-mute); font-size:13px; }
  #stagewrap { flex:1; overflow:auto; padding:66px 22px 22px; display:flex; justify-content:center; align-items:flex-start; }
  #stage { position:relative; }
  #topbar { position:fixed; top:12px; right:16px; z-index:30; display:flex; gap:8px; align-items:center; background:var(--ui-panel); border:1px solid var(--ui-line); border-radius:12px; padding:8px; box-shadow:0 6px 22px rgba(0,0,0,.16); }
  #topbar input[type=text], #topbar select { padding:7px 9px; border:1px solid var(--ui-line); border-radius:7px; background:transparent; color:inherit; font:inherit; }
  #topbar input[type=text] { width:180px; }
  #topbar > button:not(.pri) { padding:6px 10px; font-size:16px; line-height:1; }
  #topbar > button:disabled { opacity:.35; cursor:default; }
  #more { position:relative; }
  #more summary { list-style:none; cursor:pointer; padding:6px 12px; border:1px solid var(--ui-line); border-radius:7px; font-size:18px; line-height:1; user-select:none; }
  #more summary::-webkit-details-marker { display:none; }
  #more .menu { position:absolute; right:0; top:calc(100% + 6px); min-width:190px; background:var(--ui-panel); border:1px solid var(--ui-line); border-radius:10px; padding:6px; display:flex; flex-direction:column; gap:4px; box-shadow:0 8px 24px rgba(0,0,0,.2); }
  #more .menu button { text-align:left; border:0; }
  #more .menu button:hover { background:var(--ui-bg); }
  @media (max-width: 900px) { #topbar { position:static; margin:10px; flex-wrap:wrap; } #stagewrap { padding-top:22px; } }
  #bubble { position:absolute; z-index:20; display:flex; flex-wrap:wrap; align-items:center; gap:2px; max-width:600px; background:#1d2330; color:#fff; border-radius:10px; padding:4px; box-shadow:0 8px 24px rgba(0,0,0,.3); }
  #bubble[hidden] { display:none; }
  #bubble button { background:transparent; color:#fff; border:0; padding:5px 8px; border-radius:6px; font-size:13px; line-height:1.1; }
  #bubble button:hover { background:#3b5bdb; }
  #bubble button.on { background:#3b5bdb; }
  #bubble button.danger:hover { background:#e03131; }
  #bubble .sep { width:1px; align-self:stretch; background:#4a5268; margin:2px 3px; }
  #bubble input[type=color] { width:26px; height:24px; padding:0; border:0; border-radius:5px; background:none; cursor:pointer; }
  #toast { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); background:#1d2330; color:#fff; padding:9px 14px; border-radius:8px; opacity:0; transition:opacity .2s; pointer-events:none; z-index:50; }
  #toast.show { opacity:1; }
  #over { display:none; position:absolute; left:0; right:0; border-top:2px dashed #e03131; font-size:11px; color:#e03131; text-align:right; padding-top:2px; }
  .hint-drop { outline:3px dashed var(--ui-acc); outline-offset:-6px; }
  @media (max-width: 900px) { body { flex-direction:column; } #panel { width:100%; height:auto; position:static; border-right:0; border-bottom:1px solid var(--ui-line); } }
  @media print { #panel, #topbar, #bubble, #toast, #over { display:none !important; } body { background:#fff; display:block; } #stagewrap { padding:0; display:block; overflow:visible; } #stage { width:auto !important; height:auto !important; } #sheet { transform:none !important; box-shadow:none !important; } .ui { display:none !important; } @page { size:A4; margin:0; } }
  #topbar .navl { padding: 6px 10px; border: 1px solid var(--ui-line); border-radius: 7px; text-decoration: none; color: inherit; font-size: 14px; white-space: nowrap; }
  #topbar .navl:hover { border-color: var(--ui-acc); }
  .blk { cursor: grab; } .blk .t { cursor: text; }
  .blk[data-dnd-dragging] { opacity: .85; }
  @media (max-width: 900px) { #stagewrap { order: -1; max-height: 70vh; padding: 8px; } #topbar { order: -2; } }
  @media (max-width: 900px) { #bubble { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: none; justify-content: center; } }
