:root {
  --bg: #0b0f19;
  --panel: #12182a;
  --muted: #9aa6c2;
  --text: #e8edff;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #5b8cff;
  --secondary: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

code {
  color: #c7d2fe;
}

.hidden {
  display: none;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-email {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0b0f19;
}

.btn-secondary {
  background: var(--secondary);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-gate {
  position: fixed;
  inset: 56px 0 0 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.auth-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 14px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.auth-footnote {
  color: var(--muted);
  font-size: 0.9rem;
}

.app {
  padding: 16px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 360px 1fr 520px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 160px;
}

.panel-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.label {
  font-size: 0.85rem;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.assumptions {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.assumption {
  display: grid;
  gap: 6px;
}

.plot {
  height: 420px;
}

.summary {
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.35;
}

.notes {
  margin-top: 10px;
  color: #c7d2fe;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.search-result {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 8px 0 12px;
}

.chat-panel {
  height: calc(100vh - 56px - 32px);
}

.chat-container {
  height: calc(100% - 26px);
}

