:root {
  --bg: #f5f7fb;
  --ink: #13243a;
  --muted: #5d6b7a;
  --line: #d9e1ec;
  --card: #ffffff;
  --accent: #1e7a46;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, #eef3f9 0%, #f9fbff 100%);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: 0.2px; }
.project { color: var(--muted); font-size: 13px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.nav a.active { background: #e7f6ed; border-color: #b7ddc6; color: #115c33; }
.layout { padding: 16px; }
.panel {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.muted { color: var(--muted); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.card .k { font-size: 24px; font-weight: 700; color: var(--accent); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.extra {
  margin: 8px 0 16px;
}
.stack {
  display: grid;
  gap: 10px;
}
.form-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.field textarea {
  min-height: 70px;
  resize: vertical;
}
.actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.btn {
  border: 1px solid #9dcbb0;
  border-radius: 8px;
  background: #eaf7ef;
  color: #0d5e32;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.feedback {
  font-size: 13px;
  margin-top: 6px;
  color: #1f5f8b;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.activity-list {
  margin: 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 4px;
}
.activity-item {
  font-size: 13px;
  color: var(--ink);
}
.lineage-graph {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.lineage-graph svg {
  width: 100%;
  min-height: 520px;
  display: block;
}
.lineage-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.lineage-pane {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}
.lineage-pane h4 {
  margin: 0 0 8px;
}
.lineage-node {
  fill: #f1f8f4;
  stroke: #85b69a;
  stroke-width: 1.5;
}
.lineage-root {
  fill: #e1f4e8;
  stroke: #3f9461;
}
.lineage-edge {
  stroke: #8da1b4;
  stroke-width: 1.4;
}
.lineage-edge-pending {
  stroke: #c57a1f;
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.lineage-label {
  font-size: 11px;
  fill: #17314b;
}
.lineage-sex {
  font-size: 13px;
  fill: #17314b;
  font-weight: 700;
}
.lineage-placeholder {
  fill: #f7f2e8;
  stroke: #c2a46e;
  stroke-dasharray: 4 3;
}
.lineage-node-group.selected circle {
  stroke: #1e7a46;
  stroke-width: 3;
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr; }
  .lineage-layout { grid-template-columns: 1fr; }
}
