.image-annotator {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0b0d;
  color: #fff;
  overflow: hidden;
  touch-action: none;
}
.image-annotator[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.image-annotator::backdrop {
  background: rgb(0 0 0 / 0.8);
}
.annotation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 0;
}
.annotation-header h2 {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
}
.image-annotator button,
.image-annotator select {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #292929;
  color: #fff;
  font: inherit;
  font-size: 14px;
  touch-action: manipulation;
}
.image-annotator button:disabled {
  opacity: 0.4;
}
.image-annotator button:focus-visible,
.image-annotator select:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}
.image-annotator .icon-btn {
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  color: #fff;
}
.image-annotator .icon-btn:active {
  background: rgb(255 255 255 / 0.1);
}
.image-annotator .icon-btn svg {
  width: 24px;
  height: 24px;
}
.annotation-stage {
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
#annotation-canvas {
  flex: none;
  transform-origin: center;
  touch-action: none;
  cursor: crosshair;
  will-change: transform;
  background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 / 16px 16px;
}
#annotation-canvas.zoomed {
  max-width: none;
  max-height: none;
}
.annotation-tools {
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 0;
}
.annotation-colours,
.annotation-edit-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.annotation-edit-tools {
  margin-top: 10px;
}
.annotation-edit-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.image-annotator [data-colour] {
  position: relative;
  width: 44px;
  padding: 8px;
  border: 2px solid transparent;
  background: transparent;
}
.image-annotator [data-colour]::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pen-colour);
  box-shadow: 0 0 0 1px #777;
}
.image-annotator [data-colour][aria-pressed='true'] {
  border-color: #fff;
}
.annotation-note {
  margin: 10px 0 0;
  color: #c3c5ca;
  font-size: 12px;
  text-align: center;
}
@media (min-width: 768px) {
  .image-annotator {
    inset: 24px;
    width: min(100% - 48px, 1100px);
    height: calc(100dvh - 48px);
    margin: auto;
    border: 1px solid #444;
    border-radius: 16px;
  }
}

.chip-preview {
  display: block;
  border: 0;
  padding: 0;
  border-radius: inherit;
  background: none;
  cursor: pointer;
}
