:root {
  --ink: #14142a;
  --muted: #4a4e62;
  --line: #e4e7f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --blue: #1a73e8;
  --blue-dark: #1558b0;
  --warn: #92400e;
  --error: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.75rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

h1 { margin: 0; font-size: 1.25rem; }
.subtitle { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.875rem; }

.session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.session a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}

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

.seed-tabs { display: flex; gap: 0.4rem; }

.tab, button, .secondary {
  font: inherit;
  cursor: pointer;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.tab.active {
  background: #e8f1ff;
  border-color: #c5dbff;
  color: var(--blue);
}

label { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
label span { font-size: 0.8rem; font-weight: 600; color: var(--muted); }

input, select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; }

.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }

.actions { display: flex; align-items: center; gap: 1rem; }

button[type="submit"] {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-weight: 600;
}

button[type="submit"]:hover { background: var(--blue-dark); }
button[type="submit"]:disabled { opacity: 0.65; cursor: wait; }

.secondary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
}

.session button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
}

.error { margin: 0; color: var(--error); font-size: 0.875rem; }

.results { margin-top: 1rem; padding: 0; overflow: hidden; }

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.results-head h2 { margin: 0; font-size: 1rem; }
.results-actions { display: flex; gap: 0.5rem; }

.table-wrap { overflow: auto; max-height: 70vh; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); text-align: left; }
th { position: sticky; top: 0; background: #fafbff; cursor: pointer; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #f7f9ff; }

.comp-LOW { color: #067647; }
.comp-MEDIUM { color: #b54708; }
.comp-HIGH { color: #b42318; }

.gate { text-align: left; }
.gate p { color: var(--muted); }
.gate a {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-weight: 600;
}

@media (max-width: 800px) {
  .row { grid-template-columns: 1fr; }
  .topbar, .results-head { flex-direction: column; align-items: stretch; }
}
