* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #e4e4e8;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

#toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: #f7f7f9;
  border-bottom: 1px solid #d0d0d4;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

#toolbar button {
  flex: none;
  border: 1px solid #c8c8cc;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: #2a2a2e;
}

#toolbar button.active {
  background: #dbe7f7;
  border-color: #7da7d9;
}

#dateLabel {
  flex: none;
  font-weight: 600;
  font-size: 14px;
  padding: 0 6px;
}

.sep {
  flex: none;
  width: 1px;
  height: 22px;
  background: #d0d0d4;
  margin: 0 6px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  padding: 0 !important;
}

.swatch.active {
  outline: 2px solid #7da7d9;
  outline-offset: 1px;
}

#sizeSlider {
  flex: none;
  width: 90px;
}

#status {
  flex: none;
  margin-left: auto;
  color: #707074;
  font-size: 12px;
  padding: 0 8px;
}

#canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  touch-action: none;
}

#login {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e4e4e8;
}

#login[hidden] { display: none; }

#loginForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 290px;
  padding: 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

#loginForm h1 {
  margin: 0 0 8px;
  font-size: 20px;
  text-align: center;
}

#loginForm input {
  padding: 10px;
  border: 1px solid #c8c8cc;
  border-radius: 6px;
  font-size: 15px;
}

#loginForm button {
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #1565c0;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

#loginError {
  min-height: 16px;
  color: #c62828;
  font-size: 13px;
  text-align: center;
}
