:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --ink: #171717;
  --muted: #6f6a61;
  --line: #d9d0c4;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --green: #247a57;
  --teal: #0b7285;
  --amber: #b46613;
  --rose: #b23a48;
  --navy: #263b5e;
  --shadow: 0 18px 50px rgba(33, 28, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0)),
    var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP",
    sans-serif;
}

.shell {
  width: min(1220px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.scoreboard,
.workspace {
  display: grid;
  gap: 16px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 20px;
  line-height: 1.25;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(33, 28, 20, 0.08);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #23a56b;
  box-shadow: 0 0 0 6px rgba(35, 165, 107, 0.14);
}

.scoreboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.scoreboard article,
.board,
.panel,
.panel-section {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.scoreboard article {
  min-height: 92px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(33, 28, 20, 0.06);
}

.metric {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.board {
  min-height: 660px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(216, 208, 195, 0.38) 1px, transparent 1px),
    linear-gradient(rgba(216, 208, 195, 0.38) 1px, transparent 1px),
    #fbf8f1;
  background-size: 34px 34px;
  box-shadow: var(--shadow);
}

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

.section-head.compact {
  margin-bottom: 12px;
}

.board-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

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

.agent-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(33, 28, 20, 0.07);
}

.agent-card.active {
  border-color: rgba(36, 122, 87, 0.38);
}

.agent-card.manual {
  border-color: rgba(38, 59, 94, 0.36);
}

.agent-card.standby,
.agent-card.scheduled {
  background: rgba(255, 253, 248, 0.82);
}

.agent-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.mascot {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 70px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(23, 23, 23, 0.12);
  border-radius: 8px;
  background: #fff8e7;
  box-shadow: inset 0 -8px 0 rgba(23, 23, 23, 0.04);
  font-size: 28px;
  line-height: 1;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.badge.active {
  background: var(--green);
}

.badge.manual {
  background: var(--navy);
}

.badge.standby {
  background: var(--amber);
}

.badge.scheduled {
  background: var(--teal);
}

.status-stack {
  display: grid;
  justify-items: end;
  gap: 6px;
  max-width: 86px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.agent-main {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.agent-main p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.entity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.entity-row span {
  border: 1px solid rgba(36, 122, 87, 0.24);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f5fbf7;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.agent-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.agent-meta div {
  display: grid;
  gap: 3px;
}

.agent-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.agent-meta dd {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.readiness {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.readiness-head strong {
  color: var(--ink);
  font-size: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #ece5da;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.panel-section {
  padding: 16px;
  box-shadow: 0 10px 28px rgba(33, 28, 20, 0.07);
}

.live-section {
  border-color: rgba(36, 122, 87, 0.34);
  background: #f8fcf8;
}

.live-dot {
  align-self: start;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.live-card {
  display: grid;
  gap: 12px;
}

.live-main {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(36, 122, 87, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.live-main strong {
  font-size: 20px;
  line-height: 1.15;
}

.live-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.live-grid article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.live-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.live-grid strong {
  font-size: 22px;
  line-height: 1;
}

.live-detail {
  display: grid;
  gap: 9px;
  margin: 0;
}

.live-detail div {
  display: grid;
  gap: 3px;
}

.live-detail dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.live-detail dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.queue-item.hot {
  border-color: rgba(36, 122, 87, 0.42);
  background: #f5fbf7;
}

.queue-item strong {
  font-size: 15px;
}

.queue-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.reality-list {
  display: grid;
  gap: 10px;
}

.reality-list article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}

.reality-list strong {
  font-size: 14px;
}

.reality-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.milestone-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: milestone;
}

.milestone-list li {
  counter-increment: milestone;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.milestone-list li::before {
  content: counter(milestone);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.milestone-list li.done {
  color: var(--ink);
}

.milestone-list li.done::before {
  content: "✓";
  border-color: rgba(36, 122, 87, 0.42);
  background: var(--green);
  color: #fff;
}

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

.connector-grid span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.status-guide {
  display: grid;
  gap: 10px;
}

.status-guide article {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.status-guide .badge {
  width: max-content;
}

.status-guide p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.rule-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .agent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 24px, 1220px);
    padding-top: 18px;
  }

  .topbar,
  .scoreboard {
    grid-template-columns: 1fr;
  }

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

  .section-head {
    display: grid;
  }
}
