/* Screenshot Annotate */
.annotate {
  padding: var(--space);
}

.annotate__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space);
  margin-bottom: var(--space);
}

.annotate__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tool {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.tool:hover {
  color: var(--text);
  background: var(--surface-3);
}

.tool.is-active {
  background: var(--primary);
  color: var(--active-text);
}

.tool svg {
  width: 20px;
  height: 20px;
}

.annotate__props {
  display: flex;
  align-items: center;
  gap: var(--space);
  flex-wrap: wrap;
}

.annotate__prop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.annotate__prop input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}

.annotate__prop input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.annotate__prop input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
.annotate__prop input[type="color"]::-moz-color-swatch { border: none; border-radius: 6px; }

.annotate__prop--range {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.annotate__prop-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.annotate__prop--range .range {
  width: 110px;
}

.annotate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-left: auto;
}

.annotate__stage {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  background: repeating-conic-gradient(var(--surface-3) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  touch-action: none;
}

.annotate__stage canvas {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
}

.annotate__text-input {
  position: absolute;
  min-width: 60px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed var(--primary);
  border-radius: 4px;
  outline: none;
  font-family: "Inter", system-ui, sans-serif;
  z-index: 5;
}

@media (max-width: 560px) {
  .annotate__toolbar {
    gap: var(--space-sm);
  }

  .annotate__actions {
    margin-left: 0;
    width: 100%;
  }

  .annotate__actions .btn {
    flex: 1;
  }

  .annotate__prop--range .range {
    width: 80px;
  }
}
