body {
  max-width: 1100px;
  padding: 0 1rem 4rem;
  background: var(--bg-muted);
}

h1 {
  font-size: 1.75rem;
}

#status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  border-radius: 0.375rem;
  display: inline-block;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  align-self: start;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.panel h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.panel h2:first-child {
  margin-top: 0;
}

.field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.375rem 0;
  font-size: 0.875rem;
}

.field label {
  cursor: pointer;
  user-select: none;
}

.field input[type="radio"],
.field input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
}

.field input[type="text"],
.field input[type="color"] {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

.field input[type="text"] {
  flex: 1;
  min-width: 0;
}

.field input[type="color"] {
  width: 2rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--border);
}

.field select {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--surface);
  flex: 1;
  min-width: 0;
}

.field--token {
  gap: 0.5rem;
}

.field--token .token-name {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  min-width: 5.5rem;
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.reset-btn {
  margin-top: 1rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8125rem;
}

.reset-btn:hover {
  background: var(--bg-muted);
}

.panel-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem -1.25rem 0;
}

.panel-note {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.code-preview {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: ui-monospace, "Menlo", monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.code-preview .key {
  color: #93c5fd;
}

.code-preview .string {
  color: #fcd34d;
}

.code-preview .bool {
  color: #f472b6;
}

article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
}

.sample-container {
  border: 2px dashed var(--primary);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
}

.sample-container:hover {
  background: var(--surface);
}

.sample-container h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  color: var(--primary);
}

.sample-container p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.preview article h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

.preview article p {
  margin: 0.75rem 0;
}
