:root {
  color-scheme: dark;
  --bg: #151515;
  --sidebar: #1c1c1c;
  --panel: #212121;
  --panel-strong: #282828;
  --raised: #303030;
  --ink: #ededed;
  --text: #d6d6d6;
  --muted: #a6a6a6;
  --line: #303030;
  --line-strong: #444444;
  --brand: #9bd5c0;
  --brand-strong: #c6efdf;
  --brand-soft: #293b35;
  --warn: #eac28d;
  --danger: #f5a4a7;
  --shadow: 0 18px 48px #0007;
  --transcript: 720px;
  --pane-header: 49px;
  --app-gutter: clamp(16px, 4vw, 52px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button, input, textarea, select, dialog { border-radius: 0; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

h1, h2, p { margin: 0; }
h1 {
  font-size: 24px;
  line-height: 1.2;
}
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.eyebrow, .auth-brand {
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: block;
}

.field {
  display: grid;
  gap: 6px;
}
.field > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 9px 11px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea { resize: vertical; }

.button {
  display: inline-flex;
  min-height: 34px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: var(--raised);
  border-color: var(--line-strong);
}
.button:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.button--primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #1a2823;
}
.button--primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}
.button--quiet { background: transparent; }
.button--danger {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
}
.button--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
.button--small {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

.text-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.text-button:hover { color: var(--ink); }

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover, .icon-button[aria-expanded="true"] {
  background: var(--raised);
  color: var(--ink);
}

.error {
  color: var(--danger);
  font-size: 12px;
}
.empty {
  color: var(--muted);
  font-size: 12px;
  padding: 14px 9px;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  background: var(--raised);
  color: var(--text);
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.chip--pending {
  background: #34363a;
  color: #d2d4d9;
}
.chip--running {
  background: #2e3b46;
  color: #bfd2e6;
}
.chip--waiting {
  background: #3a3228;
  color: var(--warn);
}
.chip--done {
  background: #2b3a33;
  color: #b0dbc7;
}
.chip--failed {
  background: #433137;
  color: #ffc1c3;
}
.chip--cancelled { color: var(--muted); }

.auth-gate {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  display: grid;
  gap: 17px;
  width: min(398px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-panel .brand-mark {
  width: 43px;
  height: 43px;
}
.auth-panel h1 { margin: 6px 0 7px; }
.auth-panel .muted { font-size: 13px; }
.auth-panel .button--primary { min-height: 38px; }
.manual-link {
  color: var(--brand);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

.app {
  display: grid;
  --nav-width: clamp(200px, 16vw, 232px);
  grid-template-columns: var(--nav-width) minmax(0, 1fr) clamp(290px, 23vw, 344px);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar, .workspace, .inspector {
  min-width: 0;
  min-height: 0;
}
.sidebar, .workspace, .inspector {
  display: flex;
  flex-direction: column;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar__header {
  display: flex;
  min-height: var(--pane-header);
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar__header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__header .brand-mark { width: 23px; height: 23px; }

.sidebar__controls { flex: none; padding: 10px 11px 8px; }

.sidebar__body { flex: 1; min-height: 0; overflow: auto; padding-bottom: 12px; }

.room-search {
  display: flex;
  position: relative;
  align-items: center;
}

.room-search input {
  height: 30px;
  padding-inline: 30px 9px;
  background: var(--panel-strong);
  font-size: 12px;
}

.search-icon {
  position: absolute;
  left: 11px;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 5px;
  height: 1.5px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.sidebar__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

#approval-inbox { padding-bottom: 8px; }
#approval-inbox:not([hidden]) + .agent-roster { border-top: 1px solid var(--line); }
#approval-inbox-list, .room-list { display: grid; gap: 1px; }

.approval-entry__mark {
  display: grid;
  flex: none;
  width: 21px;
  height: 22px;
  place-items: center;
  color: var(--warn);
  font-size: 13px;
  font-weight: 650;
}

.approval-entry__arrow { margin-inline-start: auto; color: var(--muted); }

.room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-inline-start: 2px solid transparent;
  background: transparent;
  padding: 5px 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.room-item:hover { background: var(--raised); }
.room-item.is-active {
  border-inline-start-color: var(--brand);
  background: var(--panel-strong);
  color: var(--ink);
}

.room-item__icon, .empty-state__mark {
  display: grid;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  font-weight: 550;
}

.room-item__icon {
  width: 21px;
  height: 22px;
  border: 0;
  font-size: 15px;
}
.room-item.is-active .room-item__icon {
  color: var(--brand);
}
.room-item__content {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.room-item__unread {
  flex: none;
  min-width: 21px;
  margin-inline-start: auto;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.room-item__content strong, .room-item__preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-item__content strong {
  font-size: 13px;
  font-weight: 600;
}
.room-item__preview {
  color: var(--muted);
  font-size: 11px;
}

.sidebar__footer {
  display: grid;
  flex: none;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 13px 12px;
}

.sidebar__footer-links {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--warn);
}

.live-dot.is-online { background: var(--brand); }

.workspace {
  background: var(--bg);
  overflow: hidden;
}

.workspace__header {
  display: flex;
  min-height: var(--pane-header);
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px clamp(14px, 2vw, 25px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.workspace__identity, .workspace__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.workspace__identity, .workspace__heading { min-width: 0; }
.workspace__actions { flex: none; }
.workspace__header h1 {
  margin-bottom: 1px;
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -.02em;
}
.workspace__header h1, #room-purpose {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#room-purpose {
  color: var(--muted);
  font-size: 11px;
}

.drawer-toggle, .drawer-close { display: none; }
#toggle-inspector { position: relative; }
#toggle-inspector[data-pending="true"]::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: var(--warn);
  content: "";
}
.pane-icon {
  position: relative;
  width: 15px;
  height: 13px;
  border: 1.5px solid currentColor;
}
.pane-icon::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: currentColor;
  content: "";
}
.pane-icon--start::after { left: 4px; }
.pane-icon--end::after { right: 4px; }

.timeline {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-inline: var(--app-gutter);
}
.timeline__content {
  width: min(100%, var(--transcript));
  margin-inline: auto;
  padding: 29px 0 21px;
}
.timeline__date {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 11px;
}
.timeline__date::before, .timeline__date::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.timeline__unread {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.timeline__unread::before, .timeline__unread::after {
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--brand) 45%, var(--line));
  content: "";
}

.empty-state {
  display: grid;
  gap: 6px;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  padding: 20px 0;
  text-align: center;
}

.empty-state strong { font-size: 16px; }
.empty-state p { font-size: 12px; }
.empty-state__mark {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  background: var(--panel);
  font-size: 22px;
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: none;
  place-items: center;
  border: 0;
  background: #2d3036;
  color: #dfe0e5;
  font-size: 12px;
  font-weight: 650;
}

.avatar--agent {
  border-color: #4a4356;
  background: #352f40;
  color: #e1d7ed;
}
.avatar--executor {
  border-color: #43524b;
  background: #2d3933;
  color: #d0eadc;
}
.message {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 23px;
}
.message__body { min-width: 0; }
.message__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 5px;
}
.message__header strong {
  font-size: 13px;
  font-weight: 650;
}
.message__header time {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.message__role {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.message__text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message--system .message__text {
  color: var(--muted);
  font-size: 12px;
}
.message--own .message__text { color: var(--ink); }
.message--result .message__text {
  border-left: 2px solid #5b8c7b;
  padding-left: 11px;
}


.message__receipt {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  gap: 6px;
  margin-top: 4px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.message__receipt::before {
  width: 10px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 0 1px 1px;
  transform: translateY(-1px) rotate(-45deg);
  content: "";
}
.message__receipt:hover, .message__receipt:focus-visible {
  background: var(--brand-soft);
  border-color: var(--line-strong);
  color: var(--brand-strong);
}

.composer {
  display: grid;
  flex: none;
  gap: 7px;
  width: min(var(--transcript), calc(100% - 2 * var(--app-gutter)));
  margin: 9px auto clamp(12px, 2vw, 24px);
  padding: 11px 12px 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.composer:focus-within { border-color: #69776f; }
.composer textarea {
  min-height: 52px;
  max-height: min(38vh, 180px);
  padding: 4px 3px;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
}

.composer__footer, .composer__tools, .composer__send {
  display: flex;
  align-items: center;
  gap: 8px;
}
.composer__footer {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
  font-size: 11px;
}
.composer__tools { min-width: 0; }
.composer__send { flex: none; }
.composer__mention {
  width: 82px;
  flex: none;
  padding: 4px 5px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.composer__mention:hover:not(:disabled) { background: var(--panel-strong); }
#send-message {
  min-height: 29px;
  padding: 3px 9px;
  border-color: var(--line-strong);
  background: var(--raised);
  color: var(--ink);
  font-size: 12px;
}
#send-message:hover { background: var(--line-strong); }

.composer__mention:disabled { opacity: .55; }
#composer-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector {
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--sidebar);
}

.inspector__tabs {
  display: flex;
  flex: none;
  min-height: var(--pane-header);
  align-items: center;
  gap: 5px;
  padding-inline: 14px;
  border-bottom: 1px solid var(--line);
}
.inspector__tabs button {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.inspector__tabs button:hover { color: var(--ink); }
.inspector__tabs [aria-selected="true"] {
  border-bottom-color: var(--brand);
  color: var(--ink);
}
.count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.inspector__section {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 12px;
}
.participant-list, .task-list {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.participant {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 5px;
}

.participant:hover { background: var(--panel-strong); }
.participant__body {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
}
.participant__body strong, .participant__body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.participant__body strong { font-size: 12px; }
.participant__body span, .participant__presence { font-size: 11px; }
.participant__presence {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.presence {
  width: 6px;
  height: 6px;
  background: #7f8c9d;
}
.presence--online { background: var(--brand); }
.presence--busy { background: var(--warn); }

.approval-summary {
  margin-bottom: 10px;
  border: 1px solid #605039;
  background: #2d2520;
  padding: 7px 9px;
  color: var(--warn);
  font-size: 11px;
  font-weight: 630;
}
.task {
  display: grid;
  min-width: 0;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding: 12px 9px;
}
.task:focus { outline: 1px solid var(--warn); outline-offset: -1px; }

.task--attention {
  border-inline-start: 2px solid var(--warn);
  background: var(--panel);
  padding-inline-start: 9px;
}
.task__header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
  font-size: 13px;
}
.task__header strong { overflow-wrap: anywhere; }
.task__instruction {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task__meta { font-size: 11px; }
.task__result {
  max-height: 140px;
  overflow: auto;
  margin: 0;
  background: #1c1d1f;
  color: var(--text);
  padding: 8px;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task__approval summary {
  color: var(--warn);
  font-size: 11px;
  cursor: pointer;
}
.task__approval .task__result { margin-top: 6px; }
.task__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.task__actions [data-task-action="approve"] {
  background: var(--brand-soft);
  border-color: #495e55;
  color: var(--brand-strong);
}

.dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.dialog--wide { width: min(600px, calc(100vw - 32px)); }
.agent-platform-picker {
  min-width: 0;
  margin: 0;
  padding: 10px 11px 11px;
  border: 1px solid var(--line);
}
.agent-platform-picker legend {
  padding: 0 4px;
  color: var(--ink);
  font-weight: 650;
}
.agent-platform-picker > input { margin-bottom: 9px; }
.agent-platform-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-block-size: min(224px, 38dvh);
  overflow: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-gutter: stable;
}
.agent-platform-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 43px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.agent-platform-option:hover { border-color: var(--line-strong); background: var(--panel-strong); }
.agent-platform-option[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.agent-platform-option:disabled { opacity: .6; cursor: wait; }
.agent-platform-option--custom {
  width: 100%;
  margin-top: 8px;
  border-style: dashed;
}
#agent-platform-empty { margin: 5px 1px; font-size: 12px; }

.dialog::backdrop { background: #101113b3; }
.dialog form {
  display: grid;
  gap: 14px;
  padding: 19px;
}
.dialog__header, .dialog__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dialog__header { justify-content: space-between; }
.dialog__actions {
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}
.profile-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
}
.profile-entry:hover { background: var(--panel-strong); border-color: var(--line-strong); }
.profile-entry__label { display: grid; min-width: 0; font-size: 12px; }
.profile-entry__label span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-person {
  display: inline-flex;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.profile-person:hover .avatar { border-color: var(--brand); }
.avatar--photo { position: relative; overflow: hidden; }
.avatar--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-dialog { border-radius: 13px; }
.profile-dialog__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.profile-fields {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--brand-soft);
}
.profile-card__avatar .avatar {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  font-size: 22px;
}
.profile-card h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.profile-upload { display: grid; justify-items: start; gap: 4px; min-width: 0; font-size: 12px; }
.profile-upload label { font-weight: 650; }
#profile-avatar-file {
  padding: 4px;
  border-radius: 5px;
  font-size: 12px;
}
#profile-avatar-file::file-selector-button {
  margin-inline-end: 6px;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.profile-count { margin-top: -8px; text-align: end; font-size: 11px; }
#profile-status { font-size: 12px; }
#profile-status:empty { display: none; }
#profile-view { display: grid; gap: 14px; padding: 19px; }
#profile-view-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-social {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
}
.profile-social__switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.profile-social__switch span { display: grid; gap: 3px; }
.profile-social__switch input { width: 17px; height: 17px; flex: none; accent-color: var(--brand); }
.profile-social__card { display: grid; gap: 7px; }
.profile-social__card > button { justify-self: start; }
#profile-card-tools { display: grid; gap: 8px; }
.profile-social__actions, .friend-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-social__actions a { text-decoration: none; }
.profile-account {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.profile-account h3,
.profile-account p {
  margin: 0;
}
.profile-account > .button {
  justify-self: start;
}
.friends-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.friends-content { display: grid; gap: 13px; padding: 16px 19px 19px; }
.friends-content h3 { margin: 0 0 4px; font-size: 13px; }
.friends-list { margin: 0; padding: 0; list-style: none; }
.friends-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.friends-list li > strong { min-width: 0; }

.receipt-dialog {
  width: min(560px, calc(100% - 24px));
  border-color: var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
}
.receipt-dialog__header { padding: 14px 18px 8px; }
.receipt-dialog__message {
  margin: 0 18px 14px;
  padding: 7px 10px;
  border-inline-start: 2px solid var(--brand);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receipt-dialog__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}
.receipt-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}
.receipt-group h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.receipt-group[data-read-status="read"] h3 {
  background: var(--brand-soft);
  border-radius: 6px 6px 0 0;
  color: var(--brand-strong);
}
.receipt-group h3 span { margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.receipt-group ul { margin: 0; padding: 0; list-style: none; }
.receipt-group__empty { padding: 10px; color: var(--muted); font-size: 12px; }
.receipt-person { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; }
.receipt-person + .receipt-person { border-top: 1px solid var(--line); }
.receipt-person .avatar { border-radius: 6px; }
.receipt-person__details {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}
.receipt-person__details strong { font-size: 13px; }
.receipt-person__details .agent-health { justify-self: start; white-space: normal; }
@media (max-width: 480px) {
  .receipt-dialog__groups { grid-template-columns: minmax(0, 1fr); }
}

.invite-result {
  display: grid;
  gap: 7px;
  border: 1px solid #31594e;
  background: #172b27;
  padding: 10px;
  font-size: 12px;
}
.invite-result code { word-break: break-all; }

.drawer-scrim { display: none; }

@media (min-width: 961px) {
  .app[data-inspector-collapsed="true"] { grid-template-columns: var(--nav-width) minmax(0, 1fr); }
  .app[data-inspector-collapsed="true"] .inspector { display: none; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(175px, 24%) minmax(0, 1fr); }
  .inspector {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 5;
    width: min(336px, calc(100% - 44px));
    box-shadow: var(--shadow);
  }
  .app[data-drawer="inspector"] .inspector { display: flex; }
  .inspector__tabs { padding-right: 44px; }
  #close-inspector {
    display: grid;
    position: absolute;
    top: 9px;
    right: 9px;
  }
  .drawer-scrim {
    display: block;
    position: fixed;
    z-index: 4;
    inset: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: #101113ad;
    cursor: pointer;
  }
}

@media (max-width: 650px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  #toggle-rooms { display: grid; }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 5;
    width: min(294px, calc(100% - 44px));
    box-shadow: var(--shadow);
  }
  .app[data-drawer="rooms"] .sidebar { display: flex; }
  #close-rooms {
    display: grid;
    margin-left: auto;
  }
  .workspace__header {
    min-height: 57px;
    padding: 8px 10px;
  }
  .workspace__identity, .workspace__actions { gap: 5px; }
  .workspace__header h1 { font-size: 16px; }
  .app { --app-gutter: 13px; }
  .timeline__content { padding-top: 20px; }
  .composer { margin-bottom: max(10px, env(safe-area-inset-bottom)); }
  #composer-hint { display: none; }
}

.manual {
  width: min(810px, calc(100% - 32px));
  margin: 30px auto 50px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: clamp(16px, 5vw, 32px);
}
.manual h1 { margin-bottom: 8px; }
.manual h2 { margin: 25px 0 8px; }
.manual p, .manual li { color: var(--text); }
.manual ul { padding-left: 22px; }
.manual pre {
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
  padding: 12px;
  font-size: 12px;
}
.manual code {
  background: var(--panel-strong);
  padding: 1px 4px;
  font-size: .92em;
}
.manual pre code {
  background: transparent;
  padding: 0;
}
.manual a { color: var(--brand); }
.manual__back {
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
}

/* Agent identities and listener health */
.agent-roster {
  margin: 2px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.agent-roster .text-button { gap: 4px; }
.agent-list { display: grid; gap: 2px; padding: 0 8px; }
.agent-list .empty { padding: 5px 5px 8px; }
.agent-roster__error { padding: 5px 13px; overflow-wrap: anywhere; }

.agent-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  border-radius: 7px;
}

.agent-item:hover, .agent-item:focus-within { background: var(--panel-strong); }

.agent-item__details {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: start;
  cursor: pointer;
}

.agent-item__body { display: grid; min-width: 0; gap: 1px; }
.agent-item__body strong, .agent-item__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-item__body strong { font-size: 12px; font-weight: 650; }
.agent-item__meta { color: var(--muted); font-size: 10px; }
.agent-item__join { margin-right: 4px; border-color: var(--line); border-radius: 5px; }
.agent-item__join:disabled { opacity: .45; cursor: wait; }

.avatar {
  border: 1px solid #ffffff1a;
  border-radius: 9px;
}
.avatar--agent, .avatar--executor,
.avatar--codex, .avatar--claude, .avatar--gemini, .avatar--cursor,
.avatar--opencode, .avatar--workbuddy, .avatar--copilot, .avatar--openclaw, .avatar--pi, .avatar--hermes, .avatar--lancer {
  font: 650 15px/1 ui-monospace, "SF Mono", monospace;
}
.avatar svg { width: 75%; height: 75%; display: block; }
.avatar--codex { background: #363048; color: #dfd1fb; }
.avatar--claude { background: #493328; color: #f5b498; }
.avatar--gemini { background: #24394a; color: #a9d4fd; }
.avatar--cursor { background: #353539; color: #e4e4ec; }
.avatar--opencode { background: #29423a; color: #b2dfc0; }
.avatar--workbuddy { background: #443a26; color: #f0d393; }
.avatar--copilot { background: #293b41; color: #a6dfdd; }
.avatar--openclaw { background: #ffe1d9; overflow: hidden; }
.avatar--asset { overflow: hidden; }
.avatar--asset:not(.avatar--illustrated) { background: #eef0f5; }
.avatar--asset img { display: block; width: 74%; height: 74%; object-fit: contain; }
.avatar--illustrated img { width: 100%; height: 100%; }
.avatar--hermes { background: #253e39; color: #a9e2cc; }
.avatar--pi { background: #353c2d; color: #d5e3af; }
.avatar--lancer { background: #3d3243; color: #e2c3e9; }

.agent-health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.agent-health--good { color: var(--brand); }
.agent-health--warn { color: var(--warn); }
.agent-health--danger { color: var(--danger); }
.agent-health .presence { flex: none; border-radius: 50%; background: currentColor; }

.listener-alert {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px clamp(14px, 2vw, 25px);
  border: 0;
  border-bottom: 1px solid #54442e;
  background: #29231d;
  color: var(--warn);
  font-size: 12px;
  text-align: start;
  cursor: pointer;
}
.listener-alert:hover { background: #322a22; }
.listener-alert:focus-visible { outline-offset: -3px; }
.listener-alert > span:first-child {
  display: grid;
  width: 16px;
  height: 16px;
  flex: none;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 650;
  line-height: 1;
}
.agent-status-content, .agent-status-entry { display: grid; gap: 8px; }
.agent-status-entry { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.agent-status-entry h3 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.agent-status-entry p, #agent-status-name { overflow-wrap: anywhere; }
.agent-status-entry .agent-health { font-size: inherit; }
.auth-note { color: var(--brand); font-size: 12px; }
.pair-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pair-account-actions .button { flex: 1; }
