:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --sidebar: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #11141b;
  --ink-2: #2c3342;
  --muted: #758094;
  --line: #dde3ec;
  --line-soft: #e9eef5;
  --accent: #2467f2;
  --accent-strong: #174bc2;
  --accent-dark: #0b1020;
  --accent-soft: #edf4ff;
  --success: #0b7c5d;
  --warning: #9a6a12;
  --danger: #b42318;
  --shadow: 0 22px 70px rgba(16, 28, 52, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.workspace {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  overflow: hidden;
}

.rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 70px auto 1fr auto;
  gap: 18px;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
}

.brand-mark img {
  width: 36px;
  height: auto;
  display: block;
  opacity: 0.94;
  filter: saturate(0.82) contrast(0.9);
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1.15;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search {
  height: 48px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search svg {
  width: 20px;
  height: 20px;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 800;
}

.search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search:focus-within {
  border-color: rgba(36, 103, 242, 0.34);
  background: #fff;
  box-shadow: 0 10px 26px rgba(36, 103, 242, 0.08);
}

.search span,
.search input {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-scroll {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 22px;
  padding-right: 2px;
}

.section-title,
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.agent-panel,
.history-panel {
  display: grid;
  gap: 10px;
}

.agent-list,
.conversation-list {
  display: grid;
  gap: 6px;
}

.agent-item {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.agent-item:hover,
.agent-item.is-active {
  border-color: #d6e4ff;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 28, 52, 0.06);
}

.agent-item:focus-visible,
.conversation-main:focus-visible,
.conversation-menu-button:focus-visible,
.conversation-title-input:focus,
.topbar button:focus-visible,
.topbar a:focus-visible,
.composer button:focus-visible,
.composer textarea:focus,
.message-copy-button:focus-visible,
.message-outline-item:focus-visible {
  outline: 2px solid rgba(36, 103, 242, 0.18);
  outline-offset: 2px;
}

.agent-avatar,
.mention-avatar,
.message-agent-avatar,
.account-photo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(36, 103, 242, 0.18);
  border-radius: 50%;
  color: var(--accent-strong);
  background: linear-gradient(145deg, #ffffff, #eaf1ff);
  font-weight: 900;
}

.agent-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.mention-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 12px;
}

.message-agent-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  font-size: 10px;
}

.account-photo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.agent-avatar img,
.mention-avatar img,
.message-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-copy,
.mention-copy,
.history-empty,
.conversation-main span {
  min-width: 0;
}

.agent-copy,
.mention-copy {
  display: grid;
  gap: 3px;
}

.agent-copy strong,
.agent-copy small,
.mention-copy strong,
.mention-copy small,
.conversation-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-copy strong {
  font-size: 15px;
  line-height: 1.25;
}

.agent-copy small,
.mention-copy small {
  color: var(--muted);
  font-size: 12px;
}

.history-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-topline h2 {
  margin: 0;
  font-size: 15px;
}

.history-topline button,
.topbar button,
.topbar a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.history-topline button {
  color: var(--accent);
}

.history-topline button:hover,
.topbar button:hover,
.topbar a:hover {
  border-color: rgba(36, 103, 242, 0.26);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.conversation-list {
  max-height: min(45vh, 430px);
  overflow-y: auto;
  padding-right: 2px;
}

.conversation-row {
  position: relative;
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-2);
  background: transparent;
}

.conversation-main {
  min-width: 0;
  min-height: 36px;
  flex: 1;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 0;
  border-radius: 7px;
  padding: 5px 10px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.conversation-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-menu-button {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.conversation-row:hover,
.conversation-row.is-active {
  border-color: #d6e4ff;
  background: #fff;
  color: var(--accent);
}

.conversation-row:hover .conversation-main small,
.conversation-row.is-active .conversation-main small {
  color: var(--muted);
}

.conversation-row:hover .conversation-menu-button,
.conversation-row.is-active .conversation-menu-button,
.conversation-menu-button:focus-visible {
  opacity: 1;
}

.conversation-menu-button:hover {
  border-color: rgba(36, 103, 242, 0.2);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.conversation-row.is-editing {
  padding: 4px;
  border-color: rgba(36, 103, 242, 0.24);
  background: #fff;
}

.conversation-title-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
}

.history-action-menu {
  position: fixed;
  z-index: 30;
  min-width: 144px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(16, 28, 52, 0.18);
}

.history-action-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.history-action-menu button:hover,
.history-action-menu button:focus-visible {
  outline: 0;
  background: var(--accent-soft);
}

.history-action-menu button.is-danger {
  color: var(--danger);
}

.history-action-menu button.is-danger:hover,
.history-action-menu button.is-danger:focus-visible {
  background: #fff1f0;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.search-empty {
  padding: 6px 2px;
}

.account {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account strong,
.account small {
  display: block;
}

.account strong {
  font-size: 13px;
}

.account small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.chat-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(36, 103, 242, 0.06), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.chat-stage::before {
  content: "";
  position: absolute;
  right: -160px;
  top: 84px;
  width: 680px;
  height: 420px;
  background: url("./assets/laofeng-logo-mark.png") center / contain no-repeat;
  opacity: 0.035;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.current-agent {
  justify-self: start;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.current-agent span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.current-agent strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.2;
}

.conversation-title {
  justify-self: center;
  max-width: 520px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 900;
}

.nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-body {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.chat-panel {
  height: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(28px, 7vw, 120px) 22px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(248, 250, 252, 0.4));
}

.chat-header h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.connection-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(154, 106, 18, 0.18);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--warning);
  background: #fffaf0;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.connection-pill.is-ready {
  color: var(--success);
  background: #eefcf6;
  border-color: rgba(11, 124, 93, 0.22);
}

.chat-frame {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(148px, 12vw, 176px);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 12px;
  overflow: hidden;
  background: transparent;
}

.message-list {
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  padding: 30px clamp(24px, 5vw, 86px) 30px clamp(28px, 10vw, 154px);
  scroll-behavior: auto;
}

.message-outline {
  min-height: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  margin: 30px clamp(12px, 1.8vw, 24px) 30px 0;
  padding: 13px 9px 10px;
  border: 1px solid rgba(221, 227, 236, 0.84);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 48px rgba(16, 28, 52, 0.08);
  backdrop-filter: blur(14px);
}

.message-outline-heading {
  padding: 0 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.message-outline-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow-y: auto;
  padding-right: 2px;
}

.message-outline-item {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  padding: 5px 3px 5px 7px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.message-outline-item:hover {
  color: var(--ink-2);
  background: rgba(237, 244, 255, 0.64);
}

.message-outline-item.is-active {
  color: var(--accent);
  background: rgba(237, 244, 255, 0.82);
}

.message-outline-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.message-outline-mark {
  justify-self: end;
  color: rgba(117, 128, 148, 0.42);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.message-outline-item.is-active .message-outline-mark {
  color: var(--accent);
}

.message-outline-empty {
  margin: 0;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.message {
  display: flex;
}

.message.assistant {
  justify-content: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.message-bubble {
  position: relative;
  max-width: min(760px, 86%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 26px 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.message.is-handoff .message-bubble {
  border-color: rgba(11, 124, 93, 0.24);
}

.message.user .message-bubble {
  max-width: min(640px, 82%);
  border-color: rgba(36, 103, 242, 0.25);
  color: #fff;
  background: var(--accent);
}

.message-agent-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.message.is-handoff .message-agent-label {
  color: var(--success);
}

.message-content {
  width: 100%;
  min-width: 0;
}

.message-content.is-streaming {
  line-height: 1.75;
}

.stream-markdown-stable,
.stream-markdown-tail {
  width: 100%;
  min-width: 0;
}

.stream-markdown-tail {
  white-space: pre-wrap;
}

.stream-markdown-stable:not([hidden]) + .stream-markdown-tail:not([hidden]) {
  margin-top: 12px;
}

.message-actions {
  position: absolute;
  right: 14px;
  bottom: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-copy-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.message-copy-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.message-copy-button:hover,
.message-copy-button.is-copied {
  border-color: rgba(36, 103, 242, 0.28);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.message.user .message-copy-button {
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.message.user .message-copy-button:hover,
.message.user .message-copy-button.is-copied {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.message-bubble p {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.86;
}

.message.user .message-bubble p {
  color: #fff;
}

.message-bubble p + p,
.message-bubble p + ul,
.message-bubble p + ol,
.message-bubble p + blockquote,
.message-bubble p + .markdown-table-wrap,
.message-bubble ul + p,
.message-bubble ol + p,
.message-bubble blockquote + p,
.message-bubble .markdown-table-wrap + p,
.message-bubble pre + p {
  margin-top: 12px;
}

.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
  margin: 16px 0 8px;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  line-height: 1.35;
  letter-spacing: 0;
}

.message-bubble h3:first-child,
.message-bubble h4:first-child,
.message-bubble h5:first-child,
.message-bubble h6:first-child {
  margin-top: 0;
}

.message-bubble h3 {
  font-size: 25px;
}

.message-bubble h4 {
  font-size: 20px;
}

.message-bubble h5,
.message-bubble h6 {
  font-size: 16px;
}

.message-bubble ul,
.message-bubble ol {
  margin: 10px 0;
  padding-left: 24px;
  color: var(--ink-2);
  line-height: 1.75;
}

.message-bubble li + li {
  margin-top: 4px;
}

.message-bubble li::marker {
  color: var(--accent);
}

.message-bubble blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid rgba(36, 103, 242, 0.42);
  border-radius: 0 8px 8px 0;
  color: #334155;
  background: #f8fbff;
}

.message-bubble blockquote p {
  line-height: 1.7;
}

.message-bubble hr {
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: var(--line);
}

.message-bubble code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #1e40af;
  background: #eff6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.message-bubble pre {
  margin: 12px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}

.message-bubble pre code {
  display: block;
  padding: 14px;
  color: #e2e8f0;
  background: transparent;
  line-height: 1.65;
}

.message-bubble a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-table-wrap {
  width: 100%;
  margin: 12px 0;
  overflow-x: auto;
}

.message-bubble table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}

.message-bubble th,
.message-bubble td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.message-bubble th {
  background: #f1f5ff;
  font-weight: 800;
}

.message.user .message-bubble h3,
.message.user .message-bubble h4,
.message.user .message-bubble h5,
.message.user .message-bubble h6,
.message.user .message-bubble a,
.message.user .message-bubble ul,
.message.user .message-bubble ol {
  color: #fff;
}

.composer-shell {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  padding: 0 clamp(24px, 5vw, 86px) 20px clamp(28px, 10vw, 154px);
  border-top: 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0), rgba(248, 250, 252, 0.98) 34%, rgba(248, 250, 252, 1));
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 0;
}

.attachment-item {
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px 0 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.attachment-item.is-error {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff1f0;
}

.attachment-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
}

.attachment-remove {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.attachment-remove:hover {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

.composer {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 44px rgba(16, 28, 52, 0.08);
}

.attach-button,
.mention-button,
.composer button[type="submit"] {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.attach-button,
.mention-button {
  border: 1px solid var(--line);
  color: var(--accent);
  background: #fff;
  font-size: 20px;
}

.mention-button {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #d6e4ff;
  font-size: 16px;
}

.attach-button:hover,
.mention-button:hover {
  border-color: rgba(36, 103, 242, 0.28);
  background: var(--accent-soft);
}

.attach-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.file-input {
  display: none;
}

.composer textarea {
  min-width: 0;
  height: 42px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  line-height: 42px;
  font-size: 16px;
}

.composer button[type="submit"] {
  border: 0;
  color: #fff;
  background: var(--accent);
  font-size: 18px;
}

.composer button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.7;
}

.mention-menu {
  position: absolute;
  left: 70px;
  right: 96px;
  bottom: 76px;
  z-index: 20;
  display: grid;
  gap: 6px;
  max-height: 286px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(16, 28, 52, 0.18);
}

.mention-item {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mention-item:hover,
.mention-item.is-selected {
  border-color: rgba(36, 103, 242, 0.22);
  background: var(--accent-soft);
}

.mention-copy strong {
  font-size: 15px;
  line-height: 1.25;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

@media (max-width: 1180px) {
  .chat-frame {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .message-outline {
    display: none;
  }

  .message-list,
  .composer-shell {
    padding-right: clamp(28px, 10vw, 154px);
  }
}

@media (max-width: 980px) {
  body {
    height: auto;
    overflow: auto;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .rail {
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-scroll {
    overflow: visible;
  }

  .account {
    display: none;
  }

  .chat-stage {
    min-height: 760px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

  .conversation-title,
  .nav {
    justify-self: start;
  }

  .chat-body {
    padding: 0;
  }

  .conversation-list {
    max-height: 220px;
  }
}

@media (max-width: 560px) {
  .chat-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px;
  }

  .message-list {
    padding: 18px;
  }

  .composer-shell {
    padding: 0 16px 16px;
  }

  .message-bubble,
  .message.user .message-bubble {
    max-width: 100%;
    padding: 18px 18px 50px;
  }

  .composer {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .composer button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .mention-menu {
    left: 16px;
    right: 16px;
    bottom: 126px;
  }
}
