@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #f4efe6;
  --bg-soft: #fffaf2;
  --ink: #1d2a2f;
  --ink-muted: #43585f;
  --accent: #0b7285;
  --accent-soft: #dbf2f0;
  --warn: #b85c2d;
  --ok: #1f7a4d;
  --line: #d6d9d2;
  --card: #ffffff;
  --shadow: 0 12px 28px rgba(24, 42, 51, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #f9e5cf 0%, var(--bg) 46%, #e8efe7 100%);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(11, 114, 133, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 114, 133, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}

.layout {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.topbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}

h1 {
  margin: 4px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--ink-muted);
}

.top-actions {
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  border-color: var(--accent);
}

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

.meta-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.meta-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.meta-card h3 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

#searchInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

.people-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  overflow: auto;
}

.person-card {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
}

.person-card.active {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}

.person-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.person-name {
  margin: 0;
  font-size: 16px;
  font-family: "Space Grotesk", sans-serif;
}

.mode-pill {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 7px;
  background: #ebf7fa;
  color: #065f6f;
}

.mode-pill.hypothesis_mode {
  background: #ffe9d9;
  color: var(--warn);
}

.leverage-line,
.next-line {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.empty-state {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 28px;
  color: var(--ink-muted);
}

.person-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.person-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  line-height: 1;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip {
  background: #f0f5f6;
  color: #24454e;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.section-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

.panel pre,
.agent-json {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.metric p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.listish {
  margin: 0;
  padding-left: 18px;
}

.status-ok {
  color: var(--ok);
  font-weight: 600;
}

.status-warn {
  color: var(--warn);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sidebar {
    min-height: 320px;
  }

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