:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f8fb;
  color: #0f172a;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }

.shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 250px;
  padding: 20px 14px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: #2563eb; color: white; font-weight: 800;
}
.brand-title { font-size: 15px; font-weight: 800; }
.brand-subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }
.nav {
  width: 100%; border: 0; border-radius: 10px; padding: 11px 12px; text-align: left;
  background: #dbeafe; color: #1d4ed8; font-weight: 700;
}
.sidebar-note {
  margin-top: 18px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: white; color: #64748b; font-size: 12px; line-height: 1.65;
}

.main { flex: 1; min-width: 0; padding: 24px; }
.panel, .card, .tab-panel, .tabs, .metric {
  background: white; border: 1px solid #e2e8f0; border-radius: 12px;
}
.form-panel { padding: 20px; }
.panel-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }
.eyebrow { color: #2563eb; font-weight: 800; font-size: 12px; margin: 0 0 4px; }
h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
h2 { margin: 0 0 10px; font-size: 17px; }
h3 { margin: 0; font-size: 15px; }
.pill {
  display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8;
}
.pill.muted { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.pill.good { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.pill.warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.pill.bad { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label span, .field-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; color: #475569; }
input, select {
  width: 100%; height: 42px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 0 11px;
  background: white; color: #0f172a;
}
input:focus, select:focus { outline: 2px solid #bfdbfe; border-color: #60a5fa; }
details { margin-top: 12px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #f8fafc; }
summary { cursor: pointer; font-size: 13px; font-weight: 800; color: #334155; }
.details-grid { margin-top: 12px; margin-bottom: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
button {
  min-height: 40px; border: 1px solid #cbd5e1; border-radius: 9px; background: white; color: #334155;
  padding: 0 14px; font-weight: 800; cursor: pointer;
}
button:hover { background: #f8fafc; }
button.primary { background: #2563eb; border-color: #2563eb; color: white; }
button:disabled { opacity: .58; cursor: not-allowed; }
.error { margin: 14px 0 0; padding: 12px; border-radius: 9px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.hidden { display: none; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.metric { padding: 14px; min-height: 76px; }
.metric-value { font-size: 24px; font-weight: 850; }
.metric-label { margin-top: 4px; font-size: 12px; color: #64748b; font-weight: 700; }

.tabs { display: flex; gap: 6px; padding: 6px; margin-bottom: 12px; }
.tab { border: 0; flex: 0 0 auto; }
.tab.active { background: #eff6ff; color: #1d4ed8; }
.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }
.topic-card { border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.topic-head { padding: 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; gap: 12px; }
.topic-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prompt-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.prompt-list th, .prompt-list td { border-bottom: 1px solid #e2e8f0; padding: 10px; vertical-align: top; text-align: left; }
.prompt-list th { color: #64748b; font-size: 11px; text-transform: uppercase; background: white; }
.prompt-text { font-weight: 700; color: #0f172a; line-height: 1.55; }
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { padding: 14px; }
.muted { color: #64748b; }
.small { font-size: 12px; line-height: 1.6; }
pre {
  white-space: pre-wrap; word-break: break-word; margin: 0; padding: 14px; border-radius: 10px;
  background: #0f172a; color: #e2e8f0; line-height: 1.55;
}

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; }
  .main { padding: 14px; }
  .two, .three, .metrics, .cards-grid { grid-template-columns: 1fr; }
}
