:root {
  --bg: #f6f9fb;
  --surface: #ffffff;
  --sidebar: #f1f5f7;
  --sidebar-hover: #e6edf1;
  --sidebar-active: #ddeff0;
  --sidebar-text: #18313d;
  --sidebar-muted: #718692;
  --border: rgba(22, 61, 76, 0.11);
  --ink: #1f3138;
  --muted: #697b84;
  --brand: #00a6b4;
  --brand-strong: #007a9b;
  --brand-blue: #2f80ed;
  --danger: #a43a3a;
  --shadow: 0 18px 50px rgba(26, 68, 86, 0.11);
}

.test-hints {
  display: grid;
  gap: 10px;
  padding: 12px 10px;
  color: var(--sidebar-muted);
  font-size: 13px;
  line-height: 1.55;
}

.test-hints p {
  margin: 0;
}

.profile-markdown {
  margin: 0;
  padding: 24px 28px 36px;
  height: calc(100vh - 138px);
  height: calc(100dvh - 138px);
  overflow: auto;
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font: 14px/1.75 "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.profile-diff-details {
  border-top: 1px solid var(--border);
  background: #fbfdfe;
}

.profile-diff-details summary {
  cursor: pointer;
  padding: 10px 18px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.profile-diff {
  margin: 0 18px 14px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(22, 61, 76, 0.12);
  border-radius: 8px;
  background: #101820;
  color: #dfe7ea;
  padding: 10px 12px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.audit-drawer.open {
  transform: translateX(0);
}

.wallet-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(26, 68, 86, 0.22);
  padding: 20px 22px;
}

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

.wallet-actions .secondary-button,
.wallet-actions .primary-button {
  width: auto;
}

.wallet-entry-form {
  display: grid;
  grid-template-columns: 132px 96px 110px minmax(0, 120px) minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
}

.wallet-entry-form input,
.wallet-entry-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.wallet-period-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 40px;
  border: 1px solid rgba(22, 61, 76, 0.1);
  border-radius: 8px;
  background: #f5f8fa;
  padding: 4px;
}

.wallet-period-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.wallet-period-tab:hover,
.wallet-period-tab.is-active {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 1px 4px rgba(22, 61, 76, 0.08);
}

.wallet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wallet-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.wallet-card span,
.wallet-month small,
.wallet-row span {
  color: var(--muted);
  font-size: 12px;
}

.wallet-card strong {
  color: #142d37;
  font-size: 17px;
}

.wallet-card strong.income {
  color: var(--brand-strong);
}

.wallet-card strong.expense {
  color: #a6503c;
}

.wallet-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.wallet-section h3 {
  margin: 0;
  font-size: 15px;
}

.wallet-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallet-chart-controls {
  display: flex;
  gap: 4px;
  border: 1px solid rgba(22, 61, 76, 0.1);
  border-radius: 8px;
  background: #f5f8fa;
  padding: 3px;
}

.wallet-chart-mode {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.wallet-chart-mode:hover,
.wallet-chart-mode.is-active {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 1px 4px rgba(22, 61, 76, 0.08);
}

.wallet-chart-mode svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  min-height: 128px;
}

.wallet-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 14px;
  min-width: 0;
  align-items: stretch;
}

.wallet-plan {
  display: grid;
  gap: 6px;
}

.wallet-plan-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(22, 61, 76, 0.09);
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
}

.wallet-plan-row span {
  color: var(--muted);
  font-size: 12px;
}

.wallet-plan-row strong {
  color: #142d37;
  font-size: 14px;
}

.wallet-month {
  display: grid;
  grid-template-rows: 78px auto auto;
  gap: 6px;
  text-align: center;
  font-size: 12px;
}

.wallet-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.wallet-bars span {
  width: 18px;
  min-height: 6px;
  border-radius: 999px 999px 3px 3px;
}

.wallet-bars .income {
  background: var(--brand);
}

.wallet-bars .expense {
  background: #d56f55;
}

.wallet-chart-line,
.wallet-chart-pie {
  grid-template-columns: 1fr;
}

.wallet-line-chart {
  display: grid;
  grid-template-rows: 120px auto;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.wallet-line-chart svg {
  width: 100%;
  height: 120px;
}

.wallet-line-chart polyline {
  fill: none;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.wallet-line-chart polyline.income {
  stroke: var(--brand);
}

.wallet-line-chart polyline.expense {
  stroke: #d56f55;
}

.wallet-line-labels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.wallet-line-labels span {
  flex: 1;
  min-width: 0;
}

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

.wallet-pie-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.wallet-pie-panel h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

.wallet-pie {
  width: 108px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.56);
}

.wallet-pie-list {
  display: grid;
  gap: 8px;
}

.wallet-pie-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.wallet-pie-row span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.wallet-pie-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-pie-row b {
  color: #a6503c;
}

.wallet-empty.compact {
  grid-column: 1 / -1;
  min-height: 88px;
}

.wallet-transactions {
  display: grid;
  gap: 6px;
  max-height: 132px;
  overflow: auto;
}

.wallet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(22, 61, 76, 0.09);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
}

.wallet-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.wallet-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-row b.income {
  color: var(--brand-strong);
}

.wallet-row b.expense {
  color: #a6503c;
}

.wallet-empty {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.chat-stage {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

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

.composer textarea {
  grid-column: 1;
}

.composer .send-button {
  grid-column: 2;
}

.composer textarea:disabled {
  opacity: 0.7;
}

.risk-reasoning {
  margin-top: 8px;
  max-width: min(680px, 100%);
  border: 1px solid rgba(0, 166, 180, 0.18);
  border-radius: 8px;
  background: rgba(0, 166, 180, 0.06);
  color: var(--sidebar-text);
  font-size: 13px;
  line-height: 1.55;
}

.risk-reasoning summary {
  cursor: pointer;
  padding: 8px 10px;
  color: #3f6f9f;
  font-weight: 650;
}

.risk-reasoning div {
  padding: 0 10px 10px;
  color: var(--muted);
}

/* ---------- 处理过程：竖向时间线 ---------- */
.proc {
  margin-top: 10px;
  max-width: min(760px, 100%);
  border: 1px solid rgba(47, 128, 237, 0.11);
  border-radius: 10px;
  background: rgba(47, 128, 237, 0.028);
  overflow: hidden;
}

.proc-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: #3f6f9f;
  user-select: none;
}

.proc-summary::-webkit-details-marker { display: none; }

.proc-chevron { display: inline-flex; transition: transform 0.18s ease; }
.proc-chevron svg { width: 14px; height: 14px; }
.proc[open] .proc-chevron { transform: rotate(180deg); }

.proc-title { flex: 0 0 auto; }

.proc-badge {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.07);
  color: #4f78a7;
  font-size: 11px;
  font-weight: 650;
}

.proc-last {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proc[open] .proc-last { display: none; }

.proc-timeline {
  list-style: none;
  margin: 0;
  padding: 4px 12px 12px 16px;
}

.proc-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0 5px 24px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

/* 连接竖线 */
.proc-step::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(47, 128, 237, 0.14);
}
.proc-step:first-child::before { top: 50%; }
.proc-step:last-child::before { bottom: 50%; }

/* 节点圆点 */
.proc-node {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: #fff;
}
.proc-node svg { width: 12px; height: 12px; }

