#pbApp {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1e2530;
  --border: #2d3646;
  --text: #e6edf3;
  --dim: #8b949e;
  --accent: #22d3ee;
  --accent2: #0891b2;
  --danger: #f85149;
}#pbApp * { box-sizing: border-box; }#pbApp {
  margin: 24px 0 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  border: 1px solid #2d3646; border-radius: 12px; overflow: hidden;
}#pbApp .pbHeader {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}#pbApp .brand { display: flex; align-items: baseline; gap: 10px; }#pbApp .logo { font-size: 20px; letter-spacing: 2px; font-weight: 300; }#pbApp .logo b { color: var(--accent); font-weight: 700; }#pbApp .subtitle { color: var(--dim); font-size: 13px; }#pbApp button {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 13px; cursor: pointer; font-size: 13px;
}#pbApp button:hover { border-color: var(--accent2); }#pbApp button.primary { background: var(--accent2); border-color: var(--accent2); font-weight: 600; }#pbApp button.primary:hover { background: var(--accent); color: #06222a; }#pbApp button.small { padding: 4px 9px; font-size: 12px; }#pbApp button.danger { color: var(--danger); }#pbApp button:disabled { opacity: .45; cursor: default; }#pbApp .toolbar { display: flex; gap: 6px; flex-wrap: wrap; }#pbApp .pbMain { display: flex; min-height: 540px; }#pbApp aside#programPane {
  width: 270px; background: var(--panel); border-right: 1px solid var(--border);
  padding: 12px; overflow-y: auto; display: flex; flex-direction: column;
}#pbApp .paneHead { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; }#pbApp .paneHead h2 { font-size: 15px; margin: 0; }#pbApp .hint { color: var(--dim); font-size: 12px; font-weight: 400; }#pbApp .paneNote { color: var(--dim); font-size: 12px; margin: 0 0 10px; }#pbApp #programList { list-style: none; margin: 0; padding: 0; flex: 1; }#pbApp #programList li {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer; margin-bottom: 3px;
}#pbApp #programList li.sel { background: var(--panel2); border-color: var(--accent2); }#pbApp #programList li canvas { border: 1px solid var(--border); image-rendering: pixelated; width: 64px; height: 16px; }#pbApp #programList li .pname { flex: 1; background: none; border: none; color: var(--text); font-size: 13px; min-width: 0; }#pbApp #programList li .pname:focus { outline: 1px solid var(--accent2); border-radius: 3px; }#pbApp #programList li .cnt { color: var(--dim); font-size: 11px; }#pbApp #programList li .rowBtns { display: none; gap: 2px; }#pbApp #programList li.sel .rowBtns, #pbApp #programList li:hover .rowBtns { display: flex; }#pbApp #programList li .rowBtns button { padding: 1px 5px; font-size: 11px; }#pbApp .sizeInfo { color: var(--dim); font-size: 11px; padding-top: 8px; border-top: 1px solid var(--border); }#pbApp section#editorPane { flex: 1; padding: 14px 18px; overflow-y: auto; min-width: 0; }#pbApp #previewWrap { text-align: center; margin-bottom: 14px; }#pbApp #preview {
  width: 512px; max-width: 100%; height: auto; image-rendering: pixelated;
  background: #000; border: 2px solid var(--border); border-radius: 4px;
}#pbApp .previewBar { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 6px; flex-wrap: wrap; }#pbApp #head3d {
  width: 512px; max-width: 100%; margin: 0 auto; min-height: 240px;
  border: 2px solid var(--border); border-radius: 4px; background: #05070a;
  position: relative; cursor: grab;
}#pbApp #head3d[data-state="loading"]::after {
  content: "Loading 3D head…"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim); font-size: 13px;
}#pbApp #head3d canvas { display: block; border-radius: 3px; }#pbApp #timelineWrap {
  position: relative; width: 512px; max-width: 100%; margin: 6px auto 0;
  user-select: none;
}#pbApp #timeline { display: flex; height: 22px; gap: 0; }#pbApp .tlSeg {
  position: relative; height: 100%; box-sizing: border-box; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 3px;
  margin-right: 1px; overflow: hidden; min-width: 3px;
}#pbApp .tlSeg.anim {
  background: repeating-linear-gradient(45deg, var(--panel2) 0 4px, #26405a 4px 8px);
}#pbApp .tlSeg.faceStart { margin-left: 5px; }#pbApp .tlSeg:first-child { margin-left: 0; }#pbApp .tlSeg.sel { border-color: var(--accent); }#pbApp .tlSeg.playing { background: #114d5e; border-color: var(--accent); }#pbApp .tlSeg .tlLabel {
  position: absolute; inset: 0; font-size: 9px; color: var(--dim);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  white-space: nowrap;
}#pbApp #playhead {
  position: absolute; top: -3px; bottom: -3px; width: 2px; left: 0;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  pointer-events: none; border-radius: 1px;
}#pbApp .chk { color: var(--dim); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }#pbApp #filmstrip { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; min-height: 90px; }#pbApp .frameThumb {
  position: relative; cursor: pointer; border: 2px solid var(--border); border-radius: 4px;
  padding: 3px; background: #000;
}#pbApp .frameThumb.sel { border-color: var(--accent); }#pbApp .frameThumb canvas { width: 192px; height: 48px; image-rendering: pixelated; display: block; }#pbApp .frameThumb .fno { position: absolute; top: 2px; left: 5px; font-size: 10px; color: var(--dim); }#pbApp .frameThumb .fstay { position: absolute; bottom: 2px; right: 5px; font-size: 10px; color: var(--accent); background: rgba(0,0,0,.6); padding: 0 3px; border-radius: 3px; }#pbApp .emptyMsg { color: var(--dim); padding: 20px; }#pbApp #frameProps { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }#pbApp #frameProps h3 { margin: 0 0 8px; font-size: 13px; color: var(--dim); }#pbApp .propRow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }#pbApp .propRow label { font-size: 13px; }#pbApp .propRow input[type=number] { width: 60px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 4px; }#pbApp .propGroup { display: inline-flex; gap: 14px; align-items: center; }#pbApp .propGroup[hidden] { display: none; }#pbApp .sliderLabel { display: inline-flex; gap: 6px; align-items: center; }#pbApp .sliderLabel input[type=range] { width: 180px; accent-color: var(--accent); }#pbApp select { background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 4px; }#pbApp .dropTarget { outline: 2px dashed var(--accent); outline-offset: 2px; }#pbApp .frameThumb, #pbApp #programList li { cursor: grab; }#pbApp .shareBox {
  width: 100%; height: 90px; resize: vertical; box-sizing: border-box;
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px; font: 11px/1.4 monospace; word-break: break-all;
}#pbApp .modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}#pbApp .modal[hidden] { display: none; }#pbApp .modalBox {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; max-width: 560px; width: 92%; max-height: 90vh; overflow-y: auto;
}#pbApp .modalBox.wide { max-width: 1100px; }#pbApp .modalHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }#pbApp .modalHead h2 { margin: 0; font-size: 17px; }#pbApp .close { background: none; border: none; font-size: 22px; color: var(--dim); }#pbApp .modalFoot { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 12px; }#pbApp .libTabs { display: flex; gap: 0; margin-bottom: 10px; border-bottom: 1px solid var(--border); }#pbApp .libTab {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 8px 16px; font-size: 14px; color: var(--dim);
}#pbApp .libTab.active { color: var(--accent); border-bottom-color: var(--accent); }#pbApp .libFilter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }#pbApp .libFilter button.active { border-color: var(--accent); color: var(--accent); }#pbApp .libGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }#pbApp .libItem { cursor: pointer; text-align: center; border: 1px solid var(--border); border-radius: 6px; padding: 6px; background: #000; }#pbApp .libItem:hover { border-color: var(--accent); }#pbApp .libItem img { width: 100%; image-rendering: pixelated; }#pbApp .libItem .llabel { font-size: 11px; color: var(--dim); margin-top: 3px; }#pbApp #uploadPreview { width: 100%; image-rendering: pixelated; background: #000; border: 1px solid var(--border); margin-top: 10px; }#pbApp #blinkPreview { width: 100%; image-rendering: pixelated; background: #000; border: 1px solid var(--border); margin-top: 10px; }#pbApp .edToolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }#pbApp .toolBtn { font-size: 15px; padding: 5px 10px; }#pbApp .toolBtn.active { border-color: var(--accent); color: var(--accent); }#pbApp .edSwatches { display: inline-flex; gap: 3px; }#pbApp .edSwatches span {
  width: 22px; height: 22px; border-radius: 4px; border: 2px solid var(--border);
  display: inline-block; cursor: pointer;
}#pbApp .edSwatches span.active { border-color: #fff; }#pbApp #edCanvas {
  width: 100%; image-rendering: pixelated; background: #000;
  border: 1px solid var(--border); cursor: crosshair; touch-action: none;
}
