:root {
  --desk-height: clamp(102px, 18dvh, 178px);
}
.desk-tool {
  appearance: none;
  position: fixed;
  bottom: max(7px, env(safe-area-inset-bottom));
  z-index: 2;
  border: 0;
  padding: 0;
  border-radius: 16px;
  color: inherit;
  background: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.recorder-position {
  right: max(13px, 2.1vw, env(safe-area-inset-right));
  width: clamp(102px, 12.2vw, 176px);
  height: calc(var(--desk-height) - 10px);
}
#open-opportunity:not([hidden]) {
  display: grid;
  justify-items: end;
  align-items: start;
  z-index: 3;
  cursor: pointer;
}
#open-opportunity svg {
  width: 34px;
  height: 34px;
  padding: 6px;
  color: #ac251c;
  background: #fff;
  border: 1px solid #cccac3;
  border-radius: 50%;
}
#desk-pen {
  left: max(13px, 2.1vw, env(safe-area-inset-left));
  width: clamp(48px, 4.8vw, 78px);
  height: calc(var(--desk-height) - 10px);
}
@media (min-width: 871px) and (min-height: 521px) and (hover: hover) and (pointer: fine) {
  #desk-pen {
    left: max(4px, .45vw, env(safe-area-inset-left));
    width: clamp(34px, 3.3vw, 66px);
    height: clamp(174px, 35.5dvh, 425px);
  }
  .rocket-pen-view:not([data-mesh]) i { width: 39%; left: 30.5%; }
  .rocket-pen-view:not([data-mesh]) b { width: 22%; left: 20%; }
}
.desk-tool[aria-disabled='true'] {
  cursor: default;
}
#player-dock:not([data-state='dragging']) .desk-tool:focus-visible {
  outline: 2px solid #455ad0;
  outline-offset: 3px;
}
#player-dock[data-state='dragging'] .desk-tool:focus-visible,
.carrying-tape .rocket-tape:focus-visible {
  outline: none;
}
#player-target .rocket-player-view {transform-origin: right bottom;}
.carrying-tape,
.carrying-tape * {
  cursor: grabbing !important;
}
.rocket-drag-ghost,
.rocket-carry-flight {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  width: clamp(100px, 13vw, 174px);
  pointer-events: none;
  container-type: inline-size;
}
@media (prefers-reduced-motion: no-preference) {
  .rocket-drag-ghost .rocket-tape:not([data-mesh]) { transform: var(--carry-tilt, none); }
}
@media (min-width: 871px) and (hover: hover) and (pointer: fine) {
  :root { --desk-height: clamp(125px, min(23.5dvh, 18vw), 320px); }
  .recorder-position { width: clamp(129px, 14.2vw, 324px); }
}

@media (max-width: 560px) {
  :root {
    --desk-height: clamp(80px, 13dvh, 110px);
  }
  .recorder-position {
    width: clamp(69px, 19vw, 101px);
    right: max(5px, env(safe-area-inset-right));
  }
  #desk-pen {
    width: 42px;
    left: max(5px, env(safe-area-inset-left));
  }
}
@media (max-height: 520px) and (min-width: 561px) {
  :root {
    --desk-height: 62px;
  }
  .recorder-position {
    width: 76px;
  }
  #desk-pen {
    width: 43px;
  }
}
@media (min-width: 871px) and (max-height: 520px) and (hover: hover) and (pointer: fine) {
  :root { --desk-height: clamp(72px, 17.5dvh, 90px); }
  .recorder-position { width: clamp(85px, 11vw, 108px); }
}
.note-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: min(94vw, 660px);
  max-height: 94dvh;
  overflow: auto;
  font-family: var(--hand);
}
.note-dialog::backdrop {
  background: rgba(255, 255, 255, 0.91);
}
.note-dialog > header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 5%;
}
.note-dialog h2 {
  font-weight: 400;
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
}
.note-dialog button {
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  padding: 5px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
}
.note-dialog button:hover {
  background: #0000000a;
}
.note-dialog button:disabled {
  opacity: 0.32;
}
.note-dialog svg {
  width: 21px;
  height: 21px;
}
.note-body {
  position: relative;
  width: 100%;
  aspect-ratio: 1.74;
}
.rocket-note-model {
  display: block;
  width: 100%;
  height: 100%;
}
.note-paper {
  position: absolute;
  inset: 20% 14% 20%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}
.note-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.saved-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #877e6e44;
  padding: 2px 0 3px;
  font-size: clamp(1rem, 3vw, 1.35rem);
  line-height: 1.12;
}
.saved-note span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.saved-note i {
  opacity: 0.62;
  flex: none;
}
.saved-note svg {
  width: 13px;
  height: 13px;
}
.note-paper textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline-offset: 0;
  background: transparent;
  color: var(--ink);
  font: 400 clamp(1.08rem, 3vw, 1.45rem) / 1.13 var(--hand);
  min-height: 2em;
  padding: 3px 1px;
}
/* Leave the writing nib a clear place at the right edge of the label. */
.note-history, .note-paper textarea { margin-inline-end: 15%; }
@media (max-height: 560px) and (min-aspect-ratio: 3/2) {
  .note-dialog { width: min(94vw, max(360px, 84dvh), 660px); }
}
.note-history:empty {
  flex: 0;
}
.note-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: none;
}
.note-tools button {
  min-width: 30px;
  min-height: 27px;
  padding: 2px;
}
.note-tools [hidden] {
  display: none;
}
.note-issue {
  color: #b92119;
}
@media (prefers-reduced-motion: no-preference) {
  .note-paper {
    animation: reveal-writing 0.46s both;
  }
  @keyframes reveal-writing {
    0%,
    65% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
}
.note-paper textarea:focus {
  outline: 1px solid #85749988;
  border-radius: 2px;
}

.cassette-stack > .stack-falling {
  translate: 0 var(--stack-fall-offset, 0px);
}
