:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --border-color: #e5e7eb;
  --danger-color: #ef4444;
  --success-color: #10b981;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --accent-primary: #60a5fa;
    --accent-hover: #3b82f6;
    --border-color: #374151;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 1rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type="color"] {
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: none;
}

input[type="range"] {
  width: 100px;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  border: none;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.connection-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.connection-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

textarea {
  width: 100%;
  height: 80px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.8rem;
  resize: vertical;
}

.status-indicator {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 6px;
  background: var(--border-color);
  color: var(--text-secondary);
}

.status-indicator.connected {
  background: var(--success-color);
  color: white;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 600px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .connection-panel {
    grid-template-columns: 1fr;
  }

  .canvas-wrapper {
    height: 400px;
  }
}
