:root {
  --bg: #eeebe4;
  --sidebar: rgba(245, 241, 234, 0.94);
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #171a19;
  --muted: #66706a;
  --line: rgba(23, 26, 25, 0.1);
  --green: #1d5f4d;
  --shadow: 0 18px 48px rgba(51, 45, 34, 0.08);
  --diagram-default-width: min(22rem, 100%);
  font-family: "IBM Plex Sans", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(161, 79, 42, 0.06), transparent 22rem),
    radial-gradient(circle at bottom right, rgba(29, 95, 77, 0.06), transparent 18rem),
    linear-gradient(160deg, #f7f4ee 0%, #ecefe8 55%, #eee5d8 100%);
}

.platform-home-body {
  background:
    radial-gradient(circle at top left, rgba(240, 195, 106, 0.26), transparent 24rem),
    radial-gradient(circle at top right, rgba(29, 95, 77, 0.14), transparent 20rem),
    linear-gradient(180deg, #f7f2e7 0%, #f3f7ef 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
}

.locale-switcher {
  display: inline-flex;
  align-items: center;
  width: auto;
}

.locale-switcher select {
  width: auto;
  min-width: 96px;
  border-radius: 12px;
  padding: 10px 12px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  flex: 0 0 18px;
  accent-color: var(--green);
}

input[type="radio"] {
  border-radius: 50%;
}

textarea {
  resize: none;
  line-height: 1.7;
}

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

.shared-page {
  min-height: 100vh;
  padding: 28px 18px;
}

.shared-page-shell {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.shared-page-header {
  padding: 8px 4px 0;
}

.shared-page-header h1 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.3rem, 1.8vw, 1.8rem);
}

.shared-thread {
  min-height: 240px;
}

.chat-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.platform-home-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.platform-home-brand {
  padding: 8px 12px 8px 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(29, 95, 77, 0.12);
}