.proc-step.is-step .proc-node,
.proc-step.is-running .proc-node { background: transparent; }
.proc-step.is-step .proc-node::after,
.proc-step.is-running .proc-node::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6f9fd3;
}
.proc-step.is-step .proc-node::after { opacity: 0.45; }
.proc-step.is-running .proc-node::after {
  width: 9px;
  height: 9px;
  animation: proc-pulse 1.1s ease-in-out infinite;
}
.proc-step.is-done .proc-node { background: #5b8fc8; }
.proc-step.is-error .proc-node { background: var(--danger); }

.proc-ico {
  flex: 0 0 auto;
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.proc-label { flex: 1 1 auto; min-width: 0; }
.proc-step.is-error .proc-label { color: var(--danger); }
.proc-step.is-running .proc-label { color: var(--muted); }

.proc-dur {
  flex: 0 0 auto;
  color: var(--muted);
  opacity: 0.7;
  font-size: 11px;
}

@keyframes proc-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.6; }
  50% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .proc-step.is-running .proc-node::after { animation: none; }
}

.diff-details {
  border-color: rgba(22, 61, 76, 0.14);
  background: #fbfdfe;
}

.diff-panel {
  margin: 0 10px 10px;
  max-width: min(760px, 100%);
  overflow: auto;
  border: 1px solid rgba(22, 61, 76, 0.12);
  border-radius: 8px;
  background: #101820;
  color: #dfe7ea;
  padding: 10px 12px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(130deg, rgba(0, 166, 180, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(47, 128, 237, 0.08), transparent 30%),
    var(--bg);
}

body {
  height: 100vh;
  height: 100dvh;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(130deg, rgba(0, 166, 180, 0.14), transparent 36%),
    linear-gradient(315deg, rgba(47, 128, 237, 0.12), transparent 30%),
    rgba(246, 249, 251, 0.94);
}

.auth-panel {
  width: min(440px, 100%);
  border: 1px solid rgba(22, 61, 76, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.auth-brand-mark {
  flex: 0 0 auto;
}

.auth-title {
  color: #142d37;
  font-size: 20px;
  font-weight: 780;
  line-height: 1.2;
}

.auth-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form + .auth-form {
  margin-top: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-height: 38px;
  border: 1px solid rgba(22, 61, 76, 0.1);
  border-radius: 8px;
  background: #f5f8fa;
  padding: 4px;
}

.auth-tab,
.auth-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.auth-tab {
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 1px 4px rgba(22, 61, 76, 0.08);
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 650;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(22, 61, 76, 0.14);
  border-radius: 8px;
  outline: none;
  padding: 10px 12px;
  color: var(--ink);
}

.auth-form input:focus {
  border-color: rgba(0, 166, 180, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 166, 180, 0.08);
}

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

.auth-code-row .secondary-button {
  min-height: 42px;
  padding-inline: 10px;
}

.auth-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--brand-strong);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message.is-error {
  color: var(--danger);
}

.auth-link-button {
  width: fit-content;
  justify-self: center;
  padding: 4px 6px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.auth-link-button:hover {
  text-decoration: underline;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(0, 166, 180, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(47, 128, 237, 0.08), transparent 30%),
    var(--bg);
  transition: grid-template-columns 180ms ease;
}

.app-shell::before {
  content: none;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 16px;
  padding: 16px 12px 12px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(22, 61, 76, 0.08);
}

.sidebar-top {
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 34px 16px 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand));
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}

.brand-mark.has-image {
  color: transparent;
}

.brand-name {
  min-width: 0;
  color: var(--sidebar-text);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section-title,
.panel-note,
.topbar-subtitle,
.message-role,
.attachment-meta,
.attachment-caption {
  color: var(--muted);
}

.sidebar-section-title {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar-toggle-button {
  position: absolute;
  top: 4px;
  right: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-strong);
}

.new-chat-button,
.nav-item,
.history-item,
.account-button,
.sidebar-toggle-button,
.primary-button,
.secondary-button,
.icon-tool,
.send-button,
.icon-button,
.prompt-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.new-chat-button,
.nav-item,
.history-item,
.account-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.new-chat-button {
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.12), rgba(0, 166, 180, 0.14));
  color: var(--sidebar-text);
  font-weight: 650;
}

.nav-item,
.history-item,
.account-button {
  color: var(--sidebar-text);
}

.nav-icon {
  flex: none;
  width: 20px;
  text-align: center;
  font-size: 15px;
  line-height: 1;
}

.new-chat-button:hover,
.nav-item:hover,
.history-item:hover,
.account-button:hover,
.sidebar-toggle-button:hover {
  background: var(--sidebar-hover);
}

.app-shell.sidebar-collapsed .sidebar {
  position: relative;
  z-index: 30;
  padding-inline: 10px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: visible;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  padding: 4px 0 12px;
}

.app-shell.sidebar-collapsed .brand-name,
.app-shell.sidebar-collapsed .new-chat-button span:last-child,
.app-shell.sidebar-collapsed .nav-item span:last-child,
.app-shell.sidebar-collapsed .history-section,
.app-shell.sidebar-collapsed .account-copy {
  display: none;
}

.app-shell.sidebar-collapsed .new-chat-button,
.app-shell.sidebar-collapsed .nav-item,
.app-shell.sidebar-collapsed .account-button {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .account-area {
  align-self: end;
  padding-top: 10px;
}

.app-shell.sidebar-collapsed .login-popover {
  position: fixed;
  left: 84px;
  right: auto;
  bottom: 16px;
  width: 280px;
  z-index: 35;
}

.app-shell.sidebar-collapsed .sidebar-toggle-button {
  position: static;
  width: 100%;
  margin-bottom: 8px;
  transform: rotate(180deg);
}

.sidebar-nav {
  display: grid;
  gap: 2px;
}

.history-section {
  min-height: 0;
  overflow: hidden;
  padding-top: 8px;
}

.sidebar-section-title {
  padding: 0 12px 8px;
}

.history-list {
  display: grid;
  gap: 2px;
  overflow: auto;
  max-height: 100%;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
}

.history-row.active {
  background: var(--sidebar-hover);
}

.history-item {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-row .history-item {
  padding-right: 6px;
}

.history-item.current-task {
  color: var(--brand-strong);
  font-weight: 700;
}

.history-item.current-task.active {
  background: var(--sidebar-active);
}

.history-delete-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sidebar-muted);
  opacity: 0;
}

.history-row:hover .history-delete-button,
.history-row.active .history-delete-button,
.history-delete-button:focus-visible {
  opacity: 1;
}

.history-delete-button:hover {
  background: rgba(164, 58, 58, 0.1);
  color: var(--danger);
}

.history-empty {
  padding: 12px;
  color: var(--sidebar-muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-area {
  position: relative;
  padding-top: 8px;
  border-top: 1px solid rgba(22, 61, 76, 0.09);
}

/* ICP 备案号底部链接（手机 / 网站 UI 均显示） */
.icp-beian {
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.icp-beian a {
  color: var(--sidebar-muted);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 120ms ease;
}

.icp-beian a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* 桌面：备案号挂在侧栏底部；首页那份只在手机显示，避免桌面重复 */
.icp-beian--home {
  display: none;
  margin-top: 18px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .icp-beian--home {
    display: block;
  }
}

.account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9f4f7, #e8f1ff);
  color: var(--brand-strong);
  font-weight: 700;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.account-avatar.has-image,
.avatar-upload-preview.has-image,
.message .avatar.has-image {
  color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.message[data-role="assistant"] .avatar.has-image {
  background-color: #fff;
  background-size: contain;
  background-repeat: no-repeat;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

#accountName,
#authStatus {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(26, 68, 86, 0.18);
}

.avatar-upload,
.account-menu-item,
.account-settings-user {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(0, 166, 180, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.07), rgba(0, 166, 180, 0.08));
  padding: 10px;
  color: var(--ink);
  cursor: pointer;
}

.avatar-upload:hover,
.account-menu-item:hover {
  border-color: rgba(0, 166, 180, 0.35);
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.1), rgba(0, 166, 180, 0.12));
}

.account-settings {
  display: grid;
  gap: 2px;
}

.account-settings-user {
  cursor: default;
}

.account-menu-item {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  margin-bottom: 0;
  text-align: left;
}

.account-menu-item.danger {
  color: var(--danger);
}

.avatar-upload-preview {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9f4f7, #e8f1ff);
  color: var(--brand-strong);
  font-weight: 700;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.avatar-upload strong,
.avatar-upload small {
  display: block;
}

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

.google-login-section {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.google-login-button {
  min-height: 40px;
}

.login-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.panel-title {
  margin-bottom: 12px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
}

.field input:focus {
  border-color: rgba(0, 166, 180, 0.42);
}

.otp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: end;
}

.primary-button,
.secondary-button {
  width: 100%;
  border-radius: 8px;
  padding: 11px 12px;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand));
  color: #fff;
}

