:root {
  --bg: #f3f1ea;
  --ink: #191a17;
  --muted: #686a61;
  --line: #d8d2c3;
  --panel: #fffdf6;
  --panel-strong: #11120f;
  --accent: #0f7c6d;
  --accent-dark: #08564d;
  --warn: #b46a18;
  --shadow: 0 24px 80px rgba(37, 33, 24, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(90deg, rgba(17, 18, 15, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(17, 18, 15, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

body.chat-body,
body.profile-body,
body.skill-example-body {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.68), transparent 34%),
    radial-gradient(circle at 12% 8%, rgba(234, 86, 20, 0.045), transparent 26%),
    radial-gradient(circle at 88% 6%, rgba(127, 145, 130, 0.07), transparent 30%),
    linear-gradient(180deg, #f7f2eb 0%, #f1ece4 100%);
  font-family:
    "PingFang SC",
    "Noto Sans SC",
    "Microsoft YaHei",
    "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--panel-strong);
  color: #fffdf6;
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1.1rem;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:disabled:hover {
  background: var(--panel-strong);
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
}

.chat-shell {
  width: min(1120px, calc(100vw - 28px));
  padding: 24px 0;
}

.workspace {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 8px;
  background: rgba(251, 248, 243, 0.82);
  box-shadow: 0 18px 42px rgba(76, 63, 54, 0.065);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px 22px 16px;
  border-bottom: 1px solid rgba(121, 109, 96, 0.12);
  background: rgba(247, 242, 235, 0.68);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: #6b7c6f;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: #433d38;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
}

.session-notice {
  margin: 0;
  border-bottom: 1px solid rgba(121, 109, 96, 0.1);
  background: rgba(255, 255, 255, 0.38);
  color: #6f6861;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.42rem 22px 0.48rem;
}

.profile-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(121, 109, 96, 0.12);
  background: rgba(232, 245, 239, 0.72);
  color: #25433b;
  padding: 0.78rem 22px;
}

.profile-nudge[hidden] {
  display: none;
}

.profile-nudge strong {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.9rem;
}

.profile-nudge p {
  margin: 0;
  color: #4f665f;
  font-size: 0.82rem;
  line-height: 1.42;
}

.profile-nudge-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  overflow: auto;
}

.message {
  width: fit-content;
  max-width: min(780px, 86%);
  border: 1px solid rgba(121, 109, 96, 0.12);
  border-radius: 8px;
  padding: 0.95rem 1.05rem;
  background: rgba(255, 252, 247, 0.88);
  box-shadow: 0 10px 26px rgba(76, 63, 54, 0.045);
}

.message.assistant {
  align-self: flex-start;
}

.intro-message {
  max-width: min(820px, 92%);
}

.message.user {
  align-self: flex-end;
  max-width: min(680px, 82%);
  border-color: rgba(127, 145, 130, 0.28);
  background: rgba(235, 243, 235, 0.88);
}

.message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.role {
  display: block;
  margin-bottom: 0.35rem;
  color: #7f9182;
  font-size: 0.78rem;
  font-weight: 700;
}

.message-head .role {
  margin-bottom: 0;
}

.message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.28rem;
  margin-top: 0.75rem;
}

.icon-button {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  flex: 0 0 auto;
  line-height: 1;
  padding: 0;
}

.icon-button::after {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 3;
  border-radius: 5px;
  background: #252525;
  box-shadow: 0 4px 10px rgba(34, 34, 33, 0.18);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  padding: 0.42rem 0.52rem;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.icon-button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.icon-button:hover,
.icon-button.is-copied,
.icon-button.active {
  background: rgba(196, 69, 11, 0.09);
}

.message.pending {
  color: var(--muted);
}

.thinking {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.thinking span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
  animation: thinking-pulse 1s ease-in-out infinite;
}

.thinking span:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking span:nth-child(3) {
  animation-delay: 0.32s;
}

.thinking p {
  margin-left: 0.25rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

@keyframes thinking-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.message p {
  margin: 0;
  line-height: 1.58;
}

.message-body {
  display: grid;
  gap: 0.58rem;
  min-width: 0;
}

.message-body h2,
.message-body h3 {
  margin: 0;
  line-height: 1.25;
}

.message-body h2 {
  font-size: 1.08rem;
}

.message-body h3 {
  color: var(--accent-dark);
  font-size: 0.96rem;
}

.message-body p {
  margin: 0;
}

.message-body ul,
.message-body ol {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.2rem;
}

.message-body li {
  line-height: 1.5;
}

.message-body blockquote {
  margin: 0;
  border-left: 3px solid rgba(15, 124, 109, 0.42);
  background: rgba(232, 245, 239, 0.52);
  color: #3e5e54;
  padding: 0.62rem 0.8rem;
}

.message-body code {
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 5px;
  background: rgba(243, 241, 234, 0.82);
  font-family: "Courier New", monospace;
  font-size: 0.88em;
  padding: 0.08rem 0.28rem;
}

.message-body pre {
  overflow: auto;
  margin: 0;
  border-radius: 8px;
  background: #191a17;
  color: #fffdf6;
  padding: 0.85rem;
}

.message-body pre code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.skill-disclosure {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.skill-toggle {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(234, 86, 20, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 245, 0.92);
  color: #c8470f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  font-size: 0.86rem;
  font-weight: 800;
}

.skill-toggle:hover {
  border-color: rgba(234, 86, 20, 0.22);
  background: rgba(255, 247, 240, 0.98);
  color: #c8470f;
}

.skill-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.62rem;
}

.skill-shelf[hidden] {
  display: none;
}

.skill-card-button {
  min-height: 0;
  display: grid;
  gap: 0.45rem;
  border: 1px solid rgba(121, 109, 96, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  padding: 0.78rem 0.85rem;
  text-align: left;
  box-shadow: none;
}

.skill-card-button:hover {
  border-color: rgba(127, 145, 130, 0.24);
  background: rgba(247, 250, 245, 0.92);
  color: var(--ink);
}

.skill-name {
  color: #433d38;
  font-size: 0.94rem;
  font-weight: 800;
}

.skill-fact {
  display: grid;
  gap: 0.14rem;
  color: #6f6861;
  font-size: 0.8rem;
  line-height: 1.42;
}

.skill-fact strong {
  color: #6b7c6f;
  font-size: 0.72rem;
  line-height: 1.2;
}

.capability-note {
  color: var(--muted);
}

.message-meta {
  display: inline-block;
  margin-bottom: 0.45rem;
  border: 1px solid rgba(127, 145, 130, 0.22);
  border-radius: 999px;
  background: rgba(247, 250, 245, 0.82);
  color: #6b7c6f;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}

.profile-message-nudge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
  border-top: 1px solid rgba(121, 109, 96, 0.1);
  color: #6f6861;
  font-size: 0.82rem;
  padding-top: 0.62rem;
}

.profile-message-nudge a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.profile-message-nudge a:hover {
  text-decoration: underline;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(121, 109, 96, 0.12);
  background: rgba(246, 241, 234, 0.84);
}

.composer textarea {
  min-height: 58px;
  max-height: 180px;
  resize: vertical;
}

.composer button {
  align-self: stretch;
  min-height: 58px;
  background: #7f9182;
  color: #fbf8f3;
}

.composer button:hover {
  background: #6b7c6f;
}

.composer button:disabled:hover {
  background: #7f9182;
}

textarea,
input {
  width: 100%;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  padding: 0.85rem 0.9rem;
  outline: none;
}

.skill-form select {
  width: auto;
  min-width: 180px;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  font: inherit;
  padding: 0.85rem 2.2rem 0.85rem 0.9rem;
}

.skill-form select:focus {
  border-color: rgba(127, 145, 130, 0.38);
  box-shadow: 0 0 0 3px rgba(127, 145, 130, 0.13);
  outline: none;
}

textarea:focus,
input:focus {
  border-color: rgba(127, 145, 130, 0.38);
  box-shadow: 0 0 0 3px rgba(127, 145, 130, 0.13);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.login-form button {
  margin-top: 0.55rem;
}

.login-form.separated {
  margin-top: 1.4rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.login-form h2 {
  margin: 0;
  font-size: 1.05rem;
}

.auth-switch {
  margin-top: 1.35rem;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  text-align: center;
}

.auth-switch p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.text-button {
  display: inline;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 0 2px;
}

/* Authentication uses the same neutral workbench canvas as the chat page. */
.auth-body {
  background: #fcfcfb;
  color: #222221;
  font-family:
    "PingFang SC",
    "Noto Sans SC",
    "Microsoft YaHei",
    "Segoe UI",
    sans-serif;
}

.auth-body .login-panel {
  border-color: #e7e5e1;
  background: #fff;
  box-shadow: 0 16px 38px rgba(34, 34, 33, 0.08);
}

.auth-body .login-panel .eyebrow,
.auth-body .text-button {
  color: #c4450b;
}

.auth-body textarea,
.auth-body input {
  border-color: #d9d6d1;
  background: #fff;
  color: #222221;
}

.auth-body textarea:focus,
.auth-body input:focus {
  border-color: #c4450b;
  box-shadow: 0 0 0 3px rgba(196, 69, 11, 0.12);
}

.text-button:hover {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:focus-visible {
  outline: 2px solid rgba(15, 124, 109, 0.28);
  outline-offset: 3px;
}

.inline-code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.captcha-image {
  min-height: 54px;
  overflow: hidden;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 247, 0.92);
}

.captcha-image svg {
  display: block;
  width: 100%;
  height: 54px;
}

.footnote {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.alert {
  border: 1px solid rgba(180, 106, 24, 0.35);
  border-radius: 6px;
  background: #fff4e3;
  color: #7b3c04;
  padding: 0.75rem 0.85rem;
}

.alert.success {
  border-color: rgba(15, 124, 109, 0.32);
  background: #e8f5ef;
  color: #075448;
}

.admin-shell {
  padding: 34px 0;
}

.admin-body {
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Segoe UI",
    sans-serif;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 22px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.editor-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.92);
  box-shadow: var(--shadow);
  padding: 22px;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.skill-form {
  display: grid;
  gap: 0.7rem;
}

.skill-form.separated {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.profile-form textarea {
  min-height: 92px;
}

.profile-form #document_text {
  min-height: 420px;
  line-height: 1.7;
}

.form-help {
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.pre-line {
  white-space: pre-line;
}

.profile-detail-list dd {
  white-space: pre-wrap;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-row input {
  width: auto;
}

.radio-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0.9rem;
}

.radio-group legend {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 0.35rem;
}

.form-actions,
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.text-link {
  color: var(--accent-dark);
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.secondary-button,
.danger-button {
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--ink);
}

.secondary-button:hover {
  background: #ece7d9;
}

.danger-button {
  color: #8b1d13;
}

.danger-button:hover {
  background: #fae5e0;
}

.skill-list {
  display: grid;
  gap: 12px;
}

.skill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 1rem;
}

.skill-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.skill-admin-avatar,
.skill-detail-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #191a17;
  color: #fffdf6;
  font-size: 0.95rem;
  font-weight: 800;
}

.skill-admin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skill-detail-avatar {
  object-fit: cover;
}

.skill-card-head > div:first-of-type {
  min-width: 0;
  flex: 1;
}

.skill-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.skill-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.hint {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

.pill {
  border-radius: 999px;
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.pill.enabled {
  background: #dff1ea;
  color: #075448;
}

.pill.disabled {
  background: #eee7db;
  color: #6b6251;
}

.pill.invalid {
  background: #fae5e0;
  color: #8b1d13;
}

.pill-stack {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.danger-text {
  color: #8b1d13;
}

.file-path {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.log-list {
  display: grid;
  gap: 14px;
}

.log-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 1rem;
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.log-head h2 {
  margin: 0;
}

.log-block {
  margin-top: 0.85rem;
}

.log-block p {
  margin: 0.35rem 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-total {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(15, 124, 109, 0.2);
  border-radius: 999px;
  background: rgba(232, 245, 239, 0.88);
  color: #08564d;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0 0.78rem;
  white-space: nowrap;
}

.conversation-list {
  display: grid;
  gap: 16px;
}

.conversation-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(96, 110, 103, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 124, 109, 0.09), transparent 26%),
    rgba(255, 253, 246, 0.98);
  color: inherit;
  padding: 0;
  text-decoration: none !important;
  box-shadow: 0 10px 28px rgba(37, 33, 24, 0.06);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.conversation-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #0f7c6d;
  content: "";
}

.conversation-card:hover {
  border-color: rgba(15, 124, 109, 0.48);
  box-shadow: 0 18px 42px rgba(37, 33, 24, 0.11);
  transform: translateY(-2px);
}

.conversation-card-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.48rem;
  border-right: 1px solid rgba(96, 110, 103, 0.16);
  background: rgba(244, 248, 243, 0.86);
  padding: 1rem 0.55rem;
}

.conversation-index-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #11120f;
  color: #fffdf6;
  font-size: 0.9rem;
  font-weight: 900;
}

.conversation-turn-count {
  border-radius: 999px;
  background: rgba(15, 124, 109, 0.12);
  color: #08564d;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.22rem 0.52rem;
  white-space: nowrap;
}

.conversation-card-main {
  min-width: 0;
  padding: 1.05rem 0;
}

.conversation-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.62rem;
}

.conversation-card-top span {
  color: #08564d;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
}

.conversation-card-top code {
  max-width: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(17, 18, 15, 0.055);
  color: #545a53;
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  padding: 0.18rem 0.42rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #1f2420;
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.conversation-preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.62rem 0 0;
  color: #646960;
  font-size: 0.92rem;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.conversation-card-side {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 1px solid rgba(96, 110, 103, 0.14);
  background: rgba(255, 255, 255, 0.5);
  color: #646960;
  font-size: 0.82rem;
  padding: 1.05rem 1rem;
}

.conversation-card-side time {
  display: grid;
  gap: 0.22rem;
}

.conversation-card-side time span {
  color: #7a7f75;
  font-size: 0.74rem;
  font-weight: 800;
}

.conversation-card-side time strong {
  color: #242720;
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.35rem;
}

.mini-tags span {
  border: 1px solid rgba(15, 124, 109, 0.18);
  border-radius: 999px;
  background: rgba(232, 245, 239, 0.78);
  color: #08564d;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.22rem 0.48rem;
}

.conversation-enter {
  margin-top: auto;
  color: #0f7c6d;
  font-size: 0.82rem;
  font-weight: 900;
}

.conversation-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-session-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.admin-session-sidebar {
  border: 1px solid rgba(216, 210, 195, 0.92);
  border-radius: 8px;
  background: #fffdf6;
  padding: 0.75rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  position: sticky;
  top: 1rem;
}

.admin-session-sidebar .sidebar-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conversation-switcher {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.conversation-switcher-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(216, 210, 195, 0.7);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
}

.conversation-switcher-item:hover {
  background: #fff8e0;
  border-color: rgba(121, 109, 96, 0.4);
}

.conversation-switcher-item.active {
  background: #fff3c0;
  border-color: rgba(121, 109, 96, 0.7);
  font-weight: 700;
}

.conversation-switcher-item .switcher-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-switcher-item .switcher-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.conversation-switcher-item .pill {
  justify-self: start;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
}

.admin-session-main {
  min-width: 0;
}

@media (max-width: 900px) {
  .admin-session-layout {
    grid-template-columns: 1fr;
  }
  .admin-session-sidebar {
    position: static;
    max-height: 320px;
  }
}

.conversation-meta-bar span {
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.62rem;
}

.conversation-thread {
  display: grid;
  gap: 16px;
}

.turn-card {
  border: 1px solid rgba(216, 210, 195, 0.92);
  border-radius: 8px;
  background: #fffdf6;
  overflow: hidden;
}

.turn-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(216, 210, 195, 0.86);
  background: rgba(247, 242, 235, 0.62);
  padding: 0.95rem 1rem;
}

.turn-head h2 {
  margin: 0;
  font-size: 1rem;
}

.turn-head time {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.turn-body {
  display: grid;
  gap: 12px;
  padding: 1rem;
}

.dialogue-pane {
  border: 1px solid rgba(121, 109, 96, 0.12);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.user-pane {
  margin-left: clamp(0px, 8vw, 92px);
  background: rgba(235, 243, 235, 0.88);
  border-color: rgba(127, 145, 130, 0.26);
}

.assistant-pane {
  margin-right: clamp(0px, 8vw, 92px);
  background: rgba(255, 252, 247, 0.92);
}

.dialogue-label {
  margin-bottom: 0.5rem;
  color: #6b7c6f;
  font-size: 0.76rem;
  font-weight: 800;
}

.dialogue-content {
  color: #312d29;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.plain-content {
  white-space: pre-wrap;
}

.markdown-content {
  display: grid;
  gap: 0.62rem;
}

.markdown-content h2,
.markdown-content h3,
.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-content pre,
.markdown-content .markdown-table-wrap {
  margin: 0;
}

.markdown-content h2 {
  border-bottom: 1px solid rgba(216, 210, 195, 0.82);
  color: #433d38;
  font-size: 1.08rem;
  line-height: 1.35;
  padding-bottom: 0.32rem;
}

.markdown-content h3 {
  color: var(--accent-dark);
  font-size: 0.98rem;
  line-height: 1.35;
}

.markdown-content ul,
.markdown-content ol {
  display: grid;
  gap: 0.34rem;
  padding-left: 1.25rem;
}

.markdown-content li {
  line-height: 1.55;
}

.markdown-content blockquote {
  border-left: 3px solid rgba(15, 124, 109, 0.42);
  background: rgba(232, 245, 239, 0.52);
  color: #3e5e54;
  padding: 0.62rem 0.8rem;
}

.markdown-content code {
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 5px;
  background: rgba(243, 241, 234, 0.82);
  font-family: "Courier New", monospace;
  font-size: 0.88em;
  padding: 0.08rem 0.28rem;
}

.markdown-content pre {
  overflow: auto;
  border-radius: 8px;
  background: #191a17;
  color: #fffdf6;
  padding: 0.85rem;
}

.markdown-content pre code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.message-body .markdown-table-wrap,
.markdown-content .markdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.7);
}

.message-body table,
.markdown-content table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

.message-body th,
.message-body td,
.markdown-content th,
.markdown-content td {
  border-bottom: 1px solid rgba(121, 109, 96, 0.14);
  border-right: 1px solid rgba(121, 109, 96, 0.12);
  padding: 0.58rem 0.68rem;
  text-align: left;
  vertical-align: top;
}

.message-body th:last-child,
.message-body td:last-child,
.markdown-content th:last-child,
.markdown-content td:last-child {
  border-right: 0;
}

.message-body tr:last-child td,
.markdown-content tr:last-child td {
  border-bottom: 0;
}

.message-body th,
.markdown-content th {
  background: rgba(232, 245, 239, 0.68);
  color: #25433b;
  font-weight: 800;
}

.turn-foot {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid rgba(216, 210, 195, 0.74);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.75rem 1rem;
}

.turn-foot details {
  max-width: min(780px, 100%);
}

.turn-foot summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
}

.turn-foot p {
  margin: 0.4rem 0 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.full-panel {
  margin-top: 18px;
}

.detail-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.detail-list dt {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.file-list {
  margin: 0;
  padding-left: 1.1rem;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.7;
}

.code-preview {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191a17;
  color: #fffdf6;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 16px, 100%);
  }

  .chat-shell {
    padding: 8px 0;
  }

  .workspace {
    min-height: calc(100vh - 16px);
  }

  .topbar,
  .composer {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .profile-nudge,
  .profile-nudge-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px 16px 12px;
  }

  .session-notice {
    padding-inline: 16px;
  }

  .chat-panel {
    padding: 14px 16px;
  }

  .message,
  .message.user {
    max-width: 100%;
  }

  .intro-message {
    max-width: 100%;
  }

  .composer {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
  }

  .composer button {
    min-height: 46px;
  }

  button {
    width: 100%;
  }

  .icon-button {
    width: auto;
  }

  .skill-card-button {
    width: 100%;
    max-width: 100%;
  }

  .admin-header,
  .admin-actions,
  .log-head,
  .section-heading,
  .turn-head,
  .skill-card-head,
  .form-actions,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .conversation-card {
    grid-template-columns: 1fr;
  }

  .conversation-card-marker {
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid rgba(96, 110, 103, 0.16);
    padding: 0.85rem 1rem;
  }

  .conversation-card-main {
    padding: 0 1rem 0.95rem;
  }

  .conversation-card-side {
    align-items: flex-start;
    border-left: 0;
    border-top: 1px solid rgba(96, 110, 103, 0.14);
    text-align: left;
  }

  .mini-tags {
    justify-content: flex-start;
  }

  .user-pane,
  .assistant-pane {
    margin-left: 0;
    margin-right: 0;
  }
}

/* User workspace: scoped overrides for the logged-in chat page. */
.chat-body {
  --workspace-sidebar-width: 264px;
  --workspace-sidebar-max-width: 528px;
  overflow: hidden;
}

.chat-body .user-workspace {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--workspace-sidebar-width) minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(18, 35, 34, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(241, 236, 228, 0.84));
}

@media (min-width: 901px) {
  .chat-body .user-workspace {
    transition: grid-template-columns 0.18s ease;
  }

  .chat-body.sidebar-resizing .user-workspace {
    transition: none;
  }

  .chat-body:has(.user-workspace.sidebar-collapsed) .dialog-backdrop {
    left: 0;
  }

  .chat-body .user-workspace.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .chat-body .user-workspace.sidebar-collapsed .workspace-sidebar {
    width: 0;
    max-width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: 0;
    opacity: 0;
    padding-inline: 0;
    pointer-events: none;
  }
}

.chat-body .workspace-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 18px;
  border-right: 1px solid rgba(85, 92, 82, 0.16);
  background: rgba(255, 252, 247, 0.82);
  box-shadow: 12px 0 34px rgba(63, 54, 45, 0.06);
  padding: 18px;
  z-index: 20;
}

.chat-body .sidebar-resize-handle {
  display: none;
}

@media (min-width: 901px) {
  .chat-body .sidebar-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--workspace-sidebar-width) - 5px);
    z-index: 55;
    width: 10px;
    display: block;
    cursor: col-resize;
    touch-action: none;
  }

  .chat-body .sidebar-resize-handle::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4px;
    width: 2px;
    background: transparent;
    content: "";
    transition: background-color 0.14s ease;
  }

  .chat-body .sidebar-resize-handle:hover::after,
  .chat-body .sidebar-resize-handle:focus-visible::after,
  .chat-body.sidebar-resizing .sidebar-resize-handle::after {
    background: rgba(196, 69, 11, 0.42);
  }

  .chat-body .sidebar-resize-handle:focus-visible {
    outline: none;
  }

  .chat-body .user-workspace.sidebar-collapsed .sidebar-resize-handle {
    display: none;
  }

  .chat-body.sidebar-resizing,
  .chat-body.sidebar-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
  }
}

