.touch-surface {
  position: relative;
  overflow: hidden !important;
  touch-action: none !important;
  min-height: 240px;
  background: #f3f5f7;
}
.touch-surface[data-touch-mode='pan'] {
  cursor: grab;
}
.touch-surface img {
  position: absolute;
  max-width: none;
  max-height: none !important;
  user-select: none;
  -webkit-user-drag: none;
}
.touch-overlay {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.touch-outline {
  fill: #2085d51a;
  stroke: #0869b6;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.touch-ghost {
  fill: #12a67922;
  stroke: #047a55;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}
.touch-stroke {
  fill: none;
  stroke: #047a55;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.touch-handle {
  fill: #0869b6;
  stroke: white;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.touch-controls {
  margin-top: 8px;
}
.touch-controls .touch-modes {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}
.touch-controls button {
  grid-column: span 3;
  min-width: 0;
  min-height: 48px;
  padding: 8px 4px;
  font-size: 13px;
  line-height: 1.25;
}
.touch-controls [data-touch-tool='brush'],
.touch-controls [data-touch-tool='rectangle'],
.touch-controls [data-touch-tool='ellipse'] {
  grid-column: span 4;
}
.touch-controls button[aria-pressed='true'] {
  color: #fff;
  background: #0869b6;
  border-color: #0869b6;
}
.touch-controls .touch-hint {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.touch-confirm {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid #3d9782;
  border-radius: 12px;
  background: #dff6ed;
  color: #154536;
}
#zoom-value {
  min-width: 44px;
  align-self: center;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.canvas-navigation {
  margin: 4px 0;
  font-size: 13px;
}
.canvas-navigation summary {
  min-height: 48px;
  align-content: center;
  cursor: pointer;
}
.canvas-navigation > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.canvas-navigation button {
  min-width: 0;
  min-height: 48px;
  padding: 6px;
}
.touch-confirm .touch-summary {
  grid-column: 1/-1;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.touch-confirm button {
  min-height: 48px;
  font-size: 15px;
}
.touch-confirm .touch-apply {
  color: #fff;
  background: #047a55;
  border-color: #047a55;
}
@media (prefers-color-scheme: dark) {
  .touch-confirm {
    background: #183e32;
    color: #dff6ed;
  }
}
