:root {
  color-scheme: light;
  --bg: #f5f3ec;
  --panel: rgba(255,255,255,.82);
  --ink: #11130f;
  --muted: #66685f;
  --green: #153c2b;
  --gold: #a88645;
  --line: rgba(17,19,15,.10);
  --shadow: 0 24px 70px rgba(24,28,21,.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 80% -10%, rgba(168,134,69,.14), transparent 34rem), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
button, textarea { font: inherit; }
.shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 44px; }
.topbar, .topbar-actions, .section-head, .workspace-head, .actions, .chief-card, .department-head, .agent-row {
  display: flex;
  align-items: center;
}
.topbar, .section-head, .workspace-head, .chief-card, .department-head, .agent-row { justify-content: space-between; }
.topbar { gap: 24px; padding: 14px 2px 28px; }
.topbar-actions, .actions { gap: 10px; }
.topbar h1 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.02em; }
.eyebrow, .kicker, .agent-role {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0;
}
.status-chip, .agent-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: var(--muted);
  white-space: nowrap;
}
.status-chip { padding: 9px 13px; font-size: 13px; }
.agent-status { padding: 6px 9px; font-size: 11px; font-weight: 700; }
.agent-status.active, .agent-status.ready-bounded { color: var(--green); border-color: rgba(21,60,43,.22); background: rgba(21,60,43,.07); }
.agent-status.waiting-tool-binding, .agent-status.waiting-scope-binding { color: #7f642b; background: rgba(168,134,69,.09); }
.hero, .workspace, .organization, .metrics article {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero { border-radius: 28px; padding: clamp(28px, 5vw, 64px); min-height: 330px; display: flex; align-items: end; justify-content: space-between; gap: 36px; }
.hero h2 { max-width: 820px; margin: 12px 0 16px; font-size: clamp(38px, 6vw, 72px); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.button { border: 0; border-radius: 999px; padding: 13px 18px; cursor: pointer; transition: transform .16s ease, opacity .16s ease; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { background: var(--green); color: #fff; }
.button.secondary { background: #ece9df; color: var(--ink); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.metrics article { border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 7px; }
.metrics strong { font-size: 30px; letter-spacing: -.04em; }
.metrics span { color: var(--muted); font-size: 12px; }
.organization { border-radius: 28px; padding: clamp(24px,4vw,42px); margin-bottom: 16px; }
.section-head { gap: 24px; align-items: end; }
.section-head h2, .workspace h2 { margin: 8px 0 0; font-size: clamp(27px,4vw,42px); letter-spacing: -.04em; }
.muted { color: var(--muted); font-size: 13px; }
.chief-card { margin: 26px 0 16px; padding: 24px; border-radius: 22px; background: var(--green); color: #fff; gap: 24px; }
.chief-card h3 { margin: 6px 0 8px; font-size: 27px; }
.chief-card p { margin: 0; max-width: 760px; color: rgba(255,255,255,.72); line-height: 1.45; }
.chief-card .agent-status { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #fff; }
.department-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.department-card { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: rgba(255,255,255,.54); }
.department-head { align-items: flex-start; gap: 16px; padding: 22px; flex-wrap: wrap; }
.department-head h3 { width: 100%; margin: 20px 0 0; font-size: 25px; letter-spacing: -.035em; }
.department-head p { margin: 0; color: var(--muted); line-height: 1.45; flex: 1 1 70%; }
.lane-number { color: var(--gold); font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.agent-list { border-top: 1px solid var(--line); }
.agent-row { gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.agent-row:last-child { border-bottom: 0; }
.agent-row > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.agent-row strong { font-size: 14px; }
.agent-row span:not(.agent-status) { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace { border-radius: 28px; padding: clamp(24px,4vw,42px); }
.workspace-head { gap: 24px; align-items: end; }
textarea { width: 100%; resize: vertical; min-height: 150px; margin: 26px 0 14px; padding: 18px; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; background: rgba(250,249,245,.92); outline: none; line-height: 1.5; }
textarea:focus { border-color: rgba(21,60,43,.45); }
.message { min-height: 22px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.result { white-space: pre-wrap; margin: 14px 0 0; border-radius: 18px; padding: 20px; background: #11130f; color: #f7f4e9; overflow: auto; line-height: 1.55; font-family: inherit; }
footer { display: flex; justify-content: space-between; gap: 18px; padding: 26px 4px 0; color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 860px) {
  .shell { width: min(100% - 24px,1220px); padding-top: 14px; }
  .hero, .section-head, .workspace-head, footer { align-items: stretch; flex-direction: column; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  .department-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 520px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .chief-card { align-items: flex-start; flex-direction: column; }
  .agent-row { align-items: flex-start; }
}

.activity-panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: clamp(24px,4vw,42px);
  margin-bottom: 16px;
}
.activity-metrics {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 10px;
  margin: 24px 0 14px;
}
.activity-metrics article {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.5);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.activity-metrics strong { font-size: 24px; letter-spacing: -.03em; }
.activity-metrics span, .activity-copy span { color: var(--muted); font-size: 11px; }
.activity-list { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.activity-row { display: flex; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.activity-copy strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-status { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 700; color: var(--green); background: rgba(21,60,43,.06); }
.activity-empty { padding: 20px; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .activity-metrics { grid-template-columns: repeat(2,1fr); }
  .activity-row { align-items: flex-start; flex-direction: column; }
}
