.bot-studio {
  position: fixed; inset: 0; z-index: 14; overflow: hidden;
  contain: strict; isolation: isolate; pointer-events: none; user-select: none;
}
.bot-studio * { pointer-events: none; }
.bot-pointer {
  position: absolute; left: 0; top: 0; height: 0; width: 0;
  opacity: 0; transition: opacity .16s; will-change: transform;
}
.bot-pointer.on { opacity: 1; }
.bot-arrow {
  position: absolute; left: -1px; top: -1px; width: 21px; height: 26px;
  transform-origin: 1px 1px; filter: drop-shadow(0 2px 2px #170f0fc9);
}
.bot-arrow::before,.bot-arrow::after {
  content: ''; position: absolute; inset: 0; background: #21191a;
  clip-path: polygon(0 0,100% 56%,63% 62%,47% 100%);
}
.bot-arrow::after { inset: 2px 3px 3px 2px; background: var(--ink); }
.bot-tag {
  position: absolute; top: 19px; left: 12px; display: flex; align-items: center;
  width: max-content; max-width: 172px; border-radius: 4px 9px 9px 9px;
  background: #1a1718f5; border: 1px solid color-mix(in srgb,var(--ink) 72%,#302820);
  box-shadow: 0 2px 8px #100b0b70; overflow: hidden; font: 550 12px/1.3 var(--body);
}
.bot-tag b { padding: 3px 6px; font-weight: 750; background: var(--ink); color: #24181b; }
.bot-tag small { padding: 2px 5px; font: inherit; color: #fff0e3; }
.bot-tag small:empty,.bot-pointer.resting small { display: none; }
.bot-pointer.flip-x .bot-tag { left: auto; right: 6px; }
.bot-pointer.flip-y .bot-tag { top: auto; bottom: 5px; }
.bot-click {
  position: absolute; width: 0; height: 0; color: var(--ink);
  animation: bot-mark .48s ease-out both;
}
.bot-click::before,.bot-click::after {
  content: ''; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px;
  border-radius: 50%; border: 1.8px solid var(--ink); box-shadow: 0 0 3px #30201c;
}
.bot-click::after { left: -3px; top: -3px; width: 6px; height: 6px; background: var(--ink); }
@keyframes bot-mark { 0%{ transform:scale(.45); opacity:1 } 60%{ opacity:.83 } 100%{ transform:scale(2.2); opacity:0 } }
@media(max-width:600px) {
  .bot-tag { max-width: 128px; font-size: 11px; }
  .bot-tag small { max-width: 78px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .bot-arrow { width: 18px; height: 22px; }
}
@media print { .bot-studio,.bot-palette,#crew-dock { display: none!important; } }
h1 em.bot-draft-ink { color: transparent; -webkit-text-stroke: 1px #c3b7ac; }
.bot-selected-ink { outline: 1px dashed #ff9c73; outline-offset: 2px; }
.bot-palette {
  position:absolute; top:0; left:0; display:flex; align-items:center; gap:6px; height:30px;
  padding:4px 8px; border:1px solid #98705d; background:#211a18; color:#f6ded3;
  font:550 12px var(--body); border-radius:5px; opacity:0; box-shadow:0 3px 10px #100b0b66;
}
.bot-palette.open { opacity:1; }
.bot-palette i { width:15px; height:15px; border-radius:3px; background:#d8d0c2; }
.bot-palette i:nth-of-type(2) { background:#ba8755; }
.bot-palette i:last-child { background:var(--orange); }
.bot-palette.applied i:last-child { outline:1px solid #fff1d8; outline-offset:2px; }
#crew-dock {
  position:fixed; right:max(14px,env(safe-area-inset-right)); bottom:max(12px,env(safe-area-inset-bottom));
  z-index:15; display:flex; gap:3px; align-items:center; padding:3px;
  background:#201a17f7; border:1px solid #6e5747; border-radius:22px; box-shadow:0 3px 15px #160f0c70;
}
#crew-dock button {
  font:550 .82rem/1.3 var(--body); color:#ffe4cf; background:transparent;
  border:0; border-radius:18px; padding:8px 10px; white-space:nowrap;
}
#crew-dock #page-motion { position:static; box-shadow:none; background:#382b23; }
#crew-dock button:hover { background:#493427; }
#crew-count { font:600 .75rem var(--body); color:#f9c6a4; padding:4px 7px 4px 9px; white-space:nowrap; }
#crew-count::before { content:''; display:inline-block; width:6px; height:6px; background:#ffc279; border-radius:50%; margin-right:6px; }
#crew-count:not([hidden]) + #replay-page { display:none; }
.hero-layout { isolation: isolate; }
.hero-layout::before {
  content: ''; position: absolute; inset: 14px -6px 8px; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity .4s;
  background: linear-gradient(90deg, #b68a6b55 1px, transparent 1px) left top/50% 100%,
    radial-gradient(circle, #b993721f .9px, transparent 1px) 0 0/20px 20px;
  border-block: 1px dashed #b68a6b66; border-right: 1px solid #b68a6b55;
}
.allow-motion .hero-layout:has(.hero-copy [data-pending], .xcomp-typing, .xcomp-placing, .art-workbench)::before { opacity: .56; }
@media(max-width:500px) {
  #crew-dock { right:8px; }
  #crew-dock button { padding:8px; }
}