.secondary-button {
  border: 1px solid rgba(0, 166, 180, 0.22);
  background: rgba(0, 166, 180, 0.08);
  color: var(--brand-strong);
}

.chat-stage {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: var(--surface);
}

.topbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
}

.mobile-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #101820;
  box-shadow: 0 8px 22px rgba(26, 68, 86, 0.08);
}

.mobile-menu-button span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.topbar-title {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.wewallet-wordmark {
  display: block;
  height: 26px;
  width: auto;
  max-width: 52vw;
}

.topbar-subtitle {
  max-width: 760px;
  margin-top: 3px;
  font-size: 12px;
}

.message-list {
  min-height: 0;
  padding: 18px 20px 28px;
  overflow-y: auto;
}

.app-shell.is-dragging-files .message-list,
.app-shell.is-dragging-files .composer-inner {
  outline: 2px dashed rgba(0, 166, 180, 0.45);
  outline-offset: -8px;
  background: rgba(0, 166, 180, 0.04);
}

.message-list.is-archiving {
  animation: archiveMessages 360ms ease forwards;
}

@keyframes archiveMessages {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-28px) scale(0.985);
  }
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
  padding-inline: 24px;
  transform: translateY(-44px);
}

.empty-mascot {
  position: relative;
  width: min(320px, 56vw);
  height: 250px;
  overflow: hidden;
  margin-bottom: -6px;
  pointer-events: auto;
  animation: mascot-breathe 4.8s ease-in-out infinite;
}

.empty-mascot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 62%;
  height: 14px;
  border-radius: 999px;
  background: rgba(22, 61, 76, 0.11);
  filter: blur(8px);
  transform: translateX(-50%);
  animation: mascot-shadow 4.8s ease-in-out infinite;
}

.empty-mascot img,
.mascot-video {
  position: absolute;
  top: -38px;
  left: 50%;
  z-index: 1;
  width: 270px;
  max-width: 100%;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 20px rgba(26, 68, 86, 0.12));
  user-select: none;
}

.empty-mascot img {
  animation: mascot-nod 5.6s ease-in-out infinite;
}

.mascot-video {
  height: calc(100% + 38px);
  object-fit: contain;
  border: 0;
  background: transparent;
}

.empty-state h1 {
  position: relative;
  z-index: 0;
  max-width: 880px;
  margin: -112px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0;
}

.prompt-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  transform: translateY(-16px);
}

.prompt-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #3d423d;
  padding: 10px 14px;
}

.prompt-chip:hover {
  background: #fff;
  transform: translateY(-1px);
}

@keyframes mascot-breathe {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes mascot-shadow {
  0%,
  100% {
    opacity: 0.78;
    transform: translateX(-50%) scale(1);
  }

  50% {
    opacity: 0.5;
    transform: translateX(-50%) scale(0.86);
  }
}

@keyframes mascot-nod {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg) scale(1);
  }

  35% {
    transform: translateX(-50%) rotate(-1.2deg) scale(1.012);
  }

  70% {
    transform: translateX(-50%) rotate(1deg) scale(0.998);
  }
}

.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  max-width: 860px;
  margin: 0 auto 24px;
}

.message[data-role="user"] {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.message[data-role="user"] .avatar {
  grid-column: 2;
  grid-row: 1;
}

.message[data-role="user"] .bubble-wrap {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  width: min(680px, 100%);
  text-align: right;
}

.message[data-role="user"].has-media .bubble-wrap {
  width: min(520px, 100%);
}

.message[data-role="assistant"] .bubble-wrap {
  justify-self: start;
  width: 100%;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6e8e3;
  color: #303530;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.message[data-role="assistant"] .avatar {
  background: linear-gradient(135deg, rgba(0, 166, 180, 0.16), rgba(47, 128, 237, 0.14));
  color: var(--brand-strong);
}

.message[data-role="user"] .avatar {
  background: linear-gradient(135deg, #edf6ff, #e5f1f5);
  color: #4f6f89;
  font-size: 13px;
}

.message .avatar.has-image {
  color: transparent;
  background-size: cover;
  background-position: center;
}

.message[data-role="assistant"] .avatar::before {
  content: "AI";
}

.message[data-role="user"] .avatar::before {
  content: "企";
}

.message-role {
  width: fit-content;
  margin-bottom: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.message[data-role="assistant"] .message-role {
  color: var(--brand-strong);
  background: rgba(47, 128, 237, 0.055);
}

.message[data-role="user"] .message-role {
  color: #2b7280;
  background: rgba(47, 128, 237, 0.08);
}

.bubble-wrap {
  min-width: 0;
  max-width: 100%;
}

.bubble {
  min-width: 0;
  max-width: 100%;
  border-radius: 0;
  padding: 2px 0;
  line-height: 1.72;
  white-space: normal;
  word-break: break-word;
}

.message[data-role="assistant"] .bubble {
  width: 100%;
  max-width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid rgba(47, 128, 237, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 253, 255, 0.98)),
    linear-gradient(135deg, rgba(47, 128, 237, 0.045), rgba(0, 166, 180, 0.035));
  box-shadow: 0 8px 22px rgba(26, 68, 86, 0.055);
  padding: 13px 15px;
}

.bubble-text {
  white-space: pre-wrap;
}

.bubble-text.markdown-body {
  white-space: normal;
}

.markdown-body {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.78;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

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

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

.markdown-body p {
  margin: 0 0 0.82em;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.18em 0 0.58em;
  color: #142d37;
  line-height: 1.34;
  font-weight: 760;
}

.markdown-body h1 {
  padding-bottom: 0.38em;
  border-bottom: 1px solid rgba(22, 61, 76, 0.12);
  font-size: 24px;
}

.markdown-body h2 {
  padding-bottom: 0.26em;
  border-bottom: 1px solid rgba(22, 61, 76, 0.08);
  font-size: 19px;
}

.markdown-body h3 {
  font-size: 16px;
}

.markdown-body h4 {
  color: #35505a;
  font-size: 15px;
}

.markdown-body strong {
  color: #142d37;
  font-weight: 760;
}

.markdown-body em {
  color: #435761;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.3em 0 0.92em;
  padding-left: 1.45em;
}

.markdown-body li {
  margin: 0.2em 0;
  padding-left: 0.1em;
}

.markdown-body li::marker {
  color: var(--brand-strong);
  font-weight: 700;
}

.markdown-body blockquote {
  margin: 0.95em 0;
  padding: 8px 12px;
  border-left: 3px solid rgba(0, 166, 180, 0.45);
  border-radius: 0 8px 8px 0;
  background: rgba(0, 166, 180, 0.06);
  color: #48606a;
}

.markdown-body code {
  border: 1px solid rgba(22, 61, 76, 0.1);
  border-radius: 5px;
  background: #f3f7f8;
  color: #1e5b65;
  padding: 0.08em 0.34em;
  font: 0.92em/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.markdown-body pre {
  max-width: 100%;
  margin: 0.95em 0;
  overflow: auto;
  border: 1px solid rgba(22, 61, 76, 0.12);
  border-radius: 8px;
  background: #101820;
  color: #dfe7ea;
  padding: 12px 14px;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.markdown-body pre code {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
}

.markdown-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0.92em 0 1.05em;
  overflow: auto;
  border: 1px solid rgba(22, 61, 76, 0.11);
  border-radius: 8px;
  background: #fff;
}

.markdown-body table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
}

.markdown-body th,
.markdown-body td {
  padding: 8px 10px;
  border-right: 1px solid rgba(22, 61, 76, 0.08);
  border-bottom: 1px solid rgba(22, 61, 76, 0.08);
  text-align: left;
  vertical-align: top;
}

.markdown-body th:last-child,
.markdown-body td:last-child {
  border-right: 0;
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.markdown-body th {
  background: #f4f8fa;
  color: #17313b;
  font-weight: 760;
}

.markdown-body tbody tr:nth-child(even) {
  background: #fbfdfe;
}

.profile-markdown.markdown-body {
  font-size: 14px;
}

.message[data-role="assistant"] .markdown-body {
  width: 100%;
  max-width: min(760px, 100%);
}

.message[data-role="user"] .markdown-body {
  font-size: inherit;
  line-height: inherit;
}

.message[data-role="user"] .bubble {
  display: inline-block;
  max-width: min(680px, 100%);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.14), rgba(0, 166, 180, 0.16));
  box-shadow: 0 6px 16px rgba(47, 128, 237, 0.08);
  padding: 12px 15px;
  text-align: left;
}

.message[data-role="user"].has-media .bubble {
  display: grid;
  justify-items: end;
  gap: 2px;
  width: fit-content;
  max-width: min(520px, 100%);
  background: transparent;
  padding: 0;
  line-height: 1.35;
  white-space: normal;
}

.message[data-role="user"].has-media .bubble-text {
  justify-self: end;
  display: inline-block;
  max-width: min(520px, 100%);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.14), rgba(0, 166, 180, 0.16));
  padding: 12px 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  text-align: left;
}

