/* PoolPower 译声: cream and peach accents with white reading surfaces. */
:root {
  color-scheme: light;
  font-family: "MiSans", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-synthesis: none; color: #28212a; background: #fff; --brand: #cd3d55; --brand-dark: #b52f49; --brand-soft: #fff0ec; --ink: #28212a; --muted: #736d73; --border: #eae3e1;
  --action-gradient: linear-gradient(110deg,#cd3d55,#c74b34);
  --action-hover: linear-gradient(110deg,#b52f49,#b13d28);
  --mark-gradient: linear-gradient(145deg,#ff9550,#ff576a);
  --sidebar: 224px;
  --rack: 356px; --glass-border: #ececf0;
 }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: var(--ink); cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
button, a, input, textarea, select { outline-offset: 4px; }
button:focus-visible, a:focus-visible { outline: 2px solid #d15c70; }
a { color: #b23d50; text-decoration: none; }
a:hover { color: var(--brand-dark); }
textarea { resize: vertical; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
::selection { background: #ffe0d6; color: #4d292d; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #c8c8d0; border: 2px solid transparent; background-clip: padding-box; border-radius: 20px; }
::-webkit-scrollbar-track { background: transparent; }

/* A quiet, white workspace with neutral navigation and a single action color. */
.workspace {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(340px,1fr) var(--rack);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate; background: #fff;
 }
.workspace.library-mode { grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 27px 16px 0; background: radial-gradient(ellipse 210px 100px at 0 0,#fff3ec,transparent),#fff; border-right: 1px solid var(--border); color: var(--ink); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; margin-bottom: 30px; color: var(--ink); font-size: 25px; font-weight: 750; letter-spacing: 2px; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 41px; height: 43px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; border-radius: 10px; background: var(--mark-gradient); color: #fff; }
.brand-mark .icon { width: 28px; height: 28px; stroke-width: 1.9; }
.brand small { display: block; margin-top: 4px; font-size: 10px; font-weight: 500; letter-spacing: 1.6px; color: #909099; }
.new-chat { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 11px 14px; color: #fff; background: var(--action-gradient); border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 550; }
.new-chat:hover { background: var(--action-hover); }
.new-chat kbd { margin-left: auto; font-family: inherit; font-size: 11px; font-weight: 500; letter-spacing: .7px; color: #fff; }
.primary-nav { margin: 25px 0 26px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 43px; margin-bottom: 5px; padding: 11px 13px; border: 1px solid transparent; border-radius: 11px; text-align: left; font-size: 14px; color: #38383f; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item:hover { background: #f7f7f9; color: var(--ink); }
.nav-item.active { background: #fff0eb; border-color: transparent; color: var(--brand); font-weight: 600; }
.count, .config-count { margin-left: auto; padding: 2px 6px; border: 1px solid #eaeaf0; border-radius: 6px; color: #7b7b86; font-size: 12px; text-align: center; background: #f6f6f9; }
.history-heading { display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--muted); font-size: 12px; }
.history-heading span { color: #91919b; font-size: 12px; }
.history-heading .history-title { color: #777782; white-space: nowrap; }
.history-heading .history-privacy { margin-left: auto; font-size: 10px; white-space: nowrap; }
.history-edit { padding: 4px 2px; font-size: 11px; color: #74747f; white-space: nowrap; }
.history-edit[aria-pressed="true"] { color: #b34052; }
.history-row { display: flex; align-items: center; gap: 3px; margin: 2px 0; }
.history-row .history-item { min-width: 0; flex: 1; margin: 0; }
.history-delete { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 26px; padding: 0; border-radius: 6px; color: #997780; font-size: 20px; line-height: 1; }
.history-delete:hover { background: #faf2f4; color: #ad5d70; }
.history-list { flex: 1; min-height: 0; overflow-y: auto; padding-top: 14px; }
.history-empty { padding: 12px; font-size: 13px; line-height: 1.9; color: #85858e; }
.history-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 11px 12px; margin: 2px 0; border-radius: 12px; text-align: left; font-size: 14px; color: #65656f; }
.history-item .icon { width: 16px; height: 16px; opacity: .7; }
.history-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-item:hover, .history-item.selected { background: #fff5f0; color: #a64151; }
.sidebar-bottom { padding-top: 13px; }
.workspace-footer { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 19px 8px; border-top: 1px solid #eaeaf0; }
.workspace-avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; background: #fff0e9; color: #a63f50; border: 1px solid #f3ded7; border-radius: 50%; font-size: 14px; }
.workspace-footer b { display: block; color: #42424c; font-size: 14px; font-weight: 550; }
.workspace-footer small { display: block; margin-top: 5px; color: #85858f; font-size: 12px; }
.workspace-footer > .connection-dot { margin-left: auto; }
.account-entry { width: 100%; text-align: left; background: transparent; cursor: pointer; }
.account-entry:hover { background: #fafafb; }
.account-entry > span:nth-child(2) { min-width: 0; flex: 1; }
.account-entry b { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-entry small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { margin-left: auto; color: #9a9aa5; font-size: 22px; line-height: 1; }
.connection-dot { width: 6px; height: 6px; background: #c7c7d0; border-radius: 50%; flex-shrink: 0; }
.connection-dot.ready, .connection-chip.ready .connection-dot { background: var(--brand); }

.main-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 82px; flex-shrink: 0; padding: 20px 28px; border-bottom: 1px solid var(--border); color: var(--ink); background: radial-gradient(ellipse at 95% 0,#fff0e8,transparent 68%),#fff; }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title > div { min-width: 0; }
.topbar h1 { max-width: 350px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 600; }
.topbar-title span { display: block; margin-top: 6px; font-size: 12px; white-space: nowrap; color: #85858f; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.connection-chip { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #ececf0; border-radius: 100px; background: #fafafb; color: #6c6c76; font-size: 12px; white-space: nowrap; }
.connection-chip > span:last-child { color: #91919a; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #7c7c85; }
.icon-button .icon { width: 17px; height: 17px; }
.icon-button:hover { background: #f4f4f7; color: #34343e; }
.topbar .icon-button { color: #80808b; }
.topbar .icon-button:hover { background: #f5f5f8; color: var(--ink); }
.mobile-menu { display: none; }
.chat-view { display: flex; flex-direction: column; flex: 1; min-height: 0; container-type: inline-size; --creation-max: 1200px; --creation-gutter: 28px; --creation-size: min(var(--creation-max), calc(100cqw - var(--creation-gutter) * 2)); --creation-offset: var(--creation-gutter); }
.plan-tabs { display: flex; gap: 22px; padding: 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.plan-tabs > button { padding: 14px 0 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; }
.plan-tabs > button.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.plan-tabs span { font-size: 11px; color: var(--muted); margin-left: 4px; }
.plan-editor { flex: 1; min-height: 0; overflow: auto; padding: 27px 0 35px; }
.plan-heading, .plan-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-heading { margin-bottom: 22px; }
.plan-heading h2 { font-size: 23px; margin-top: 8px; line-height: 1.4; }
.plan-heading .source-tag { flex-shrink: 0; }
.plan-overview { padding: 18px; background: #f8f8fa; border-radius: 12px; }
.plan-overview > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-caption { display: block; color: #7f7f8b; font-size: 11px; margin-bottom: 7px; }
.plan-overview b, .plan-voice-advice b { display: block; font-size: 14px; font-weight: 600; }
.plan-overview p { font-size: 13px; line-height: 1.9; margin-top: 10px; color: #50505c; white-space: pre-wrap; }
.plan-overview h3 { font-size: 12px; font-weight: 600; margin-top: 16px; }
.plan-overview h3:first-of-type { margin-top: 8px; }
.plan-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-section-title h3 { font-size: 14px; font-weight: 600; }
.plan-section-title > span { font-size: 11px; color: #84848f; text-align: right; }
.plan-small-note { font-size: 11px; color: #92929e; line-height: 1.8; margin: 9px 0 12px; }
#planLanguage { font-size: 12px; color: #777782; }
.plan-voice-advice { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 15px 0 25px; padding: 17px; border: 1px solid var(--border); border-radius: 12px; }
.plan-voice-advice p { margin: 8px 0; font-size: 13px; line-height: 1.8; color: #5e5e69; }
.plan-voice-advice small { display: block; color: #92929c; font-size: 11px; line-height: 1.7; }
.plan-voice-advice button { flex-shrink: 0; font-size: 12px; }
.plan-chart-section { margin-bottom: 28px; }
.plan-section-heading h3 { font-size: 14px; font-weight: 600; }
.plan-section-heading > span { color: #80808c; font-size: 11px; text-align: right; }
.plan-chart-section > p { font-size: 11px; line-height: 1.8; color: #9696a0; margin: 8px 0 12px; }
#planChart { overflow-x: auto; margin: 8px 0 0; }
.plan-speed-chart { display: block; width: 100%; min-width: 360px; }
.plan-route { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.plan-route button { display: flex; align-items: center; gap: 7px; padding: 7px 9px; background: #f7f7f9; border: 1px solid #ededf2; border-radius: 8px; font-size: 11px; color: #73737e; }
.plan-route button:hover { border-color: #df9a94; }
.plan-route span { color: #42424b; }
.plan-route small { color: #8b8b97; font-size: 10px; }
.plan-segments { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; margin-top: 13px; }
.plan-segment { min-width: 0; border: 1px solid #e6e6ed; border-radius: 12px; overflow: hidden; background: #fff; }
.plan-segment summary { display: flex; align-items: flex-start; gap: 10px; padding: 14px; cursor: pointer; list-style: none; }
.plan-segment summary::-webkit-details-marker { display: none; }
.plan-step { display: grid; place-items: center; width: 25px; height: 25px; flex-shrink: 0; border-radius: 7px; background: #fff0e9; color: #aa4b54; font-size: 12px; }
.plan-segment summary > div { min-width: 0; flex: 1; }
.plan-segment summary b { font-size: 14px; font-weight: 600; }
.plan-segment-meta { display: block; font-size: 11px; line-height: 1.8; color: #8b8b97; margin-top: 5px; }
.plan-segment summary p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #777782; line-height: 1.7; margin-top: 7px; }
.plan-segment[open] summary p { display: none; }
.plan-expand-label { color: #868691; font-size: 11px; padding-top: 3px; }
.plan-segment[open] .plan-expand-label { font-size: 0; }
.plan-segment[open] .plan-expand-label::after { content: '收起'; font-size: 11px; }
.plan-segment-body { border-top: 1px solid var(--border); padding: 14px; }
.plan-segment-body > label, .plan-parameter-grid label { display: block; color: #777782; font-size: 12px; line-height: 1.8; }
.plan-segment-body > label { margin-bottom: 14px; }
.plan-segment-body .input { width: 100%; min-width: 0; min-height: 36px; margin-top: 5px; padding: 8px 10px; font-size: 12px; }
.plan-segment-body textarea.plan-text { min-height: 88px; line-height: 1.8; }
.plan-parameter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.plan-ai-note { padding: 11px 13px; background: #f8f8fa; border-radius: 8px; font-size: 12px; color: #7d7d89; line-height: 1.8; }
.plan-ai-note b { display: block; color: #5d5d69; font-size: 11px; margin-bottom: 3px; }
.plan-segment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.plan-segment-actions .text-button { font-size: 11px; }
.plan-segment-actions > span { flex: 1; }
.plan-add { width: 100%; margin-top: 14px; padding: 13px; border: 1px dashed #dcdce5; border-radius: 10px; color: #777782; font-size: 12px; }
.plan-add:hover { background: #fafafc; }
.plan-empty { padding: 50px 12px; text-align: center; color: #84848f; font-size: 13px; line-height: 2; }
#editPlanButton { margin-top: 7px; font-size: 12px; }
@container (max-width: 600px) { .plan-segments { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 600px) {
  .plan-editor { padding-top: 22px; padding-bottom: 22px; }
  .plan-heading h2 { font-size: 20px; }
  .plan-voice-advice { flex-direction: column; }
  .plan-section-heading { align-items: flex-start; }
  .plan-segment summary, .plan-segment-body { padding: 14px; }
}
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 33px 0; scroll-behavior: smooth; background: #fff; }
.messages::-webkit-scrollbar-thumb { background-color: #cccdd5; }
.empty-state { position: relative; padding: 18px 0 35px; color: var(--ink); text-align: center; isolation: isolate; }
.empty-state::before { content: none; display: none; }
.hero-icon { position: relative; display: grid; place-items: center; width: 57px; height: 57px; margin: 0 auto 24px; border: 0; border-radius: 16px; background: var(--mark-gradient); color: #fff; }
.hero-icon .icon { width: 32px; height: 32px; stroke-width: 1.5; }
.hero-icon::after { content: none; display: none; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 2.2px; color: #9696a0; }
.empty-state .eyebrow { color: #9696a0; }
.empty-state h2 { margin: 20px 0 16px; font-size: clamp(30px,2.7vw,40px); line-height: 1.35; font-weight: 700; letter-spacing: -1px; color: var(--ink); }
.empty-state h2 em { color: var(--brand); font-style: normal; }
.empty-state .intro { font-size: 16px; line-height: 1.9; color: #7a7a84; }
.starter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 31px; text-align: left; }
.starter-card { display: flex; align-items: flex-start; gap: 11px; min-width: 0; padding: 19px 17px; border: 1px solid #efdfdb; border-radius: 14px; background: #fff; text-align: left; color: #302a31; transition: background .15s, border-color .15s; }
.starter-card:hover { background: #fffcfa; transform: none; border-color: #e3b7ad; }
.starter-card > .icon { width: 19px; height: 19px; margin-top: 1px; color: var(--brand); }
.starter-card b { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.starter-card span { display: block; color: #85858e; font-size: 13px; line-height: 1.7; }
.setup-hint { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 25px; font-size: 13px; line-height: 1.8; color: #888892; }
.setup-hint > .icon { width: 14px; height: 14px; }
.setup-hint button { padding: 0; color: #b54155; border-bottom: 1px solid #f0cec6; font-size: 13px; }
.composer-wrap { flex-shrink: 0; padding: 4px 0 17px; }
.composer { padding: 8px; border: 1px solid #dedee5; border-radius: 18px; background: #fff; }
.composer:focus-within { border-color: #aaaab5; background: #fff; }
.composer textarea { display: block; width: 100%; min-height: 90px; max-height: 250px; padding: 14px 15px; border: 0; outline: none; resize: none; border-radius: 16px; background: transparent; color: #292932; font-size: 16px; line-height: 1.8; }
.composer textarea::placeholder { color: #95959e; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 5px 2px 10px; color: #8b8b96; border-top: 1px solid #f1f1f4; }
.composer-tool { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.composer-tool .icon { width: 14px; height: 14px; }
.composer-bottom > div { display: flex; align-items: center; gap: 13px; }
.composer-actions { justify-content: flex-end; flex-wrap: wrap; }
.translation-controls { display: inline-flex; align-items: center; gap: 8px; padding-right: 10px; border-right: 1px solid var(--border); }
.translation-toggle { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #73737e; white-space: nowrap; }
.translation-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.translation-switch { width: 29px; height: 17px; padding: 2px; border-radius: 20px; background: #d6d6de; }
.translation-switch::after { content: ''; display: block; width: 13px; height: 13px; border-radius: 50%; background: white; transition: transform .15s; }
.translation-toggle input:checked + .translation-switch { background: var(--brand); }
.translation-toggle input:checked + .translation-switch::after { transform: translateX(12px); }
.translation-toggle input:focus-visible + .translation-switch { outline: 2px solid #d15c70; outline-offset: 3px; }
.translation-controls select { max-width: 95px; min-height: 30px; padding: 3px 7px; border: 1px solid #e8e8ee; border-radius: 7px; background: white; color: #777782; font-size: 12px; }
.translation-controls.enabled select { color: #b33e52; border-color: #efc5bd; }
@container (max-width: 720px) { .composer-tool { display: none; } .composer-bottom .composer-actions { margin-left: auto; } .composer-bottom .keyboard-hint { display: none; } }
.keyboard-hint { color: #a2a2ac; font-size: 12px; }
.send-button { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: var(--action-gradient); color: #fff; }
.send-button:hover { background: var(--action-hover); }
.send-button .icon { width: 20px; height: 20px; }
.composer-note { margin-top: 9px; text-align: center; color: #92929d; font-size: 12px; line-height: 1.7; }
.composer-note.save-error { color: #b04451 !important; cursor: pointer; }
.planning .composer textarea { height: 48px; min-height: 48px; padding: 7px 10px; font-size: 14px; line-height: 1.7; }
.planning .composer-bottom { padding-top: 6px; }
.planning .composer-wrap { padding-bottom: 12px; }
.planning .composer-note { margin-top: 5px; font-size: 11px; }
/* Use the same column for both scrollable views and the fixed composer.
   Container units keep the edges aligned even when a view has a scrollbar. */
.plan-tabs, .plan-editor > *, .messages > *, .conversation-audio-view > *, .composer, .composer-note, .audio-revision-hint {
  width: var(--creation-size); max-width: none;
  margin-inline-start: var(--creation-offset); margin-inline-end: 0;
}

/* Reading and editing surfaces. */
.message { display: flex; gap: 12px; margin-top: 0; margin-bottom: 27px; }
.message-avatar { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 2px; flex-shrink: 0; background: #fff0e9; border: 1px solid #f0dcd5; border-radius: 10px; color: var(--brand); font-size: 12px; }
.message-avatar .icon { width: 18px; height: 18px; }
.message.user { flex-direction: row-reverse; }
.message-body { min-width: 0; flex: 1; }
.message.user .message-body { flex: 0 1 auto; max-width: 88%; }
.message-label { margin: 4px 0 9px; color: var(--muted); font-size: 12px; }
.message.user .message-label { text-align: right; }
.message-text { padding: 13px 16px; border-radius: 15px; background: #fff; color: #302a31; font-size: 16px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-text { background: #fff5f0; border: 1px solid #f5e9e3; color: #302a31; border-radius: 16px 4px 16px 16px; }
.message.failed .message-text { color: #b04451; background: #fdf4f5; }
.script-card { margin-top: 13px; overflow: hidden; background: #fff; border: 1px solid #e8e8ee; border-radius: 15px; }
.script-card-header { display: flex; align-items: center; gap: 8px; padding: 17px 18px; border-bottom: 1px solid var(--border); background: #fff; font-size: 14px; font-weight: 600; color: #3a3039; }
.script-card-header .icon { width: 16px; height: 16px; color: #85858f; }
.script-card-header span { margin-left: auto; color: #8a8a94; font-size: 12px; font-weight: 400; }
.script-segment { padding: 16px 19px 4px; }
.segment-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; color: #777782; font-size: 12px; }
.segment-meta span { padding: 3px 7px; background: #f3f3f6; border-radius: 6px; }
.segment-text { white-space: pre-wrap; overflow-wrap: anywhere; color: #35353e; font-size: 16px; line-height: 1.95; }
.script-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 13px 16px; border-top: 1px solid var(--border); }
.script-card-footer > span { color: var(--muted); font-size: 12px; line-height: 1.7; }
.script-card-footer > div { display: flex; gap: 8px; }
.thinking { display: flex; align-items: center; gap: 9px; padding: 9px 0; color: #858590; font-size: 14px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #f0e1dd; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Voice controls. */
.voice-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #ececf0; background: #fff; }
.voice-panel-heading { display: flex; align-items: center; justify-content: space-between; height: 82px; flex-shrink: 0; padding: 25px 25px; border-bottom: 1px solid var(--border); }
.voice-panel-heading > div { display: flex; align-items: center; gap: 9px; color: #73737d; }
.voice-panel-heading h2 { color: var(--ink); font-size: 17px; font-weight: 650; }
.voice-panel-heading .icon { width: 18px; height: 18px; }
.tag { background: #f5f5f8; color: #7d7d88; border: 1px solid #ececf2; border-radius: 100px; padding: 4px 9px; font-size: 12px; }
.voice-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 25px 25px 15px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-label label, .controls-grid label, .range-label label { color: #55555e; font-size: 14px; font-weight: 550; }
.source-tag { padding: 4px 7px; border-radius: 6px; color: #85858e; background: #f4f4f7; font-size: 12px; }
.script-preview { border: 1px solid var(--border); border-radius: 13px; background: #fff; overflow: hidden; }
.script-editor { width: 100%; height: 150px; min-height: 110px; max-height: 350px; padding: 13px; border: 0; border-radius: 0; outline-color: #d15c70; background: transparent; color: #41414a; font-size: 14px; line-height: 1.9; resize: none; }
.script-editor::placeholder { color: #91919a; }
.script-editor:read-only { cursor: default; outline: none; }
.editor-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid #ededf2; color: #91919b; font-size: 12px; }
.preview-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.preview-actions .text-button { min-height: 25px; font-size: 12px; }
.preview-actions .icon { width: 13px; height: 13px; }
.preview-hint { margin-top: 9px; color: #90909a; font-size: 12px; line-height: 1.8; }
.script-preview.editing { border-color: #e2ada8; background: #fff; }
.script-preview.editing .script-editor { resize: vertical; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; color: #787881; font-size: 13px; }
.text-button:hover { color: var(--brand); }
.text-button .icon { width: 13px; height: 13px; }
.panel-divider { height: 1px; background: var(--border); margin: 24px 0; }
.voice-preview { display: flex; align-items: center; gap: 11px; padding: 13px; margin-bottom: 11px; border: 1px solid #eaeaf0; border-radius: 12px; background: #fafafb; }
.voice-avatar { display: grid; place-items: center; width: 38px; height: 40px; flex-shrink: 0; background: #fff3ed; color: #bc6070; border-radius: 10px; }
.voice-avatar .icon { width: 24px; height: 24px; }
.voice-preview b { display: block; color: #4e4e59; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.voice-preview p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; color: #8a8a94; font-size: 12px; line-height: 1.7; }
.input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #e3e3ea; border-radius: 10px; background: #fff; color: #4d4d58; font-size: 14px; line-height: 1.5; outline-color: #d15c70; }
.input::placeholder { color: #9797a0; }
.input:focus-visible { outline: 2px solid #d15c70; outline-offset: 2px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' stroke='%238a8a94' fill='none' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; text-overflow: ellipsis; }
.voice-search { margin-bottom: 9px; background: #fff; }
.voice-search::-webkit-search-cancel-button { appearance: none; }
.voice-filter-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 20px; margin: -1px 0 9px; color: var(--muted); font-size: 12px; }
.voice-filter-meta .text-button { flex-shrink: 0; font-size: 12px; }
.controls-grid { display: grid; grid-template-columns: 1fr; gap: 17px; margin: 24px 0; }
.controls-grid label { display: block; margin-bottom: 9px; }
.range-label { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.range-label output { min-width: 45px; padding: 4px 8px; border-radius: 6px; background: #faf7f5; color: var(--muted); font-size: 12px; text-align: center; }
input[type=range] { display: block; width: 100%; height: 4px; margin: 16px 0; accent-color: var(--brand); cursor: pointer; }
.range-caption { display: flex; justify-content: space-between; margin-top: 10px; color: #9696a0; font-size: 12px; }
.control-note { margin-top: 14px; color: #9797a2; font-size: 12px; line-height: 1.8; }
.model-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--border); }
.model-summary > span { color: #92929d; font-size: 12px; }
.model-summary b { color: #73737e; font-size: 12px; font-weight: 500; }
.model-summary button { width: 100%; justify-content: flex-end; font-size: 12px; }
.generate-footer { flex-shrink: 0; padding: 18px 25px 17px; border-top: 1px solid var(--border); background: #fff; }
.estimate { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.estimate > span { color: #858590; font-size: 13px; }
.estimate strong { color: #51515f; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.generate-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 48px; padding: 13px; border: 0; border-radius: 12px; color: #fff; background: var(--action-gradient); font-size: 14px; font-weight: 600; }
.generate-button:hover { background: var(--action-hover); }
.generate-button .icon { width: 19px; height: 19px; }
.generate-footer p { margin-top: 11px; color: #a1a1aa; font-size: 12px; line-height: 1.6; text-align: center; }

.library-view { flex: 1; overflow: auto; padding: 35px; }
.library-view > * { width: 100%; max-width: none; margin-inline: 0; }
.library-view .audio-card { width: 100%; max-width: none; margin-inline: 0; }
.library-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 15px; background: #fafafb; margin-bottom: 18px; }
.library-filters label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.library-date-field { position: relative; flex: 0 1 230px; min-width: 210px; }
.library-keyword-field { flex: 1; min-width: 160px; }
.library-filters .library-actions { gap: 8px; margin-left: auto; }
.library-filters .library-actions button { min-height: 43px; }
.library-date-button #libraryDateLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.library-filters .input { min-height: 43px; background: #fff; }
.library-filters > button { min-height: 43px; }
.library-date-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; cursor: pointer; }
.library-date-button[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px #cd3d550d; }
.library-date-popover { position: fixed; z-index: 25; width: 260px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 11px; border: 1px solid #e7e4ef; border-radius: 12px; background: #fff; box-shadow: 0 12px 38px #2520331c; }
.library-date-popover :focus-visible { outline: 2px solid #d15c70; outline-offset: 2px; }
.library-calendar-title, .library-calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.library-calendar-title { margin-bottom: 4px; font-size: 12px; }
.library-calendar-title .icon-button, .library-calendar-nav .icon-button { width: 23px; height: 23px; }
.library-calendar-nav { padding-bottom: 5px; }
.library-calendar-nav select { width: auto; flex: 1; min-width: 0; border: 0; background: #fff; padding: 4px 2px; font-size: 11px; text-align: center; color: var(--ink); cursor: pointer; }
.library-calendar-week, .library-calendar-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); text-align: center; }
.library-calendar-week { padding: 6px 0 4px; border-top: 1px solid #efedf4; color: var(--muted); font-size: 10px; }
.library-calendar-days { row-gap: 1px; }
.library-calendar-days button { min-height: 25px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; font-size: 11px; }
.library-calendar-days button:hover { background: #fff0eb; color: var(--brand); }
.library-calendar-days .outside-month { color: #bab7c5; }
.library-calendar-days .in-range { background: #fff0eb; border-radius: 0; }
.library-calendar-days .range-edge { background: var(--brand); color: #fff; font-weight: 600; }
.library-calendar-days .today { box-shadow: inset 0 0 0 1px #d15c70; }
.library-date-presets { display: flex; gap: 5px; padding-top: 8px; margin-top: 7px; border-top: 1px solid #efedf4; }
.library-date-presets button { flex: 1; justify-content: center; padding: 4px 5px; min-height: 25px; font-size: 10px; }
.library-date-summary { margin: 7px 0; font-size: 10px; color: var(--muted); min-height: 15px; line-height: 1.6; }
.library-date-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.library-date-footer > :first-child { margin-right: auto; font-size: 10px; }
.library-date-footer .primary-button, .library-date-footer .secondary-button { min-height: 26px; padding: 4px 10px; font-size: 10px; }
.library-result-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 15px; }
.library-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 23px; color: var(--muted); font-size: 12px; }
.audio-card-meta time { color: #827980; font-size: 11px; }
.audio-view-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.audio-view-toggle { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: #faf8f7; flex-shrink: 0; }
.audio-view-toggle > button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 28px; padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 12px; }
.audio-view-toggle > button.active { color: var(--brand); background: #fff; border-color: #f0d8d2; box-shadow: 0 1px 3px #642c2310; }
.audio-view-toggle .icon { width: 13px; height: 13px; }
.conversation-audio-content > .library-heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.conversation-audio-content > .library-heading > :first-child { flex: 1; min-width: 220px; }
@media (max-width: 700px) {
  .library-date-field, .library-keyword-field { flex: 1 1 100%; min-width: 0; }
  .library-date-popover { width: min(260px, calc(100vw - 40px)); }
  .library-result-meta { flex-wrap: wrap; }
  .library-pagination { justify-content: center; }
}
.conversation-audio-view { flex: 1; min-height: 0; overflow: auto; padding: 28px 0; }
.conversation-audio-view h2 { font-size: 21px; overflow-wrap: anywhere; }
.conversation-audio-note { margin-top: 9px; color: #92929d; font-size: 12px; line-height: 1.8; }
.show-audio .audio-revision-hint { display: none; }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 27px; color: var(--ink); }
.library-heading .eyebrow { color: #9999a2; }
.library-heading h2 { margin-top: 9px; color: var(--ink); font-size: 25px; font-weight: 600; line-height: 1.6; }
.library-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,300px),1fr)); gap: 14px; align-items: stretch; container-type: inline-size; }
.library-list > .library-empty { grid-column: 1 / -1; }
.library-list.audio-list-mode { grid-template-columns: minmax(0,1fr); gap: 10px; }
.library-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.library-actions [aria-pressed="true"] { color: #b34052; border-color: #efc5bd; }
.audio-delete { display: grid; place-items: center; flex-shrink: 0; width: 27px; height: 27px; padding: 0; border-radius: 7px; font-size: 21px; line-height: 1; color: #997780; }
.audio-delete:hover:not(:disabled) { background: #faf2f4; color: #ad5d70; }
.library-empty { padding: 70px 15px; border: 1px dashed #e0e0e8; border-radius: 22px; color: #9797a2; font-size: 16px; line-height: 2; text-align: center; background: #fafafb; }
.audio-card { display: flex; flex-direction: column; min-width: 0; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.audio-card-header { display: flex; align-items: center; gap: 8px; min-height: 45px; color: #3a3039; font-size: 14px; font-weight: 550; }
.audio-card-header > .icon { width: 17px; height: 17px; color: var(--brand); }
.audio-card-header > b { min-width: 0; flex: 1; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.6; }
.audio-card-header > .audio-status { flex-shrink: 0; padding: 4px 6px; border-radius: 6px; color: var(--muted); background: #f6f4f3; font-size: 10px; font-weight: 400; white-space: nowrap; }
.audio-status[data-status="succeeded"] { color: #a14452; background: #fff0e9; }
.audio-status[data-status="failed"] { color: #ae4654; background: #fff0f2; }
.audio-card-player { min-width: 0; }
.audio-card audio { display: block; width: 100%; min-width: 0; height: 34px; margin: 0; }
.audio-card p { margin: 10px 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.audio-card .error { color: #b04451; overflow-wrap: anywhere; }
.audio-card .thinking { min-height: 34px; margin: 0; padding: 0; color: var(--muted); }
.audio-card .spinner { border-top-color: var(--brand); }
.audio-card .audio-warning { padding: 10px 12px; border-radius: 10px; color: #8d7850; background: #faf8f1; font-size: 13px; }
.audio-card-footer { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: auto; color: var(--muted); font-size: 11px; line-height: 1.7; }
.audio-card-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.audio-card-meta > span { font-size: 12px; }
.audio-card-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid #f0eae7; }
.audio-card-actions .text-button { min-height: 30px; padding: 4px 6px; font-size: 12px; }
.audio-revision-hint { flex-shrink: 0; margin-top: 12px; margin-bottom: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fafafb; color: #73737e; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.audio-card .secondary-button { min-height: 30px; padding: 5px 8px; border-radius: 8px; font-size: 11px; }
.audio-list-mode .audio-card { display: grid; grid-template-columns: minmax(210px,1fr) minmax(250px,1.1fr) auto; align-items: center; column-gap: 18px; row-gap: 5px; padding: 13px 15px; }
.audio-list-mode .audio-card-header { grid-column: 1; grid-row: 1; min-height: 30px; }
.audio-list-mode .audio-card-player { grid-column: 2; grid-row: 1 / 3; }
.audio-list-mode .audio-card-footer { display: contents; }
.audio-list-mode .audio-card-meta { grid-column: 1; grid-row: 2; padding-left: 25px; }
.audio-list-mode .audio-card-actions { grid-column: 3; grid-row: 1 / 3; border: 0; padding: 0; }
.audio-list-mode .audio-warning { grid-column: 1 / -1; margin: 0; }
@container (max-width: 920px) {
  .audio-list-mode .audio-card { grid-template-columns: minmax(170px,1fr) minmax(250px,1fr); }
  .audio-list-mode .audio-card-actions { grid-column: 1 / -1; grid-row: 3; padding-top: 7px; border-top: 1px solid #f0eae7; }
}
@container (max-width: 540px) {
  .audio-list-mode .audio-card { grid-template-columns: minmax(0,1fr); }
  .audio-list-mode .audio-card-header, .audio-list-mode .audio-card-player, .audio-list-mode .audio-card-meta, .audio-list-mode .audio-card-actions { grid-column: 1; grid-row: auto; }
}
.chat-jobs { max-width: none; }
.chat-jobs .audio-card { margin: 17px 0; }

/* Rounded surfaces and controls carry the same identity into every dialog. */
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 17px; border: 1px solid transparent; border-radius: 100px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.primary-button { color: #fff; background: var(--action-gradient); }
.primary-button:hover { background: var(--action-hover); }
.secondary-button { border-color: #e5e5eb; background: #fff; color: #73737d; }
.secondary-button:hover { border-color: #d6d6df; background: #f8f8fa; color: #51515b; }
.primary-button .icon, .secondary-button .icon { width: 15px; height: 15px; }
dialog { padding: 0; max-height: 90dvh; border: 1px solid #eaeaf0; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 22px 80px rgba(20,20,35,.16); }
dialog::backdrop { background: rgba(22,22,30,.25); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 29px 30px 25px; background: #fff; }
.dialog-header h2 { margin-top: 8px; font-size: 24px; font-weight: 650; letter-spacing: -.4px; }
.dialog-header p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.dialog-header > .icon-button { margin-top: 3px; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 30px; border-top: 1px solid var(--border); background: #fafafb; }
.dialog-footer > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.dialog-footer .icon { width: 15px; height: 15px; }
.settings-dialog { width: min(900px,94vw); }
.settings-dialog .dialog-footer, .account-dialog .dialog-footer { position: sticky; bottom: 0; z-index: 2; }
.provider-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(7,auto); column-gap: 18px; row-gap: 0; padding: 0 30px 28px; }
.provider-card { display: grid; grid-template-rows: subgrid; grid-row: 1 / span 7; align-items: start; min-width: 0; padding: 21px; border: 1px solid #e7e7ee; border-radius: 15px; background: #fff; }
.provider-card:first-child { grid-column: 1; }
.provider-card:last-child { grid-column: 2; }
.provider-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.provider-logo { display: grid; place-items: center; width: 37px; height: 37px; flex-shrink: 0; border-radius: 12px; }
.ark-logo { background: #f7f4f3; color: #a08175; font-size: 20px; font-weight: 700; }
.minimax-logo { background: #fff0ec; color: #bc5664; }
.provider-title h3 { color: var(--ink); font-size: 16px; font-weight: 600; }
.provider-title p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.provider-state { margin-left: auto; padding: 4px 7px; border-radius: 6px; background: #f5f5f8; color: #898995; font-size: 12px; }
.provider-state.ready { background: #fff0e9; color: #b64b5e; }
.provider-baseurl { min-width: 0; margin-bottom: 20px; }
.provider-baseurl > label, .provider-fields > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.provider-baseurl > .provider-base-url { height: 44px; min-height: 44px; font-family: ui-monospace,Consolas,monospace; font-size: 12px; color: #7e7e89; background: #fafafb; }
.provider-fields { min-width: 0; }
.provider-fields > .input { height: 44px; min-height: 44px; margin-bottom: 15px; }
.provider-card .field-note { margin: -5px 0 21px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.provider-models { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin-bottom: 16px; }
.model-fetch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.model-fetch-row > span { max-width: 150px; color: var(--muted); font-size: 12px; text-align: right; }
.provider-models .fetched-models, .provider-models .model-fetch-result { margin: 0; }
.provider-card .model-fetch-result { min-height: 0; font-size: 12px; line-height: 1.8; }
.provider-card .model-fetch-result:empty { display: none; }
.settings-dialog .provider-card .secondary-button { height: 36px; min-height: 36px; padding: 0 12px; font-size: 12px; }
.endpoint { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 36px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.endpoint a { display: inline-flex; align-items: center; min-height: 36px; color: #767680; text-decoration: underline; text-underline-offset: 4px; }
.provider-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.clear-key { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; cursor: pointer; }
.clear-key input { width: 13px; height: 13px; accent-color: var(--brand); }
.test-result { min-height: 20px; margin-top: 10px; color: #8b747a; font-size: 13px; line-height: 1.8; }
.test-result.success { color: #777184; }
.small-dialog { width: min(480px,92vw); }
.small-dialog .dialog-header { padding: 23px 25px; }
.small-dialog .dialog-header h2 { font-size: 22px; }
.help-steps { margin: 0; padding: 0 35px 12px 50px; color: var(--muted); font-size: 14px; }
.help-steps li { padding: 10px 0 13px 4px; }
.help-steps b { color: #5c5c66; font-weight: 600; }
.help-steps p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.help-note { margin: 0 25px 25px; padding: 15px; border-radius: 13px; background: #f7f7fa; color: var(--muted); font-size: 13px; line-height: 1.8; }
.brand-copy b { display: block; font-size: 15px; letter-spacing: -.25px; font-weight: 650; white-space: nowrap; }
.brand-copy em { font-size: 16px; font-style: normal; margin-left: 2px; }
.brand-copy small { font-size: 9px; letter-spacing: 1.35px; }
.auth-loading-screen { display: none; }
.auth-loading .workspace, .auth-screen .workspace { display: none; }
.auth-loading .auth-loading-screen { display: flex; position: fixed; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #fafafb; color: var(--muted); font-size: 13px; }
.auth-loading-brand { font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.auth-loading-brand b { color: var(--brand); }
dialog.login-dialog { inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: auto; box-shadow: none; text-align: left; background: radial-gradient(ellipse 65% 58% at 0 0,#ffebec,transparent 78%),radial-gradient(ellipse 65% 42% at 0 100%,#fff0e2,transparent 76%),#fffdfb; }
.login-dialog::before { content: none; display: none; }
.login-shell { position: relative; isolation: isolate; min-height: 100dvh; display: flex; flex-direction: column; }
.login-shell::before { content: ''; position: absolute; inset: auto 0 42px; height: 180px; background: url('/login-waves.svg?v=peach-light') left bottom / min(850px,68vw) auto no-repeat; pointer-events: none; z-index: -1; }
.login-header { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 48px; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 21px; font-weight: 600; text-decoration: none; }
.login-brand b { font-weight: 650; margin-left: 4px; }
.login-brand .brand-mark { width: 39px; height: 39px; border-radius: 11px; flex-shrink: 0; }
.login-header-note { color: #93939e; font-size: 12px; }
.login-content { display: grid; grid-template-columns: minmax(0,1fr) 410px; align-items: center; gap: 80px; width: min(1160px,calc(100% - 96px)); margin: auto; padding: 20px 0 30px; flex: 1; }
.login-eyebrow { color: var(--brand); font-size: 11px; font-weight: 600; letter-spacing: 2.4px; }
.login-intro h1 { margin: 24px 0 21px; color: var(--ink); font-size: clamp(32px,3.3vw,47px); line-height: 1.4; letter-spacing: -1.5px; font-weight: 650; }
.login-intro h1 span { color: var(--brand); }
.login-intro > p { color: var(--muted); font-size: 14px; line-height: 2; }
.login-workflow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; padding: 0; margin-top: 34px; }
.login-workflow > div { min-width: 0; flex: 1 1 120px; display: flex; align-items: center; gap: 9px; padding: 15px 12px; border: 1px solid #ecdfd9; border-radius: 14px; background: #ffffffb8; }
.login-step-icon { width: 28px; height: 28px; display: grid; place-items: center; flex-shrink: 0; color: var(--brand); font-size: 11px; font-weight: 600; }
.login-step-icon .icon { width: 20px; height: 20px; }
.login-workflow b { display: block; color: #444450; font-size: 13px; font-weight: 550; white-space: nowrap; }
.login-workflow small, .login-step-arrow { display: none; }
.login-team-note { display: flex; gap: 8px; align-items: center; margin-top: 22px; color: #a0a0aa; font-size: 11px; line-height: 1.8; }
.login-team-note .icon { width: 13px; height: 13px; flex-shrink: 0; }
.login-card { padding: 34px 33px 28px; border: 1px solid #e8ded8; background: #fff; border-radius: 22px; box-shadow: 0 14px 48px #7a39210a; }
.login-card-label { color: var(--brand); font-size: 9px; font-weight: 600; letter-spacing: 1.8px; }
.login-card h2 { color: var(--ink); font-size: 27px; font-weight: 650; margin-top: 15px; }
.login-card > p { margin: 13px 0 26px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-card .primary-button { display: flex; justify-content: center; gap: 10px; width: 100%; min-height: 45px; margin-top: 9px; border-radius: 11px; }
.login-card .input { min-height: 45px; background: #fff; border-radius: 10px; font-size: 13px; }
.login-password-field { position: relative; }
.login-password-field .input { padding-right: 57px; }
.login-password-field .text-button { position: absolute; top: 0; right: 12px; height: 45px; color: var(--muted); font-size: 12px; }
.login-card > .login-account-note { text-align: center; margin: 23px 0 0; color: var(--muted); font-size: 11px; }
.login-card .remember-login { font-size: 12px; margin-top: 19px; }
.login-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px 48px; color: #b0aeb8; font-size: 11px; }
@media (max-width: 1000px) {
  .login-content { gap: 35px; grid-template-columns: minmax(0,1fr) 370px; }
  .login-intro h1 { font-size: 32px; }
  .login-workflow { gap: 9px; }
  .login-workflow small { font-size: 10px; }
}
@media (max-width: 760px) {
  .login-header { padding: 25px 24px; }
  .login-header-note { display: none; }
  .login-brand { font-size: 19px; }
  .login-content { width: min(430px,calc(100% - 40px)); grid-template-columns: minmax(0,1fr); gap: 28px; padding: 18px 0 35px; }
  .login-intro h1 { font-size: 29px; margin-top: 18px; }
  .login-intro > p, .login-workflow, .login-team-note { display: none; }
  .login-card { padding: 29px 26px; }
  .login-footer { padding: 20px 24px; }
  .login-footer > :last-child { display: none; }
}
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); max-width: min(600px,85vw); padding: 13px 22px; border: 1px solid #484851; border-radius: 16px; background: #34343d; color: #fff; font-size: 14px; line-height: 1.8; white-space: pre-wrap; z-index: 100; box-shadow: 0 6px 24px rgba(20,20,30,.12); }
.toast.error { background: #9c515c; }

.account-dialog { width: min(650px,92vw); }
.admin-dialog { width: min(1000px,94vw); }
.account-body { padding: 0 30px 28px; }
.account-body h3 { color: #50505a; font-size: 16px; font-weight: 600; }
.account-form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.account-form > div > label, .account-form > label:not(.remember-login) { display: block; color: var(--muted); font-size: 14px; }
.account-form > div > .input { margin-top: 8px; }
.account-form > .input { margin-bottom: 10px; }
.account-form .input { min-height: 44px; }
.account-form .remember-login { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.remember-login input { accent-color: var(--brand); }
.login-dialog .account-form p { margin: 0; }
.password-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.password-form > .primary-button { align-self: flex-start; margin-top: 4px; }
.account-body .field-note { margin-top: 11px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.usage-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 9px 0 17px; }
.usage-heading h3 { margin-right: auto; }
.usage-heading label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.month-input { width: 150px; min-height: 38px; padding: 7px 9px; font-size: 13px; }
.usage-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.usage-grid > div { padding: 15px; border: 1px solid #ededf2; border-radius: 12px; background: #fafafb; }
.usage-grid span { display: block; color: var(--muted); font-size: 13px; }
.usage-grid strong { display: block; margin: 8px 0; color: #535360; font-size: 25px; font-weight: 550; }
.usage-grid small { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; }
.create-user-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-bottom: 25px; padding: 19px; border: 1px solid #ededf2; border-radius: 14px; background: #fafafb; }
.create-user-form label, .user-quota-form label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.create-user-form .input { min-height: 42px; }
.create-user-form > .primary-button { align-self: end; justify-self: start; min-height: 42px; }
.issued-credential { margin: 0 0 26px; padding: 17px; border: 1px solid #e6e6ee; border-radius: 12px; background: #f8f8fb; }
.issued-credential > b { display: block; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.issued-credential > label, .issued-credential p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.issued-credential > div { display: flex; gap: 10px; margin: 8px 0; }
.issued-credential input { min-width: 0; font-family: ui-monospace,Consolas,monospace; }
.user-list { display: grid; gap: 17px; }
.user-card { padding: 20px; border: 1px solid #e7e7ee; border-radius: 15px; background: #fff; }
.user-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.user-card header b { color: #51515c; font-size: 16px; }
.user-card header div > span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.user-status { padding: 5px 9px; border-radius: 7px; background: #f5f5f8; color: #9999a4; font-size: 12px; }
.user-status.enabled { background: #fff0e9; color: #b34052; }
.user-card .usage-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.user-card .usage-grid > div { padding: 12px; border-radius: 13px; }
.user-card .usage-grid strong { font-size: 22px; }
.user-quota-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: end; gap: 11px; margin-top: 18px; }
.user-quota-form label { margin: 0; }
.user-quota-form .input { min-height: 40px; margin-top: 8px; }
.user-quota-form .secondary-button { min-height: 40px; }
.user-card > footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 18px; }
.danger-text { color: #a96370; }
.topbar-actions button:disabled, .model-summary button:disabled { opacity: .7; cursor: default; }

@media (min-width: 1650px) {
  :root { --sidebar: 244px; --rack: 380px; }
  .messages { padding-top: 45px; }
  .empty-state { padding-top: 36px; padding-bottom: 50px; }
  .voice-panel-body, .generate-footer { padding-left: 29px; padding-right: 29px; }
  .script-editor { height: 180px; }
}
@media (max-width: 1200px) {
  :root { --sidebar: 196px; --rack: 320px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 9px; padding: 0 6px; font-size: 25px; }
  .brand small { font-size: 9px; }
  .history-heading .history-privacy, .connection-chip > span:last-child, .keyboard-hint, .topbar-title span { display: none; }
  .topbar { padding: 20px; }
  .topbar h1 { max-width: 225px; }
  .topbar-actions { gap: 2px; }
  .chat-view { --creation-gutter: 20px; }
  .messages { padding-top: 26px; padding-bottom: 26px; }
  .empty-state { padding-top: 7px; }
  .empty-state h2 { font-size: 35px; letter-spacing: -1px; }
  .empty-state .intro { font-size: 14px; }
  .hero-icon { width: 49px; height: 49px; margin-bottom: 20px; }
  .starter-grid { gap: 10px; margin-top: 24px; }
  .starter-card { padding: 15px 12px; gap: 8px; }
  .starter-card > .icon { display: none; }
  .starter-card span { font-size: 12px; }
  .voice-panel-body, .generate-footer { padding-left: 20px; padding-right: 20px; }
  .voice-panel-heading { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 960px) {
  :root { --sidebar: 178px; --rack: 296px; }
  .workspace { grid-template-columns: var(--sidebar) minmax(320px,1fr) var(--rack); }
  .brand { font-size: 23px; gap: 7px; }
  .brand-mark { width: 35px; height: 38px; }
  .brand small { letter-spacing: 1px; font-size: 9px; }
  .new-chat { padding: 11px 12px; }
  .new-chat kbd { display: none; }
  .nav-item { padding-left: 9px; padding-right: 9px; }
  .workspace-footer { padding-left: 3px; padding-right: 3px; gap: 7px; }
  .workspace-footer b { font-size: 13px; }
  .workspace-footer small { font-size: 12px; }
  .topbar h1 { max-width: 165px; font-size: 16px; }
  .connection-chip { font-size: 12px; padding: 7px 8px; }
  .chat-view { --creation-gutter: 20px; }
  .empty-state h2 { font-size: 30px; }
  .starter-grid { grid-template-columns: 1fr; }
  .starter-card { padding: 12px 14px; }
  .starter-card b { margin-bottom: 3px; }
  .voice-panel-body, .generate-footer { padding-left: 16px; padding-right: 16px; }
  .script-editor { height: 135px; }
}
@media (max-width: 850px) {
  .workspace { grid-template-columns: 190px minmax(0,1fr); height: auto; overflow: visible; }
  .sidebar { position: sticky; top: 0; height: 100dvh; grid-row: 1 / 3; }
  .main-panel { height: 100dvh; }
  .voice-panel { grid-column: 2; min-height: 650px; border-top: 1px solid var(--border); }
  .voice-panel-body { overflow: visible; padding: 25px; }
  .voice-panel-heading { height: 72px; padding: 21px 25px; }
  .generate-footer { padding: 20px 25px; }
  .controls-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .starter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .empty-state h2 { font-size: 37px; }
  .topbar h1 { max-width: 260px; }
  .script-editor { height: 160px; }
  .library-view { padding: 26px 23px; }
}
@media (max-width: 700px) {
  .account-body { padding: 0 20px 23px; }
  .create-user-form { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 15px; }
  .user-card .usage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .user-quota-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .user-card { padding: 15px; }
  .account-dialog .dialog-header, .admin-dialog .dialog-header { padding: 24px 20px; }
  .usage-heading { gap: 10px; }
}
@media (max-width: 600px) {
  .workspace { display: block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: 244px; height: 100dvh; transform: translateX(-100%); transition: transform .2s; background: #fff; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .main-panel { height: 94dvh; min-height: 600px; }
  .topbar { height: 76px; padding: 17px 15px; }
  .topbar h1 { max-width: 190px; font-size: 16px; }
  .topbar-actions .connection-chip { display: none; }
  .voice-panel { min-height: 0; }
  .chat-view { --creation-gutter: 15px; }
  .messages { padding-top: 25px; padding-bottom: 25px; }
  .empty-state { padding-top: 10px; padding-bottom: 25px; }
  .empty-state h2 { font-size: 34px; letter-spacing: -1.1px; }
  .starter-grid { gap: 9px; margin-top: 24px; }
  .starter-card { padding: 14px 12px; border-radius: 15px; }
  .starter-card b { font-size: 14px; margin-bottom: 6px; }
  .starter-card span { font-size: 12px; }
  .setup-hint { font-size: 12px; }
  .composer-wrap { padding-top: 4px; padding-bottom: 16px; }
  .composer { border-radius: 20px; }
  .composer textarea { min-height: 85px; font-size: 16px; padding: 12px; }
  .message { gap: 8px; }
  .message-avatar { width: 25px; height: 27px; }
  .message-text { padding: 12px; }
  .script-card-header { padding: 14px; }
  .script-segment { padding-left: 14px; padding-right: 14px; }
  .script-card-footer { padding: 11px; flex-wrap: wrap; }
  .settings-dialog { max-height: 90dvh; }
  .provider-grid { grid-template-columns: minmax(0,1fr); grid-template-rows: none; gap: 17px; padding: 0 17px 20px; }
  .provider-card { grid-column: auto !important; grid-row: auto; grid-template-rows: none; padding: 20px; }
  .dialog-header { padding: 24px 20px; }
  .dialog-header h2 { font-size: 23px; }
  .dialog-footer { align-items: flex-start; gap: 13px; padding: 16px 20px; }
  .dialog-footer > span { font-size: 12px; }
  .dialog-footer .primary-button { padding-left: 13px; padding-right: 13px; }
  .login-dialog { padding: 28px 25px; }
  .login-dialog h2 { font-size: 25px; }
  .library-heading { flex-wrap: wrap; }
  .library-heading h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