.chat-body .workspace-brand {
  display: flex;
  align-items: center;
  min-height: 68px;
  text-decoration: none;
}

.chat-body .workspace-brand img {
  display: block;
  width: min(220px, 100%);
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
}

.chat-body .new-conversation-button {
  min-height: 46px;
  border: 1px solid rgba(15, 124, 109, 0.2);
  background: #0f7c6d;
  color: #fffdf6;
  letter-spacing: 0;
  box-shadow: 0 12px 24px rgba(15, 124, 109, 0.16);
}

.chat-body .new-conversation-button:hover {
  background: #08564d;
}

.chat-body .expert-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  gap: 10px;
}

.chat-body .history-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.chat-body .sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6f6861;
  font-size: 0.78rem;
  font-weight: 800;
}

.chat-body .history-count,
.chat-body .expert-count {
  min-width: 28px;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 999px;
  background: rgba(247, 242, 235, 0.72);
  color: #433d38;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.32rem 0.48rem;
  text-align: center;
}

.chat-body .expert-list {
  min-height: 0;
  max-height: none;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: visible;
  padding-right: 0;
}

.chat-body .expert-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(121, 109, 96, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: #433d38;
  box-shadow: none;
  padding: 0.62rem;
  text-align: left;
}

.chat-body .expert-item:hover,
.chat-body .expert-item.active {
  border-color: rgba(196, 69, 11, 0.34);
  background: rgba(255, 240, 232, 0.78);
  color: #2f2924;
}