.bubble-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
  gap: 10px;
  margin-top: 12px;
}

.message[data-role="user"].has-media .bubble-media-grid {
  justify-self: end;
  margin-left: 0;
  margin-right: 0;
  width: min(260px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: end;
  gap: 6px;
  margin-top: 0;
  line-height: 0;
}

.message[data-role="user"].has-media .bubble-media-grid.media-count-1 {
  width: min(260px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.bubble-media-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.message[data-role="user"].has-media .bubble-media-card {
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.bubble-media-card.audio-card {
  width: fit-content;
  justify-self: end;
  overflow: visible;
  border: 0;
  background: transparent;
}

.bubble-media-card img,
.bubble-media-card video {
  display: block;
  width: 100%;
}

.bubble-media-card.audio-card audio {
  display: none;
}

.voice-message {
  min-width: 118px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.14), rgba(0, 166, 180, 0.16));
  color: #23424f;
  padding: 0 13px;
  line-height: 1;
}

.voice-message-play {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
}

.voice-message-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
}

.voice-message.is-playing .voice-message-play::before {
  width: 8px;
  height: 10px;
  margin-left: 0;
  border: 0;
  border-inline: 3px solid currentColor;
}

.voice-message-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand-strong);
}

.voice-message-wave i {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
}

.voice-message-wave i:nth-child(1) {
  height: 8px;
  opacity: 0.55;
}

.voice-message-wave i:nth-child(2) {
  height: 15px;
}

.voice-message-wave i:nth-child(3) {
  height: 10px;
  opacity: 0.72;
}

.voice-message-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.message[data-role="assistant"] .voice-message {
  background: #fff;
  border: 1px solid var(--border);
}

.message[data-role="user"].has-media .bubble-media-card img {
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

.bubble-media-card audio {
  padding: 10px;
}

.bubble-media-card video {
  max-height: 260px;
  background: #101820;
}

.bubble-file-link {
  display: block;
  padding: 12px;
  color: var(--brand-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.bubble-file-link:hover {
  background: rgba(0, 166, 180, 0.06);
}

.suggestion-chips {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 1px 0 3px;
}

.suggestion-chip {
  width: fit-content;
  max-width: min(320px, 100%);
  min-height: 32px;
  border: 1px solid rgba(47, 128, 237, 0.14);
  border-radius: 999px;
  background: rgba(247, 252, 255, 0.92);
  color: #3f6f9f;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(47, 128, 237, 0.045);
}

.suggestion-chip:hover {
  background: #eef7ff;
}

.turn-progress {
  width: min(520px, 100%);
  margin-top: 2px;
  border: 1px solid rgba(47, 128, 237, 0.1);
  border-radius: 8px;
  background: rgba(47, 128, 237, 0.028);
  box-shadow: none;
  overflow: hidden;
  text-align: left;
}

.turn-progress[data-status="completed"][data-expanded="false"] {
  width: fit-content;
  max-width: min(520px, 100%);
  border-color: rgba(47, 128, 237, 0.11);
  background: rgba(47, 128, 237, 0.025);
  box-shadow: none;
}

.turn-progress + .bubble-text,
.turn-progress + .bubble-media-grid {
  margin-top: 4px;
}

.reasoning-details > summary.turn-progress-header {
  list-style: none;
}

.reasoning-details > summary.turn-progress-header::-webkit-details-marker {
  display: none;
}

.turn-progress-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(47, 128, 237, 0.09);
  background: transparent;
  color: #3f6f9f;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.turn-progress[data-status="completed"][data-expanded="false"] .turn-progress-header {
  width: auto;
  border-bottom: 0;
  padding: 4px 8px;
  color: #557895;
  font-weight: 600;
}

.turn-progress-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-progress-chevron {
  flex: 0 0 auto;
  color: #7d98b5;
}

.turn-progress-live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 7px;
  color: #6b7f95;
  font-size: 12px;
}

.turn-progress[data-status="completed"][data-expanded="false"] .turn-progress-live {
  display: none;
}

.turn-progress-steps {
  display: grid;
  gap: 0;
  max-height: min(620px, 58vh);
  overflow: auto;
  padding: 3px 0 7px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 180ms ease, opacity 160ms ease, transform 180ms ease, padding 180ms ease;
}

.turn-progress[data-expanded="false"] .turn-progress-steps {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
}

.turn-progress-step {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 10px;
  color: #4f6174;
}

.turn-progress-step::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: -6px;
  left: 15px;
  width: 1px;
  background: rgba(47, 128, 237, 0.16);
}

.turn-progress-step:last-child::before {
  display: none;
}

.turn-progress-step:only-child::before {
  display: none;
}

.turn-progress-dot {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  margin-left: 2px;
  border-radius: 50%;
  background: #9cb5cf;
}

.turn-progress-step[data-status="running"] .turn-progress-dot {
  background: #5d91ca;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.09);
}

.turn-progress-step[data-status="completed"] .turn-progress-dot {
  background: #6f9fd3;
}

.turn-progress-step[data-status="skipped"] .turn-progress-dot {
  background: #c2c8c2;
}

.turn-progress-step[data-status="failed"] .turn-progress-dot {
  background: var(--danger);
}

.turn-progress-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.turn-progress-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.turn-progress-copy strong {
  overflow: hidden;
  color: #3f5062;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-progress-step-status {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.055);
  color: #647d99;
  font-size: 11px;
  line-height: 1.35;
}

.turn-progress-step[data-status="running"] .turn-progress-step-status {
  background: rgba(47, 128, 237, 0.09);
  color: #3f6f9f;
}

.turn-progress-step[data-status="completed"] .turn-progress-step-status {
  background: rgba(47, 128, 237, 0.07);
  color: #557895;
}

