:root {
  --bg: #070b12;
  --bg2: #0b111c;
  --panel: #101827;
  --panel2: #121d2e;
  --surface: #162235;
  --surface2: #1d2b40;
  --line: rgba(176, 202, 237, 0.16);
  --line2: rgba(176, 202, 237, 0.28);
  --text: #e6edf7;
  --muted: #94a7bd;
  --muted2: #71849b;
  --accent: #70d6ff;
  --accent2: #b8f7d4;
  --warn: #f7ca6a;
  --danger: #ff817e;
  --ok: #7af0b0;
  --shadow: 0 18px 50px rgba(0,0,0,.30);
  --radius: 14px;
  --gap: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(circle at top left, rgba(112,214,255,.12), transparent 33rem), var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  font-size: 12.5px;
}
button, input, select { font: inherit; }
.app-shell { height: 100svh; display: grid; grid-template-rows: 52px 1fr; overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 22, .94); backdrop-filter: blur(14px); min-width: 0;
}
.brand-block { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-copy { min-width: 0; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(112,214,255,.26), rgba(184,247,212,.14));
  border: 1px solid var(--line2); color: var(--accent); font-weight: 900; letter-spacing: -.06em;
}
h1 { margin: 0; font-size: 15px; line-height: 1.05; letter-spacing: .01em; }
.brand-block p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workspace {
  min-height: 0; display: grid;
  grid-template-columns: minmax(245px, 292px) minmax(540px, 1fr) minmax(305px, 390px);
  gap: var(--gap); padding: var(--gap); overflow: hidden;
}
.panel {
  background: linear-gradient(180deg, rgba(18,29,46,.96), rgba(12,18,29,.96));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 0;
}
.sidebar, .right-panel { display: flex; flex-direction: column; overflow: hidden; }
.main-stage {
  min-width: 0; min-height: 0; display: grid;
  grid-template-rows: auto minmax(260px, .58fr) minmax(230px, .42fr);
  gap: var(--gap); overflow: hidden;
}
.panel-section { padding: 11px; border-bottom: 1px solid var(--line); min-height: 0; }
.panel-section:last-child { border-bottom: 0; }
.panel-section.tight { padding-bottom: 10px; }
h2 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .085em; text-transform: uppercase; color: #cfe3ff; }
h3 { margin: 0 0 7px; font-size: 13px; }
p { line-height: 1.42; }
.small-copy { color: var(--muted); margin: 0; font-size: 12px; }
.field-label { display: block; color: var(--muted); font-size: 10.5px; margin: 8px 0 5px; }
.input {
  width: 100%; border: 1px solid var(--line2); background: rgba(7,11,18,.76); color: var(--text);
  border-radius: 10px; padding: 7px 8px; outline: none; min-height: 32px;
}
.input:focus { border-color: rgba(112,214,255,.72); box-shadow: 0 0 0 3px rgba(112,214,255,.10); }
.dual-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seed-row { display: grid; grid-template-columns: 1fr 34px; gap: 7px; }
.check-row { display: grid; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 11.5px; }
.check-row label { display: flex; gap: 7px; align-items: center; }
.button-row { display: grid; grid-template-columns: 1fr .62fr; gap: 8px; margin-top: 10px; }
.button {
  border: 1px solid var(--line2); background: rgba(22,34,53,.94); color: var(--text); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); border-color: rgba(112,214,255,.72); background: rgba(29,43,64,.98); }