.chat-body .expert-item.is-locked {
  color: #6f6861;
}

.chat-body .expert-item.is-locked .expert-avatar {
  opacity: 0.68;
}

.chat-body .expert-item.is-locked small {
  color: #9b3f16;
}

.chat-body .expert-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #191a17;
  color: #fffdf6;
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-body .expert-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-body .expert-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-body .expert-main strong,
.chat-body .expert-main small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-body .expert-main strong {
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
}

.chat-body .expert-main small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #6f6861;
  font-size: 0.74rem;
  line-height: 1.32;
}

.chat-body .conversation-history {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: visible;
  padding-right: 0;
}

.chat-body .history-empty {
  margin: 0;
  border: 1px dashed rgba(121, 109, 96, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  color: #7b746e;
  font-size: 0.86rem;
  line-height: 1.45;
  padding: 0.9rem;
}

.chat-body .history-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(121, 109, 96, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  color: #433d38;
  box-shadow: none;
  font-weight: 400;
  padding: 0.72rem 0.78rem;
  text-align: left;
}

.chat-body .history-item:hover,
.chat-body .history-item.active {
  border-color: rgba(15, 124, 109, 0.28);
  background: rgba(232, 245, 239, 0.72);
  color: #25433b;
}

.chat-body .history-item span {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-body .history-item small {
  color: #7b746e;
  font-size: 0.72rem;
  font-weight: 400;
}

.chat-body .account-zone {
  position: relative;
  border-top: 1px solid rgba(121, 109, 96, 0.12);
  padding-top: 14px;
}

.chat-body .account-trigger {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #433d38;
  box-shadow: none;
  padding: 0.62rem;
  text-align: left;
}

.chat-body .account-trigger:hover,
.chat-body .account-trigger[aria-expanded="true"] {
  border-color: rgba(15, 124, 109, 0.25);
  background: rgba(247, 250, 245, 0.92);
  color: #25433b;
}

.chat-body .account-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #191a17;
  color: #fffdf6;
  font-size: 0.82rem;
}

.chat-body .account-summary {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-body .account-summary strong,
.chat-body .account-summary small {
  overflow: hidden;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-body .account-summary small {
  color: #7b746e;
  font-size: 0.74rem;
}

.chat-body .account-chevron {
  color: #7b746e;
  font-size: 1rem;
}

.chat-body .account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 100%;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(121, 109, 96, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 18px 42px rgba(63, 54, 45, 0.16);
  padding: 8px;
}

.chat-body .account-menu a,
.chat-body .account-menu button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 6px;
  background: transparent;
  color: #433d38;
  font-size: 0.9rem;
  font-weight: 400;
  padding: 0.55rem 0.68rem;
  text-align: left;
  text-decoration: none;
}

.chat-body .account-menu a:hover,
.chat-body .account-menu button:hover {
  background: rgba(232, 245, 239, 0.72);
  color: #25433b;
}

.chat-body .account-menu form {
  margin: 0;
}

.chat-body .account-menu .logout-action {
  color: #9a3412;
}

.chat-body .chat-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chat-body .workspace-header {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(121, 109, 96, 0.12);
  background: rgba(247, 242, 235, 0.72);
  padding: 16px 22px;
}

.chat-body .workspace-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-body .workspace-title h1 {
  overflow: hidden;
  max-width: min(62vw, 760px);
  color: #2e332f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-body .sidebar-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(121, 109, 96, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: #433d38;
  padding: 0;
}

.chat-body .sidebar-toggle:hover {
  background: rgba(232, 245, 239, 0.82);
  color: #25433b;
}

.chat-body .profile-status,
.chat-body .secondary-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(121, 109, 96, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #433d38;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0 0.82rem;
  text-decoration: none;
}

.chat-body .profile-status:hover,
.chat-body .secondary-button:hover {
  border-color: rgba(15, 124, 109, 0.24);
  background: rgba(232, 245, 239, 0.78);
  color: #25433b;
}

.chat-body .compact-profile-nudge {
  grid-row: 2;
  border-bottom: 1px solid rgba(121, 109, 96, 0.1);
  padding: 0.7rem 22px;
}

.chat-body .workspace-chat-panel {
  grid-row: 3;
  min-height: 0;
  padding: 20px 22px;
  scroll-behavior: smooth;
}

.chat-body .workspace-chat-panel .message {
  max-width: min(760px, 88%);
}

.chat-body .workspace-chat-panel .message.user {
  max-width: min(660px, 82%);
}

.chat-body .workspace-chat-panel .intro-message {
  max-width: min(760px, 94%);
}

.chat-body .workspace-composer {
  grid-row: 4;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: end;
  border-top: 1px solid rgba(121, 109, 96, 0.14);
  background: rgba(255, 252, 247, 0.88);
  padding: 14px 22px 18px;
}

.chat-body .workspace-composer textarea {
  min-height: 58px;
  max-height: 168px;
}

.chat-body .workspace-composer button {
  min-height: 58px;
}

.chat-body .dialog-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--workspace-sidebar-width);
  display: grid;
  place-items: center;
  background: rgba(25, 26, 23, 0.36);
  backdrop-filter: blur(8px);
  padding: 18px;
  z-index: 50;
}

.chat-body .invite-dialog {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 28px 86px rgba(25, 26, 23, 0.28);
  padding: 22px;
}

.chat-body .dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.chat-body .dialog-head h2 {
  margin: 0;
  color: #2e332f;
  font-size: 1.35rem;
}

.chat-body .dialog-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 50%;
  background: rgba(247, 242, 235, 0.82);
  color: #433d38;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

.chat-body .dialog-close:hover {
  background: rgba(232, 245, 239, 0.82);
  color: #25433b;
}

.chat-body .contact-dialog-backdrop {
  align-items: center;
  overflow-y: auto;
  z-index: 130;
}

.chat-body .contact-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 86px rgba(25, 26, 23, 0.28);
  padding: 20px;
}

.chat-body .contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 10px;
  background: #fff;
  padding: 24px;
}

.chat-body .contact-details {
  display: grid;
  gap: 8px;
  margin: 0;
  color: #222221;
  font-style: normal;
  line-height: 1.45;
}

.chat-body .contact-details strong {
  margin-bottom: 2px;
  font-size: 1.3rem;
  font-weight: 700;
}

.chat-body .contact-details span {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.chat-body .contact-qr {
  width: 240px;
  height: 240px;
  display: block;
  justify-self: end;
  background: #fff;
  image-rendering: auto;
}

@media (max-width: 520px) {
  .chat-body .contact-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .chat-body .contact-qr {
    width: min(240px, 100%);
    height: auto;
    justify-self: center;
  }
}

.chat-body .dialog-copy {
  margin: 0.8rem 0 1rem;
  color: #6f6861;
  line-height: 1.5;
}

.chat-body .invite-meta {
  margin: 0.65rem 0 0;
  color: #6b7c6f;
  font-size: 0.86rem;
  font-weight: 800;
}

.chat-body .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.chat-body .dialog-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.chat-body .dialog-actions button {
  min-height: 42px;
}

.chat-body .site-guide-dialog {
  width: min(680px, 100%);
}

.chat-body .intro-dialog-backdrop {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  padding: 18px;
  background: rgba(25, 26, 23, 0.36);
  backdrop-filter: blur(8px);
}

.chat-body .intro-dialog-backdrop .invite-dialog {
  position: relative;
  width: min(680px, 100%);
  height: auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 251, 246, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(255, 240, 232, 0.78), transparent 48%);
  box-shadow: 0 28px 86px rgba(25, 26, 23, 0.28);
  padding: 22px;
}

.chat-body .intro-dialog-backdrop .profile-intro-dialog {
  width: min(520px, 100%);
}

.chat-body .intro-dialog-backdrop .dialog-head,
.chat-body .intro-dialog-backdrop .dialog-copy,
.chat-body .intro-dialog-backdrop .guide-points,
.chat-body .intro-dialog-backdrop .dialog-actions {
  width: 100%;
}

.chat-body .intro-dialog-backdrop .dialog-head {
  align-items: flex-start;
}

.chat-body .intro-dialog-backdrop .dialog-head h2 {
  font-size: 1.35rem;
}

.chat-body .intro-dialog-backdrop .dialog-copy {
  font-size: 1rem;
  line-height: 1.7;
}

.chat-body .intro-dialog-backdrop .dialog-close {
  position: static;
}

.chat-body .intro-dialog-backdrop .dialog-actions {
  justify-content: flex-end;
}

