body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f0;
  color: #222;
  overflow: hidden;
}

/* ── View switching ───────────────────────────────────────── */
.view {
  display: none;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  flex-direction: column;
}

.view--active {
  display: flex;
}

/* ── Shared header / toolbar ──────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  user-select: none;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #333;
}

/* ── Back button ──────────────────────────────────────────── */
.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f0f0ee;
  color: #444;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-back:hover {
  background: #e4e4e0;
}

/* ── Toolbar icon buttons (undo / redo) ───────────────────── */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f0f0ee;
  color: #444;
  font-size: 1rem;
  transition: background 0.15s, opacity 0.15s;
}

.btn-icon:hover:not(:disabled) {
  background: #e4e4e0;
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Divider ──────────────────────────────────────────────── */
.toolbar-divider {
  width: 1px;
  height: 28px;
  background: #e0e0e0;
  flex-shrink: 0;
}

/* ── Spacer ───────────────────────────────────────────────── */
.toolbar-spacer {
  flex: 1;
}

/* ── Tolerance control ────────────────────────────────────── */
.tolerance-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #666;
}

.tolerance-wrap input[type="range"] {
  width: 80px;
  cursor: pointer;
}
