:root {
  color-scheme: light;
  --ink: #1b1f24;
  --muted: #637083;
  --line: #d7dde6;
  --paper: #f7f9fc;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --blue: #2563eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
.file-button {
  min-height: 40px;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
}

button:hover,
.file-button:hover {
  background: var(--accent-strong);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.overview,
.workspace,
.ingest {
  display: grid;
  gap: 18px;
}

.overview {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1rem;
}

.lede {
  max-width: 760px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
}

.controls,
.ingest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics article,
.chart-panel,
.feed,
.ingest {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metrics article {
  padding: 16px;
}

.metrics span,
.panel-header span,
.feed time,
#ingest-message {
  color: var(--muted);
  font-size: 0.88rem;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

.chart-panel,
.feed,
.ingest {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.status {
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  color: var(--accent-strong);
  padding: 4px 10px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(#fff, #f8fbff);
}

.feed {
  max-height: 446px;
  overflow: auto;
}

.feed ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed li {
  border-left: 4px solid var(--blue);
  padding: 8px 0 8px 10px;
}

.feed strong {
  display: block;
  margin-bottom: 3px;
}

.ingest {
  margin-top: 18px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: 0.92rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.5;
  padding: 12px;
}

@media (max-width: 820px) {
  .overview,
  .workspace {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding: 20px 0;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .controls button,
  .file-button {
    width: 100%;
    text-align: center;
  }
}