.chat-body .guide-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.chat-body .guide-points div {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
  border: 1px solid rgba(121, 109, 96, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 0.82rem;
}

.chat-body .guide-points strong {
  color: #2e332f;
  font-size: 0.92rem;
}

.chat-body .guide-points span {
  color: #6f6861;
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .chat-body .user-workspace {
    grid-template-columns: 1fr;
  }

  .chat-body .workspace-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .chat-body .workspace-sidebar.is-open {
    transform: translateX(0);
  }

  .chat-body .sidebar-toggle {
    display: inline-flex;
  }

  .chat-body .workspace-title h1 {
    max-width: min(58vw, 540px);
  }
}

@media (max-width: 680px) {
  .chat-body {
    overflow: hidden;
  }

  .chat-body .user-workspace button {
    width: auto;
  }

  .chat-body .workspace-sidebar {
    padding: 14px;
  }

  .chat-body .workspace-header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .chat-body .workspace-title {
    align-items: flex-start;
  }

  .chat-body .workspace-title h1 {
    max-width: calc(100vw - 138px);
    font-size: 1.28rem;
  }

  .chat-body .profile-status {
    min-height: 36px;
    flex: 0 0 auto;
    padding-inline: 0.7rem;
  }

  .chat-body .compact-profile-nudge {
    align-items: stretch;
    padding: 0.72rem 14px;
  }

  .chat-body .workspace-chat-panel {
    padding: 14px;
  }

  .chat-body .workspace-chat-panel .message,
  .chat-body .workspace-chat-panel .message.user {
    max-width: 100%;
  }

  .chat-body .workspace-composer {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .chat-body .workspace-composer button {
    width: 100%;
    min-height: 46px;
  }

  .chat-body .dialog-backdrop {
    left: 0;
    align-items: end;
    padding: 12px;
  }

  .chat-body .intro-dialog-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .chat-body .intro-dialog-backdrop .invite-dialog {
    padding: 72px 18px 28px;
  }

  .chat-body .invite-dialog {
    padding: 18px;
  }

  .chat-body .contact-dialog-backdrop {
    align-items: center;
    padding: 10px;
  }

  .chat-body .contact-dialog {
    max-height: calc(100vh - 20px);
    border-radius: 10px;
    padding: 16px;
  }

  .chat-body .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-body .guide-points {
    grid-template-columns: 1fr;
  }

  .chat-body .dialog-actions button,
  .chat-body .dialog-actions .secondary-button {
    width: 100%;
  }
}

/* Plain composer. */
.chat-body .workspace-composer {
  display: block;
  padding: 14px 22px 18px;
}

.chat-body .composer-box {
  display: grid;
  border: 1px solid rgba(121, 109, 96, 0.14);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 18px 42px rgba(63, 54, 45, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  padding: 18px;
}

.chat-body .workspace-composer textarea {
  min-height: 86px;
  max-height: 160px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: #2f332f;
  font-size: 1rem;
  line-height: 1.55;
  padding: 0;
}

.chat-body .workspace-composer textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.chat-body .workspace-composer textarea::placeholder {
  color: #a9aaa4;
}

.chat-body .workspace-composer > .sr-only {
  min-height: 0;
  padding: 0;
}

@media (max-width: 680px) {
  .chat-body .workspace-composer {
    padding: 10px 12px 12px;
  }

  .chat-body .composer-box {
    border-radius: 22px;
    padding: 14px;
  }

  .chat-body .workspace-composer textarea {
    min-height: 92px;
  }

}

/* Empty-state redesign: a restrained Vikki workbench. */
.chat-body {
  --workbench-canvas: #fcfcfb;
  --workbench-sidebar: #f6f6f4;
  --workbench-line: #e7e5e1;
  --workbench-ink: #222221;
  --workbench-muted: #74716c;
  --workbench-orange: #c4450b;
  --workbench-orange-hover: #a93708;
  --workbench-orange-soft: #fff0e8;
}

.chat-body .user-workspace {
  position: relative;
  background: var(--workbench-canvas);
}

.chat-body .workspace-sidebar {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
  gap: 12px;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  border-right-color: var(--workbench-line);
  background: var(--workbench-sidebar);
  box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 14px;
  padding-bottom: 72px;
}

.chat-body .workspace-sidebar::-webkit-scrollbar {
  width: 8px;
}

.chat-body .workspace-sidebar::-webkit-scrollbar-track,
.chat-body .workspace-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
}

.chat-body .workspace-sidebar.is-scrolling {
  scrollbar-color: rgba(121, 109, 96, 0.36) transparent;
}

.chat-body .workspace-sidebar.is-scrolling::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(121, 109, 96, 0.36);
}

.chat-body .workspace-sidebar.is-history-active {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
}

.chat-body .workspace-sidebar.is-crystallization-active {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

.chat-body .workspace-brand {
  min-height: 44px;
}

.chat-body .workspace-brand img {
  width: min(180px, 100%);
  max-height: 44px;
}

.chat-body .new-conversation-button {
  min-height: 38px;
  border-color: var(--workbench-line);
  border-radius: 6px;
  background: #fff;
  color: var(--workbench-ink);
  box-shadow: 0 1px 4px rgba(34, 34, 33, 0.05);
  font-size: 0.94rem;
  font-weight: 600;
}

.chat-body .new-conversation-button:hover {
  border-color: #e8c2ad;
  background: var(--workbench-orange-soft);
  color: var(--workbench-orange);
}

.chat-body .sidebar-section-head {
  color: var(--workbench-muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.25;
}

.chat-body .expert-section,
.chat-body .history-section,
.chat-body .crystallization-section {
  flex: 0 0 auto;
  min-height: 0;
  gap: 6px;
}

.chat-body .account-zone {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 4;
  flex: 0 0 auto;
  margin-top: auto;
  width: var(--workspace-sidebar-width);
  background: var(--workbench-sidebar);
}

.chat-body .expert-section:not(.is-collapsed),
.chat-body .history-section:not(.is-collapsed) {
  grid-template-rows: auto minmax(0, auto);
}

.chat-body .workspace-sidebar.is-history-active .history-section:not(.is-collapsed) {
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-body .crystallization-section:not(.is-collapsed) {
  align-content: start;
  grid-template-rows: auto auto;
}

.chat-body .expert-section-toggle,
.chat-body .history-section-toggle,
.chat-body .crystallization-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  letter-spacing: 0;
  padding: 2px 0;
  text-align: left;
}

.chat-body .expert-section-toggle:hover,
.chat-body .history-section-toggle:hover,
.chat-body .crystallization-toggle:hover {
  color: var(--workbench-ink);
}

.chat-body .expert-toggle-meta,
.chat-body .history-toggle-meta,
.chat-body .crystallization-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-body .expert-toggle-icon,
.chat-body .history-toggle-icon,
.chat-body .crystallization-toggle-icon {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.chat-body .expert-section.is-collapsed .expert-toggle-icon,
.chat-body .history-section.is-collapsed .history-toggle-icon,
.chat-body .crystallization-section.is-collapsed .crystallization-toggle-icon {
  transform: rotate(-45deg);
}

.chat-body .history-count,
.chat-body .expert-count,
.chat-body .crystallization-count {
  min-width: 20px;
  border-color: var(--workbench-line);
  border-radius: 4px;
  background: transparent;
  color: var(--workbench-muted);
  font-size: 0.66rem;
  font-weight: 400;
  padding: 0.16rem 0.3rem;
}

.chat-body .expert-list {
  min-height: 0;
  max-height: none;
  overflow: visible;
  gap: 2px;
  padding-right: 4px;
}

.chat-body .expert-item {
  min-height: 39px;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--workbench-ink);
  padding: 5px 6px;
  font-weight: 400;
}

.chat-body .expert-item:hover {
  border-color: transparent;
  background: #ecebe8;
  color: var(--workbench-ink);
}

.chat-body .expert-item.active {
  border-color: transparent;
  background: var(--workbench-orange-soft);
  color: var(--workbench-ink);
  box-shadow: inset 2px 0 0 var(--workbench-orange);
}

.chat-body .expert-item.is-locked:hover {
  background: #f4f0eb;
}

.chat-body .expert-avatar {
  width: 26px;
  height: 26px;
  background: #222221;
  font-size: 0.68rem;
  font-weight: 400;
}

.chat-body .expert-main {
  gap: 1px;
}

.chat-body .expert-main strong {
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.2;
}

.chat-body .conversation-history {
  min-height: 0;
  max-height: none;
  overflow: visible;
  gap: 3px;
  padding-right: 0;
}

.chat-body .history-empty {
  border-color: var(--workbench-line);
  border-radius: 6px;
  background: transparent;
  color: var(--workbench-muted);
}

.chat-body .history-item {
  min-height: 42px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--workbench-ink);
  font-size: 0.96rem;
  font-weight: 400;
  padding: 0.55rem 0.6rem;
}

.chat-body .history-item:hover,
.chat-body .history-item.active {
  border-color: transparent;
  background: var(--workbench-orange-soft);
  color: var(--workbench-ink);
}

.chat-body .history-item small,
.chat-body .account-summary small,
.chat-body .account-chevron {
  color: var(--workbench-muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.chat-body .history-item {
  position: relative;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  overflow: visible;
  padding: 0;
}

.chat-body .history-item-content {
  min-width: 0;
  display: grid;
  align-items: center;
}

.chat-body .history-open {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.52rem 0.3rem 0.52rem 0.6rem;
  text-align: left;
}

.chat-body .history-item:hover .history-open,
.chat-body .history-item:focus-within .history-open,
.chat-body .history-item.is-pinned .history-open,
.chat-body .history-item:has(.history-menu-trigger[aria-expanded="true"]) .history-open {
  padding-right: 36px;
}

.chat-body .history-open:hover,
.chat-body .history-open:focus-visible,
.chat-body .history-menu-trigger:hover,
.chat-body .history-menu-trigger:focus-visible {
  background: transparent;
}

.chat-body .history-item-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-body .history-item-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-body .history-item:hover .history-item-meta,
.chat-body .history-item:focus-within .history-item-meta,
.chat-body .history-item.is-pinned .history-item-meta,
.chat-body .history-item:has(.history-menu-trigger[aria-expanded="true"]) .history-item-meta {
  display: none;
}

.chat-body .history-item .history-item-title {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-body .history-menu-trigger {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 36px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  visibility: hidden;
}

.chat-body .history-menu-trigger img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.chat-body .history-item:hover .history-menu-trigger,
.chat-body .history-item:focus-within .history-menu-trigger,
.chat-body .history-menu-trigger[aria-expanded="true"],
.chat-body .history-menu-trigger:focus-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.chat-body .history-item.is-pinned .history-menu-trigger {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.chat-body .history-menu-trigger::after,
.chat-body .conversation-title-edit::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 5;
  width: max-content;
  max-width: 150px;
  border-radius: 4px;
  background: #222221;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  line-height: 1.2;
  opacity: 0;
  padding: 0.32rem 0.46rem;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.chat-body .history-menu-trigger:hover::after,
.chat-body .history-menu-trigger:focus-visible::after,
.chat-body .conversation-title-edit:hover::after,
.chat-body .conversation-title-edit:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chat-body .history-menu-trigger::after {
  display: none;
}

.chat-body .history-menu-overlay {
  position: fixed;
  z-index: 180;
  width: min(168px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  border: 1px solid #ded8d2;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgb(42 34 28 / 16%);
  padding: 5px;
}

.chat-body .history-pin-trigger-icon {
  display: none;
}

.chat-body .history-item.is-pinned .history-pin-trigger-icon {
  display: block;
}

.chat-body .history-item.is-pinned .history-more-trigger-icon {
  display: none;
}

.chat-body .history-item.is-pinned:hover .history-pin-trigger-icon,
.chat-body .history-item.is-pinned:focus-within .history-pin-trigger-icon,
.chat-body .history-item.is-pinned .history-menu-trigger:hover .history-pin-trigger-icon,
.chat-body .history-item.is-pinned .history-menu-trigger:focus-visible .history-pin-trigger-icon,
.chat-body .history-item.is-pinned .history-menu-trigger[aria-expanded="true"] .history-pin-trigger-icon {
  display: none;
}

.chat-body .history-item.is-pinned:hover .history-more-trigger-icon,
.chat-body .history-item.is-pinned:focus-within .history-more-trigger-icon,
.chat-body .history-item.is-pinned .history-menu-trigger:hover .history-more-trigger-icon,
.chat-body .history-item.is-pinned .history-menu-trigger:focus-visible .history-more-trigger-icon,
.chat-body .history-item.is-pinned .history-menu-trigger[aria-expanded="true"] .history-more-trigger-icon {
  display: block;
}

.chat-body .history-menu-overlay[hidden] {
  display: none;
}

.chat-body .history-title-form[hidden] {
  display: none;
}

.chat-body .history-title-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--workbench-line);
  border-radius: 4px;
  background: #fff;
  color: var(--workbench-ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  outline: none;
  padding: 0 0.45rem;
  text-overflow: ellipsis;
}

.chat-body .history-title-input:focus {
  border-color: rgba(234, 86, 20, 0.46);
}

.chat-body .history-menu-overlay button {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--workbench-ink);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.chat-body .history-menu-overlay button img {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
  object-fit: contain;
}

.chat-body .history-menu-overlay button:hover,
.chat-body .history-menu-overlay button:focus-visible {
  background: #f1efec;
}

.chat-body .history-menu-overlay .history-delete-action {
  color: #b42318;
}

@media (max-width: 560px) {
  .chat-body .history-menu-overlay {
    width: min(166px, calc(100vw - 32px));
  }
}

.chat-body .crystallization-panel {
  max-height: none;
  overflow: visible;
}

.chat-body .history-item.is-busy {
  opacity: 0.58;
}

.chat-body .crystallization-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  gap: 6px;
  border-top: 0;
  padding-top: 0;
}

.chat-body .crystallization-section,
.chat-body .crystallization-section * {
  font-weight: 400;
}

.chat-body .crystallization-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  letter-spacing: 0;
  padding: 2px 0;
  text-align: left;
}

.chat-body .crystallization-toggle:hover {
  color: var(--workbench-ink);
}

.chat-body .crystallization-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-body .crystallization-count {
  min-width: 20px;
  border: 1px solid var(--workbench-line);
  border-radius: 4px;
  background: transparent;
  color: var(--workbench-muted);
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.16rem 0.3rem;
  text-align: center;
}

.chat-body .crystallization-toggle-icon {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.chat-body .crystallization-section.is-collapsed .crystallization-toggle-icon {
  transform: rotate(-45deg);
}

.chat-body .crystallization-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  max-height: none;
  overflow: visible;
  gap: 4px;
}

.chat-body .crystallization-subtitle {
  display: block;
  margin: 0;
  color: var(--workbench-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.chat-body .crystallization-subtitle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
}

.chat-body .crystallization-folder-add {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--workbench-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
}

.chat-body .crystallization-folder-add:hover,
.chat-body .crystallization-folder-add:focus {
  border-color: var(--workbench-line);
  background: #fff;
  color: var(--workbench-orange);
  outline: none;
}

.chat-body .crystallization-folder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px;
}

.chat-body .crystallization-folder-form[hidden] {
  display: none;
}

.chat-body .crystallization-folder-name {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--workbench-line);
  border-radius: 4px;
  background: #fff;
  color: var(--workbench-ink);
  font: inherit;
  font-size: 0.76rem;
  padding: 0 0.42rem;
}

.chat-body .crystallization-folder-name:focus {
  border-color: rgba(234, 86, 20, 0.46);
  outline: none;
}

.chat-body .crystallization-folder-create,
.chat-body .crystallization-folder-cancel {
  min-height: 28px;
  border: 1px solid var(--workbench-line);
  border-radius: 4px;
  background: transparent;
  color: var(--workbench-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  padding: 0 0.34rem;
}

.chat-body .crystallization-folder-create {
  border-color: rgba(234, 86, 20, 0.32);
  color: var(--workbench-orange);
}

.chat-body .crystallization-folder-create:hover,
.chat-body .crystallization-folder-create:focus,
.chat-body .crystallization-folder-cancel:hover,
.chat-body .crystallization-folder-cancel:focus {
  background: var(--workbench-orange-soft);
  outline: none;
}

.chat-body .crystallization-list {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 3px;
  padding-right: 4px;
}

.chat-body .crystallization-folder {
  display: grid;
  gap: 2px;
}

.chat-body .crystallization-folder-toggle {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--workbench-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.2rem 0.38rem;
  text-align: left;
}

.chat-body .crystallization-folder-toggle:hover,
.chat-body .crystallization-folder-toggle:focus {
  background: var(--workbench-orange-soft);
  outline: none;
}

.chat-body .crystallization-folder-icon {
  width: 12px;
  height: 9px;
  position: relative;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--workbench-muted);
}

.chat-body .crystallization-folder-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 1px;
  width: 6px;
  height: 3px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: var(--workbench-sidebar);
}

.chat-body .crystallization-folder-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-body .crystallization-folder-count {
  min-width: 18px;
  color: var(--workbench-muted);
  font-size: 0.68rem;
  text-align: right;
}

.chat-body .crystallization-folder-items,
.chat-body .crystallization-unfiled-items {
  min-height: 28px;
  display: grid;
  grid-auto-rows: max-content;
  gap: 2px;
  border: 1px dashed transparent;
  border-radius: 5px;
  padding: 2px 0 2px 12px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.chat-body .crystallization-folder-items[hidden] {
  display: none;
}

.chat-body .crystallization-unfiled {
  display: grid;
  gap: 2px;
}

.chat-body .crystallization-unfiled-label {
  margin: 0;
  color: var(--workbench-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  padding: 0.2rem 0.38rem 0;
}

.chat-body .crystallization-folder-empty {
  margin: 0;
  color: var(--workbench-muted);
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 0.3rem 0.4rem;
}

.chat-body .crystallization-list.is-dragging-item .crystallization-drop-zone {
  border-color: rgba(234, 86, 20, 0.22);
}

.chat-body .crystallization-drop-zone.is-drag-over {
  border-color: rgba(234, 86, 20, 0.68);
  background: var(--workbench-orange-soft);
}

.chat-body .crystallization-empty {
  margin: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--workbench-muted);
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 0.42rem 0.6rem;
}

.chat-body .crystallization-item {
  display: block;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: grab;
  padding: 0.34rem 0.38rem 0.34rem 0.6rem;
}

.chat-body .crystallization-item.is-dragging {
  opacity: 0.46;
}

.chat-body .crystallization-item:active {
  cursor: grabbing;
}

.chat-body .crystallization-item:hover {
  background: var(--workbench-orange-soft);
}

.chat-body .crystallization-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 4px;
  min-height: 26px;
}

.chat-body .crystallization-title-button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--workbench-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
}

.chat-body .crystallization-title-button:hover,
.chat-body .crystallization-title-button:focus {
  color: var(--workbench-orange);
  outline: none;
}

.chat-body .crystallization-title-edit {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.chat-body .crystallization-title-edit:hover,
.chat-body .crystallization-title-edit:focus {
  border-color: var(--workbench-line);
  background: #fff;
  outline: none;
}

.chat-body .crystallization-title-edit img {
  width: 13px;
  height: 13px;
  display: block;
}

.chat-body .crystallization-title-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.chat-body .crystallization-title-form[hidden] {
  display: none;
}

.chat-body .crystallization-title {
  min-width: 0;
  height: 26px;
  border: 1px solid var(--workbench-line);
  border-radius: 4px;
  background: #fff;
  color: var(--workbench-ink);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  overflow: hidden;
  padding: 0 0.36rem;
  text-overflow: ellipsis;
}

.chat-body .crystallization-title:focus {
  border-color: rgba(234, 86, 20, 0.46);
  outline: none;
}

.chat-body .crystallization-selection-action {
  position: fixed;
  z-index: 80;
  min-width: 92px;
  min-height: 32px;
  border: 1px solid #aebea8;
  border-radius: 8px;
  background: #c9d4c3;
  color: #3f4a42;
  box-shadow: 0 10px 24px rgba(61, 79, 65, 0.14);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  padding: 0 0.72rem;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.chat-body .crystallization-selection-action:hover,
.chat-body .crystallization-selection-action:focus-visible {
  border-color: #97aa90;
  background: #b8c8b2;
  color: #303a33;
  box-shadow: 0 12px 28px rgba(61, 79, 65, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.chat-body .crystallization-selection-action:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.chat-body .crystallization-selection-action[aria-busy="true"] {
    border-color: var(--workbench-orange-hover);
    background: var(--workbench-orange);
    color: #fffdf8;
    box-shadow: 0 10px 24px rgba(196, 69, 11, 0.22);
    opacity: 1;
}

/* 参考资料树的低饱和层级侧边栏。 */
.chat-body {
    --sidebar-tree-bg: #fbfaf6;
    --sidebar-tree-line: #d7dad3;
    --sidebar-sage: #e7ece6;
    --sidebar-sage-border: #b8c7b6;
    --sidebar-sage-hover: #f0f2ee;
    --sidebar-sage-active: #e3eae1;
    --sidebar-green: #5f816c;
    --sidebar-folder: #c7953d;
}

.chat-body .workspace-sidebar {
    gap: 5px;
    padding: 14px 12px;
    border-right-color: #dedfd9;
    background: var(--sidebar-tree-bg);
}

.chat-body .workspace-brand {
    padding-inline: 4px;
}

.chat-body .new-conversation-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-color: #dedfd9;
    background: #fffdf9;
    color: #303630;
    font-weight: 500;
    box-shadow: none;
}

.chat-body .new-conversation-button:hover,
.chat-body .new-conversation-button:focus-visible {
    border-color: var(--sidebar-sage-border);
    background: var(--sidebar-sage-hover);
    color: #344039;
}

.chat-body .new-conversation-icon {
    color: var(--sidebar-green);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1;
}

.chat-body .expert-section,
.chat-body .history-section,
.chat-body .crystallization-section {
    gap: 2px;
}

.chat-body .sidebar-section-head {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    box-sizing: border-box;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #555d56;
    font-size: 0.82rem;
    transition:
        color 160ms ease,
        border-color 160ms ease,
        background-color 160ms ease;
}

.chat-body .sidebar-section-head:hover,
.chat-body .sidebar-section-head:focus-within {
    border-color: #dce1da;
    background: #f3f5f1;
    color: #344039;
}

.chat-body .expert-section:not(.is-collapsed) > .sidebar-section-head,
.chat-body .history-section:not(.is-collapsed) > .sidebar-section-head,
.chat-body .crystallization-section:not(.is-collapsed) > .sidebar-section-head {
    border-color: transparent;
    background: transparent;
    color: #465047;
}

.chat-body .expert-section:has(.expert-item.active) > .sidebar-section-head,
.chat-body .history-section:has(.history-item.active) > .sidebar-section-head,
.chat-body .crystallization-section:has(.crystallization-item.active) > .sidebar-section-head {
    border-color: var(--sidebar-sage-border);
    background: var(--sidebar-sage);
    color: #2f3b32;
}

.chat-body .sidebar-section-leading,
.chat-body .sidebar-section-label,
.chat-body .expert-toggle-meta,
.chat-body .history-toggle-meta,
.chat-body .crystallization-toggle-meta {
    display: flex;
    align-items: center;
}

.chat-body .sidebar-section-leading {
    min-width: 0;
    gap: 7px;
}

.chat-body .sidebar-section-label {
    min-width: 0;
    gap: 7px;
    font-weight: 600;
}

.chat-body .sidebar-section-glyph {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: var(--sidebar-green);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-body .expert-toggle-icon,
.chat-body .history-toggle-icon,
.chat-body .crystallization-toggle-icon {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-color: #8c938c;
}

.chat-body .expert-count,
.chat-body .history-count,
.chat-body .crystallization-count {
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-color: #d9dcd6;
    background: #fffdf9;
    color: #747a74;
}

.chat-body .expert-list,
.chat-body .conversation-history,
.chat-body .crystallization-panel {
    position: relative;
    margin-left: 10px;
    padding-left: 14px;
    padding-right: 0;
}

.chat-body .expert-list::before,
.chat-body .conversation-history::before,
.chat-body .crystallization-panel::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 10px;
    left: 3px;
    width: 1px;
    background: var(--sidebar-tree-line);
}

.chat-body .expert-item,
.chat-body .history-item,
.chat-body .crystallization-folder,
.chat-body .crystallization-unfiled,
.chat-body .crystallization-subtitle-row,
.chat-body .crystallization-item {
    position: relative;
}

.chat-body .expert-item::before,
.chat-body .history-item::before,
.chat-body .crystallization-folder::before,
.chat-body .crystallization-unfiled::before,
.chat-body .crystallization-subtitle-row::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -11px;
    width: 11px;
    border-top: 1px solid var(--sidebar-tree-line);
}

.chat-body .expert-item,
.chat-body .history-item {
    border: 1px solid transparent;
    border-radius: 6px;
}

.chat-body .expert-item:hover,
.chat-body .history-item:hover {
    border-color: transparent;
    background: #f3f4f1;
}

.chat-body .expert-item.active,
.chat-body .history-item.active {
    border-color: transparent;
    background: #f2f5f0;
    box-shadow: inset 2px 0 0 #9eaf9b;
}

.chat-body .expert-item {
    min-height: 36px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.chat-body .history-item,
.chat-body .history-open,
.chat-body .history-menu-trigger {
    min-height: 34px;
}

.chat-body .history-open {
    padding-top: 0.34rem;
    padding-bottom: 0.34rem;
}

.chat-body .crystallization-folder-header,
.chat-body .crystallization-unfiled-header {
    border: 1px solid transparent;
    border-radius: 6px;
}

.chat-body .crystallization-folder-header:hover,
.chat-body .crystallization-unfiled-header:hover {
    border-color: #d5ddd3;
    background: var(--sidebar-sage-hover);
}

.chat-body .crystallization-folder-icon {
    color: var(--sidebar-folder);
}

.chat-body .crystallization-folder-icon::before {
    background: var(--sidebar-tree-bg);
}

.chat-body .crystallization-folder-items,
.chat-body .crystallization-unfiled-items {
    margin-left: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--sidebar-tree-line);
}

.chat-body .crystallization-folder-items .crystallization-item::before,
.chat-body .crystallization-unfiled-items .crystallization-item::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -12px;
    width: 12px;
    border-top: 1px solid var(--sidebar-tree-line);
}

.chat-body .crystallization-item:hover,
.chat-body .crystallization-item.active {
    background: #f3f4f1;
}

.chat-body .crystallization-item.active {
    box-shadow: inset 2px 0 0 #9eaf9b;
    outline: 0;
}

.chat-body .sidebar-account-zone {
    border-top-color: #dedfd9;
}

.chat-body .crystallization-flight-card {
  position: fixed;
  z-index: 95;
  max-height: 68px;
  overflow: hidden;
  border: 1px solid rgba(234, 86, 20, 0.34);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--workbench-ink);
  box-shadow: 0 16px 38px rgba(34, 34, 33, 0.2);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 0.56rem 0.68rem;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, opacity;
}

.chat-body .crystallization-toggle.is-receiving-crystallization,
.chat-body .sidebar-toggle.is-receiving-crystallization,
.chat-body .crystallization-section.is-receiving-crystallization {
  background: var(--workbench-orange-soft);
  box-shadow: 0 0 0 4px rgba(234, 86, 20, 0.12);
  animation: crystallization-target-arrival 0.58s ease-out;
}

@keyframes crystallization-target-arrival {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 86, 20, 0.36);
    transform: scale(1);
  }
  45% {
    box-shadow: 0 0 0 7px rgba(234, 86, 20, 0.12);
    transform: scale(1.025);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(234, 86, 20, 0);
    transform: scale(1);
  }
}

