:root {
  --bg: #f4efe6;
  --bg-accent: #efe1d0;
  --surface: rgba(255, 250, 243, 0.86);
  --surface-strong: rgba(255, 247, 237, 0.98);
  --border: rgba(98, 62, 26, 0.14);
  --text: #2f2117;
  --muted: #7a6455;
  --working: #247a52;
  --warm: #b66f19;
  --failed: #b33a3a;
  --idle: #70655c;
  --main: #255d8f;
  --sub: #7d4db5;
  --shadow: 0 20px 60px rgba(99, 61, 20, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 32%),
    radial-gradient(circle at bottom right, rgba(232, 185, 121, 0.25), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero,
.panel-grid,
.summary-grid {
  display: grid;
  gap: 18px;
}

.hero {
  grid-template-columns: 1.7fr 1fr;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-size: 12px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 0.96;
}

.subtitle {
  margin: 16px 0 0;
  max-width: 620px;
  font-size: 1.05rem;
  color: var(--muted);
}

.source-panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.source-panel {
  padding: 20px;
}

.summary-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.panel-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
}

.card {
  padding: 22px;
}

.card-label,
.muted,
.path-text,
.source-text,
.agent-key,
.agent-meta {
  color: var(--muted);
}

.card-value {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.section-head,
.meter-head,
.agent-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.badge,
.agent-kind,
.agent-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.neutral {
  background: rgba(64, 56, 49, 0.1);
  color: var(--text);
}

.badge.working,
.agent-state.working {
  background: rgba(36, 122, 82, 0.14);
  color: var(--working);
}

.agent-state.maybe_working {
  background: rgba(182, 111, 25, 0.14);
  color: var(--warm);
}

.agent-state.failed {
  background: rgba(179, 58, 58, 0.14);
  color: var(--failed);
}

.agent-state.idle {
  background: rgba(112, 101, 92, 0.14);
  color: var(--idle);
}

.agent-kind.main {
  background: rgba(37, 93, 143, 0.12);
  color: var(--main);
}

.agent-kind.sub {
  background: rgba(125, 77, 181, 0.12);
  color: var(--sub);
}

.meter-group {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.meter-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(47, 33, 23, 0.08);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8b979, #ad6430);
  transition: width 400ms ease;
}

.meter-fill.memory {
  background: linear-gradient(90deg, #8ca2d8, #255d8f);
}

.overview-text {
  margin-top: 18px;
  font-size: 1.04rem;
  line-height: 1.6;
}

.agents-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.agent-item {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.6fr 1fr;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid rgba(98, 62, 26, 0.1);
}

.agent-title {
  margin: 0;
  font-size: 1.05rem;
}

.agent-key,
.agent-meta {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero,
  .panel-grid,
  .summary-grid,
  .agent-item {
    grid-template-columns: 1fr;
  }
}
