:root {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --border: #dbe3ef;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --planned: #7c3aed;
  --planned-soft: #f5f3ff;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

.demo-badge {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 5px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
}

.demo-back {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 720px;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.pill--now {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill--planned {
  background: var(--planned-soft);
  color: var(--planned);
}

.pill--kind {
  background: var(--accent-soft);
  color: var(--accent);
}

.props-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 960px) {
  .props-demo-grid {
    grid-template-columns: 1fr;
  }
}

.demo-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.demo-panel h2 {
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.demo-panel pre {
  margin: 0;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
  flex: 1;
  overflow: auto;
  max-height: 320px;
}

.demo-panel--form {
  padding: 14px;
}

.demo-panel--form h2 {
  margin: -14px -14px 12px;
}

/* Form widgets */
.field-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.field-row:last-child {
  margin-bottom: 0;
}

.field-row--stack {
  grid-template-columns: 1fr;
  gap: 6px;
}

.field-row--bool {
  grid-template-columns: 100px auto auto;
}

.field-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
}

.field-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  background: var(--panel);
  color: var(--text);
}

.field-control--narrow {
  max-width: 160px;
}

.field-control--muted {
  color: var(--muted);
  font-style: italic;
}

.field-control--mono {
  font-family: var(--mono);
  font-size: 12px;
  resize: vertical;
}

.field-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.field-bool-label {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}

.field-hint {
  grid-column: 2;
  font-size: 11px;
  color: var(--muted);
}

.field-chip {
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  cursor: pointer;
}

.field-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1d4ed8;
  font-size: 12px;
}

.tag-pill button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.tag-input {
  border: 0;
  outline: none;
  font-size: 12px;
  min-width: 80px;
  flex: 1;
}

.field-color {
  width: 40px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.field-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.catalog-form {
  display: grid;
  gap: 16px;
}

.catalog-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.catalog-section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.full-node-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 800px) {
  .full-node-wrap {
    grid-template-columns: 1fr;
  }
}

.schema-ref {
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--panel);
  font-size: 13px;
}

.schema-ref a {
  color: var(--accent);
}
