* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1a202c;
  background: #f7f8fa;
  line-height: 1.5;
}
.topbar { background: #1f3a5f; color: #fff; }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0.7rem 1rem;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.topbar nav a { color: #cdd9ea; margin-left: 1rem; text-decoration: none; }
.topbar nav a:hover { color: #fff; }

.container { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
h1 { font-size: 1.5rem; }
.muted { color: #64748b; }
.hidden { display: none; }
.error { color: #b91c1c; background: #fee2e2; padding: 0.5rem 0.8rem; border-radius: 6px; margin-top: 0.8rem; }
.ok { color: #166534; background: #dcfce7; padding: 0.5rem 0.8rem; border-radius: 6px; margin-top: 0.8rem; }

textarea, input, select {
  font: inherit; padding: 0.5rem 0.6rem; border: 1px solid #cbd5e1;
  border-radius: 6px; background: #fff;
}
textarea { width: 100%; resize: vertical; }
button {
  font: inherit; padding: 0.5rem 1rem; border: 0; border-radius: 6px;
  background: #1f3a5f; color: #fff; cursor: pointer;
}
button:hover { background: #2c4f80; }
button:disabled { opacity: 0.6; cursor: wait; }

.chat-form .filters { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.answer { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; margin-top: 1rem; }
#answer-text { white-space: pre-wrap; }
.source { border-top: 1px solid #e2e8f0; padding: 0.6rem 0; }
.source blockquote {
  margin: 0.4rem 0 0; padding: 0.4rem 0.8rem; border-left: 3px solid #1f3a5f;
  background: #f1f5f9; font-size: 0.9rem; color: #334155;
}
.disclaimer { font-size: 0.8rem; color: #64748b; border-top: 1px solid #e2e8f0; padding-top: 0.6rem; }

.tabs { display: flex; gap: 0.4rem; margin: 1rem 0; flex-wrap: wrap; }
.tabs button { background: #e2e8f0; color: #1a202c; }
.tabs button.active { background: #1f3a5f; color: #fff; }
.tab { display: none; }
.tab.active { display: block; }

.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.inline-form { display: flex; gap: 0.5rem; margin: 0.5rem 0; flex-wrap: wrap; align-items: center; }
.inline-form input { min-width: 160px; }

table { width: 100%; border-collapse: collapse; background: #fff; margin-top: 0.8rem; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
th { background: #f1f5f9; }
pre { background: #0f172a; color: #e2e8f0; padding: 0.8rem; border-radius: 8px; overflow-x: auto; font-size: 0.8rem; }
