:root {
  --color-bg: #FAFAFA;
  --color-surface: #FFFFFF;
  --color-text: #1F1F1F;
  --color-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-accent: #4F46E5;
  --color-success: #16A34A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
}

h1 { font-weight: 700; }
h2 { font-weight: 600; }

#brief-input {
  transition: height 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  height: auto;
  overflow: hidden;
}

#brief-input.field-error {
  border-color: #DC2626 !important;
  box-shadow: 0 0 0 1px #DC2626;
}

#brief-hint.field-error-text {
  color: #DC2626;
}

.chip {
  cursor: pointer;
}

.chip.chip-active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

#generate-btn {
  cursor: pointer;
}

#generate-btn:disabled {
  cursor: progress;
  opacity: 0.85;
}

#generate-icon.spin {
  animation: gen-spin 0.9s linear infinite;
}

@keyframes gen-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#result-state {
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(10px);
}

#result-state.show {
  opacity: 1 !important;
  transform: translateY(0);
}

.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  cursor: default;
}

.swatch::after {
  content: attr(data-hex);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.swatch:hover::after {
  opacity: 1;
}

.section-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

#toast {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 768px) {
  #brief-input { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #generate-icon.spin { animation: none; }
  #result-state, #brief-input, #toast { transition: none; }
}