.turn-progress-step[data-status="skipped"] .turn-progress-step-status {
  background: #f3f4f6;
  color: #8b948f;
}

.turn-progress-copy small {
  color: #6b7f95;
  font-size: 12px;
  line-height: 1.35;
}

.agent-skill-panel {
  display: grid;
  gap: 4px;
  margin-top: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(47, 128, 237, 0.16);
  border-radius: 6px;
  background: #f8fbff;
}

.agent-skill-panel span {
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
  font-size: 11px;
  line-height: 1.3;
}

.agent-skill-panel[data-called="false"] {
  border-color: rgba(156, 163, 175, 0.22);
  background: #f9fafb;
}

.agent-skill-panel[data-called="false"] span,
.agent-skill-panel[data-called="pending"] span {
  background: #eef2f7;
  color: #64748b;
}

.skill-execution-panel {
  display: grid;
  gap: 8px;
  margin-top: 5px;
  padding: 9px;
  border: 1px solid rgba(47, 128, 237, 0.16);
  border-radius: 6px;
  background: #f8fbff;
}

.skill-current {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #1d4ed8;
  font-size: 12px;
}

.skill-execution-panel[data-called="false"] {
  border-color: rgba(156, 163, 175, 0.22);
  background: #f9fafb;
}

.skill-execution-panel[data-called="false"] .skill-current {
  color: #64748b;
}

.skill-result-list {
  display: grid;
  gap: 6px;
}

.skill-result-item {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 6px;
  background: #fff;
}

.skill-result-item strong {
  white-space: normal;
}

.skill-result-item[data-status="failed"] {
  border-color: rgba(220, 38, 38, 0.2);
  background: #fff7f7;
}

.material-request-card {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid rgba(5, 150, 105, 0.18);
  border-radius: 6px;
  background: #f0fdf4;
}

.material-request-card__header {
  display: grid;
  gap: 2px;
}

.material-request-card strong {
  color: #047857;
}

.material-form-fields {
  display: grid;
  gap: 6px;
}

.material-form-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(5, 150, 105, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.material-form-field div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.material-form-field span {
  max-width: 180px;
  color: #047857;
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.material-form-submit {
  justify-self: start;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-radius: 6px;
  background: #dcfce7;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.thinking-pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2f80ed;
  box-shadow: 0 0 0 0 rgba(47, 128, 237, 0.28);
  animation: thinkingPulse 1.2s ease-out infinite;
}

@keyframes thinkingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 128, 237, 0.3);
  }
  80% {
    box-shadow: 0 0 0 8px rgba(47, 128, 237, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 128, 237, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .turn-progress-steps {
    transition: none;
  }
}

.attachment-caption {
  padding: 9px 10px 10px;
  font-size: 12px;
}

.composer-attachments {
  width: min(920px, calc(100% - 40px));
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto 10px;
  max-height: 96px;
  overflow-y: auto;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  box-shadow: 0 10px 28px rgba(20, 23, 21, 0.08);
}

.attachment-chip.image-chip {
  position: relative;
  gap: 0;
  max-width: none;
  padding: 4px;
}

.attachment-chip.video-chip {
  position: relative;
  gap: 0;
  max-width: none;
  padding: 4px;
}

.attachment-chip img,
.attachment-chip video {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
}

.attachment-kind-badge,
.attachment-file-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(47, 128, 237, 0.1);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.attachment-kind-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 11px;
}

.attachment-file-icon.audio {
  background: rgba(0, 166, 180, 0.12);
}

.attachment-body {
  min-width: 0;
}

.attachment-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.attachment-meta {
  font-size: 12px;
}

.remove-attachment {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(164, 58, 58, 0.08);
  color: var(--danger);
}

.attachment-chip.image-chip .remove-attachment,
.attachment-chip.video-chip .remove-attachment {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  background: #fbf4f4;
  box-shadow: 0 4px 12px rgba(20, 23, 21, 0.12);
}

.composer {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto 26px;
}

.composer-inner {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
  align-items: end;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.composer-inner.is-sending {
  grid-template-columns: 42px minmax(0, 1fr) 42px 42px 42px;
}

.composer textarea {
  width: 100%;
  max-height: 180px;
  min-height: 42px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  overflow-y: hidden;
  padding: 10px 4px;
  font-size: 16px;
  line-height: 1.42;
}

.icon-tool,
.send-button,
.stop-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.icon-tool {
  color: #46606b;
}

.icon-tool:hover {
  background: rgba(0, 166, 180, 0.08);
}

.icon-tool svg,
.send-button svg,
.stop-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-button {
  background: #e6ebef;
  color: #7a8993;
}

.composer-inner.has-text .send-button {
  background: #d9ecff;
  color: #2f80ed;
}

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

.composer-inner:not(.has-text) .send-button,
.send-button:disabled,
.stop-button:disabled {
  cursor: default;
}

.send-button:disabled,
.stop-button:disabled {
  opacity: 0.5;
}

.attachment-menu {
  position: relative;
}

.attachment-popover {
  position: absolute;
  left: 0;
  bottom: 50px;
  min-width: 150px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  box-shadow: var(--shadow);
}

.attachment-popover[hidden],
.login-popover[hidden],
.audit-backdrop[hidden] {
  display: none !important;
}

.attachment-popover label,
.attachment-popover button {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}

.attachment-popover label:hover,
.attachment-popover button:hover {
  background: #f1f2ef;
}

.attachment-popover svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-tool.is-recording {
  background: rgba(164, 58, 58, 0.12);
  color: var(--danger);
}

.status-error {
  color: var(--danger);
}

.status-ok {
  color: var(--brand-strong);
}

.audit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(21, 30, 23, 0.24);
  backdrop-filter: blur(3px);
}

.audit-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: 50vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 70px rgba(31, 41, 34, 0.18);
  transform: translateX(105%);
  transition: transform 0.24s ease;
}

.audit-drawer.is-open {
  transform: translateX(0);
}

.audit-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.audit-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.audit-header p,
.audit-status,
.audit-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(22, 115, 95, 0.08);
  color: var(--ink);
}

.audit-card,
.audit-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.audit-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.audit-toolbar select {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 11px 14px;
}

.audit-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.audit-card,
.audit-item {
  padding: 14px;
}

.audit-card {
  cursor: pointer;
}

.audit-card.active {
  border-color: rgba(0, 166, 180, 0.42);
  background: rgba(0, 166, 180, 0.08);
}

.audit-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.audit-title {
  font-weight: 700;
  word-break: break-word;
  line-height: 1.45;
}

.audit-meta,
.audit-preview,
.audit-kv,
.audit-reason,
.audit-empty-line {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.55;
}

.audit-reason {
  color: var(--ink);
}

.audit-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.audit-badge.accepted,
.audit-badge.allowed {
  background: rgba(0, 166, 180, 0.12);
  color: var(--brand-strong);
}

.audit-badge.rejected,
.audit-badge.blocked {
  background: rgba(164, 58, 58, 0.1);
  color: var(--danger);
}

.audit-badge.partial {
  background: rgba(163, 112, 38, 0.14);
  color: #865a16;
}

.audit-code {
  margin-top: 6px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(25, 32, 25, 0.04);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.audit-expanded {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.audit-group {
  display: grid;
  gap: 8px;
}

.audit-technical summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.audit-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(21, 30, 23, 0.22);
  backdrop-filter: blur(3px);
}

.wallet-pending-bar {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 8px 68px;
  display: grid;
  gap: 6px;
  max-height: 40vh;
  overflow-y: auto;
  background: transparent;
  border: 0;
}

.wallet-pending-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.wallet-pending-title {
  font-weight: 600;
  color: var(--brand-strong, #163d4c);
}

.wallet-pending-count {
  font-size: 12px;
  color: var(--muted);
}

.wallet-pending-list {
  display: grid;
  gap: 6px;
}

.wallet-pending-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 128, 237, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.05), rgba(0, 166, 180, 0.04));
}

