#scratch-toggle,
.scratch-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 9px;
  border: 0;
  border-radius: 12px;
  white-space: nowrap;
  font:
    650 14px/1.2 system-ui,
    sans-serif;
  background: #efebff;
  color: #4d34b4;
  touch-action: manipulation;
}
#scratch-toggle[hidden],
.scratch-toolbar[hidden],
.scratch-toolbar button[hidden] {
  display: none !important;
}
.scratch-toolbar :is(.scratch-finish, .scratch-move.is-active) {
  background: #6046ce;
  color: white;
}
.scratch-toolbar .scratch-undo {
  font-weight: 750;
}
#scratch-toggle span,
.scratch-toolbar span {
  font-size: 17px;
  line-height: 1;
}
.scratch-layer {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}
.scratch-ink {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}
.scratch-ink path {
  fill: none;
  stroke: #6e42d2;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scratch-layer.is-drawing .scratch-ink {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}
.scratch-layer.is-moving .scratch-ink {
  cursor: grab;
}
.scratch-toolbar {
  position: relative;
  z-index: 12;
  display: flex;
  gap: 5px;
}
#scratch-toggle[aria-pressed='true'],
.question-tools:has(.scratch-toolbar:not([hidden])) > :not(.scratch-toolbar),
header:has(> .scratch-toolbar:not([hidden])) > button {
  display: none;
}
.scratch-toolbar button:disabled {
  opacity: 0.48;
  cursor: default;
}

@media (max-width: 640px) {
  #scratch-toggle,
  .scratch-toolbar button {
    font-size: 13px;
    padding-inline: 7px;
  }
}
@media (max-width: 360px) {
  header:has(.scratch-toolbar.can-scroll:not([hidden])) .site-name {
    display: none;
  }
}
