/* Tokens from the mobile mockups (AmphionLive-1 语音 · 手机端). No web fonts: Google Fonts is unreachable in mainland China. */
:root {
  --bg: #F8F9FB;
  --surface: #FFFFFF;
  --raised: #EEF1F4;
  --line: #DCE0E5;
  --line-strong: #BFC6CF;
  --text: #1F252D;
  --text-2: #3F4854;
  --muted: #536070;
  --faint: #616C79;
  --accent: #2563EB;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAF1FF;
  --accent-text: #1D4FB8;
  --danger: #B43B3A;
  --danger-ink: #FFFFFF;
  --online: #187548;
  --user-wave: #5A687B;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
@keyframes enter-call-view { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .view.call-transition { animation: enter-call-view 320ms cubic-bezier(.4, 0, .2, 1); }
}
a { color: var(--accent); }
.mono { font-family: var(--mono); }

.app { max-width: 1440px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.app-header { height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 32px 12px; border-bottom: 1px solid var(--line); }
.app-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.app-brand > span { display: flex; align-items: center; gap: 12px; }
.brand-divider { color: var(--line-strong); font-weight: 400; }
.brand-product { color: var(--muted); font-size: 14px; font-weight: 400; }
.app-header-end { display: flex; align-items: center; gap: 16px; }
/* 中文 / English: secondary, so quiet; the pressed language reads as selected without relying on color alone. */
.language-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.language-switch button { min-width: 64px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.language-switch button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; cursor: default; }
.language-switch button:not([aria-pressed="true"]):hover { color: var(--text); }
.app { position: relative; }
.app[data-view="talking"] { height: 100dvh; min-height: 0; }
.view {
  flex: 1;
  min-height: calc(100dvh - 72px);
  width: 100%; max-width: 680px; margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
           max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.grow { flex-grow: 1; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.row-10 { display: flex; gap: 10px; align-items: center; }
.row-10 > .input { flex: 1; min-width: 0; }
.label { font-size: 14px; color: var(--muted); }
.agent-switch { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.agent-switch input { appearance: none; flex: 0 0 44px; width: 44px; height: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.agent-switch input::before { content: ''; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.agent-switch input:checked { background: var(--accent); }
.agent-switch input:checked::before { transform: translateX(18px); background: var(--accent-ink); }
.agent-switch input:disabled { opacity: .5; cursor: wait; }
.text-action { background: transparent; border: 0; color: var(--accent); min-height: 44px; padding: 6px 10px; font-size: 14px; }
#agentSteps { padding: 12px 0; border-top: 1px solid var(--line); }
#agentSteps > :not(summary) { margin-top: 12px; }
#agentSteps summary { cursor: pointer; min-height: 44px; align-content: center; }
.note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--faint); }
.lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.body-14 { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.body-15 { margin: 0; font-size: 15px; line-height: 1.7; color: var(--muted); }
.h1-22 { margin: 0; font-size: 22px; font-weight: 700; }
.h1-18 { margin: 0; font-size: 18px; font-weight: 700; }
.error-text { margin: 0; font-size: 14px; line-height: 1.6; color: var(--danger); }

/* controls */
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { border: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 500; padding: 0 20px; white-space: nowrap; }
.btn-56 { height: 56px; border-radius: 16px; font-size: 17px; font-weight: 700; }
.btn-52 { height: 52px; }
.btn-48 { height: 48px; font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary[data-soon="true"] { background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.btn-quiet { background: var(--raised); border: 1px solid var(--line-strong); color: var(--text); }
.btn-danger-text { background: transparent; color: var(--danger); }
.input {
  height: 52px; width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 0 16px; font-size: 16px; /* 16px stops iOS zooming on focus */
}
.input.mono { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; }
.input::placeholder { color: var(--faint); letter-spacing: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; }
.icon-btn.back { margin-left: -10px; }
.advanced summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--faint); cursor: pointer; }
.advanced[open] summary { color: var(--muted); }

/* login */
.view-login { padding-top: max(72px, env(safe-area-inset-top)); padding-left: 24px; padding-right: 24px; padding-bottom: 40px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.brand h1 { margin: 0 0 -12px; font-size: 30px; font-weight: 700; letter-spacing: .5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider span:empty { flex-grow: 1; height: 1px; background: var(--line); }
.divider span:not(:empty) { flex: none; }

/* ready */
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 20px; background: var(--raised); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 4px; background: var(--faint); flex: none; }
.dot[data-state="ok"] { background: var(--online); }
.dot[data-state="down"] { background: var(--danger); }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); }
.segmented button { height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 15px; }
.segmented button[aria-pressed="true"] { background: var(--line); color: var(--text); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 15px; }
.chip[aria-checked="true"] { border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.notice { width: 100%; border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.notice[data-level="error"] { border-color: #E3B6B2; color: var(--danger); }
.notice[data-level="warn"] { border-color: #A9C4F5; color: var(--accent-text); }

/* talking */
.view-talking { gap: 18px; }
.talk-top { display: flex; align-items: center; justify-content: space-between; height: 44px; gap: 12px; }
.pill { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 16px;
  background: var(--raised); color: var(--text-2); font-size: 13px; font-weight: 500; min-width: 0; }
.pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; }
.pill[data-state="speaking"] { background: var(--accent-soft); color: var(--accent-text); }
.pill[data-state="speaking"] .dot { background: var(--accent); }
.pill[data-state="listening"] .dot { background: var(--online); }
.pill[data-state="muted"] .dot { background: var(--danger); }
.timer { font-size: 15px; color: var(--muted); }
.captions { flex: 1 1 0; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
  overscroll-behavior: contain; }
.cap { display: flex; flex-direction: column; gap: 6px; }
.cap-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.cap-text { font-size: 17px; line-height: 1.65; color: var(--faint); white-space: pre-wrap; word-break: break-word; }
.cap.user .cap-text { color: var(--text-2); }
.cap.system .cap-text { font-size: 13px; color: var(--faint); }
.cap.user.unrecognized .cap-text { font-size: 14px; color: var(--faint); }
.cap.now .cap-head { color: var(--accent); }
.cap.now .cap-text { font-size: 20px; line-height: 1.6; font-weight: 500; color: var(--text); }
.cap.now.speaking .cap-text::after { content: ""; display: inline-block; width: 2px; height: 20px; margin-left: 3px;
  vertical-align: -3px; background: var(--accent); }
.tag { height: 22px; padding: 0 8px; border-radius: 11px; background: var(--raised); border: 1px solid var(--line);
  font-size: 12px; line-height: 20px; color: var(--muted); }
.stats-line { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 6px; font-size: 12px; color: var(--faint);
  text-align: center; }
.stats-line .warn { color: var(--accent); }
.stats-line .bad { color: var(--danger); }
.net-hint { color: var(--accent); }
.controls { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.round { border-radius: 50%; border: 1px solid var(--line); background: var(--raised); color: var(--text);
  display: flex; align-items: center; justify-content: center; }
.round-64 { width: 64px; height: 64px; }
.round-84 { width: 84px; height: 84px; }
.round.danger { border: 0; background: var(--danger); color: var(--danger-ink); }
.round[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
#mute .ico-muted { display: none; }
#mute[aria-pressed="true"] .ico-mic { display: none; }
#mute[aria-pressed="true"] .ico-muted { display: block; }

/* busy */
.view-busy { padding-left: 24px; padding-right: 24px; padding-bottom: 36px; }
.navbar { height: 44px; display: flex; align-items: center; gap: 4px; }
.busy-center { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  text-align: center; }
.queue-ring { width: 148px; height: 148px; border-radius: 74px; border: 1px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center; animation: spin 18s linear infinite; }
.queue-core { width: 108px; height: 108px; border-radius: 54px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  animation: spin 18s linear infinite reverse; }
.queue-k { font-size: 12px; color: var(--muted); }
.queue-n { font-size: 36px; color: var(--accent); line-height: 1.2; }
@keyframes spin { to { transform: rotate(360deg); } }
.toggle-row { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 16px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; color: var(--text-2); }
.toggle-row input { width: 22px; height: 22px; accent-color: var(--accent); }

/* tokens */
.view-tokens { gap: 22px; padding-bottom: 36px; min-width: 0; container-type: inline-size; }
#view-keys .api-connection { border-top: 1px solid var(--line); padding-top: 22px; }
#view-keys h2 { margin: 0; }
#view-keys .codebox code { min-width: 0; flex: 1; user-select: all; }
#view-keys .copy-btn { flex-shrink: 0; }
#view-keys .item-title { white-space: normal; overflow-wrap: anywhere; }
.view-tokens .agent-switch .item-title { white-space: normal; overflow: visible; }
.view-tokens .btn { white-space: normal; height: auto; min-height: 48px; padding-block: 12px; }
/* Reflow settings at narrow content widths, including browser zoom. */
@container (max-width: 240px) {
  .view-tokens .item { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .view-tokens .item-text { flex: 1 1 80px; }
  .view-tokens .item-title { white-space: normal; overflow-wrap: anywhere; }
  .view-tokens .codebox { flex-wrap: wrap; }
  .view-tokens .codebox code { flex: 1 1 100%; }
  .view-tokens .codebox .copy-btn { margin-left: auto; }
  .view-tokens .card { padding: 12px; }
  .view-tokens .row-10 { flex-wrap: wrap; }
}
.card { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.list { display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 68px; }
.item:last-child { border-bottom: 0; }
.item-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--raised); display: flex;
  align-items: center; justify-content: center; color: var(--text-2); }
.item-text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 12px; color: var(--muted); }
.invite-list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.invite-list-head > .stack-8 { flex: 0 0 150px; }
.invite-list { overflow: hidden; }
.invite-list .item { align-items: flex-start; }
.invite-item-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.admin-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 0; }
.admin-pager .note { text-align: right; }
.pill-btn { height: 36px; min-width: 44px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font-size: 14px; }
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 6px 6px 14px;
  border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.codebox code { font-size: 15px; color: var(--accent); overflow-wrap: anywhere; }
.key-text { font-size: 13px !important; }
.copy-btn { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 0; background: var(--raised); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; }

/* device approval */
.view-device { padding-top: max(64px, env(safe-area-inset-top)); padding-left: 24px; padding-right: 24px; padding-bottom: 36px; gap: 28px; }
.eyebrow { font-size: 13px; color: var(--muted); }
.h1-26 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.35; }
.code-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line); }
.user-code { font-family: var(--mono); font-size: 34px; letter-spacing: 4px; color: var(--accent); }
.kv { display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv > div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); flex: none; }
.kv span:last-child { text-align: right; }
.btn-outline { height: 52px; border-radius: 16px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.result-icon { width: 72px; height: 72px; border-radius: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 14px; line-height: 1.5; box-shadow: 0 8px 24px rgba(30, 41, 59, .14); z-index: 10; }

@media (min-height: 760px) { .view-talking { gap: 20px; } }
@media (prefers-reduced-motion: reduce) { .queue-ring, .queue-core { animation: none; } }
a.btn { text-decoration: none; }
a.btn-outline { display: flex; align-items: center; justify-content: center; font-size: 16px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 16px; font-size: 15px; }

/* admin */
.view-admin { gap: 16px; padding-bottom: 36px; }
.admin-entry { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 14px 16px; text-align: left;
  border-radius: 18px; background: var(--accent-soft); border: 1px solid #B7CCF4; color: var(--accent-text); }
.admin-entry .item-sub { color: var(--muted); }
.admin-entry .item-icon { color: var(--accent); }
.admin-status { font-size: 12px; color: var(--faint); }
.seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg-4 button { font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-2 .label { font-size: 13px; }
.row-10.space { justify-content: space-between; }
.row-10 .grow { flex: 1; min-width: 0; }
.small-code { font-size: 24px; letter-spacing: 2px; overflow-wrap: anywhere; }
.secret-card { border-color: #B7CCF4; }
.qr-box { align-self: center; width: min(240px, 70vw); aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #fff; }
.qr-box svg { display: block; width: 100%; height: 100%; }
.copy-btn { font-size: 14px; }
.badge { flex: none; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; line-height: 24px;
  background: var(--raised); border: 1px solid var(--line); color: var(--muted); }
.badge[data-state="active"] { color: var(--online); }
.badge[data-state="pending"] { color: var(--accent); border-color: #A9C4F5; }
.badge[data-state="disabled"] { color: var(--danger); }
.role { margin-left: 8px; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--raised); color: var(--accent-text); }
.item-button { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; }
.user-wrap { border-bottom: 1px solid var(--line); }
.user-wrap:last-child { border-bottom: 0; }
.user-wrap .item { border-bottom: 0; }
.user-editor { padding: 0 16px 16px; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.kv-mini { font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.btn-danger-outline { background: transparent; border: 1px solid #E3B6B2; color: var(--danger); }
.pill-btn.danger-text { color: var(--danger); border-color: #E3B6B2; }
.pill-btn { flex-shrink: 0; white-space: nowrap; }
.card > .list .item { padding: 12px 14px; }
.item-sub.wrap { white-space: normal; overflow-wrap: anywhere; }
.audit-item { align-items: flex-start; }
input[type="number"].input { -moz-appearance: textfield; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(28, 36, 48, .32); display: flex; align-items: flex-end;
  justify-content: center; }
.sheet { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px; padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; background: var(--surface); border: 1px solid var(--line); }
.sheet .body-15 { margin: 0; }
#sheetOk { background: var(--accent); color: var(--accent-ink); }
#sheetOk[data-danger="true"] { background: var(--danger); color: var(--danger-ink); }
.chips-sm { gap: 8px; }
.chips-sm .chip { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 18px; }

/* remote delegation */
.agent-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.agent-change { color: var(--accent); font-size: 14px; flex: none; }
.agent-item { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; }
.agent-item:disabled { opacity: .55; }
.agent-item[aria-checked="true"] .item-title::after { content: " ✓"; color: var(--accent); }
.state-dot { display: inline-block; width: 7px; height: 7px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; background: var(--faint); }
.state-dot[data-state="online"] { background: var(--online); }
.state-dot[data-state="busy"] { background: var(--accent); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.steps code { color: var(--accent); }
.task { display: block; flex: none; padding: 8px 12px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); }
.task > summary { cursor: pointer; min-height: 32px; }
.task > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.task > summary .task-head { display: inline-flex; width: calc(100% - 20px); vertical-align: middle; }
.task[open] > summary, .task[open] > .task-detail { margin-bottom: 6px; }
.task[data-status="running"], .task[data-status="needs_confirm"] { border-color: #A9C4F5; }
.task-head { display: flex; align-items: center; gap: 10px; }
.task-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-detail { font-size: 13px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }
.task .badge[data-state="running"], .task .badge[data-state="needs_confirm"] { color: var(--accent); border-color: #A9C4F5; }
.task .badge[data-state="done"] { color: var(--online); }
.task .badge[data-state="failed"] { color: var(--danger); }
.task .pill-btn { height: 32px; font-size: 13px; }
/* what the computer did (task-card.js): conclusion and changed files always, steps and output behind 「查看过程」 */
.task-summary { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 9.6em; overflow-y: auto; }
.task-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12px; }
.task-files li { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.task-file-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.task-added { color: var(--online); flex: none; }
.task-removed { color: var(--danger); flex: none; }
.task-more { align-self: flex-start; background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.task-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.task-process { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.task-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.5; }
.task-steps li { display: flex; gap: 8px; min-width: 0; color: var(--muted); }
.task-step-kind { flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--raised); color: var(--text); font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; }
.task-steps li[data-kind="edit"] .task-step-kind { color: var(--accent); }
.task-step-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-output-label { font-size: 12px; color: var(--faint); }
.task-output { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre; overflow: auto; max-height: 14em; max-width: 100%; }
.task-output:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* an opened process needs room; the conversation below still shows */
@media (min-width: 720px) { .task-output { max-height: 20em; } }
.agent-banner { font-size: 13px; color: var(--danger); text-align: center; }
/* never wider than the phone: long pills truncate instead of widening the view */
.app { overflow-x: hidden; }
.view { min-width: 0; }
.pill { flex: 0 1 auto; overflow: hidden; }
.talk-top .timer { flex: none; }
.sheet .body-15 { overflow-wrap: anywhere; }
.controls .ctl[hidden] { display: none !important; }
.controls:has(.ctl[hidden]) { justify-content: space-evenly; }

/* optional server features: user captions, continued calls */
.cap.user.live .cap-text { color: var(--text-2); opacity: .8; }
.cap.system.divider { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.cap.system.divider::before, .cap.system.divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cap.system.divider .cap-text { flex: none; font-size: 12px; }

/* attached text (delegation) */
.textarea { height: auto; min-height: 84px; padding: 12px 16px; line-height: 1.5; resize: vertical; font-family: var(--mono); font-size: 14px; }
.text-row .note { flex: 1; min-width: 0; }
.cap.attached .cap-text { font-family: var(--mono); font-size: 13px; line-height: 1.6; max-height: 9.6em; overflow: hidden;
  padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }

/* 我的记忆 */
.memory-entry { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.memory-entry .item-icon { color: var(--accent); }
.memory-note { border-color: #B7CCF4; }
.memory-input { font-family: var(--sans); font-size: 15px; }
.memory-item { align-items: flex-start; }
.memory-text { font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.carried { margin-left: 8px; color: var(--accent); }
.carried::before { content: "● "; font-size: 9px; vertical-align: 2px; }
.version-line { text-align: center; margin: 4px 0 0; opacity: 0.7; }

/* 管理 → 在线: conversation monitor (admin.js) */
.session-open { cursor: pointer; }
.session-item .item-text { min-width: 0; }
.role.speaking { color: var(--accent); }
.monitor-note { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.t-line { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--raised); }
.t-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.t-text { font-size: 15px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.t-assistant { background: transparent; border: 1px solid var(--line); }
.t-tool, .t-task { background: transparent; padding-top: 4px; padding-bottom: 4px; }
.t-tool .t-head, .t-task .t-head { color: var(--accent); }
.t-tool .t-text, .t-task .t-text { font-size: 13px; }

/* 声纹 (labs): top-right entry on the start page, the picker and the three-clip enrollment */
.voiceprint-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; max-width: 168px; padding: 0 12px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.voiceprint-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voiceprint-chip[data-on="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.voiceprint-item { padding: 0 16px 0 0; }
.voiceprint-pick { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; min-height: 68px; padding: 12px 0 12px 16px; }
.radio { width: 20px; height: 20px; flex: none; border-radius: 10px; border: 1.5px solid var(--line-strong); }
.voiceprint-pick[aria-checked="true"] .radio { border: 6px solid var(--accent); }
.voiceprint-pick[aria-checked="true"] .item-title { color: var(--accent-text); }
.enroll-step.done { border-color: #B8D6C4; }
.enroll-step.bad { border-color: #E3B6B2; }
.reading { margin: 0; font-size: 17px; line-height: 1.7; color: var(--text); }
.level { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.level-bar { width: 0; height: 100%; background: var(--accent); transition: width 60ms linear; }
.rec-status { color: var(--accent-text); }

/* Voice workspace: transcript and execution have independent reading positions. */
.view-login { max-width: 480px; min-height: 100dvh; padding-top: 64px; padding-bottom: 40px; }
.view-login .brand { gap: 20px; }
.view-login .brand h1 { font-size: 28px; }
.eyebrow { font-size: 13px; color: var(--muted); }
.voice-picker { align-items: center; }
.voice-picker .chips { justify-content: center; }
.prompt-language-picker select.input { appearance: auto; -webkit-appearance: auto; flex: 0 0 auto; }
.chip { border-radius: 8px; }
.view-talking { max-width: none; min-height: 0; overflow: hidden; padding: 0 32px; gap: 0; }
.talk-top { min-height: 72px; height: auto; flex: none; border-bottom: 1px solid var(--line); }
.talk-heading { display: flex; align-items: center; gap: 20px; min-width: 0; }
.talk-heading h1 { font-size: 20px; font-weight: 600; margin: 0; flex: none; }
.pill { background: transparent; padding: 0; border-radius: 0; }
.pill[data-state="speaking"] { background: transparent; }
.latest-caption { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; min-height: 32px;
  border: 0; background: var(--raised); color: var(--text); border-radius: 6px; font: inherit; font-size: 12px; cursor: pointer; }
[data-icon] { display: inline-flex; align-items: center; flex: none; }
.captions { min-height: 0; gap: 24px; padding: 0 12px 16px 0; scrollbar-gutter: stable; }
.cap { flex: none; }
.cap .cap-text { color: var(--text-2); font-size: 16px; line-height: 1.75; }
.cap.now .cap-text { color: var(--text); font-size: 18px; }
.cap.user { padding-left: 14px; border-left: 2px solid var(--line-strong); }
.cap.user .cap-head { color: var(--muted); }
.cap.system .cap-text, .cap.user.unrecognized .cap-text { font-size: 13px; }
.task-overview { font-size: 12px; color: var(--muted); }
.task-overview[data-state="running"], .task-overview[data-state="needs_confirm"] { color: var(--accent); }
.task-overview[data-state="done"] { color: var(--online); }
.task-overview[data-state="failed"] { color: var(--danger); }
.task { padding: 16px; background: transparent; }
.task > summary { list-style: none; }
.task > summary::-webkit-details-marker { display: none; }
.task > summary .task-head { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: start; gap: 10px; }
.task-title { white-space: normal; overflow: visible; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; }
.task > summary::after { content: '展开'; display: block; font-size: 12px; color: var(--faint); margin-top: 8px; }
:root:lang(en) .task:not([open]) > summary::after { content: 'Expand'; }
.task[open] > summary::after { content: none; }
.task[open] > summary { margin-bottom: 12px; }
.task .badge { font-size: 11px; height: 24px; line-height: 22px; border-radius: 4px; padding: 0 6px; }
.task .pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; height: auto; border-radius: 6px; }
.task .pill-btn svg { width: 12px; height: 12px; }
.task-detail { max-height: none; overflow: visible; }
.task-summary { max-height: none; overflow: visible; font-size: 14px; line-height: 1.75; }
.task-files { margin: 12px 0; }
.task-file-path { white-space: normal; overflow-wrap: anywhere; }
.task-more { min-height: 44px; margin-top: 4px; }
.task-process { gap: 12px; }
.task-steps { gap: 10px; }
.task-steps li { line-height: 1.65; }
.task-step-kind { margin-top: 1px; background: transparent; border: 1px solid var(--line); border-radius: 4px; }
.task-output { border: 0; border-left: 2px solid var(--line-strong); border-radius: 0; padding: 8px 12px;
  max-height: 16em; background: var(--surface); }
.controls { flex: none; border-top: 1px solid var(--line); justify-content: center; gap: 48px;
  padding: 16px 0 max(16px, env(safe-area-inset-bottom)); }
.controls:has(.ctl[hidden]) { justify-content: center; }
.controls .round-64 { width: 48px; height: 48px; }
.controls .round-84 { width: 56px; height: 56px; }
.controls .round svg { width: 22px; height: 22px; }
.controls .ctl { min-width: 64px; gap: 6px; }
.btn, .input, .card, .item, .agent-card, .agent-switch, .admin-entry, .memory-entry, .notice, .advanced { border-radius: 8px; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:not(:disabled) { cursor: pointer; }
/* Demo workspaces (workspace-preview.js): the workspace page right of the conversation, above the tasks. */
.reset-workspace { display: inline-flex; align-items: center; gap: 6px; }
.preview-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.preview-pane .task-panel-header h2 { white-space: nowrap; }
.preview-actions { display: flex; align-items: center; gap: 2px; min-width: 0; }
.preview-actions .task-overview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; }
.preview-actions .icon-btn { width: 36px; height: 36px; border-radius: 6px; display: inline-flex; align-items: center;
  justify-content: center; }
.preview-frame { flex: 1 1 0; min-height: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; }
.preview-switcher, .source-toolbar { display: flex; align-items: center; gap: 8px; }
.preview-switcher { border-bottom: 1px solid var(--line); }
.preview-switcher label { position: relative; cursor: pointer; padding: 12px 8px; color: var(--muted);
  border-bottom: 2px solid transparent; }
.preview-switcher input { position: absolute; opacity: 0; }
.preview-switcher label:has(:checked) { color: var(--text); border-color: var(--accent); }
.preview-switcher label:has(:focus-visible) { outline: 2px solid var(--accent); }
.source-pane { display: flex; flex: 1 1 0; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.source-pane > .code-view, .source-pane > .preview-image { flex: 1 1 0; min-height: 0; }
.source-toolbar { justify-content: space-between; }
.file-picker { flex: 1; min-width: 0; max-width: 40rem; padding: 8px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font: 13px var(--mono); }
.preview-body { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.preview-body > * { flex: 1 1 0; min-height: 0; }
.code-view { position: relative; margin: 0; overflow: auto; padding: 12px 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text-2); font: 12.5px/1.65 var(--mono); tab-size: 2; counter-reset: line; }
.code-view code { display: block; min-width: max-content; }
.code-line { position: relative; display: block; min-height: 1.65em; padding: 0 16px 0 56px; white-space: pre; }
.code-line::before { content: counter(line); counter-increment: line; position: absolute; left: 0; width: 40px;
  text-align: right; color: var(--faint); }
.code-line.changed { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); color: var(--text); }
.preview-image { object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.preview-note { flex: none !important; margin: 0; padding-top: 40px; color: var(--muted); font-size: 13px; text-align: center; }
/* A demo site in a call: the page fills the call area at every width; 对话 and 任务 are tabs beside it, and the
   controls stay below. The model's current line runs across the bottom of the page. */
.preview-body { position: relative; }
.preview-caption { position: absolute; left: 12px; right: 12px; bottom: 12px; flex: none !important; padding: 10px 14px;
  border-radius: 10px; background: rgba(25, 31, 40, .84); color: #fff; font-size: 15px; line-height: 1.6;
  pointer-events: none; }
.preview-caption:empty { display: none; }
.demo-delegate { width: 100%; max-width: 420px; align-self: center; }
/* A voice-model tool call in the conversation (toolCaption): one line, the call's result when opened. */
.cap.tool { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font-size: 13px; color: var(--muted); }
.cap.tool summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cap.tool summary code { font: 12px var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.cap.tool .tool-state { margin-left: auto; font-size: 12px; }
.cap.tool.tool-done .tool-state, .cap.tool.tool-delegated .tool-state, .cap.tool.tool-answered .tool-state { color: var(--online); }
.cap.tool.tool-failed .tool-state, .cap.tool.tool-refused .tool-state { color: var(--danger); }
.cap.tool.tool-skipped { opacity: 0.7; }
.cap.tool .tool-detail { margin: 8px 0 0; max-height: 16em; overflow: auto; white-space: pre-wrap; font: 12px/1.55 var(--mono);
  color: var(--text-2); }
.demo-delegate-note { margin: 0; text-align: center; max-width: 420px; align-self: center; }
@media (hover: hover) {
  .icon-btn:hover, .round:not(.danger):hover, .latest-caption:hover { background: var(--line); }
  .task > summary:hover .task-title { color: var(--accent-text); }
}
@media (max-width: 959px) and (min-width: 760px) {
  .view-talking { padding: 0 24px; }
  .task { padding: 12px; }
  .task > summary .task-head { grid-template-columns: minmax(0, 1fr) auto; }
  .task-title { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 759px) {
  .app-header { height: 60px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .app-brand { font-size: 16px; }
  .app-brand img { width: 28px; height: 28px; }
  .language-switch button { min-width: 0; height: 32px; padding: 0 10px; }
  .view { min-height: calc(100dvh - 60px); }
  .view-login { min-height: 100dvh; padding-top: 40px; }
  .view-talking { min-height: 0; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .talk-top { min-height: 60px; }
  .talk-heading { gap: 12px; }
  .talk-heading h1 { font-size: 17px; }
  .pill { font-size: 12px; gap: 6px; }
  .preview-actions .task-overview { display: none; }
  .captions { gap: 20px; padding-right: 4px; }
  .cap.now .cap-text { font-size: 18px; }
  .task { padding: 12px; }
  .task > summary .task-head { grid-template-columns: minmax(0, 1fr) auto; }
  .task .badge { justify-self: start; }
  .task-title { grid-column: 1 / -1; grid-row: 2; }
  .task .pill-btn { min-height: 44px; margin-top: -6px; padding: 0 10px; }
  .invite-list-head { align-items: stretch; flex-direction: column; gap: 8px; }
  .invite-list-head > .stack-8 { flex-basis: auto; }
  .invite-list .item { flex-wrap: wrap; gap: 8px; padding: 14px 12px; }
  .invite-item-actions { width: 100%; justify-content: flex-end; }
  .admin-pager { align-items: stretch; flex-direction: column-reverse; }
  .admin-pager > .row-8 { justify-content: space-between; }
  .admin-pager .note { text-align: left; }
  .controls { gap: 36px; padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .task-output { max-height: 12em; }
}
@media (max-height: 650px) and (max-width: 759px) {
  .app[data-view="talking"] .app-header { display: none; }
  .talk-top { min-height: 52px; }
  .controls { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Workspace: 场景 | 服务电话 (a demo server with the trained service-call stores); the tabs are in shell.css. */
.service-group .chips { max-height: 220px; overflow: auto; }
.chip.chip-test { border-style: dashed; }
.chip.chip-test::after { content: "测试"; margin-left: 6px; font-size: 11px; color: var(--faint); }
:root:lang(en) .chip.chip-test::after { content: "Test"; }
.service-details { display: flex; flex-direction: column; gap: 16px; overflow: auto; padding: 20px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.service-head { display: flex; flex-direction: column; gap: 4px; }
.service-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.service-title h2 { margin: 0; font-size: 20px; font-weight: 600; }
.service-meta { margin: 0; font-size: 13px; color: var(--muted); }
.service-customer { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-left: 2px solid var(--line-strong);
  font-size: 13px; color: var(--text-2); }
.service-customer-phone { color: var(--text); font: 13px var(--mono); }
.service-order code { font: 12px var(--mono); color: var(--accent-text); }

/* 提示词与工具: the system message and tools block a call's model reads (also the store details above). */
.prompt-details { flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.task-elapsed { flex: none; margin-left: auto; color: var(--faint); font-size: 12px; }
.task[data-status="running"] .task-elapsed { color: var(--accent-text); }
.prompt-details[open] { flex: 1 1 0; min-height: 240px; overflow: auto; }
.prompt-details > summary { border-radius: 7px 7px 0 0; }
.prompt-details > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; cursor: pointer;
  font-size: 13px; color: var(--text-2); position: sticky; top: 0; background: var(--surface); }
.prompt-details > summary [data-icon] { color: var(--muted); }
.prompt-view { display: flex; flex-direction: column; gap: 16px; padding: 4px 12px 12px; }
.prompt-block { display: flex; flex-direction: column; gap: 8px; }
.prompt-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.prompt-block h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.prompt-count { margin-left: auto; font: 12px var(--mono); color: var(--faint); }
.prompt-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--faint); }
.prompt-code { margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--bg); color: var(--text-2);
  font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-text { max-height: 50vh; overflow: auto; }
.prompt-tool { border-top: 1px solid var(--line); padding: 6px 0; }
.prompt-tool > summary { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.prompt-tool-name { font: 13px var(--mono); color: var(--text); }
.prompt-tool-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--raised); color: var(--faint); }
.prompt-tool-desc { margin: 4px 0 8px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.prompt-tool-tag.own { background: var(--accent-soft); color: var(--accent-text); }
.prompt-details .prompt-text { max-height: none; overflow: visible; }

/* An ordering store's menu, from its instructions: categories, items with prices, options as small chips. */
.service-menu { gap: 0; }
.service-menu h3 { margin-bottom: 6px; }
.menu-category { margin: 14px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--accent-text);
  text-transform: uppercase; }
.menu-item { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.menu-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.menu-item-name { font-size: 14px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.menu-item-price { font: 13px var(--mono); color: var(--text-2); white-space: nowrap; }
.menu-item.sold-out .menu-item-text, .menu-item.sold-out .menu-item-price { color: var(--faint); text-decoration: line-through; }
.menu-option { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.menu-option-label { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.menu-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.menu-choice { padding: 1px 8px; border-radius: 10px; background: var(--raised); color: var(--text-2); }
.menu-tag { font-size: 11px; padding: 0 6px; border-radius: 8px; line-height: 18px; }
.menu-tag.required { background: var(--accent-soft); color: var(--accent-text); }
.menu-tag.sold { background: #FBEAE9; color: var(--danger); }

/* 声音克隆: upload or record a voice sample the replies are spoken in. */
.clone-panel { margin-top: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.clone-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.clone-upload { cursor: pointer; display: inline-flex; align-items: center; }
.clone-script { margin: 0; padding: 8px 12px; border-left: 2px solid var(--accent); background: var(--accent-soft);
  color: var(--accent-text); font-size: 14px; line-height: 1.6; }
.clone-preview { width: 100%; height: 36px; }

/* 本机配置 (control.js) */
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.control-section h2 { margin: 0; }
.host-list .host { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.host-list .host:last-child { border-bottom: 0; }
.host-head { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.host-head .item-sub, .model-item .item-sub, .update-item .item-sub { overflow-wrap: anywhere; }
.host-action { align-self: flex-start; }
.host-steps summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--accent); cursor: pointer; }
.host-steps > :not(summary) { margin-top: 8px; }
.host-steps .codebox code { flex: 1; min-width: 0; font-size: 13px; }
.model-item, .update-item { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.model-item .item-text, .update-item .item-text { flex: 1 1 260px; min-width: 0; }
.model-url { font-size: 12px; overflow-wrap: anywhere; }
.model-state { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding-top: 2px; }
.frontend-chips .chip { height: auto; min-height: 44px; padding: 8px 16px; text-align: left; white-space: normal; }
.control-output { margin: 8px 0 0; max-height: 220px; overflow: auto; padding: 10px; border-radius: 10px; background: var(--raised);
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.config-path { overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .brand-divider, .brand-product { display: none; }
}