.button.primary { background: linear-gradient(135deg, rgba(112,214,255,.24), rgba(184,247,212,.16)); border-color: rgba(112,214,255,.42); }
.button.compact { padding: 7px 9px; font-size: 12px; }
.button.square { padding: 0; display: grid; place-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--muted); background: rgba(255,255,255,.03); white-space: nowrap;
}
.pill.live { color: var(--ok); border-color: rgba(122,240,176,.30); }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: var(--gap); min-width: 0; }
.metric-card, .status-card {
  background: rgba(7,11,18,.42); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 58px;
}
.metric-card strong { display: block; font-size: 17px; color: var(--accent); }
.metric-card span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.timeline-panel, .lane-panel, .details-panel { overflow: hidden; display: flex; flex-direction: column; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 11px 8px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.compact-head { padding-bottom: 7px; }
.section-head h2 { margin-bottom: 2px; }
.section-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.timeline {
  min-height: 0; padding: 11px; display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; overflow: auto;
}
.section-card {
  border: 1px solid var(--line); border-radius: 13px; background: rgba(7,11,18,.42); padding: 10px; min-height: 108px; cursor: pointer; position: relative; overflow: hidden;
}
.section-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); opacity: .85; }
.section-card.active { border-color: rgba(112,214,255,.82); box-shadow: 0 0 0 3px rgba(112,214,255,.10) inset; }
.section-card h3 { font-size: 12.5px; margin: 0 0 6px; }
.section-type { color: var(--accent2); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; }
.section-card p { color: var(--muted); margin: 7px 0; font-size: 11.5px; }
.section-bars { display: flex; gap: 6px; align-items: center; color: var(--muted2); font-size: 10.5px; }
.meter { height: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.meter > i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, rgba(112,214,255,.72), rgba(184,247,212,.72)); }
.selected-section { border-top: 1px solid var(--line); padding: 9px 11px; min-height: 92px; overflow: auto; }
.selected-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 10px; }
.selected-grid p { margin: 0; color: var(--muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; border: 1px solid var(--line2); color: #d8e6f5; background: rgba(255,255,255,.035);
  border-radius: 999px; padding: 3px 7px; font-size: 10.5px;
}
.tag.warn { border-color: rgba(247,202,106,.36); color: var(--warn); }
.tag.ok { border-color: rgba(122,240,176,.36); color: var(--ok); }
.tag.danger { border-color: rgba(255,129,126,.36); color: var(--danger); }
.bottom-grid { min-height: 0; display: grid; grid-template-columns: minmax(390px, 1.35fr) minmax(270px, .65fr); gap: var(--gap); overflow: hidden; }
.table-wrap { overflow: auto; min-height: 0; }
.lane-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.lane-table th, .lane-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.lane-table th { position: sticky; top: 0; background: #121d2e; color: #cfe3ff; font-size: 10px; letter-spacing: .065em; text-transform: uppercase; z-index: 2; }
.lane-table td:first-child, .lane-table th:first-child { text-align: left; position: sticky; left: 0; background: #101827; z-index: 3; }
.lane-dot { width: 18px; height: 18px; border-radius: 999px; margin: auto; border: 1px solid var(--line2); background: rgba(255,255,255,.035); }
.lane-dot.on { background: rgba(112,214,255,.34); border-color: rgba(112,214,255,.72); box-shadow: 0 0 0 3px rgba(112,214,255,.08); }
.diagnostics { padding: 10px; overflow: auto; min-height: 0; display: grid; gap: 8px; }
.diag-item { border: 1px solid var(--line); border-radius: 11px; padding: 8px; background: rgba(7,11,18,.36); }
.diag-item strong { display: block; margin-bottom: 3px; color: var(--accent2); }
.diag-item span { color: var(--muted); }
.family-list, .roadmap-list, .trait-blend { display: grid; gap: 7px; }
.family-card, .roadmap-item, .blend-card {
  border: 1px solid var(--line); border-radius: 11px; background: rgba(7,11,18,.34); padding: 8px;
}
.family-card b, .roadmap-item b, .blend-card b { display: block; color: var(--text); font-size: 12px; margin-bottom: 2px; }
.family-card span, .roadmap-item span, .blend-card span { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.roadmap-panel { overflow: auto; }
.console-section { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.console-log {
  flex: 1; min-height: 130px; overflow: auto; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 11px;
  color: #cde4ff; padding: 9px; margin: 0; font: 11px/1.45 var(--mono); white-space: pre-wrap;
}
.scroll-mini { flex: 1; overflow: auto; }
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 250px minmax(480px,1fr); }
  .right-panel { display: none; }
}
@media (max-width: 840px) {
  body { overflow: auto; }
  .app-shell { min-height: 100svh; height: auto; }
  .workspace { grid-template-columns: 1fr; overflow: visible; }
  .main-stage { grid-template-rows: auto auto auto; overflow: visible; }
  .bottom-grid, .selected-grid { grid-template-columns: 1fr; }
  .sidebar, .right-panel, .timeline-panel, .lane-panel, .details-panel { max-height: none; }
  .right-panel { display: flex; }
}
