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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #1a1f2e;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #d0d8e8;
}

#ui {
  display: flex;
  width: 100vw; height: 100vh;
  flex-direction: row;
  overflow: hidden;
}

#canvas {
  flex: 1;
  display: block;
  cursor: crosshair;
}

#canvas.panning { cursor: grabbing; }

#palette {
  width: 140px;
  flex-shrink: 0;
  background: #151a28;
  border-left: 1px solid #2a3050;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.palette-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8090b0;
  padding: 10px 12px 6px;
}

#palette-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px;
  overflow-y: auto;
  flex: 1;
}

.pitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.pitem:hover { background: #1e2540; }
.pitem.active { background: #2a3a6a; outline: 1px solid #4a6aaa; }

.pitem canvas {
  flex-shrink: 0;
  border-radius: 2px;
}

.pitem-label {
  font-size: 0.72rem;
  color: #a0b0cc;
  line-height: 1.2;
}

.pitem.active .pitem-label { color: #c8d8f8; }

.palette-sep {
  height: 1px;
  background: #2a3050;
  margin: 6px;
}

.palette-hint {
  font-size: 0.63rem;
  color: #506080;
  padding: 6px 12px 10px;
  line-height: 1.6;
}

#status-bar {
  position: fixed;
  bottom: 0; left: 0;
  right: 140px;
  height: 22px;
  background: #10141f;
  border-top: 1px solid #1e2438;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 16px;
  font-size: 0.65rem;
  color: #5a6a88;
  pointer-events: none;
}

#status-selected {
  color: #c8a830;
  font-size: 0.65rem;
}

#status-conn { margin-left: auto; }
#status-conn.connected { color: #4a8a5a; }
#status-conn.disconnected { color: #8a4a4a; }

.palette-hint strong {
  color: #a0b8e8;
}
