:root {
  color-scheme: dark;
  --bg: #090b10;
  --surface: rgba(18, 21, 29, .92);
  --surface-2: #171b24;
  --surface-3: #202530;
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #f2f4f8;
  --muted: #8b93a5;
  --subtle: #626a7c;
  --codex: #68dfb0;
  --codex-bg: rgba(55, 154, 117, .14);
  --claude: #f2a373;
  --claude-bg: rgba(190, 104, 58, .15);
  --blue: #77a8ff;
  --danger: #ff747a;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: radial-gradient(rgba(255, 255, 255, .16) .5px, transparent .5px);
  background-size: 6px 6px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

button, input { font: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; width: 500px; height: 500px; border-radius: 50%; filter: blur(120px); opacity: .11; pointer-events: none; }
.ambient-one { top: -340px; right: 8%; background: var(--codex); }
.ambient-two { bottom: -390px; left: -180px; background: var(--claude); }

.login-page {
  min-height: 100%;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .48);
}
.login-card h1 { margin: 12px 0; font-size: 25px; }
.login-card .brand-mark { margin-bottom: 18px; }
.login-help { color: var(--muted); line-height: 1.6; font-size: 12px; }
.login-help code { color: var(--codex); }
.login-form { display: grid; gap: 10px; margin-top: 22px; }
.login-form label { color: var(--muted); font-size: 10px; }
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  font: 700 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .22em;
}
.login-form input:focus { border-color: rgba(119, 168, 255, .42); }
.login-form .send-button { min-height: 42px; margin-top: 4px; }
.login-form p { min-height: 18px; margin: 0; color: var(--danger); font-size: 10px; }

.app-shell {
  position: relative;
  width: min(1580px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  padding: 0 0 10px;
}

.topbar {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(104, 223, 176, .35);
  border-radius: 12px;
  color: var(--codex);
  background: rgba(104, 223, 176, .07);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand h1, .panel-head h2, .chat-title h2 { margin: 0; letter-spacing: -.025em; }
.brand h1 { margin-top: 3px; font-size: 17px; }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 750; }

.top-stats { display: flex; align-items: center; gap: 7px; }
.top-stats span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, .018);
  font-size: 10px;
}
.top-stats strong { color: var(--text); margin-right: 3px; font-size: 12px; }
.top-stats .owner-unread strong { color: var(--blue); }
.top-stats .failed-count strong { color: var(--danger); }

.live-state { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.logout-button { border: 0; color: var(--subtle); background: transparent; cursor: pointer; font-size: 9px; }
.logout-button:hover { color: var(--text); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 5px rgba(139, 147, 165, .07); }
.live-state.online { color: #b3ead5; }
.live-state.online .pulse { background: var(--codex); animation: pulse 2.3s infinite; }
.live-state.offline { color: #ffacaf; }
.live-state.offline .pulse { background: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(104, 223, 176, 0); } }

.messenger {
  height: calc(100% - 62px);
  min-height: 520px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(12, 14, 20, .78);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px);
}
.messenger.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.messenger.sidebar-collapsed .conversation-panel { visibility: hidden; border: 0; }

.conversation-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(18, 21, 29, .68);
}
.panel-head { min-height: 72px; padding: 15px 16px 11px; display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin-top: 5px; font-size: 21px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.all-unread {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 0 0 5px rgba(119, 168, 255, .08);
}
.all-unread.empty { color: var(--subtle); background: var(--surface-3); box-shadow: none; }
.new-thread-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--codex);
  background: rgba(104, 223, 176, .06);
  cursor: pointer;
  font-size: 17px;
}
.new-thread-button:hover { border-color: rgba(104, 223, 176, .28); }

.search {
  height: 39px;
  margin: 0 15px 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, .025);
}
.search:focus-within { border-color: rgba(119, 168, 255, .35); }
.search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.search input::placeholder { color: var(--subtle); }

