* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #2c3e50;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 65px;
  background-color: #1a252f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  z-index: 10;
}

.app-title {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 700;
}

.header-controls {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  color: #ffffff;
}

.btn:active { transform: scale(0.95); }
.btn-primary { background-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; }
.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }

.app-main {
  flex: 1;
  display: flex;
  background-color: #ecf0f1;
  overflow: hidden;
}

.sidebar {
  background-color: #bdc3c7;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #2c3e50;
  letter-spacing: 1px;
  text-align: center;
}

.drawings-sidebar {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  border-right: 2px solid #95a5a6;
}

.palette-sidebar {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  background-color: #ffffff;
  border-left: 2px solid #bdc3c7;
  align-items: center;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); border-radius: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #7f8c8d; border-radius: 8px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #34495e; }

.drawings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.drawing-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.drawing-card:hover { transform: scale(1.02); }
.drawing-card.active { border-color: #3498db; background-color: #e8f4f8; }

.drawing-preview {
  width: 100%;
  height: 80px;
  object-fit: contain;
  pointer-events: none;
}

.drawing-card span {
  font-size: 0.85rem;
  font-weight: bold;
  color: #333333;
  display: block;
  margin-top: 4px;
}

.canvas-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

#paintCanvas {
  background-color: #ffffff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border-radius: 12px;
  cursor: pointer;
  max-width: 100%;
  max-height: 100%;
}

.palette-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.color-swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: #2c3e50; transform: scale(1.2); }