.scarab-projection {
  margin: 14px 16px 18px;
  overflow: hidden;
  border: 1px solid #55406d;
  border-radius: 14px;
  background: #0c0b18;
}
.scarab-projection-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border-bottom: 1px solid #513d68;
  background: linear-gradient(110deg,#25103b,#0b2937);
}
.scarab-projection-head small {
  color: #e87bd9;
  font: 800 .55rem ui-monospace,monospace;
  letter-spacing: .1em;
}
.scarab-projection-head h4 { margin: .28rem 0; font-size: 1.18rem; }
.scarab-projection-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: .72rem; }
.scarab-projection-head output {
  align-self: center;
  min-width: 150px;
  padding: 8px 12px;
  border: 1px solid #b98cf2;
  border-radius: 999px;
  color: #e4c7ff;
  text-align: center;
  font: 900 .62rem ui-monospace,monospace;
}
.scarab-projection-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  padding: 12px 16px;
  background: #121023;
}
.scarab-projection-controls>div { display: flex; flex-wrap: wrap; gap: 6px; }
.scarab-projection-controls button { font-size: .58rem; }
.scarab-rotation-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  flex: 1 1 260px;
  color: #baa8bd;
  font: 800 .55rem ui-monospace,monospace;
}
.scarab-rotation-control output { color: #fff; }
.scarab-rotation-control input { grid-column: 1/-1; width: 100%; accent-color: #ed4ec0; }
.scarab-projection-stage { display: grid; grid-template-columns: minmax(0,1fr) 198px; gap: 1px; background: #413352; }
.scarab-projection-stage>svg { display: block; width: 100%; height: auto; min-height: 360px; background: #10091f; }
.scarab-projection-stage>aside { display: grid; align-content: stretch; gap: 1px; background: #413352; }
.scarab-projection-stage>aside div { display: grid; align-content: center; padding: 12px; background: #0d101b; }
.scarab-projection-stage small,.scarab-projection-stage b,.scarab-projection-stage span { display: block; }
.scarab-projection-stage small { color: #9f90ad; font: 800 .5rem ui-monospace,monospace; }
.scarab-projection-stage b { margin: .3rem 0; color: #fff4ba; font: 800 .72rem ui-monospace,monospace; }
.scarab-projection-stage span { color: #b8acbd; font: .54rem ui-monospace,monospace; }
.scarab-projection-stage .grid-line { stroke: #39cce5; stroke-width: 1; opacity: .27; }
.scarab-projection-stage .grid-axis { stroke: #65e2f4; stroke-width: 1.5; opacity: .75; }
.scarab-projection-stage .pink-strip-plane { fill: #ed4ec0; fill-opacity: .17; stroke: #f06bc9; stroke-width: 2; }
.scarab-projection-stage .pink-strip-core { fill: none; stroke: #ff5aca; stroke-width: 6; opacity: .72; filter: drop-shadow(0 0 8px #ed4ec0); }
.scarab-projection-stage .pyramid-face { stroke: #f1ce50; stroke-width: 1.7; }
.scarab-projection-stage .pyramid-face.side-a { fill: #76258e; fill-opacity: .48; }
.scarab-projection-stage .pyramid-face.side-b { fill: #a53aba; fill-opacity: .31; }
.scarab-projection-stage .pyramid-face.side-c { fill: #54266e; fill-opacity: .42; }
.scarab-projection-stage .transit-face { fill: #b32d9e; fill-opacity: .38; stroke: #ff74d6; stroke-width: 2.2; }
.scarab-projection-stage .transit-face.face-1 { fill: #d54bbd; fill-opacity: .5; }
.scarab-projection-stage .transit-face.face-2 { fill: #7c42bb; fill-opacity: .38; }
.scarab-projection-stage .transit-face.face-3 { fill: #e48b43; fill-opacity: .24; }
.scarab-projection-stage .handle-line { fill: none; stroke: #56e0ed; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 5px #35baca); }
.scarab-projection-stage .handle-return { stroke: #f6d44f; stroke-dasharray: 9 6; }
.scarab-projection-stage .scarab-ring { fill: none; stroke: #f3d84a; stroke-width: 3; }
.scarab-projection-stage .scarab-axis { fill: none; stroke: #e950be; stroke-width: 4; stroke-dasharray: 10 7; }
.scarab-projection-stage .transverse-axis { opacity: .72; stroke-width: 1.5; stroke-dasharray: 7 6; }
.scarab-projection-stage .transverse-axis.axis-jw { stroke: #6fe3ef; }
.scarab-projection-stage .transverse-axis.axis-mw { stroke: #f2d454; }
.scarab-projection-stage .transverse-diamond {
  fill: #ed4ec0;
  fill-opacity: .25;
  stroke: #ff69d5;
  stroke-width: 4;
  filter: drop-shadow(0 0 12px #ed4ec0);
}
.scarab-projection-stage .transverse-diamond.inner {
  fill: #7f32b1;
  fill-opacity: .22;
  stroke: #e9a0ff;
  stroke-width: 1.8;
  stroke-dasharray: 8 6;
}
.scarab-projection-stage .handle-puncture { fill: none; stroke: #fff3a0; stroke-width: 4; stroke-linecap: round; }
.scarab-projection-stage .axis-label { fill: #fff0a4; font-size: 13px; font-weight: 900; }
.scarab-projection-stage .boundary-label { fill: #d98acb; font-size: 9px; letter-spacing: .05em; }
.scarab-projection-stage .scarab-node { fill: #111324; stroke: #ffe45c; stroke-width: 3; }
.scarab-projection-stage .scarab-node.axis-node { fill: #e950be; stroke: #fff; }
.scarab-projection-stage text { fill: #f5eff8; font: 600 13px ui-monospace,monospace; }
.scarab-projection-stage .view-label { fill: #bca9c6; font-size: 11px; }
.scarab-projection-stage .phase-label { fill: #ff75d1; font-weight: 800; letter-spacing: .08em; }
.scarab-projection[data-phase="handle"] .scarab-projection-head output { border-color: #56e0ed; color: #8ff5ff; }
.scarab-projection[data-view="transverse"] .scarab-projection-head output { border-color: #ff69d5; color: #ffb5e8; box-shadow: 0 0 16px #ed4ec044; }
.scarab-projection[data-phase="after"] .scarab-projection-head output { border-color: #f3d84a; color: #ffe98c; }
.scarab-gap-lens { padding: 12px 16px; border-top: 1px solid #49355c; background: #100d1c; }
.scarab-gap-lens header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.scarab-gap-lens small { color: #e87bd9; font: 800 .5rem ui-monospace,monospace; letter-spacing: .08em; }
.scarab-gap-lens h5 { margin: .2rem 0; color: #fff; }
.scarab-gap-lens output { color: #f0d95b; font: 800 .56rem ui-monospace,monospace; }
.scarab-gap-lens p { margin: .55rem 0 0; color: #aa9eb1; font-size: .59rem; }
.scarab-gap-ticks { display: grid; grid-template-columns: repeat(17,1fr); gap: 3px; margin-top: 10px; }
.scarab-gap-ticks span { display: grid; place-items: center; min-height: 30px; border: 1px solid #3f3549; border-radius: 4px; color: #7f7187; font: 700 .5rem ui-monospace,monospace; }
.scarab-gap-ticks span.occupied { border-color: #49d6e6; background: #133140; color: #dffbff; }
.scarab-gap-ticks span.gap { background: #281028; color: #dd78ca; }
.scarab-projection-sources { display: flex; flex-wrap: wrap; gap: 8px; padding: 9px 14px; border-top: 1px solid #3c304a; background: #0d101b; }
.scarab-projection-sources a { color: #7eddec; font: 700 .54rem ui-monospace,monospace; }
.scarab-projection-boundary { padding: 11px 14px; border-top: 1px solid #513d68; background: #171021; color: #c3b5c9; font-size: .6rem; }
.scarab-projection-boundary b { color: #e87bd9; }
@media(max-width:820px) {
  .scarab-projection-stage { grid-template-columns: 1fr; }
  .scarab-projection-stage>aside { grid-template-columns: 1fr 1fr; }
  .scarab-projection-head { display: grid; }
  .scarab-projection-head output { justify-self: start; }
}
@media(max-width:560px) {
  .scarab-projection { margin: 12px 8px; }
  .scarab-projection-controls>div,.scarab-projection-controls>button { width: 100%; }
  .scarab-projection-controls>div button { width: auto; flex: 1; }
  .scarab-projection-stage>aside { grid-template-columns: 1fr; }
  .scarab-gap-lens header { display: grid; }
  .scarab-gap-ticks { grid-template-columns: repeat(9,1fr); }
}
