:root {
  color-scheme: light;
  --ink: #15202b;
  --muted: #617080;
  --line: #d9e1e8;
  --surface: #ffffff;
  --panel: #f5f7f8;
  --accent: #116b5f;
  --accent-strong: #0d5148;
  --warn: #a65310;
  --ok: #207447;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf1f3;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 20px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 15px;
}

.status-strip,
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef8f5;
  color: var(--accent-strong);
  font-size: 13px;
  white-space: nowrap;
}

.pill.muted {
  background: #f1f3f5;
  color: var(--muted);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  min-height: 0;
}

.sidebar {
  padding: 18px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-panel {
  border-left: 1px solid var(--line);
  border-right: 0;
  overflow: auto;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  color: var(--ink);
  font-weight: 600;
}

.check-row input {
  min-height: 18px;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 107, 95, 0.12);
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-strong);
}

.agents {
  display: grid;
  gap: 10px;
}

.agents-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.agent-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.agent-row strong {
  color: var(--ink);
}

.conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.messages {
  overflow: auto;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(21, 32, 43, 0.04);
}

.message.agent {
  border-left: 4px solid var(--ok);
}

.message.feishu {
  border-left: 4px solid #2f66c5;
}

.message.system {
  border-left: 4px solid var(--warn);
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .setup-panel {
    border-left: 0;
  }

  .messages {
    padding: 16px;
  }

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