* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
  color: #1a1a1a;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}

.button, button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  color: #c0392b;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

input, textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #ddd;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#variants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.variant-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.variant-svg {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 6px;
  overflow: hidden;
}

.variant-svg img {
  max-width: 100%;
  max-height: 100%;
}

.variant-rationale {
  font-size: 0.85rem;
  color: #555;
}

.variant-actions {
  display: flex;
  gap: 0.5rem;
}

.refine-panel, .showcase-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
}

.showcase-styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  font-size: 0.8rem;
}

.showcase-styles label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.showcase-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.showcase-entry img {
  width: 100%;
  border-radius: 6px;
}

.showcase-style-label {
  display: block;
  font-size: 0.75rem;
  text-align: center;
  color: #555;
}