.chat-body .crystallization-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  margin: 0;
  border: 1px solid rgba(34, 34, 33, 0.08);
  border-radius: 6px;
  background: #222221;
  color: #fffdf6;
  box-shadow: 0 14px 30px rgba(34, 34, 33, 0.16);
  font-size: 0.82rem;
  font-weight: 400;
  padding: 0.68rem 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
  .chat-body .crystallization-toggle.is-receiving-crystallization,
  .chat-body .sidebar-toggle.is-receiving-crystallization,
  .chat-body .crystallization-section.is-receiving-crystallization {
    animation: none;
    box-shadow: 0 0 0 3px rgba(234, 86, 20, 0.16);
    transform: none;
  }
}

.chat-body .crystallization-detail-dialog,
.chat-body .crystallization-detail-dialog * {
  font-weight: 400;
}

.chat-body .crystallization-detail-backdrop {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.chat-body .crystallization-detail-dialog {
  width: min(520px, calc(100vw - 40px));
  max-height: min(620px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(34, 34, 33, 0.1);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 24px 70px rgba(34, 34, 33, 0.22);
  color: var(--workbench-ink);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 1rem;
}

.chat-body .crystallization-detail-head {
  display: flex;
  justify-content: flex-end;
}

.chat-body .crystallization-detail-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--workbench-line);
  border-radius: 6px;
  background: transparent;
  color: var(--workbench-muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.chat-body .crystallization-detail-close:hover,
.chat-body .crystallization-detail-close:focus {
  background: var(--workbench-orange-soft);
  color: var(--workbench-ink);
  outline: none;
}

.chat-body .crystallization-detail-dialog h2 {
  margin: 0;
  color: var(--workbench-ink);
  font-size: 1rem;
  line-height: 1.35;
}

.chat-body .crystallization-detail-time {
  margin: 0;
  color: var(--workbench-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.chat-body .crystallization-detail-content {
  min-height: 120px;
  overflow: auto;
  border: 1px solid var(--workbench-line);
  border-radius: 6px;
  background: #fff;
  color: var(--workbench-ink);
  font-size: 0.88rem;
  line-height: 1.65;
  padding: 0.82rem;
  white-space: pre-wrap;
}

.chat-body .crystallization-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.chat-body .crystallization-detail-delete {
  min-height: 34px;
  border: 1px solid rgba(190, 62, 35, 0.34);
  border-radius: 6px;
  background: transparent;
  color: #9b2f1d;
  cursor: pointer;
  font: inherit;
  padding: 0 0.78rem;
}

.chat-body .crystallization-detail-delete:hover,
.chat-body .crystallization-detail-delete:focus {
  background: rgba(190, 62, 35, 0.08);
  outline: none;
}

.chat-body .account-zone {
  border-top-color: var(--workbench-line);
  align-self: stretch;
  width: var(--workspace-sidebar-width);
  min-height: 0;
  background: var(--workbench-sidebar);
  box-shadow: 0 -10px 16px var(--workbench-sidebar);
  margin: 0;
  padding-top: 10px;
}

.chat-body .account-trigger {
  width: 100%;
  min-height: 48px;
  grid-template-columns: 30px minmax(0, 1fr) 24px;
  border-color: transparent;
  border-radius: 0;
  background: #fffdf9;
  color: var(--workbench-ink);
  padding: 0.46rem 14px;
}

.chat-body .account-login-link {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  text-decoration: none;
}

.chat-body .account-login-link .account-more {
  width: auto;
  color: var(--workbench-muted);
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.chat-body .account-avatar {
  width: 30px;
  height: 30px;
  background: #ececea;
}

.chat-body .account-avatar img {
  width: 17px;
  height: 17px;
  display: block;
  object-fit: contain;
}

.chat-body .account-summary {
  gap: 0;
}

.chat-body .account-summary strong {
  font-size: 0.96rem;
  font-weight: 400;
}

.chat-body .account-more {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.chat-body .account-more img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
  opacity: 0.7;
}

.chat-body .account-trigger:hover,
.chat-body .account-trigger[aria-expanded="true"] {
  border-color: transparent;
  background: var(--workbench-orange-soft);
  color: var(--workbench-ink);
}

.chat-body .account-trigger:hover .account-more img,
.chat-body .account-trigger[aria-expanded="true"] .account-more img {
  opacity: 1;
}

.chat-body .account-menu {
  border-color: var(--workbench-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(34, 34, 33, 0.12);
}

.chat-body .account-menu a,
.chat-body .account-menu button {
  color: var(--workbench-ink);
  font-weight: 400;
}

.chat-body .account-menu a:hover,
.chat-body .account-menu button:hover {
  background: var(--workbench-orange-soft);
  color: var(--workbench-ink);
}

.chat-body .workspace-sidebar {
  padding-bottom: 90px;
}

.chat-body .crystallization-list {
  padding-bottom: 12px;
}

.chat-body .user-workspace.sidebar-collapsed .account-zone {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 900px) {
  .chat-body .workspace-sidebar {
    padding-bottom: 90px;
  }

  .chat-body .workspace-sidebar.is-open {
    transform: none;
  }

  .chat-body .account-zone {
    position: fixed;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    margin: 0;
  }

  .chat-body .user-workspace .account-trigger {
    width: 100%;
  }
}

.chat-body .chat-workspace {
  position: relative;
  background: var(--workbench-canvas);
}

.chat-body .chat-workspace.is-empty {
  --empty-state-gap: 24px;
  grid-template-rows:
    auto
    auto
    minmax(var(--empty-state-gap), 1fr)
    auto
    auto
    minmax(var(--empty-state-gap), 1fr);
  overflow-y: auto;
}

.chat-body .workspace-header {
  border-bottom-color: var(--workbench-line);
  background: var(--workbench-canvas);
  padding: 14px 24px;
}

.chat-body .workspace-title h1,
.chat-body .dialog-head h2 {
  color: var(--workbench-ink);
}

.chat-body .workspace-title h1 {
  font-size: clamp(1.75rem, 2.15vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0;
}

.chat-body .workspace-title .eyebrow {
  color: var(--workbench-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-body .workspace-title {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-body .conversation-title-display {
  min-width: 0;
}

.chat-body .conversation-title-display[hidden],
.chat-body .conversation-title-form[hidden] {
  display: none;
}

.chat-body .conversation-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-body .conversation-title-edit {
  position: relative;
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  opacity: 0.62;
  padding: 0;
}

.chat-body .conversation-title-edit[hidden] {
  display: none;
}

.chat-body .conversation-title-edit:hover,
.chat-body .conversation-title-edit:focus-visible {
  background: #f1efec;
  opacity: 1;
}

.chat-body .conversation-title-edit img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.chat-body .conversation-title-form {
  width: min(720px, 62vw);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: start;
  gap: 7px 10px;
}

.chat-body .conversation-title-form input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #cbc7c1;
  border-radius: 5px;
  background: #fff;
  color: var(--workbench-ink);
  font: inherit;
  padding: 0.5rem 0.65rem;
}

.chat-body .conversation-title-form input:focus {
  border-color: var(--workbench-orange);
  box-shadow: 0 0 0 3px rgba(196, 69, 11, 0.1);
  outline: none;
}

.chat-body .conversation-title-actions {
  display: flex;
  gap: 6px;
}

.chat-body .conversation-title-actions button {
  min-height: 40px;
  border-radius: 5px;
  padding: 0.45rem 0.72rem;
}

.chat-body .conversation-title-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #b42318;
  font-size: 0.78rem;
  line-height: 1.35;
}

.chat-body .conversation-title-error[hidden] {
  display: none;
}

.chat-body .conversation-status {
  position: fixed;
  left: calc(var(--workspace-sidebar-width) + (100vw - var(--workspace-sidebar-width)) / 2);
  bottom: 24px;
  z-index: 140;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  border: 1px solid #d8d4ce;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(34, 34, 33, 0.16);
  color: var(--workbench-ink);
  font-size: 0.86rem;
  line-height: 1.4;
  padding: 0.65rem 0.85rem;
  transform: translateX(-50%);
}

.chat-body .conversation-status[hidden] {
  display: none;
}

.chat-body .conversation-status.is-error,
.chat-body .conversation-delete-error {
  border-color: #f0c7c3;
  color: #b42318;
}

.chat-body .conversation-delete-dialog {
  width: min(460px, 100%);
}

.chat-body .conversation-delete-dialog .dialog-copy {
  overflow-wrap: anywhere;
}

.chat-body .conversation-delete-error {
  margin: 0.5rem 0 0;
  border: 1px solid #f0c7c3;
  border-radius: 5px;
  background: #fff7f6;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.55rem 0.65rem;
}

.chat-body .conversation-delete-error[hidden] {
  display: none;
}

.chat-body .conversation-delete-confirm {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.chat-body .conversation-delete-confirm:hover,
.chat-body .conversation-delete-confirm:focus-visible {
  border-color: #8f1c13;
  background: #8f1c13;
  color: #fff;
}

.chat-body .sidebar-toggle {
  position: absolute;
  top: 22px;
  left: calc(var(--workspace-sidebar-width) - 42px);
  z-index: 60;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--workbench-ink);
}

.chat-body .sidebar-toggle img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

.chat-body .sidebar-toggle:hover {
  background: transparent;
  color: var(--workbench-ink);
  opacity: 0.72;
}

.chat-body .user-workspace.sidebar-collapsed .sidebar-toggle {
  top: 22px;
  left: 16px;
}

.chat-body .user-workspace.sidebar-collapsed .workspace-header {
  padding-left: 72px;
}

.chat-body .profile-status,
.chat-body .secondary-button {
  border-color: var(--workbench-line);
  border-radius: 6px;
  background: #fff;
  color: var(--workbench-ink);
}

.chat-body .profile-status:hover,
.chat-body .secondary-button:hover {
  border-color: #e8c2ad;
  background: var(--workbench-orange-soft);
  color: var(--workbench-ink);
}

.chat-body .compact-profile-nudge {
  align-items: center;
  border-bottom-color: #f0d9cb;
  background: #fff8f4;
  color: var(--workbench-ink);
  padding: 0.58rem 24px;
}

.chat-body .compact-profile-nudge strong {
  font-size: 0.86rem;
}

.chat-body .compact-profile-nudge p {
  color: var(--workbench-muted);
  font-size: 0.8rem;
}

.chat-body .compact-profile-nudge .secondary-button {
  min-height: 32px;
  font-size: 0.78rem;
}

.chat-body .skill-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.72rem;
  border-bottom: 1px solid var(--workbench-line);
  background: #fff;
  margin-top: 8px;
  padding: 0.92rem 24px 0.88rem;
  text-align: center;
}

.chat-body .skill-guide[hidden] {
  display: none;
}

.chat-body .chat-workspace:not(.is-empty) .skill-guide {
  display: none;
}

.chat-body .chat-workspace.is-empty .skill-guide {
  position: static;
  grid-row: 4;
  width: min(680px, 52vw);
  justify-self: center;
  align-self: end;
  border: 0;
  background: transparent;
  margin-top: 0;
  padding: 0;
  transform: none;
}

.chat-body .skill-guide-avatar {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--workbench-ink);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  overflow: hidden;
}

.chat-body .skill-guide-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-body .skill-guide-avatar img[hidden] {
  display: none;
}

.chat-body .skill-guide-copy {
  display: grid;
  gap: 0.54rem;
  min-width: 0;
  width: 100%;
  justify-items: center;
}

.chat-body .skill-guide-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  max-width: 100%;
}

.chat-body .skill-guide-title-row h2 {
  margin: 0;
  color: var(--workbench-ink);
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
}

.chat-body .skill-guide-example-link {
  border-bottom: 1px solid rgba(196, 69, 11, 0.28);
  color: var(--workbench-orange);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.chat-body .skill-guide-example-link:hover,
.chat-body .skill-guide-example-link:focus {
  border-bottom-color: currentColor;
  outline: none;
}

.chat-body .skill-guide-copy p {
  margin: 0;
  color: var(--workbench-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 62ch;
  white-space: pre-wrap;
}

.chat-body .skill-lock-notice {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(155, 63, 22, 0.22);
  border-radius: 6px;
  background: #fff4ed;
  color: #9b3f16;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.46rem 0.72rem;
}

.chat-body .skill-prompt-examples {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--skill-prompt-column-count, 1), minmax(0, 1fr));
  gap: 0.72rem;
  padding-top: 0.18rem;
}

.chat-body .skill-prompt-examples[hidden] {
  display: none;
}

.chat-body .skill-prompt-example {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  border: 1px solid #d9d6d1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--workbench-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow: hidden;
  padding: 0.62rem 0.82rem;
  text-align: left;
}

.chat-body .skill-prompt-example-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.chat-body .skill-prompt-example:hover,
.chat-body .skill-prompt-example:focus {
  border-color: rgba(196, 69, 11, 0.42);
  background: var(--workbench-orange-soft);
  outline: none;
}

.chat-body .workspace-chat-panel {
  background: var(--workbench-canvas);
  padding: 24px 28px;
}

.skill-example-shell {
  display: grid;
  gap: 14px;
  padding: 24px 0 28px;
}

.skill-example-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.skill-example-header h1 {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
}

.skill-example-lead {
  margin: 0.4rem 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.55;
}

.skill-example-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.skill-example-summary,
.skill-example-guide {
  padding: 1rem 1.1rem;
}

.skill-example-guide h2 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.skill-example-guide p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
}

.chat-body .workspace-chat-panel .message {
  border-color: var(--workbench-line);
  box-shadow: none;
}

.chat-body .workspace-chat-panel .message.user {
  border-color: #e2dfda;
  background: #f4f3f1;
  color: var(--workbench-ink);
}

.chat-body .workspace-chat-panel .message.user p,
.chat-body .workspace-chat-panel .message.user .role,
.chat-body .workspace-chat-panel .message.user a {
  color: var(--workbench-ink);
}

.chat-body .workspace-chat-panel .message.user .role {
  color: var(--workbench-muted);
}

.chat-body .conversation-navigator {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 25;
  width: 256px;
  transform: translateY(-50%) translateX(calc(100% - 32px));
  transition: transform 0.18s ease;
}

.chat-body .conversation-navigator:hover,
.chat-body .conversation-navigator:focus-within,
.chat-body .conversation-navigator.is-expanded {
  transform: translateY(-50%) translateX(-14px);
}

.chat-body .conversation-navigator-toggle {
  position: absolute;
  top: 50%;
  left: -32px;
  width: 32px;
  height: 104px;
  border: 1px solid var(--workbench-line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #fff;
  box-shadow: -4px 6px 16px rgba(34, 34, 33, 0.08);
  color: var(--workbench-muted);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.45rem 0;
  writing-mode: vertical-rl;
}

.chat-body .conversation-navigator-toggle:hover,
.chat-body .conversation-navigator-toggle:focus-visible {
  background: var(--workbench-orange-soft);
  color: var(--workbench-orange);
}

.chat-body .conversation-navigator-panel {
  overflow: hidden;
  border: 1px solid var(--workbench-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: -10px 14px 30px rgba(34, 34, 33, 0.12);
  padding: 0.72rem;
}

.chat-body .conversation-navigator-title {
  margin: 0 0 0.5rem;
  color: var(--workbench-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.chat-body .conversation-navigator-list {
  display: grid;
  gap: 3px;
  max-height: min(54vh, 460px);
  overflow-y: auto;
}

.chat-body .conversation-navigator-item {
  width: 100%;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--workbench-ink);
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.48rem;
  text-align: left;
}

.chat-body .conversation-navigator-item span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #f1efec;
  color: var(--workbench-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.chat-body .conversation-navigator-item strong {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 600;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-body .conversation-navigator-item:hover,
.chat-body .conversation-navigator-item.active {
  background: var(--workbench-orange-soft);
}

.chat-body .conversation-navigator-item.active span {
  background: var(--workbench-orange);
  color: #fff;
}

.chat-body .workspace-chat-panel .message.assistant {
  background: #fff;
}

.chat-body .workspace-composer {
  border-top-color: var(--workbench-line);
  background: var(--workbench-canvas);
  --composer-line-height: calc(18px * 1.4);
  padding: 14px 28px 20px;
}

.chat-body .composer-box {
  position: relative;
  border-color: #d9d6d1;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  padding: 18px 20px 52px 20px;
}

.chat-body .composer-box:focus-within {
  border-color: var(--workbench-orange);
  box-shadow: 0 0 0 3px rgba(196, 69, 11, 0.12);
}

.chat-body .knowledge-button {
  position: absolute;
  right: 58px;
  bottom: 19px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1;
  padding: 0;
}

.chat-body .workspace-composer .knowledge-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.chat-body .knowledge-button::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 4;
  border-radius: 5px;
  background: #252525;
  box-shadow: 0 4px 10px rgba(34, 34, 33, 0.18);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  padding: 0.42rem 0.52rem;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
}

.chat-body .knowledge-button:hover::after,
.chat-body .knowledge-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chat-body .knowledge-button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.chat-body .knowledge-button:hover,
.chat-body .knowledge-button:focus-visible,
.chat-body .knowledge-button.is-working {
  background: transparent;
}

.chat-body .workspace-composer textarea {
  min-height: calc(var(--composer-line-height) * 2);
  max-height: calc(var(--composer-line-height) * 5);
  overflow-y: hidden;
  resize: none;
  border-radius: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: var(--workbench-ink);
  caret-color: currentColor;
  font-size: 18px;
  line-height: 1.4;
}

.chat-body .workspace-composer textarea::placeholder {
  color: #b8b8be;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: inherit;
  letter-spacing: 0;
  opacity: 1;
}

.chat-body .workspace-composer.is-locked-expert .composer-box {
  border-color: #d2c9bf;
  background: #f7f5f2;
}

.chat-body .workspace-composer textarea:disabled {
  color: #8b8580;
  cursor: not-allowed;
}

.chat-body .send-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  line-height: 1;
  padding: 0;
}

.chat-body .workspace-composer .send-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
}

.chat-body .send-button img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}

.chat-body .send-button:hover:not(:disabled) {
  background: transparent;
}

.chat-body .send-button:disabled {
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}

.chat-body .send-button:disabled:hover {
  background: transparent;
}

.chat-body .stop-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: var(--warn);
  line-height: 1;
  padding: 0;
}

.chat-body .workspace-composer .stop-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
}

.chat-body .stop-button img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.chat-body .stop-button:hover {
  background: #9a5c14;
}

.chat-body .message.assistant .generation-status {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

.chat-body .message.assistant.interrupted .generation-status {
  color: var(--warn);
}

.chat-body .message.assistant.failed .generation-status {
  color: #b42618;
}

.chat-body .is-empty .workspace-chat-panel {
  display: none;
  padding: 0;
  pointer-events: none;
}

.chat-body .is-empty .workspace-composer {
  position: static;
  grid-row: 5;
  width: min(680px, 52vw);
  justify-self: center;
  align-self: start;
  border-top: 0;
  background: transparent;
  margin-top: var(--empty-state-gap);
  padding: 0;
  transform: none;
}

@media (max-width: 900px) {
  .chat-body .workspace-header,
  .chat-body .compact-profile-nudge {
    padding-inline: 16px;
  }

  .chat-body .workspace-chat-panel,
  .chat-body .workspace-composer {
    padding-inline: 16px;
  }

  .chat-body .is-empty .workspace-composer {
    width: min(680px, calc(100% - 32px));
    padding-bottom: 0;
  }

  .chat-body .chat-workspace.is-empty .skill-guide {
    width: min(680px, calc(100% - 32px));
  }
}

@media (max-width: 1099px) {
  .chat-body .conversation-navigator {
    display: none;
  }
}

@media (max-width: 680px) {
  .chat-body .workspace-header {
    padding: 10px 12px;
  }

  .chat-body .skill-guide {
    flex-direction: column;
    padding: 0.7rem 12px;
  }

  .chat-body .chat-workspace.is-empty {
    --empty-state-gap: 16px;
  }

  .chat-body .chat-workspace.is-empty .skill-guide {
    width: calc(100% - 24px);
    padding: 0;
  }

  .chat-body .skill-guide-avatar {
    width: 54px;
    height: 54px;
  }

  .chat-body .skill-guide-title-row {
    flex-wrap: wrap;
    gap: 0.34rem 0.5rem;
  }

  .chat-body .skill-guide-title-row h2 {
    font-size: 1.35rem;
  }

  .chat-body .skill-prompt-examples {
    grid-template-columns: 1fr;
    gap: 0.48rem;
  }

  .chat-body .skill-prompt-example {
    min-height: 42px;
    text-align: center;
  }

  .chat-body .compact-profile-nudge {
    gap: 8px;
    padding: 0.55rem 12px;
  }

  .chat-body .compact-profile-nudge p {
    display: none;
  }

  .chat-body .workspace-chat-panel,
  .chat-body .workspace-composer {
    padding-inline: 12px;
  }

  .chat-body .composer-box {
    border-radius: 0;
    padding: 16px 16px 50px 16px;
  }

  .chat-body .workspace-composer textarea {
    font-size: 18px;
    line-height: 1.4;
  }

  .chat-body .send-button {
    right: 12px;
    bottom: 12px;
    width: 40px;
  }

  .chat-body .knowledge-button {
    right: 58px;
    bottom: 17px;
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .chat-body .workspace-composer .knowledge-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .chat-body .workspace-composer .send-button {
    width: 40px;
    min-height: 40px;
  }

  .chat-body .compact-profile-nudge {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .chat-body .compact-profile-nudge .profile-nudge-actions {
    align-items: center;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
  }

  .chat-body .compact-profile-nudge .secondary-button {
    width: auto;
    padding-inline: 0.58rem;
  }

  .chat-body .is-empty .workspace-composer {
    width: calc(100% - 24px);
    padding-bottom: 0;
  }

  .skill-example-header {
    flex-direction: column;
  }

  .skill-example-actions {
    align-self: flex-start;
  }
}

@media (max-width: 900px) {
  .chat-body .conversation-status {
    left: 50%;
  }
}

@media (max-width: 680px) {
  .chat-body .conversation-title-form {
    width: calc(100vw - 168px);
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .chat-body .workspace-title h1 {
    max-width: calc(100vw - 168px);
  }

  .chat-body .sidebar-toggle,
  .chat-body .user-workspace.sidebar-collapsed .sidebar-toggle {
    left: auto;
    right: 100px;
  }

  .chat-body .conversation-title-actions {
    justify-content: flex-start;
  }

  .chat-body .conversation-title-actions button {
    min-height: 34px;
    padding: 0.35rem 0.62rem;
  }

  .chat-body .conversation-title-form input {
    height: 36px;
  }

  .chat-body .conversation-title-edit {
    width: 30px;
    height: 30px;
    min-height: 30px;
    flex-basis: 30px;
  }

  .chat-body .conversation-delete-backdrop {
    padding: 12px;
  }

  .chat-body .conversation-delete-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 18px;
  }

  .chat-body .conversation-delete-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-body .conversation-delete-actions button {
    width: 100%;
  }

  .chat-body .conversation-status {
    bottom: 16px;
  }
}

/* WorkBuddy-inspired thinking state and simplified user messages. */
.chat-body .workspace-chat-panel .message.user {
  border: 1px solid #e2dfda;
  border-radius: 10px;
  background: #f7f6f4;
  padding: 0.72rem 0.9rem;
}

.chat-body .workspace-chat-panel .message.user p {
  margin: 0;
  color: var(--workbench-ink);
  line-height: 1.65;
}

.chat-body .workspace-chat-panel .message.user .role {
  display: none;
}

.chat-body .workspace-chat-panel .message.assistant.pending.processing-message {
  position: relative;
  min-width: min(300px, 86vw);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--workbench-muted);
  isolation: isolate;
  padding: 0.35rem 0.2rem 0.65rem;
}

.chat-body .workspace-chat-panel.is-centering-processing {
  padding-bottom: var(--processing-center-padding, 24px);
}

.chat-body .workspace-chat-panel .message.assistant.pending.processing-message > * {
  position: relative;
  z-index: 1;
}

.chat-body .processing-brand-image {
  width: min(150px, 52vw);
  height: auto;
  display: block;
  background: transparent;
  object-fit: contain;
  object-position: left center;
}

.chat-body .processing-state {
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-top: 6px;
  color: #898985;
  font-size: 1rem;
  line-height: 1.45;
  width: fit-content;
  background: linear-gradient(
    100deg,
    #898985 0%,
    #898985 42%,
    #b9bab8 47%,
    #f1f2f0 50%,
    #c8c9c7 53%,
    #898985 58%,
    #898985 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: processing-text-wave 4.8s linear infinite;
}

.chat-body .processing-detail {
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-top: 6px;
  color: #b3b1ad;
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@keyframes processing-text-wave {
  0% {
    background-position: 100% 0;
  }

  16.667% {
    background-position: 0% 0;
  }

  100% {
    background-position: 0% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-body .processing-state {
    animation: none;
    background: none;
    -webkit-text-fill-color: #898985;
  }
}

/* Crystallization discovery: persistent sidebar cue plus one-time contextual hint. */
.chat-body .crystallization-discovery-hint {
  margin: 0 0 0.42rem;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  border: 1px solid #e2e0dc;
  border-radius: 6px;
  background: #f7f6f3;
  color: #777773;
  font-size: 0.7rem;
  line-height: 1.45;
  padding: 0.48rem 0.52rem;
}

.chat-body .crystallization-discovery-hint[hidden],
.chat-body .crystallization-onboarding-hint[hidden] {
  display: none;
}

.chat-body .crystallization-discovery-icon,
.chat-body .crystallization-onboarding-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d6d7d4;
  border-radius: 5px;
  background:
    linear-gradient(to top, rgba(196, 199, 196, 0.58) 0 38%, transparent 38%),
    #fbfbf9;
  color: #666763;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.72rem;
}

.chat-body .crystallization-discovery-copy {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.3rem;
}

.chat-body .crystallization-discovery-arrow {
  color: #a09f9a;
}

.chat-body .crystallization-onboarding-hint {
  max-width: min(520px, 100%);
  margin: 0.6rem 0 0.28rem;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  border: 1px solid #e1dfdb;
  border-radius: 7px;
  background: #f8f7f4;
  color: #777773;
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 0.5rem 0.58rem;
  animation: crystallization-discovery-enter 0.18s ease-out both;
}

.chat-body .crystallization-onboarding-copy {
  min-width: 0;
}

.chat-body .crystallization-onboarding-dismiss {
  margin-left: auto;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #85847f;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  padding: 0.18rem 0.26rem;
  white-space: nowrap;
}

.chat-body .crystallization-onboarding-dismiss:hover,
.chat-body .crystallization-onboarding-dismiss:focus-visible {
  color: #3f403d;
  text-decoration: underline;
  outline: none;
}

@keyframes crystallization-discovery-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-body .crystallization-onboarding-hint {
    animation: none;
  }
}

/* Full-page Vikki VWork opening animation. */
.chat-body .opening-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #fff;
  color: #303030;
  color-scheme: light;
  pointer-events: auto;
  isolation: isolate;
  animation: opening-splash-screen 2.6s ease-in-out both;
}

.chat-body .opening-splash.is-finished {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.chat-body .opening-splash-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(58vw, 560px, calc(100vh - 96px));
  max-width: calc(100vw - 40px);
  animation: opening-splash-logo 2.6s cubic-bezier(0.22, 0.76, 0.26, 1) both;
}

.chat-body .opening-splash-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1145 / 1084;
  overflow: hidden;
}

.chat-body .opening-splash-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.chat-body .opening-splash-visual::after {
  content: "";
  position: absolute;
  inset: -14% -36%;
  background: linear-gradient(
    104deg,
    transparent 38%,
    rgba(255, 255, 255, 0.22) 45%,
    rgba(255, 255, 255, 0.88) 50%,
    rgba(255, 255, 255, 0.2) 55%,
    transparent 62%
  );
  opacity: 0;
  pointer-events: none;
  transform: translateX(-72%) skewX(-10deg);
  mix-blend-mode: screen;
  animation: opening-splash-shine 2.6s ease-in-out both;
}

.chat-body .opening-splash-credit {
  margin: clamp(10px, 1.8vh, 18px) 0 0;
  color: #303030;
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", "思源黑体", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(14px, 1.55vw, 20px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.18em;
  text-align: center;
  text-indent: 0.18em;
  white-space: nowrap;
}

@keyframes opening-splash-screen {
  0%,
  72% {
    visibility: visible;
    opacity: 1;
  }

  100% {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes opening-splash-logo {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(14px) scale(0.88);
  }

  20% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }

  70% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(-4px) scale(1.025);
  }
}

@keyframes opening-splash-shine {
  0%,
  20% {
    opacity: 0;
    transform: translateX(-72%) skewX(-10deg);
  }

  26% {
    opacity: 0.72;
  }

  54% {
    opacity: 0.48;
    transform: translateX(72%) skewX(-10deg);
  }

  55%,
  100% {
    opacity: 0;
    transform: translateX(72%) skewX(-10deg);
  }
}

@media (max-width: 760px) {
  .chat-body .opening-splash-stage {
    width: min(86vw, 520px, calc(100vh - 84px));
    max-width: calc(100vw - 24px);
  }

  .chat-body .opening-splash-credit {
    margin-top: clamp(9px, 1.5vh, 14px);
    font-size: clamp(13px, 4vw, 17px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-body .opening-splash {
    animation-duration: 0.45s;
  }

  .chat-body .opening-splash-stage {
    animation: none;
  }

  .chat-body .opening-splash-visual::after {
    display: none;
    animation: none;
  }
}