.thread-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; scrollbar-color: #343a47 transparent; }
.thread {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.thread:hover { background: rgba(255, 255, 255, .035); }
.thread.active { border-color: rgba(119, 168, 255, .18); background: rgba(119, 168, 255, .075); }
.thread.unread .thread-task { color: #fff; }
.thread-top, .thread-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.thread-domain {
  overflow: hidden;
  color: var(--blue);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: .09em;
  font-size: 8px;
  font-weight: 750;
}
.thread-time { flex: 0 0 auto; color: var(--subtle); font-size: 9px; }
.thread-task { overflow: hidden; color: #dce0e8; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.thread-gitlab { margin-left: 7px; color: #d3a0ff; font-size: 7px; font-weight: 600; }
.thread-preview { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.thread-total { color: var(--subtle); font-size: 9px; }
.unread-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-size: 9px;
  font-weight: 800;
}
.thread-empty { padding: 28px 18px; color: var(--muted); text-align: center; font-size: 11px; }
.privacy-note { margin: 0 16px; padding: 15px 4px 17px; display: flex; gap: 10px; border-top: 1px solid var(--line); }
.privacy-note .lock { padding-top: 2px; color: var(--codex); font-size: 9px; }
.privacy-note strong { font-size: 10px; }
.privacy-note p { margin: 4px 0 0; color: var(--muted); line-height: 1.4; font-size: 9px; }

.chat-panel { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: rgba(10, 12, 17, .38); }
.chat-head {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 23, 31, .72);
}
.chat-identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.pair-avatars { width: 51px; display: flex; align-items: center; }
.mini-avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid #171a22;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}
.mini-avatar + .mini-avatar { margin-left: -11px; }
.mini-avatar.transport-codex_queue { z-index: 1; color: var(--codex); background: #14372d; }
.mini-avatar.transport-claude_socket { color: var(--claude); background: #42291d; }
.mini-avatar.transport-ollama, .mini-avatar.more { color: #c5a7ff; background: #30234c; }
.chat-title { min-width: 0; }
.chat-title h2 { max-width: 700px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.chat-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--muted); font-size: 9px; }
.chat-meta span:first-child { color: #aeb4c1; }
.chat-meta .round-status { color: var(--blue); }
.gitlab-chip { color: #d3a0ff; text-decoration: none; }
.gitlab-chip:hover { text-decoration: underline; }
.back-button { display: none; border: 0; color: var(--text); background: transparent; cursor: pointer; font-size: 20px; }
.sidebar-toggle { width: 29px; height: 29px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(255, 255, 255, .025); cursor: pointer; }
.sidebar-toggle:hover { color: var(--text); border-color: var(--line-strong); }

.message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px clamp(16px, 3vw, 50px) 24px;
  scroll-behavior: smooth;
  scrollbar-color: #343a47 transparent;
}
.chat-message { width: min(74%, 760px); display: flex; align-items: flex-end; gap: 10px; align-self: flex-start; }
.chat-message.side-right { align-self: flex-end; flex-direction: row-reverse; }
.chat-message.from-owner { width: min(86%, 900px); align-self: center; }
.chat-message.continued { margin-top: -9px; }
.avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 7px 24px rgba(0, 0, 0, .22);
}
.avatar.transport-codex_queue { color: var(--codex); background: #123229; }
.avatar.transport-claude_socket { color: var(--claude); background: #3d261b; }
.avatar.transport-ollama { color: #c5a7ff; background: #30234c; }
.avatar.transport-owner { color: var(--blue); background: #172b4d; }
.message-stack { min-width: 0; max-width: calc(100% - 44px); }
.message-meta { min-height: 18px; margin: 0 6px 5px; display: flex; align-items: center; gap: 7px; }
.side-right .message-meta { justify-content: flex-end; }
.author { color: var(--codex); font-size: 10px; }
.side-right .author { color: var(--claude); }
.from-agent .avatar.transport-ollama + .message-stack .author { color: #c5a7ff; }
.from-owner .author { color: var(--blue); }
.model-name, .message-time { color: var(--subtle); font-size: 8px; }
.message-time { margin-left: auto; }
.side-right .message-time { margin-left: 0; }
.bubble {
  position: relative;
  padding: 13px 15px;
  border: 1px solid rgba(104, 223, 176, .13);
  border-radius: 6px 17px 17px 17px;
  background: linear-gradient(145deg, rgba(37, 76, 64, .46), var(--codex-bg));
  box-shadow: 0 10px 32px rgba(0, 0, 0, .13);
}
.side-right .bubble {
  border-color: rgba(242, 163, 115, .14);
  border-radius: 17px 6px 17px 17px;
  background: linear-gradient(215deg, rgba(91, 53, 34, .48), var(--claude-bg));
}
.from-owner .bubble {
  border-color: rgba(119, 168, 255, .2);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(37, 62, 107, .55), rgba(34, 55, 91, .24));
}
.owner-priority { color: var(--blue); text-transform: uppercase; letter-spacing: .07em; font-size: 7px; font-weight: 750; }
.body-text { margin: 0; color: #d9dde5; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.56; font-size: 12px; }
.message-attachments { margin-top: 10px; display: grid; gap: 6px; }
.download-card { min-width: 220px; max-width: 100%; padding: 8px 10px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 1px 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(0, 0, 0, .16); text-decoration: none; }
.download-card:hover { border-color: rgba(119, 168, 255, .38); background: rgba(119, 168, 255, .08); }
.download-icon { grid-row: 1 / 3; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: rgba(119, 168, 255, .12); font-weight: 800; }
.download-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 650; }
.download-meta { color: var(--subtle); font-size: 8px; }
.gitlab-ref { color: #caa6ff; text-decoration: underline; text-decoration-color: rgba(202, 166, 255, .35); text-underline-offset: 2px; }
.gitlab-ref:hover { color: #e0ccff; text-decoration-color: currentColor; }
.message-foot { margin: 6px 5px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-right .message-foot { flex-direction: row-reverse; }
.message-id { color: #4f5666; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.delivery { color: var(--muted); font-size: 8px; }
.message-foot .delivery { max-width: 70%; text-align: right; line-height: 1.35; }
.delivery::before { content: "•"; margin-right: 5px; color: currentColor; }
.delivery.read { color: var(--codex); }
.delivery.failed { color: var(--danger); }
.delivery.pending { color: #d5ba75; }

.composer {
  flex: 0 0 auto;
  padding: 9px 14px 10px;
  border-top: 1px solid var(--line);
  background: rgba(20, 23, 31, .92);
}
.composer.drag-active { box-shadow: inset 0 0 0 2px rgba(119, 168, 255, .45); }
.composer-main { display: flex; align-items: flex-end; gap: 10px; }
.owner-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(119, 168, 255, .28);
  border-radius: 50%;
  color: var(--blue);
  background: #172b4d;
  font-size: 11px;
  font-weight: 800;
}
.attach-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue);
  background: rgba(119, 168, 255, .05);
  cursor: pointer;
  font-size: 18px;
}
.attach-button:hover { border-color: rgba(119, 168, 255, .36); }
.attach-button input, .dialog-attachment-button input { display: none; }
.composer textarea {
  flex: 1;
  min-height: 38px;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  line-height: 1.45;
  font-size: 11px;
}
.composer textarea:focus { border-color: rgba(119, 168, 255, .38); }
.composer textarea::placeholder { color: var(--subtle); }
.send-button, .continue-button {
  min-height: 36px;
  border: 1px solid rgba(119, 168, 255, .3);
  border-radius: 10px;
  color: #eef4ff;
  background: rgba(72, 119, 198, .3);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.send-button { padding: 0 15px; }
.send-button:hover, .continue-button:hover { background: rgba(72, 119, 198, .46); }
.send-button:disabled, .continue-button:disabled { opacity: .45; cursor: wait; }
.composer-options { min-height: 27px; margin: 6px 0 0 78px; display: flex; align-items: center; gap: 8px; }
.composer-options label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; }
.composer-options select {
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  padding: 4px 7px;
  color: #cbd1dc;
  background: var(--surface-2);
  font-size: 9px;
}
.agent-picker {
  min-width: 180px;
  max-width: min(48vw, 620px);
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}
.participant-selector { position: relative; flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.participant-selector summary { min-height: 27px; padding: 5px 8px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); cursor: pointer; list-style: none; }
.participant-selector summary::-webkit-details-marker { display: none; }
.participant-selector summary::before { content: "◇"; color: var(--blue); }
.participant-selector summary strong { max-width: 180px; overflow: hidden; color: #dbe1ec; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 600; }
.participant-selector[open] > .agent-picker { position: absolute; z-index: 12; left: 0; bottom: 34px; width: min(470px, 70vw); max-width: none; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border: 1px solid var(--line-strong); border-radius: 12px; background: #171b24; box-shadow: 0 18px 54px rgba(0, 0, 0, .5); }
.model-search { grid-column: 1 / -1; width: 100%; min-height: 30px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--text); background: rgba(255, 255, 255, .035); font-size: 9px; }
.model-search:focus { border-color: rgba(119, 168, 255, .38); }
.agent-choice {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: 12px 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
}
.agent-choice:has(input:checked) { border-color: rgba(119, 168, 255, .42); background: rgba(72, 119, 198, .16); }
.agent-choice:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.agent-choice input { width: 11px; height: 11px; margin: 0; accent-color: var(--blue); }
.agent-choice-avatar { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--blue); background: rgba(119, 168, 255, .1); font-size: 8px; font-weight: 800; }
.agent-choice-copy { min-width: 0; display: grid; gap: 2px; }
.agent-choice-name { color: #dbe1ec; font-size: 8px; white-space: nowrap; }
.agent-choice-model { overflow: hidden; color: var(--subtle); text-overflow: ellipsis; font-size: 7px; white-space: nowrap; }
.priority-label { color: var(--blue); text-transform: uppercase; letter-spacing: .06em; font-size: 7px; font-weight: 750; }
.participant-status { color: var(--codex); font-size: 8px; white-space: nowrap; }
.continue-button { margin-left: auto; padding: 0 11px; }
.composer-status { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.composer-context { min-height: 17px; margin: 3px 0 0 78px; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.composer-context .priority-label { margin-left: auto; }
.attachment-queue { margin: 6px 0 0 78px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.attachment-chip { min-width: 0; max-width: 260px; height: 29px; padding: 0 6px 0 8px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .025); }
.attachment-chip .attachment-icon { color: var(--blue); }
.attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.attachment-size { flex: 0 0 auto; color: var(--subtle); font-size: 7px; }
.attachment-remove { width: 18px; height: 18px; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.attachment-remove:hover { color: var(--danger); }

.new-thread-dialog {
  width: min(620px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text);
  background: #151922;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .65);
}
.new-thread-dialog::backdrop { background: rgba(4, 6, 10, .78); backdrop-filter: blur(5px); }
.new-thread-form { padding: 20px; display: grid; gap: 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 5px 0 0; font-size: 20px; }
.dialog-head button { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 22px; }
.new-thread-form > label, .new-thread-form > .field-group, .dialog-options label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; }
.new-thread-form input, .new-thread-form textarea, .new-thread-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  padding: 10px 11px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  font-size: 11px;
}
.field-status { color: var(--subtle); line-height: 1.4; font-size: 8px; }
.new-thread-form .agent-choice input { width: 11px; padding: 0; }
.dialog-agent-picker { max-width: 100%; flex-wrap: wrap; overflow: visible; }
.dialog-participant-selector > .agent-picker,
.dialog-participant-selector[open] > .agent-picker { position: static; width: 100%; max-width: 100%; margin-top: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); box-shadow: none; }
.dialog-attachment-button span { width: fit-content; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--blue); cursor: pointer; background: rgba(119, 168, 255, .04); }
.new-thread-form > .attachment-queue { margin: -5px 0 0; }
.new-thread-form input:focus, .new-thread-form textarea:focus, .new-thread-form select:focus { border-color: rgba(119, 168, 255, .38); }
.new-thread-form textarea { resize: vertical; min-height: 110px; max-height: 300px; }
.dialog-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.dialog-foot span { flex: 1; color: var(--danger); font-size: 9px; }
.dialog-foot .send-button { min-width: 130px; }

.chat-empty { flex: 1; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 19px; color: var(--blue); background: rgba(119, 168, 255, .06); font-size: 14px; font-weight: 800; }
.chat-empty h3 { margin: 16px 0 5px; color: #cbd0da; font-size: 15px; }
.chat-empty p { margin: 0; font-size: 10px; }

@media (max-width: 900px) {
  .app-shell { width: 100%; padding: 0; }
  .topbar { height: 64px; padding: 0 14px; grid-template-columns: 1fr auto; }
  .top-stats { display: none; }
  .messenger { height: calc(100% - 64px); min-height: 0; border-width: 1px 0 0; border-radius: 0; grid-template-columns: 1fr; }
  .messenger.sidebar-collapsed { grid-template-columns: 1fr; }
  .messenger.sidebar-collapsed .conversation-panel { visibility: visible; }
  .conversation-panel { border-right: 0; }
  .chat-panel { display: none; }
  .messenger.chat-open .conversation-panel { display: none; }
  .messenger.chat-open .chat-panel { display: flex; }
  .back-button { display: block; }
  .sidebar-toggle { display: none; }
  .chat-meta { display: none; }
  .chat-head { padding: 11px 14px; }
  .pair-avatars { display: none; }
  .chat-message { width: 88%; }
  .message-list { padding: 25px 13px 32px; }
  .composer { padding: 10px; }
  .composer-options, .composer-context, .attachment-queue { margin-left: 0; flex-wrap: wrap; gap: 7px; }
  .participant-selector[open] > .agent-picker { left: 0; width: min(440px, calc(100vw - 24px)); grid-template-columns: 1fr; }
  .priority-label { display: none; }
  .participant-status { white-space: normal; }
}

@media (max-width: 520px) {
  .brand .eyebrow { display: none; }
  .chat-message { width: 94%; gap: 7px; }
  .avatar { flex-basis: 29px; width: 29px; height: 29px; }
  .body-text { font-size: 11px; }
  .bubble { padding: 11px 12px; }
  .model-name { display: none; }
  .owner-avatar { display: none; }
  .composer-main { gap: 7px; }
  .send-button { padding: 0 10px; }
}

/* Readability pass: keep the compact layout without sub-10px interface text. */
body { font-size: 14px; }
.login-help { font-size: 14px; }
.login-form label, .login-form p { font-size: 13px; }
.brand h1 { font-size: 19px; }
.eyebrow { font-size: 11px; }
.top-stats span { font-size: 12px; }
.top-stats strong { font-size: 14px; }
.live-state { font-size: 13px; }
.logout-button { font-size: 12px; }
.search input { font-size: 13px; }
.thread-domain, .thread-time, .thread-total { font-size: 11px; }
.thread-task { font-size: 14px; }
.thread-gitlab { font-size: 10px; }
.thread-preview { font-size: 12px; }
.unread-badge { font-size: 11px; }
.thread-empty { font-size: 13px; }
.privacy-note .lock { font-size: 11px; }
.privacy-note strong { font-size: 12px; }
.privacy-note p { font-size: 11px; }
.chat-title h2 { font-size: 18px; }
.chat-meta { font-size: 11px; }
.author { font-size: 12px; }
.model-name, .message-time { font-size: 10px; }
.owner-priority { font-size: 10px; }
.body-text { font-size: 14px; line-height: 1.6; }
.download-name { font-size: 12px; }
.download-meta { font-size: 10px; }
.message-id { color: #626b7d; font-size: 9px; }
.delivery { font-size: 10px; }
.composer textarea { font-size: 14px; }
.send-button, .continue-button { font-size: 13px; }
.composer-options label { font-size: 11px; }
.composer-options select { font-size: 12px; }
.participant-selector { font-size: 11px; }
.participant-selector summary strong { font-size: 11px; }
.model-search { min-height: 32px; font-size: 12px; }
.agent-choice-avatar { font-size: 10px; }
.agent-choice-name { font-size: 12px; }
.agent-choice-model { font-size: 10px; }
.priority-label { font-size: 9px; }
.participant-status, .composer-status { font-size: 11px; }
.attachment-name { font-size: 12px; }
.attachment-size { font-size: 10px; }
.new-thread-form > label,
.new-thread-form > .field-group,
.dialog-options label { font-size: 12px; }
.new-thread-form input,
.new-thread-form textarea,
.new-thread-form select { font-size: 14px; }
.field-status { font-size: 11px; }
.dialog-foot span { font-size: 12px; }
.chat-empty p { font-size: 13px; }