.wallet-pending-action {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.wallet-pending-action.add { background: #2f9e44; }
.wallet-pending-action.update { background: #2f80ed; }
.wallet-pending-action.delete { background: #d9534f; }

.wallet-pending-summary {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}

.wallet-pending-explain {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.wallet-pending-controls {
  display: flex;
  gap: 6px;
}

.wallet-pending-controls button {
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.wallet-pending-controls button.confirm {
  border-color: #2f9e44;
  color: #2f9e44;
}

.wallet-pending-controls button.confirm:hover {
  background: rgba(47, 158, 68, 0.08);
}

.wallet-pending-controls button.reject {
  border-color: #d9534f;
  color: #d9534f;
}

.wallet-pending-controls button.reject:hover {
  background: rgba(217, 83, 79, 0.08);
}

.wallet-pending-controls button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.profile-modal,
.video-call-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(26, 68, 86, 0.22);
  padding: 22px;
}

.profile-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.account-profile-modal {
  width: min(940px, calc(100vw - 32px));
}

.profile-modal-header,
.video-call-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-modal h2,
.video-call-modal h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.video-call-header p,
.profile-note {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.profile-avatar-button {
  position: relative;
  width: 148px;
  height: 148px;
  display: block;
  margin: 28px auto 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.profile-avatar-preview {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9f4f7, #e8f1ff);
  color: var(--brand-strong);
  font-size: 42px;
  font-weight: 700;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.profile-avatar-preview.has-image {
  color: transparent;
}

.profile-avatar-camera {
  position: absolute;
  right: 5px;
  bottom: 10px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #20313a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 49, 56, 0.18);
}

.profile-avatar-camera svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink);
}

.profile-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 12px 14px;
}

.profile-field input:focus {
  border-color: rgba(0, 166, 180, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 166, 180, 0.1);
}

.profile-insights {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.profile-insights-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-insights-header h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

.profile-insights-header span,
.profile-insights-empty,
.profile-insight-row span,
.profile-tag-group > div:first-child {
  color: var(--muted);
  font-size: 12px;
}

.profile-insights-empty {
  border: 1px dashed rgba(22, 61, 76, 0.18);
  border-radius: 12px;
  padding: 16px;
  background: rgba(246, 249, 251, 0.7);
  line-height: 1.6;
}

.profile-insight-group {
  padding: 14px 0;
  border-top: 1px solid rgba(22, 61, 76, 0.08);
}

.profile-insight-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.profile-insight-group h4 {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0;
}

.profile-insight-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
}

.profile-insight-row strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.profile-tag-group {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.profile-tag-group.muted {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(22, 61, 76, 0.08);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tags span {
  border: 1px solid rgba(0, 166, 180, 0.18);
  border-radius: 999px;
  background: rgba(0, 166, 180, 0.07);
  color: var(--brand-strong);
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.profile-tag-group.muted .profile-tags span {
  border-color: rgba(22, 61, 76, 0.12);
  background: rgba(22, 61, 76, 0.05);
  color: var(--muted);
}

.profile-actions,
.video-call-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.account-profile-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
  margin-top: 18px;
}

.account-profile-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.account-profile-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid rgba(22, 61, 76, 0.1);
  border-radius: 12px;
  background: #f7fafb;
  padding: 18px 14px;
}

.account-profile-card .profile-avatar-button {
  width: 104px;
  height: 104px;
  margin: 0;
}

.account-profile-card .profile-avatar-preview {
  width: 104px;
  height: 104px;
  font-size: 32px;
}

.account-profile-card .profile-avatar-camera {
  right: 0;
  bottom: 2px;
  width: 34px;
  height: 34px;
  border-width: 2px;
}

.account-profile-card .profile-avatar-camera svg {
  width: 18px;
  height: 18px;
}

.account-profile-card-copy {
  display: grid;
  gap: 4px;
  text-align: center;
}

.account-profile-card-copy strong {
  color: var(--sidebar-text);
  font-size: 15px;
  line-height: 1.25;
}

.account-profile-card-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-tabs {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(22, 61, 76, 0.1);
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}

.account-tab {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  padding: 10px 12px;
  text-align: left;
  font-weight: 650;
}

.account-tab:hover,
.account-tab.is-active {
  background: #eef6f7;
  color: var(--brand-strong);
}

.account-danger-zone {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  border-top: 1px solid rgba(22, 61, 76, 0.09);
  padding-top: 14px;
}

.account-tab.danger {
  border: 1px solid rgba(212, 74, 74, 0.16);
  background: rgba(212, 74, 74, 0.06);
  color: var(--danger);
}

.account-tab.danger:hover {
  border-color: rgba(212, 74, 74, 0.28);
  background: rgba(212, 74, 74, 0.1);
  color: var(--danger);
}

.account-profile-form {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

.account-profile-panel {
  min-width: 0;
}

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

.account-field-wide {
  grid-column: 1 / -1;
}

.account-profile-message {
  min-width: 0;
  flex: 1;
  align-self: center;
  color: var(--brand-strong);
  font-size: 13px;
}

.account-profile-message.is-error {
  color: var(--danger);
}

.account-profile-form .profile-actions {
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.account-profile-form .primary-button {
  width: auto;
  min-width: 118px;
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

/* ── 通话界面：微信风格全屏语音/视频通话 ─────────────────────────── */
.video-call-backdrop { background: rgba(8, 14, 20, 0.55); }

.video-call-modal {
  /* 桌面端：居中一块"手机"面板；移动端在断点处铺满全屏 */
  width: min(420px, calc(100vw - 24px));
  height: min(860px, calc(100dvh - 24px));
  padding: 0;
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  background: #0d1620;
  box-shadow: 0 30px 90px rgba(4, 12, 20, 0.5);
  color: #fff;
}

.video-call-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0d1620;
  transform: scaleX(-1); /* 自拍镜像，像照镜子更自然 */
}

.video-call-self-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  background: linear-gradient(160deg, #18324a, #0d1620);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 16px;
}
/* hidden 属性要真正隐藏：作者样式的 display 会盖过 UA 的 [hidden]{display:none}，
   所以显式补一条更高优先级的规则，否则占位板会一直盖住摄像头画面。 */
.video-call-self-placeholder[hidden] { display: none; }

.video-call-self-avatar {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 26px;
  font-weight: 600;
  color: #fff;
}

.video-call-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

/* 上下渐变压暗，保证文字/按钮在任意画面上都清晰 */
.video-call-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 12, 18, 0.55) 0%, rgba(6, 12, 18, 0) 22%),
    linear-gradient(0deg, rgba(6, 12, 18, 0.72) 0%, rgba(6, 12, 18, 0) 34%);
}

.video-call-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
}

.video-call-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.video-call-peer-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f80ed, #00a6b4);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  flex: none;
}

.video-call-peer-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-call-peer-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.video-call-peer-status {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}

.video-call-close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.video-call-close:hover { background: rgba(255, 255, 255, 0.26); }

.video-call-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 172px;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 0 20px;
  pointer-events: none;
}

.video-call-listening { display: flex; gap: 7px; }
.video-call-listening span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  animation: vc-bounce 1.2s infinite ease-in-out both;
}
.video-call-listening span:nth-child(1) { animation-delay: -0.24s; }
.video-call-listening span:nth-child(2) { animation-delay: -0.12s; }
@keyframes vc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-7px); opacity: 1; }
}

.video-call-caption {
  margin: 0;
  max-width: 92%;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.video-call-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
}