.platform-home-sidebar {
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.platform-home-sidebar .sidebar-top {
  grid-template-rows: auto minmax(0, 1fr);
}

.platform-sidebar-apps {
  align-content: start;
}

.platform-sidebar-app {
  text-decoration: none;
}

.platform-sidebar-app-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.platform-sidebar-app-subscribed {
  border-color: rgba(29, 95, 77, 0.28);
  background: linear-gradient(180deg, rgba(236, 245, 241, 0.96), rgba(223, 239, 232, 0.9));
  box-shadow: 0 12px 30px rgba(29, 95, 77, 0.08);
}

.platform-sidebar-app-subscribed .conversation-card-title,
.platform-sidebar-app-subscribed .platform-sidebar-app-meta {
  color: var(--green);
}

.platform-sidebar-app-unavailable {
  opacity: 0.54;
  background: rgba(255, 255, 255, 0.62);
}

.account-platform-apps {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.account-platform-app {
  text-decoration: none;
}

.account-platform-app-meta {
  display: grid;
  gap: 2px;
}

.platform-hero {
  padding: 8px 4px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 12px;
}

.platform-hero-title {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.7rem, 2.2vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.platform-hero-slogan {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.platform-hero-slogan *,
.platform-app-card-body strong,
.platform-app-card-body span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quoted-emphasis {
  color: var(--ink);
  font-weight: 700;
}

.platform-home-main {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: 18px 22px 28px;
}

.platform-home-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.platform-home-top-actions .locale-switcher select {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.platform-home-section {
  display: grid;
  gap: 16px;
}

.platform-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.platform-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.platform-app-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(29, 95, 77, 0.12);
  box-shadow: 0 16px 48px rgba(20, 35, 29, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.platform-app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(20, 35, 29, 0.11);
  border-color: rgba(29, 95, 77, 0.2);
}

.platform-app-card-image {
  width: 100%;
  aspect-ratio: 16 / 9.4;
  object-fit: cover;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(238, 244, 239, 0.92));
}

.platform-app-card-visual {
  width: 100%;
  aspect-ratio: 16 / 9.4;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(238, 244, 239, 0.92));
}

.platform-app-card-visual svg {
  display: block;
  width: 100%;
  height: 100%;
}

.platform-app-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.platform-app-card-body strong {
  font-size: 1rem;
  line-height: 1.35;
}

.platform-app-card-body span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.platform-user-panel {
  padding: 22px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(29, 95, 77, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.platform-user-status,
.platform-user-note {
  margin: 0;
}

.platform-user-status {
  font-weight: 600;
}

.platform-user-note {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.6;
}

.platform-faq-panel {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(29, 95, 77, 0.12);
  display: grid;
  gap: 14px;
}

.platform-faq-head {
  display: grid;
  gap: 10px;
}

.platform-faq-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.platform-faq-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.platform-faq-suggestions .tiny-button {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.platform-faq-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.platform-faq-form > .hint {
  grid-column: 1 / -1;
}

.platform-faq-form textarea {
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  resize: vertical;
}

.platform-faq-actions {
  display: grid;
  justify-items: end;
  align-content: end;
  gap: 6px;
  min-width: 86px;
}

.platform-faq-thread {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-height: none;
  overflow: visible;
}

.platform-faq-thread .platform-faq-thread-message {
  min-width: 0;
}

.platform-faq-thread .platform-faq-thread-message.user {
  padding: 4px 0;
  gap: 4px;
  background: transparent;
}

.platform-faq-thread .platform-faq-thread-message.user .message-role,
.platform-faq-thread .platform-faq-thread-message.user .message-body p {
  line-height: 1.2;
}

.platform-faq-thread .platform-faq-thread-message.assistant {
  overflow: hidden;
}

.platform-faq-thread .platform-faq-thread-message .message-role {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.platform-faq-thread .platform-faq-thread-message .message-body,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body p,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body ul,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body ol,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body li,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body blockquote,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body a,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body code,
.platform-faq-thread .platform-faq-thread-message .message-body .markdown-body pre,
.platform-faq-thread .platform-faq-thread-message .message-body > pre {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.platform-faq-thread .platform-faq-thread-message .message-body > pre {
  margin: 0;
  white-space: pre-wrap;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 26, 25, 0.42);
  backdrop-filter: blur(2px);
}

.confirm-dialog-panel {
  position: relative;
  width: min(92vw, 460px);
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.2);
  display: grid;
  gap: 16px;
}

.confirm-dialog-title {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
}

.confirm-dialog-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.manual-copy-dialog .confirm-dialog-panel {
  width: min(92vw, 720px);
}

.manual-copy-textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  font: 0.94rem/1.6 "IBM Plex Sans", "PingFang SC", sans-serif;
}

.manual-copy-textarea:focus {
  border-color: rgba(29, 95, 77, 0.38);
  box-shadow: 0 0 0 3px rgba(29, 95, 77, 0.12);
  outline: none;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 16px;
  padding: 14px;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--sidebar);
  backdrop-filter: blur(14px);
}

.sidebar-top,
.sidebar-actions,
.sidebar-section,
.sidebar-footer,
.sidebar-auth-actions,
.account-grid,
.auth-stack,
.stack,
.list-block,
.conversation-list,
.attachment-list,
.whwm-result {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-field span {
  color: var(--ink);
}

.required-star {
  color: #b42318;
  font-style: normal;
}

.segmented-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.segmented-choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.segmented-choice label:has(input:checked) {
  background: var(--ink);
  color: #fff;
}

.segmented-choice input {
  accent-color: currentColor;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.checkbox-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.checkbox-group-compact {
  max-height: 260px;
  overflow: auto;
}

.checkbox-group label,
.checkbox-subgroup {
  min-width: 0;
}

.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 1px;
}

.checkbox-subgroup {
  display: grid;
  gap: 7px;
  padding: 4px 0 8px;
}

.checkbox-subgroup strong,
.emphasis-label,
.emphasis-button {
  font-weight: 800;
}

.profile-preference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.verification-row .ghost-button {
  min-width: 116px;
  padding-inline: 14px;
}

.auth-warning {
  margin: -2px 0 0;
  line-height: 1.55;
}

.oauth-login-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.oauth-login-card h3 {
  margin: 0;
}

.oauth-login-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.oauth-button {
  justify-content: center;
  text-align: center;
}

.account-action-status {
  min-height: 20px;
}

.sidebar-top {
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.brand-mark-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-section-head,
.panel-head,
.action-row,
.inline-form,
.chat-topbar,
.account-header,
.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  gap: 10px;
  padding: 16px 20px;
}

.routing-suggestion {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(29, 95, 77, 0.16);
  border-radius: 18px;
  background: rgba(250, 252, 248, 0.98);
  box-shadow: 0 10px 24px rgba(29, 95, 77, 0.08);
}

.routing-suggestion-text {
  margin: 0;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

.routing-suggestion-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-topbar {
  padding: 4px 4px 0;
}

.chat-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-topbar-actions .ghost-button,
.chat-topbar-actions .primary-button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.chat-topbar h1,
.account-header h1 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.3rem, 1.8vw, 1.8rem);
}

.slogan {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 860px;
  white-space: pre-line;
}

.kicker,
.message-role {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.message-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 2px;
}

.message-time {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.ghost-button,
.tiny-button,
.block-link,
.block-button,
.primary-button,
.icon-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.ghost-button,
.tiny-button,
.block-link,
.block-button,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 11px 15px;
}

.primary-button {
  padding: 11px 15px;
  background: #111827;
  color: #fff;
}

.block-button,
.block-link {
  width: 100%;
}

.message,
.conversation-card,
.attachment-chip,
.list-item,
.member-card,
.balance-box,
.whwm-card,
.whwm-subcard,
.plan-card,
.panel,
.account-entry {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
}

.conversation-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 6px 8px;
  overflow: visible;
  text-align: left;
}

.conversation-card-main {
  display: block;
  min-width: 0;
  padding: 4px 6px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.conversation-card-title {
  min-width: 0;
  display: block;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.conversation-list,
.sidebar-section {
  min-width: 0;
}

.conversation-list {
  align-content: start;
  min-height: 0;
  overflow: auto;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-subscription-entry {
  width: 100%;
  margin-top: 10px;
}

.conversation-menu {
  position: relative;
}

.conversation-menu-trigger {
  min-width: 32px;
  height: 32px;
  padding: 0 8px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.04);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.conversation-menu-trigger:hover,
.conversation-menu-trigger:focus-visible {
  background: rgba(17, 24, 39, 0.08);
  color: var(--ink);
  outline: none;
}

.conversation-menu-panel {
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: none;
  min-width: max-content;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(51, 45, 34, 0.12);
}

.conversation-menu.open .conversation-menu-panel {
  display: flex;
  gap: 4px;
}

.conversation-menu-item {
  width: auto;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}

.conversation-menu-item:hover,
.conversation-menu-item:focus-visible {
  background: rgba(17, 24, 39, 0.06);
  outline: none;
}

.conversation-menu-item.danger:hover,
.conversation-menu-item.danger:focus-visible {
  background: rgba(167, 41, 41, 0.08);
  color: #8b1e1e;
}

.conversation-card.active {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(17, 24, 39, 0.06);
}

.thread {
  min-height: 0;
  overflow: auto;
  padding: 8px 4px 4px;
  display: grid;
  gap: 8px;
}

.thread.empty-thread {
  grid-template-rows: minmax(0, 1fr);
  align-content: start;
  padding-top: var(--empty-thread-top-padding, 4px);
}

.thread.empty-thread > .message {
  height: 100%;
  min-height: 100%;
  align-content: start;
}

.message {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
}

.message:focus-visible {
  outline: 2px solid rgba(18, 108, 91, 0.45);
  outline-offset: 2px;
}

.message.user,
.message.assistant {
  background: rgba(255, 255, 255, 0.9);
}

.message.pending {
  border-style: dashed;
  gap: 8px;
  padding: 8px 12px;
}

.message-body,
.whwm-card-body,
.whwm-subcard {
  display: grid;
  gap: 6px;
}

.message-body,
.message-body *,
.markdown-body,
.markdown-body * {
  -webkit-user-select: text;
  user-select: text;
}

.message-actions,
.message-actions * {
  -webkit-user-select: none;
  user-select: none;
}

.message-body p,
.whwm-card-body p,
.whwm-subcard p {
  margin: 0;
  line-height: 1.5;
}

.message-body pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.5;
}

.markdown-body {
  display: grid;
  gap: 6px;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0.2em 0 0;
  line-height: 1.35;
}

.markdown-body p {
  margin: 0;
  line-height: 1.5;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.markdown-body li + li {
  margin-top: 2px;
}

.markdown-body pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.05);
  overflow: auto;
}

.markdown-body code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.94em;
}

.markdown-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body hr {
  width: 100%;
  height: 1px;
  margin: 4px 0;
  border: 0;
  background: rgba(29, 95, 77, 0.14);
}

.markdown-body blockquote {
  margin: 0;
  padding-left: 10px;
  border-left: 3px solid rgba(29, 95, 77, 0.25);
  color: var(--muted);
}

.markdown-body .markdown-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(29, 95, 77, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.markdown-body table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.markdown-body th,
.markdown-body td {
  padding: 7px 9px;
  border: 1px solid rgba(29, 95, 77, 0.14);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.markdown-body th {
  background: rgba(29, 95, 77, 0.08);
  font-weight: 700;
}

.markdown-body tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.42);
}

.markdown-body .svg-diagram {
  width: var(--diagram-default-width);
  max-width: 100%;
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(29, 95, 77, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 246, 0.96));
  overflow: auto;
}

.markdown-body .svg-diagram-canvas {
  overflow: auto;
}

.markdown-body .svg-diagram-image,
.markdown-body .rendered-diagram-image {
  display: block;
  width: 100%;
  height: auto;
}

.markdown-body .whwm-hanzi-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0 12px;
}

.markdown-body .whwm-hanzi-image-item {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.markdown-body .whwm-hanzi-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(29, 95, 77, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.markdown-body .whwm-hanzi-image-wide {
  width: min(520px, 100%);
  max-width: 100%;
}

.markdown-body .whwm-hanzi-image-small {
  width: 88px;
  max-width: 28vw;
}

.markdown-body .whwm-hanzi-image-reference {
  margin-top: 4px;
  color: rgba(42, 53, 49, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.markdown-body .whwm-hanzi-image-primary {
  position: static;
  height: auto;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
}

.markdown-body .whwm-hanzi-images[data-hanzi-primary-failed="true"] .whwm-hanzi-image-secondary[data-hanzi-image-loaded="true"] {
  position: static;
  height: auto;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
}

.markdown-body .whwm-hanzi-images[data-hanzi-primary-failed="true"][data-hanzi-secondary-failed="true"] .whwm-hanzi-image-tertiary[data-hanzi-image-loaded="true"] {
  position: static;
  height: auto;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
}

.markdown-body .mermaid-diagram,
.markdown-body .whwm-binary-tree-diagram,
.markdown-body .whwm-plot-diagram,
.markdown-body .whwm-circuit-layout-diagram,
.markdown-body .whwm-circuit-diagram,
.markdown-body .whwm-mechanics-diagram,
.markdown-body .whwm-optics-diagram {
  width: var(--diagram-default-width);
  max-width: 100%;
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(29, 95, 77, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 246, 0.96));
  overflow: auto;
}

.markdown-body .mermaid-diagram {
  width: 100%;
}

.markdown-body .concept-map-diagram {
  width: 80%;
  max-width: 80%;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.markdown-body .concept-map-zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.markdown-body .concept-map-zoom-button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(29, 95, 77, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.markdown-body .concept-map-zoom-button:hover {
  border-color: rgba(29, 95, 77, 0.45);
  background: rgba(242, 248, 245, 0.96);
}

.markdown-body .concept-map-zoom-label {
  min-width: 46px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.concept-map-save-menu {
  position: fixed;
  z-index: 10000;
  min-width: 132px;
  padding: 6px;
  border: 1px solid rgba(29, 95, 77, 0.2);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.concept-map-save-menu button {
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.concept-map-save-menu button:hover {
  background: rgba(242, 248, 245, 0.96);
}

.markdown-body .mermaid-diagram-canvas,
.markdown-body .whwm-binary-tree-diagram-canvas,
.markdown-body .whwm-plot-diagram-canvas,
.markdown-body .whwm-circuit-layout-diagram-canvas,
.markdown-body .whwm-circuit-diagram-canvas,
.markdown-body .whwm-mechanics-diagram-canvas,
.markdown-body .whwm-optics-diagram-canvas {
  min-height: 36px;
  color: var(--muted);
}

.markdown-body .whwm-mechanics-diagram-canvas,
.markdown-body .whwm-binary-tree-diagram-canvas,
.markdown-body .whwm-circuit-layout-diagram-canvas,
.markdown-body .whwm-circuit-diagram-canvas,
.markdown-body .whwm-optics-diagram-canvas {
  overflow: auto;
}

.markdown-body .concept-map-diagram .mermaid-diagram-canvas {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.markdown-body .mermaid-diagram-canvas svg,
.markdown-body .whwm-binary-tree-diagram-canvas svg,
.markdown-body .whwm-plot-diagram-canvas svg,
.markdown-body .whwm-circuit-layout-diagram-canvas svg,
.markdown-body .whwm-circuit-diagram-canvas svg,
.markdown-body .whwm-mechanics-diagram-canvas svg,
.markdown-body .whwm-optics-diagram-canvas svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.markdown-body .concept-map-diagram .mermaid-diagram-canvas svg {
  width: auto;
  max-width: none;
}

@media (max-width: 760px) {
  .markdown-body .concept-map-diagram {
    width: 100%;
  }
}

.message-body ul,
.whwm-card-body ul,
.whwm-subcard ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.message-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.message-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 100%;
}

.message-action-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.message-quota-warning {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(167, 41, 41, 0.14);
  border-radius: 12px;
  background: rgba(167, 41, 41, 0.06);
  color: #7a2020;
  line-height: 1.55;
}

.inline-message-editor {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.inline-message-editor-warning {
  padding: 12px 14px;
  border: 1px solid rgba(167, 41, 41, 0.14);
  border-radius: 14px;
  background: rgba(167, 41, 41, 0.06);
  color: #7a2020;
  line-height: 1.5;
}

.inline-message-editor-input {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.98rem;
  line-height: 1.75;
  resize: vertical;
  box-sizing: border-box;
  max-width: 100%;
}

.inline-message-editor-input:focus {
  outline: 2px solid rgba(29, 95, 77, 0.18);
  border-color: rgba(29, 95, 77, 0.28);
}

.pending-activity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 20px;
  max-width: min(100%, 760px);
  width: 100%;
}

.pending-activity-text {
  color: var(--ink);
  line-height: 1.35;
}

.pending-activity-rotator {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(100%, 620px);
  min-height: 1.6em;
  padding-right: 4px;
}

.pending-activity-rotator-item {
  position: absolute;
  inset: 0 auto 0 0;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  animation-name: pending-rotator-cycle;
  animation-duration: calc(var(--pending-rotator-count) * 3.6s);
  animation-timing-function: step-end;
  animation-iteration-count: infinite;
  animation-delay: calc(var(--pending-rotator-index) * 3.6s);
}

.pending-activity-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.pending-activity-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(29, 95, 77, 0.65);
  animation: pending-bounce 1.2s infinite ease-in-out;
}

.pending-activity-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.pending-activity-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes pending-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes pending-rotator-cycle {
  0% {
    opacity: 1;
  }

  19.999% {
    opacity: 1;
  }

  20%,
  100% {
    opacity: 0;
  }
}

.composer {
  position: sticky;
  bottom: 0;
  padding-top: 6px;
}

.chat-composer-shell {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(51, 45, 34, 0.08);
}

.composer-row {
  display: grid;
  grid-template-columns: 40px 40px minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.chat-input {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 8px 4px 8px 2px;
  background: transparent;
}

.chat-input:focus {
  outline: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-cancel-button {
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
}

.icon-button,
.send-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
}

.attach-button {
  cursor: pointer;
}

.icon-button input {
  display: none;
}

.icon-plus,
.icon-camera,
.icon-mic,
.send-arrow {
  display: inline-block;
  position: relative;
}

.icon-plus {
  width: 14px;
  height: 14px;
}

.icon-plus::before,
.icon-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.icon-plus::before {
  width: 14px;
  height: 2px;
}

.icon-plus::after {
  width: 2px;
  height: 14px;
}

.icon-camera {
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-camera::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.icon-camera::after {
  content: "";
  position: absolute;
  left: 2px;
  top: -5px;
  width: 6px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.icon-mic {
  width: 12px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 10px;
}

.icon-mic::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 2px;
  height: 7px;
  background: currentColor;
  transform: translateX(-50%);
}

.icon-mic::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 14px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  transform: translateX(-50%);
}

.send-button {
  background: #111827;
  color: #fff;
}

.text-send-button {
  width: auto;
  min-width: 64px;
  padding: 0 16px;
  font-size: 0.92rem;
  font-weight: 600;
}

.attachment-list.empty {
  display: none;
}

.attachment-chip,
.list-item,
.member-card,
.plan-card {
  padding: 14px 16px;
}

.runtime-entitlement-card {
  display: grid;
  gap: 10px;
}

.runtime-identity-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.runtime-identity-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 700;
}

.runtime-identity-button.active {
  border-color: rgba(29, 95, 77, 0.54);
  background: #1d5f4d;
  color: #fff;
}

.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;
}

.attachment-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.whwm-card {
  overflow: hidden;
}

.whwm-card-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(29, 95, 77, 0.1), rgba(255, 255, 255, 0.2));
  border-bottom: 1px solid var(--line);
}

.whwm-card-body {
  gap: 8px;
  padding: 12px 14px;
}

.whwm-subcard {
  gap: 6px;
  padding: 10px 12px;
  background: rgba(248, 242, 234, 0.72);
}

.whwm-subcard h4 {
  margin: 0;
}

.katex-display {
  margin: 0.35em 0;
}

.account-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.account-panel-user {
  grid-column: 1;
  grid-row: 1;
}

.account-panel-api {
  grid-column: 1;
  grid-row: 2;
}

.api-guide-summary {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(29, 95, 77, 0.14);
  border-radius: 18px;
  background: rgba(248, 242, 234, 0.62);
}

.api-guide-summary .hint,
.api-guide-markdown p,
.api-guide-markdown li {
  line-height: 1.6;
}

.api-guide-summary code,
.api-guide-markdown code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.api-guide-summary .tiny-button {
  justify-self: start;
}

.api-guide-steps .account-entry {
  align-items: start;
  flex-direction: column;
}

.api-guide-markdown {
  gap: 10px;
}

.account-panel-billing {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.account-right-action-areas {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.account-action-area {
  display: grid;
  gap: 8px;
}

.account-action-area .ghost-button {
  justify-self: start;
}

.account-settings-block {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account-settings-block h3 {
  margin: 0;
}

.shortcut-settings-form {
  max-width: 720px;
}

.shortcut-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(29, 95, 77, 0.14);
  border-radius: 16px;
  background: rgba(248, 242, 234, 0.62);
}

.shortcut-option input {
  margin-top: 4px;
}

.shortcut-option span {
  display: grid;
  gap: 4px;
}

.shortcut-option small {
  color: var(--muted);
  line-height: 1.5;
}

.subscription-billing-only {
  grid-template-columns: 1fr;
}

.subscription-billing-only .account-panel-billing {
  grid-column: auto;
  grid-row: auto;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plan-card {
  display: grid;
  gap: 8px;
}

.plan-card.compact {
  padding: 12px 14px;
}

.plan-card.active {
  border-color: rgba(29, 95, 77, 0.48);
  background: rgba(29, 95, 77, 0.08);
}

.account-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.sidebar-auth-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sidebar-auth-actions .block-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sidebar-auth-actions button.block-button {
  grid-column: 1 / -1;
}

.admin-toolbar,
.admin-toolbar-row,
.admin-user-card,
.admin-user-card-main,
.admin-access-row,
.admin-access-row-main,
.admin-access-role,
.admin-access-toggle,
.payment-method-picker,
.billing-bundle-builder,
.billing-bundle-head,
.billing-bundle-apps,
.billing-app-chip,
.billing-bundle-plan-grid {
  display: grid;
  gap: 10px;
}

.admin-toolbar-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: center;
}

.admin-trace-filter {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 0.8fr) minmax(150px, 1.1fr) minmax(150px, 1.1fr);
  gap: 10px;
  align-items: center;
}

.admin-trace-filter input,
.admin-trace-filter select {
  width: 100%;
}

.run-trace-detail {
  display: block;
}

.run-trace-detail summary {
  cursor: pointer;
  list-style-position: inside;
}

.run-trace-detail summary > div {
  display: inline-grid;
  gap: 4px;
  width: calc(100% - 28px);
  vertical-align: top;
}

.run-trace-body,
.run-trace-events,
.run-trace-event,
.run-trace-meta-block {
  display: grid;
  gap: 8px;
}

.run-trace-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.run-trace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.run-trace-events {
  margin: 0;
  padding-left: 20px;
}

.run-trace-event {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.run-trace-event-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.run-trace-event-head span,
.run-trace-event small {
  color: var(--muted);
}

.run-trace-meta-block pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 241, 234, 0.72);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
}

.admin-batch-access-list {
  gap: 10px;
}

.admin-access-row {
  grid-template-columns: minmax(0, 1.3fr) auto auto;
  align-items: center;
}

.admin-access-row-main span,
.admin-user-card-main span,
.admin-user-card-main small,
.admin-access-role span {
  color: var(--muted);
}

.admin-access-role {
  min-width: 122px;
}

.admin-access-role select,
.admin-toolbar-row select {
  width: 100%;
}

.admin-access-toggle {
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 8px;
  color: var(--muted);
}

.admin-access-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-user-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-user-card.active {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(17, 24, 39, 0.06);
}

.billing-bundle-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.billing-bundle-apps,
.billing-bundle-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.billing-cycle-checkout {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(29, 95, 77, 0.18);
  border-radius: 16px;
  background: rgba(248, 242, 234, 0.72);
}

.billing-cycle-checkout-head,
.billing-cycle-checkout-total {
  display: grid;
  gap: 5px;
}

.billing-cycle-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.billing-cycle-option {
  display: grid;
  gap: 4px;
  min-height: 92px;
  align-content: start;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.billing-cycle-option.active {
  border-color: rgba(29, 95, 77, 0.54);
  background: #1d5f4d;
  color: #fff;
}

.billing-cycle-option small,
.billing-cycle-checkout-head small,
.billing-cycle-checkout-total small {
  color: var(--muted);
}

.billing-cycle-option.active small {
  color: rgba(255, 255, 255, 0.78);
}

.billing-app-chip {
  align-content: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 242, 234, 0.72);
  cursor: pointer;
}

.billing-app-chip input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.billing-app-chip small,
.billing-bundle-head span {
  color: var(--muted);
}

.account-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.1);
  font-size: 0.9rem;
  font-weight: 700;
}

.account-name {
  font-size: 0.94rem;
  font-weight: 600;
}

.balance-box,
.empty,
.hint {
  color: var(--muted);
}

.hint.pending-status {
  display: block;
  width: 100%;
  padding: 8px 0 2px;
  color: var(--ink);
}

.hint.pending-status .pending-activity {
  min-height: 22px;
}

@media (max-width: 1080px) {
  .chat-shell,
  .account-grid,
  .plan-grid,
  .platform-app-grid {
    grid-template-columns: 1fr;
  }

  .account-panel-user,
  .account-panel-api,
  .account-panel-billing {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .verification-row {
    grid-template-columns: 1fr;
  }

  .oauth-login-actions {
    grid-template-columns: 1fr;
  }

  .profile-preference-grid {
    grid-template-columns: 1fr;
  }

  .chat-main,
  .chat-sidebar,
  .account-shell,
  .platform-home-shell {
    padding: 14px;
    width: min(100vw - 18px, 100%);
  }

  .chat-topbar,
  .account-header,
  .action-row,
  .inline-form,
  .composer-toolbar,
  .platform-user-panel,
  .platform-faq-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .composer-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .admin-toolbar-row,
  .admin-trace-filter,
  .admin-access-row,
  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .run-trace-grid {
    grid-template-columns: 1fr;
  }

  .platform-home-shell {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    justify-items: center;
  }

  .platform-home-sidebar {
    position: static;
    max-height: none;
    order: 2;
    width: 100%;
    box-sizing: border-box;
  }

  .platform-home-main {
    order: 1;
    width: calc(100vw - 72px);
    max-width: 100%;
    min-width: 0;
    padding: 16px 0 28px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .platform-home-top-actions {
    position: static;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .platform-home-body {
    overflow-x: hidden;
  }
}

@media (max-width: 420px) {
  .platform-home-main {
    width: 320px;
    max-width: calc(100vw - 52px);
  }
}


.platform-document-tool-link {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.88rem;
  white-space: nowrap;
}

body.document-tools-page {
  color: #17211b;
  background:
    radial-gradient(circle at top left, rgba(30, 123, 99, 0.24), transparent 28rem),
    radial-gradient(circle at right 20%, rgba(182, 94, 46, 0.14), transparent 24rem),
    linear-gradient(135deg, #f7eddc 0%, #f2f6f0 48%, #efe2cc 100%);
}

body.document-tools-page .app-shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

body.document-tools-page .hero-panel,
body.document-tools-page .composer-panel,
body.document-tools-page .result-panel {
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 28px 60px rgba(32, 47, 39, 0.14);
  backdrop-filter: blur(14px);
}

body.document-tools-page .hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 280px);
  gap: 22px;
  padding: 28px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(15, 31, 24, 0.9), rgba(30, 123, 99, 0.9));
}

body.document-tools-page .hero-copy {
  color: #f8f5ed;
}

body.document-tools-page .eyebrow,
body.document-tools-page .section-kicker {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.document-tools-page .hero-copy h1 {
  margin: 0;
  max-width: none;
  width: 100%;
  white-space: nowrap;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.04;
}

body.document-tools-page .hero-text {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(248, 245, 237, 0.84);
  font-size: 1.02rem;
  line-height: 1.7;
}

body.document-tools-page .hero-card {
  display: grid;
  gap: 10px;
  align-content: end;
}

body.document-tools-page .workspace {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

body.document-tools-page .top-auth-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(23, 33, 27, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

body.document-tools-page .composer-panel,
body.document-tools-page .result-panel {
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.88);
}

body.document-tools-page .composer-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(248, 243, 233, 0.92));
}

body.document-tools-page .field {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

body.document-tools-page .field span,
body.document-tools-page .upload-zone span {
  color: #5d6b61;
  font-size: 0.96rem;
}

body.document-tools-page textarea {
  resize: vertical;
  min-height: 120px;
  padding: 16px 18px;
  border: 1px solid rgba(23, 33, 27, 0.12);
  border-radius: 22px;
  color: #17211b;
  background: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
}

body.document-tools-page textarea:focus,
body.document-tools-page input:focus,
body.document-tools-page select:focus {
  outline: 2px solid rgba(30, 123, 99, 0.18);
  border-color: rgba(30, 123, 99, 0.36);
}

body.document-tools-page select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(23, 33, 27, 0.12);
  border-radius: 16px;
  color: #17211b;
  background: rgba(255, 255, 255, 0.9);
}

body.document-tools-page .field-hint {
  color: #5d6b61;
  font-size: 0.86rem;
  line-height: 1.5;
}

body.document-tools-page .upload-zone {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 20px;
  border: 1.5px dashed rgba(30, 123, 99, 0.35);
  border-radius: 24px;
  background: rgba(220, 242, 234, 0.4);
  cursor: pointer;
}

body.document-tools-page .upload-zone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

body.document-tools-page .upload-zone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

body.document-tools-page .upload-zone.dragover {
  border-color: #145544;
  background: rgba(220, 242, 234, 0.72);
}

body.document-tools-page .upload-zone > span,
body.document-tools-page .upload-zone > .file-meta,
body.document-tools-page .upload-zone strong {
  position: relative;
  z-index: 1;
}

body.document-tools-page .upload-zone strong {
  font-size: 1.08rem;
}

body.document-tools-page .file-meta {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #17211b;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(30, 123, 99, 0.12);
}

body.document-tools-page .file-meta-name {
  font-size: 0.98rem;
  line-height: 1.45;
  word-break: break-all;
}

body.document-tools-page .file-meta-size {
  font-size: 0.86rem;
  color: #5d6b61;
}

body.document-tools-page .file-meta-state {
  color: #b65e2e;
  font-size: 0.82rem;
  line-height: 1.4;
}

body.document-tools-page .pick-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  user-select: none;
}

body.document-tools-page .document-tool-action-row {
  flex-wrap: wrap;
  align-items: center;
}

body.document-tools-page .document-tool-select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
}

body.document-tools-page .document-tool-precision-note {
  margin: 0;
  flex: 1 1 320px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(182, 94, 46, 0.12);
  border: 1px solid rgba(182, 94, 46, 0.22);
  color: #7d3d1d;
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 600;
}

body.document-tools-page .analysis-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(23, 33, 27, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(220, 242, 234, 0.28), rgba(255, 255, 255, 0.72));
}

body.document-tools-page .analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.document-tools-page .analysis-stage-badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #f7fbf8;
  background: #1e7b63;
}

