:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #0f172a;
  background: #f1f5f9;
}

body {
  margin: 0;
}

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.sub, .hint {
  margin: 0.25rem 0;
  color: #475569;
  font-size: 0.95rem;
}

.log {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

.bubble {
  margin-bottom: 1rem;
}

.bubble .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.bubble .body {
  line-height: 1.45;
}

.bubble.user .body {
  white-space: pre-wrap;
  background: #e0f2fe;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
}

.bubble.assistant .body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.bubble.assistant .body th,
.bubble.assistant .body td {
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.5rem;
  text-align: left;
}

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

.chart-root {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem 1rem;
  background: #f8fafc;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

.chart-toolbar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.chart-toolbar button {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  color: #475569;
}

.chart-toolbar button.active {
  border-color: #0ea5e9;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

.chart-canvas-wrap {
  position: relative;
  height: 280px;
  width: 100%;
  min-width: 240px;
  min-height: 200px;
}

.chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-fallback {
  font-size: 0.85rem;
  color: #b45309;
  margin: 0;
}

.composer {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.composer textarea {
  flex: 1;
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font: inherit;
}

.composer button {
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: #0ea5e9;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.composer button:disabled {
  opacity: 0.6;
  cursor: wait;
}

footer {
  font-size: 0.8rem;
  color: #64748b;
}