.video-call-controls {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 26px;
}

.vc-btn {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.vc-ico {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.1s;
}
.vc-ico svg { width: 25px; height: 25px; }
.vc-btn:hover .vc-ico { background: rgba(255, 255, 255, 0.26); }
.vc-btn:active .vc-ico { transform: scale(0.94); }
.vc-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.vc-btn[disabled]:hover .vc-ico { background: rgba(255, 255, 255, 0.16); }
.vc-btn-label { font-size: 12.5px; color: rgba(255, 255, 255, 0.85); }
.vc-btn.is-active .vc-ico { background: #fff; color: #0d1620; }

.vc-btn-camera .vc-ico {
  width: 68px;
  height: 68px;
  background: #fff;
  color: #0d1620;
}
.vc-btn-camera:hover .vc-ico { background: #f0f2f4; }
.vc-btn-camera.is-off .vc-ico { background: rgba(255, 255, 255, 0.16); color: #fff; }

.vc-btn-danger .vc-ico { background: #fa5151; color: #fff; }
.vc-btn-danger:hover .vc-ico { background: #e84a4a; }

.video-call-disclaimer {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
}

.upload-request-card {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 128, 237, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.06), rgba(0, 166, 180, 0.05));
  display: grid;
  gap: 8px;
}

.upload-request-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--brand-strong, #163d4c);
}

.upload-request-icon {
  font-size: 16px;
  line-height: 1;
}

.upload-request-title {
  font-size: 14px;
}

.upload-request-reason {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.upload-request-items {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--ink);
}

.upload-request-items li {
  line-height: 1.4;
}

.upload-request-hint {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 400;
}

.upload-request-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.upload-request-button {
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.upload-request-button.primary {
  border-color: #2f80ed;
  background: #2f80ed;
  color: #fff;
}

.upload-request-button.primary:hover {
  background: #1e6cd6;
  border-color: #1e6cd6;
}

.upload-request-button:hover {
  background: rgba(47, 128, 237, 0.08);
}

.upload-request-button.ghost {
  border-color: transparent;
  color: var(--muted);
}

.upload-request-button.ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 720px) {
  .video-call-stage {
    grid-template-columns: minmax(0, 1fr);
  }
}

.video-preview-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #18272f;
}

.video-preview-wrap video,
.video-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-preview-wrap video {
  object-fit: cover;
}

.video-placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.74);
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.22), rgba(0, 166, 180, 0.2));
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(300px, 84vw);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 14px;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    overflow: auto;
    border-right: 1px solid rgba(22, 61, 76, 0.08);
    box-shadow: 24px 0 70px rgba(26, 68, 86, 0.18);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(21, 30, 23, 0.24);
    backdrop-filter: blur(3px);
  }

  .app-shell.sidebar-collapsed .sidebar {
    height: 100vh;
    height: 100dvh;
    max-height: none;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  .sidebar-top {
    min-width: 0;
  }

  .brand,
  .app-shell.sidebar-collapsed .brand {
    min-height: 0;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name,
  .app-shell.sidebar-collapsed .brand-name {
    display: block;
    font-size: 16px;
  }

  .sidebar-toggle-button,
  .app-shell.sidebar-collapsed .sidebar-toggle-button {
    display: grid;
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    margin: 0;
    transform: rotate(180deg);
    font-size: 0;
  }

  .sidebar-toggle-button::before,
  .app-shell.sidebar-collapsed .sidebar-toggle-button::before {
    content: "×";
    font-size: 20px;
    line-height: 1;
  }

  .sidebar-nav {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 12px;
    white-space: normal;
  }

  .app-shell.sidebar-collapsed .nav-item span:last-child {
    display: inline;
  }

  .history-section {
    display: block;
    min-height: 0;
    overflow: auto;
  }

  .account-area,
  .app-shell.sidebar-collapsed .account-area {
    align-self: end;
    padding-top: 10px;
    border-top: 1px solid rgba(22, 61, 76, 0.09);
  }

  .account-button,
  .app-shell.sidebar-collapsed .account-button {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
  }

  .account-copy,
  .app-shell.sidebar-collapsed .account-copy {
    display: grid;
  }

  .chat-stage {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    min-height: 0;
  }

  .login-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 72px;
    z-index: 30;
  }

  .topbar {
    min-height: 56px;
    flex-direction: row-reverse;
    padding: 10px 16px;
  }

  .topbar > div:first-child {
    text-align: right;
    transform: translateY(-2px);
  }

  .mobile-menu-button {
    display: grid;
    grid-template-rows: repeat(3, 2px);
    align-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border-color: rgba(16, 24, 32, 0.08);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.96);
    color: #101820;
    box-shadow: 0 8px 18px rgba(26, 68, 86, 0.1);
  }

  .wewallet-wordmark {
    height: 24px;
    width: auto;
    max-width: 68vw;
  }

  .message-list {
    padding: 12px 12px 18px;
  }

  .empty-state {
    gap: 2px;
    padding-inline: 10px;
    transform: translateY(-24px);
  }

  .empty-mascot {
    width: min(196px, 52vw);
    height: 142px;
    margin-bottom: 4px;
  }

  .empty-mascot img,
  .mascot-video {
    top: -22px;
    width: 164px;
  }

  .empty-state h1 {
    margin-top: -34px;
    font-size: 28px;
    line-height: 1.15;
  }

  .prompt-chips {
    width: min(360px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    transform: translateY(-6px);
  }

  .prompt-chip {
    width: 100%;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0 8px;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
  }

  .profile-modal {
    padding: 18px;
  }

  .wallet-entry-form {
    grid-template-columns: 1fr 1fr;
  }

  .account-profile-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 14px;
  }

  .account-profile-form,
  .account-danger-zone {
    grid-column: auto;
    grid-row: auto;
  }

  .account-profile-side {
    gap: 12px;
  }

  .account-profile-card {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    padding: 14px;
  }

  .account-profile-card .profile-avatar-button,
  .account-profile-card .profile-avatar-preview {
    width: 72px;
    height: 72px;
  }

  .account-profile-card .profile-avatar-preview {
    font-size: 24px;
  }

  .account-profile-card .profile-avatar-camera {
    width: 28px;
    height: 28px;
  }

  .account-profile-card .profile-avatar-camera svg {
    width: 15px;
    height: 15px;
  }

  .account-profile-card-copy {
    text-align: left;
  }

  .account-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-tab {
    text-align: center;
  }

  .account-field-grid {
    grid-template-columns: 1fr;
  }

  .profile-insight-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
  }

  .message[data-role="user"].has-media .bubble-media-grid {
    width: min(220px, 100%);
  }

  .message[data-role="user"].has-media .bubble-media-grid.media-count-1 {
    width: min(220px, 100%);
  }

  .composer,
  .composer-attachments {
    width: calc(100% - 24px);
  }

  .composer {
    margin-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .composer-inner {
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px;
    border-radius: 24px;
  }

  .composer-inner.is-sending {
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px 38px;
  }

  .icon-tool,
  .send-button,
  .stop-button {
    width: 38px;
    height: 38px;
  }

  .audit-drawer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 18px;
  }
}

/* Local customer-manager UI overrides. */
.chat-stage {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.composer .composer-attachments {
  width: 100%;
  margin: 0 0 10px;
}

.composer-inner,
.composer-inner.is-sending {
  grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
}

.composer textarea {
  grid-column: 2;
}

.composer #imageButton {
  grid-column: 1;
}

.composer #micButton {
  grid-column: 3;
}

.composer .send-button {
  grid-column: 4;
}