body.document-tools-page .analysis-stage-badge.idle {
  color: #5d6b61;
  background: rgba(23, 33, 27, 0.08);
}

body.document-tools-page .analysis-stage-badge.running {
  background: linear-gradient(135deg, #1e7b63, #145544);
}

body.document-tools-page .analysis-stage-badge.done {
  background: #2d6d59;
}

body.document-tools-page .analysis-stage-badge.error {
  background: #a14f2d;
}

body.document-tools-page .analysis-summary {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 249, 240, 0.8);
  border: 1px solid rgba(23, 33, 27, 0.08);
}

body.document-tools-page .analysis-summary span {
  display: block;
  color: #5d6b61;
  font-size: 0.76rem;
  line-height: 1.25;
}

body.document-tools-page .analysis-summary p {
  margin: 8px 0 0;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  body.document-tools-page .hero-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body.document-tools-page .hero-copy h1 {
    white-space: normal;
  }
}

@media (max-width: 980px) {
  body.document-tools-page .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.document-tools-page .app-shell {
    width: min(100vw - 20px, 1320px);
    padding-top: 12px;
  }

  body.document-tools-page .hero-panel,
  body.document-tools-page .composer-panel,
  body.document-tools-page .result-panel {
    padding: 18px;
    border-radius: 24px;
  }
}
