:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #1b2633;
  background: #f5f7f9;
  font-size: 14px;
  --muted: #637284;
  --line: #e1e7ed;
  --brand: #2453db;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  height: 72px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 28px;
}
header #account {
  margin-left: auto;
}
.brand {
  font-size: 23px;
  text-decoration: none;
  color: #233044;
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand b {
  font-weight: 500;
  color: var(--brand);
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
}
.chip {
  display: inline-block;
  background: #eaf0ff;
  color: #294eaa;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11px;
}
button {
  border: 1px solid #d7e0e9;
  background: white;
  border-radius: 7px;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:hover {
  background: #edf2fa;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.primary:hover {
  background: #1943c3;
}
h1,
h2,
p {
  margin-top: 0;
}
h2 {
  font-size: 13px;
  font-weight: 650;
}
h1 {
  font-size: 23px;
  letter-spacing: -0.035em;
  margin-bottom: 0;
}
#welcome {
  max-width: 1100px;
  min-height: calc(100vh - 72px);
  margin: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 60px 36px;
}
.intro h1 {
  font-size: 48px;
  line-height: 1.12;
  margin: 24px 0;
}
.intro p,
.intro li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}
.intro ol {
  padding-left: 20px;
}
#signin {
  display: flex;
  justify-content: center;
}
#app {
  height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 220px minmax(400px, 1fr) 270px;
}
.sidebar {
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #f1f4f8;
  overflow: auto;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.label-row h2 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.icon {
  padding: 2px 7px;
  background: transparent;
  font-size: 20px;
  border: 0;
}
.sidebar #topics {
  margin-bottom: 30px;
}
.sidebar #projects {
  margin-bottom: 28px;
}
.nav {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  margin: 3px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav.selected {
  background: #e0e9ff;
  color: #214ab9;
  font-weight: 600;
}
.sidebar-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: white;
  min-width: 0;
}
.toolbar {
  display: flex;
  padding: 24px 28px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toolbar h1 {
  margin-top: 5px;
}
.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tabs {
  display: flex;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  border: 0;
  border-radius: 0;
  padding: 14px 0;
  background: transparent;
  color: var(--muted);
}
.tabs .selected {
  color: var(--brand);
  box-shadow: inset 0 -2px var(--brand);
}
.view {
  padding: 24px 28px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.view h2 {
  margin-top: 12px;
}
.entry {
  padding: 0 0 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid #edf0f4;
}
.meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.meta b {
  font-size: 13px;
}
.meta time {
  font-size: 11px;
  color: var(--muted);
}
.body {
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.status {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #eef3f7;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.small {
  font-size: 11px;
}
.empty {
  padding: 40px 10px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
.details {
  border-left: 1px solid var(--line);
  padding: 26px 20px;
  overflow: auto;
}
.details h2 {
  margin-top: 0;
  margin-bottom: 20px;
}
.details h2:not(:first-child) {
  margin-top: 28px;
}
.identity {
  padding-bottom: 18px;
  overflow-wrap: anywhere;
}
.identity strong {
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}
.identity code {
  font-size: 9px;
}
.identity button {
  font-size: 10px;
  padding: 3px 6px;
  margin-top: 6px;
}
.identity select {
  max-width: 100%;
  font-size: 11px;
}
#compose {
  margin: 0 28px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 5px #21304706;
  padding: 12px;
}
textarea,
input,
select {
  font: inherit;
  border: 1px solid #d7e0e9;
  background: white;
  border-radius: 6px;
  padding: 9px;
  color: inherit;
  max-width: 100%;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 85px;
  line-height: 1.5;
}
#message-body {
  border: 0;
  min-height: 80px;
  resize: vertical;
}
.compose-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.compose-meta select {
  font-size: 11px;
  padding: 4px;
}
.compose-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 10px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.file-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.file-row button {
  font-size: 11px;
}
.file-path {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f5f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  font:
    12px/1.7 ui-monospace,
    monospace;
}
label {
  display: block;
  font-size: 12px;
  line-height: 1.6;
}
label input {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 680px;
  width: 90vw;
  padding: 28px;
  box-shadow: 0 20px 80px #11182730;
}
dialog::backdrop {
  background: #17203366;
}
dialog h2 {
  font-size: 22px;
}
#invite-topics label {
  display: flex;
  gap: 8px;
  margin: 7px 0;
  align-items: center;
}
#invite-topics input {
  width: auto;
  margin: 0;
}
#snippet-area {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#snippet {
  min-height: 190px;
  margin: 8px 0;
  font-size: 12px;
}
#notice {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #25344a;
  color: white;
  z-index: 10;
  padding: 12px 20px;
  border-radius: 8px;
  max-width: 85vw;
}
#context-form {
  margin-top: 26px;
}
#context-form button {
  margin-top: 10px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  #app {
    grid-template-columns: 185px minmax(360px, 1fr);
  }
  .details {
    display: none;
  }
  .toolbar {
    padding: 18px;
  }
  .view,
  .tabs {
    padding-left: 18px;
    padding-right: 18px;
  }
  #compose {
    margin: 0 18px 18px;
  }
  header .eyebrow {
    display: none;
  }
}
@media (max-width: 700px) {
  #welcome {
    grid-template-columns: 1fr;
    padding: 30px;
    gap: 20px;
  }
  .intro h1 {
    font-size: 36px;
  }
  #app {
    grid-template-columns: 140px minmax(0, 1fr);
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .sidebar {
    padding: 18px 8px;
  }
  .tabs {
    gap: 10px;
    font-size: 11px;
  }
  .compose-footer .muted {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

#name-dialog {
  max-width: 420px;
}
#new-name {
  width: 100%;
  margin: 8px 0 24px;
}
.presence-summary {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 28px;
  text-align: left;
  background: #f6f8fc;
  font-size: 11px;
  color: #41516a;
}
.presence-badge {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 7px;
  font-size: 10px;
  margin: 5px 0 8px 5px;
  background: #edf0f4;
  color: #5b6879;
}
.presence-streaming {
  background: #e2f5e9;
  color: #176f3a;
}
.presence-api_only {
  background: #fff2d5;
  color: #8b5b00;
}
.presence-revoked {
  background: #fce8e8;
  color: #a63232;
}
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.agent-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.agent-card strong {
  font-size: 15px;
}
.agent-card .small {
  line-height: 1.8;
}
.receipt-counts {
  font-size: 11px;
  color: #495b72;
  margin: 8px 0;
  line-height: 1.7;
}
.receipt-pending {
  background: #fff2d5;
  color: #8b5b00;
}
.receipt-received,
.receipt-completed {
  background: #e2f5e9;
  color: #176f3a;
}
.receipt-working,
.receipt-thinking {
  background: #eaf0ff;
  color: #294eaa;
}
.receipt-blocked {
  background: #fce8e8;
  color: #a63232;
}
.tabs {
  overflow-x: auto;
  flex-shrink: 0;
}
.tabs button {
  white-space: nowrap;
}
.agent-card button {
  margin-right: 4px;
}
.presence-summary:hover {
  background: #eaf0ff;
}