.composer textarea:disabled {
  opacity: 0.7;
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-rows: minmax(0, 1fr);
  }

  .sidebar {
    width: min(286px, 86vw);
  }

  .brand-name,
  .app-shell.sidebar-collapsed .brand-name {
    display: block;
  }

  .sidebar-nav {
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    position: relative;
    min-height: 48px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    justify-items: start;
    gap: 8px;
    overflow: hidden;
    border: 1px solid rgba(47, 128, 237, 0.14);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 252, 255, 0.82)),
      linear-gradient(90deg, rgba(47, 128, 237, 0.06), rgba(0, 166, 180, 0.03));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68), 0 6px 18px rgba(47, 128, 237, 0.045);
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
  }

  .nav-item::before,
  .nav-item::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  .nav-item::before {
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, rgba(47, 128, 237, 0.64), rgba(0, 166, 180, 0.42));
  }

  .nav-item::after {
    right: 10px;
    top: 9px;
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(47, 128, 237, 0.42));
  }

  .nav-item span:first-child {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(47, 128, 237, 0.08);
    color: #3f6f9f;
    font-size: 12px;
  }

  .nav-item span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-avatar {
    width: 30px;
    height: 30px;
  }

  .topbar {
    min-height: 50px;
    padding: 8px 12px;
  }

  .wewallet-wordmark {
    height: 20px;
    width: auto;
    max-width: 68vw;
  }

  .topbar-subtitle {
    font-size: 11px;
  }

  .message {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }

  .message[data-role="user"] {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .message[data-role="user"] .bubble-wrap {
    width: min(277px, calc(100vw - 113px));
  }

  .message[data-role="user"] .bubble {
    max-width: 100%;
  }

  .avatar {
    width: 30px;
    height: 30px;
  }

  .message-role {
    margin-bottom: 4px;
    padding: 1px 7px;
    font-size: 11px;
  }

  .message[data-role="assistant"] .bubble {
    max-width: 100%;
    border-radius: 13px;
    padding: 11px 12px;
    box-shadow: 0 6px 18px rgba(26, 68, 86, 0.07);
  }

  .suggestion-chips {
    width: 100%;
    gap: 7px;
    margin-top: 7px;
  }

  .suggestion-chip {
    max-width: min(277px, 100%);
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .message[data-role="user"] .bubble,
  .message[data-role="user"].has-media .bubble-text {
    border-radius: 16px;
    padding: 10px 12px;
  }

  .markdown-body {
    font-size: 14px;
    line-height: 1.68;
  }

  .message .markdown-body table {
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
  }

  .message .markdown-body th,
  .message .markdown-body td {
    padding: 7px 8px;
    overflow-wrap: anywhere;
  }

  .wallet-pending-bar {
    padding: 0 12px 8px 52px;
  }

  .audit-drawer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
    border-left: 0;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: none;
  }

  .audit-header {
    align-items: center;
  }

  .audit-header h2 {
    margin-bottom: 3px;
  }

  .audit-header p {
    max-width: 270px;
    font-size: 12px;
    line-height: 1.45;
  }

  .audit-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-markdown {
    height: auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid rgba(47, 128, 237, 0.1);
    border-radius: 10px;
    padding: 14px 13px calc(18px + env(safe-area-inset-bottom));
    font-size: 13px;
    line-height: 1.68;
  }

  .profile-markdown.markdown-body {
    font-size: 13px;
    line-height: 1.68;
  }

  .profile-diff-details {
    border: 1px solid rgba(47, 128, 237, 0.1);
    border-radius: 10px;
    overflow: hidden;
  }

  .profile-diff {
    margin: 0 10px 10px;
    max-height: 160px;
    font-size: 11px;
  }

  .wallet-modal {
    inset: 0;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    transform: none;
    border: 0;
    border-radius: 0;
    grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: none;
  }

  .wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .wallet-actions .secondary-button,
  .wallet-actions .primary-button {
    width: 100%;
    min-height: 40px;
  }

  .wallet-entry-form,
  .wallet-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .wallet-entry-form {
    gap: 8px;
  }

  .wallet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .wallet-card {
    min-width: 0;
    padding: 9px 10px;
  }

  .wallet-card strong {
    font-size: 15px;
  }

  .wallet-period-tabs {
    min-height: 38px;
  }

  .wallet-period-tab {
    font-size: 12px;
  }

  .wallet-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 118px;
  }

  .wallet-month {
    grid-template-rows: 68px auto auto;
  }

  .wallet-bars {
    padding: 7px;
  }

  .wallet-section {
    gap: 8px;
  }

  .wallet-pie-layout {
    grid-template-columns: 1fr;
  }

  .wallet-pie-panel {
    grid-template-columns: 86px minmax(0, 1fr);
    padding: 10px;
  }

  .wallet-pie {
    width: 84px;
  }

  .wallet-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 9px 10px;
  }

  .wallet-row b {
    justify-self: start;
  }

  .wallet-transactions {
    max-height: none;
  }

  .profile-modal,
  .account-profile-modal,
  .video-call-modal {
    inset: 0;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    transform: none;
    border: 0;
    border-radius: 0;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  }

  .profile-modal-header,
  .audit-header {
    gap: 10px;
  }

  .profile-modal h2,
  .video-call-modal h2,
  .audit-header h2 {
    font-size: 20px;
  }

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

  .account-profile-card {
    padding: 12px;
  }

  .account-tabs {
    gap: 4px;
    padding: 4px;
  }

  .account-tab {
    min-height: 42px;
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
  }

  /* 通话界面移动端：真·全屏，控制栏保持横向圆形排布 */
  .video-call-modal {
    overflow: hidden;
    padding: 0;
    border-radius: 0;
  }

  .video-call-controls {
    gap: 20px;
  }

  .video-call-center {
    bottom: 184px;
  }

  .composer-inner,
  .composer-inner.is-sending {
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-mascot,
  .empty-mascot::after,
  .empty-mascot img {
    animation: none;
  }
}

/* 贷款额度弹窗 */
.loan-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(26, 68, 86, 0.22);
  padding: 20px 22px;
}

.loan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.loan-toolbar .secondary-button,
.loan-toolbar .primary-button {
  width: auto;
  flex: none;
}

.loan-updated-at {
  font-size: 12px;
  color: var(--muted);
}

.loan-body {
  min-height: 120px;
}

.loan-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 36px 8px;
  color: var(--muted);
  font-size: 14px;
}

.loan-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 166, 180, 0.25);
  border-top-color: var(--brand);
  animation: loan-spin 0.8s linear infinite;
  flex: none;
}

@keyframes loan-spin {
  to { transform: rotate(360deg); }
}

.loan-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.loan-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-strong);
  background: rgba(0, 166, 180, 0.12);
}

.loan-card {
  display: grid;
  gap: 16px;
}

.loan-card-top {
  border-radius: 12px;
  padding: 20px 20px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-strong));
  box-shadow: 0 12px 30px rgba(0, 122, 155, 0.28);
}

.loan-amount-label {
  font-size: 13px;
  opacity: 0.85;
}

.loan-amount-value {
  margin-top: 4px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.loan-amount-symbol {
  font-size: 20px;
  font-weight: 600;
  margin-right: 2px;
}

.loan-amount-unit {
  font-size: 16px;
  font-weight: 600;
  margin-left: 2px;
}

.loan-grade {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
}

.loan-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.loan-meta-item {
  display: grid;
  gap: 3px;
}

.loan-meta-item span {
  font-size: 12px;
  opacity: 0.85;
}

.loan-meta-item strong {
  font-size: 16px;
  font-weight: 700;
}

.loan-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--brand-strong);
}

.loan-section-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.loan-reasons {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.loan-materials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.loan-materials li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f7fbfc;
}

.loan-material-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.loan-material-impact {
  font-size: 12px;
  color: var(--brand-strong);
  text-align: right;
  flex: none;
}

.loan-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

