:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --bg: #17181b;
  --bg-deep: #121316;
  --panel: #1d1f23;
  --panel-soft: #232529;
  --border: #2e3136;
  --border-soft: #292c31;
  --text: #e9eaee;
  --text-soft: #b9bdc6;
  --muted: #8a8f9a;
  --faint: #6b707a;
  --accent: #d8dadd;
  --accent-ink: #1a1b1e;
  --hover: #ffffff0d;
  --shadow: 0 10px 30px #00000030;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f5;
  --bg-deep: #ececee;
  --panel: #ffffff;
  --panel-soft: #f1f1f3;
  --border: #e0e0e4;
  --border-soft: #e7e7ea;
  --text: #26272b;
  --text-soft: #4c4e55;
  --muted: #7c7f88;
  --faint: #9a9da6;
  --accent: #2b2c31;
  --accent-ink: #f6f6f7;
  --hover: #0000000a;
  --shadow: 0 10px 30px #00000018;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; }
body { min-width: 320px; overflow: hidden; background: var(--bg); color: var(--text); transition: background .2s, color .2s; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.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; }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 312px minmax(0, 1fr); }
.sidebar { min-height: 0; display: flex; flex-direction: column; padding: 20px 14px 14px; border-right: 1px solid var(--border-soft); background: var(--panel); z-index: 30; }
.sidebar-top { display: flex; align-items: center; gap: 5px; padding: 0 2px; }
.sidebar-top > .icon-button { flex: 0 0 auto; }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 850; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--text-soft); font-size: 18px; line-height: 1; }
.icon-button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.conversation-controls { display: flex; align-items: center; gap: 4px; margin: 20px 2px 16px; padding: 4px; border-radius: 10px; background: var(--bg-deep); }
.new-chat-button { display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; flex: 0 0 36px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.new-chat-button svg { width: 17px; height: 17px; }
.new-chat-button:hover { background: var(--panel); color: var(--text); }
.conversation-controls .tabs { min-width: 0; flex: 1; gap: 4px; padding: 0; background: transparent; }
.conversation-controls .tab { min-height: 36px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 9px; background: var(--bg-deep); }
.tab { min-height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px #00000026; }
.search-box { display: flex; align-items: center; gap: 7px; height: 38px; margin: 14px 2px 10px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: var(--bg-deep); color: var(--faint); }
.search-box:focus-within { border-color: var(--muted); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: var(--faint); }
.list-status { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.item-list { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.chat-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 68px; margin: 2px 0; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: inherit; text-align: left; }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--panel-soft); }
.chat-item.active::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--text-soft); }
.item-avatar { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; background: var(--panel-soft); }
.item-copy { min-width: 0; flex: 1; }
.item-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-title { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.item-time { flex: 0 0 auto; color: var(--faint); font-size: 10px; }
.item-preview { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.character-list { display: grid; grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 2px; }
.character-card { display: flex; gap: 12px; width: 100%; padding: 12px 10px; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--panel-soft); color: inherit; text-align: left; }
.character-card:hover { border-color: var(--muted); }
.character-card .item-avatar { width: 46px; height: 46px; }
.character-card .item-preview { display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.55; }
.character-author { color: var(--muted); font-size: 10px; }
.account-card { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 3px 4px; }
.account-avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.account-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.account-info strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-info span { color: var(--muted); font-size: 10px; }
.account-card .icon-button { width: 32px; height: 32px; font-size: 16px; }
.chat-pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-header { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 24px; border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); z-index: 5; }
.chat-heading { min-width: 0; flex: 1; }
.chat-heading h1 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.model-badge { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.model-badge svg { width: 19px; height: 19px; }
.model-badge:hover { background: var(--hover); color: var(--text); }
.model-badge.custom { background: var(--hover); color: var(--text); }
.model-badge.custom::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px var(--bg); }
.messages { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px max(22px, calc((100% - 880px) / 2)) 96px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--border) transparent; transition: padding-bottom .15s ease; }
.welcome { max-width: 460px; margin: clamp(40px, 12vh, 130px) auto 0; text-align: center; }
.welcome-mark { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--panel-soft); color: var(--text-soft); font-size: 32px; font-weight: 800; }
.welcome h2 { margin: 0; font-size: 25px; letter-spacing: -.6px; }
.welcome p { margin: 14px 0 26px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.secondary-button, .ghost-button, .primary-button, .danger-button { min-height: 40px; padding: 0 18px; border-radius: 8px; font-size: 13px; font-weight: 650; }
.secondary-button, .primary-button { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.secondary-button:hover, .primary-button:hover { filter: brightness(1.08); }
.ghost-button { border: 1px solid var(--border); background: transparent; color: var(--text-soft); }
.ghost-button:hover { background: var(--hover); }
.danger-button { border: 1px solid color-mix(in srgb, #b95959 45%, transparent); background: transparent; color: #c26a6a; }
:root[data-theme="light"] .danger-button { color: #a54444; }
.message-row { display: flex; gap: 12px; margin: 0 0 25px; animation: message-in .18s ease-out; }
.message-row.user { justify-content: flex-end; padding-left: 12%; }
.message-row.assistant { padding-right: 6%; }
.message-avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; background: var(--panel-soft); }
.message-body { min-width: 0; max-width: 100%; }
.message-meta { display: flex; align-items: center; gap: 9px; min-height: 18px; margin: 0 0 6px; color: var(--faint); font-size: 10px; }
.message-row.user .message-meta { justify-content: flex-end; }
.message-action { padding: 2px 4px; border: 0; background: transparent; color: var(--faint); font-size: 10px; }
.message-action:hover { color: var(--text-soft); }
.bubble { padding: 11px 15px; border: 1px solid var(--border-soft); border-radius: 6px 16px 16px 16px; background: var(--panel); color: var(--text); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.message-row.user .bubble { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); white-space: pre-wrap; }
.bubble > :first-child { margin-top: 0; }
.bubble > :last-child { margin-bottom: 0; }
.bubble p { margin: 9px 0; }
.bubble h1, .bubble h2, .bubble h3 { margin: 18px 0 9px; line-height: 1.4; }
.bubble h1 { font-size: 20px; }.bubble h2 { font-size: 18px; }.bubble h3 { font-size: 16px; }
.bubble a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; }
.bubble code { padding: 2px 5px; border-radius: 5px; background: var(--bg-deep); color: var(--text-soft); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.bubble pre { max-width: 100%; overflow-x: auto; padding: 14px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--bg-deep); }
.bubble pre code { padding: 0; }
.bubble blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted); }
.bubble .br-paren { color: #6fb3ff; }
.bubble .br-square { color: #ffb45e; }
.bubble .br-corner { color: #7fd98a; }
.bubble .br-corner2 { color: #4fd1b5; }
.bubble .br-action { color: #ffd166; }
.bubble .br-title { color: #c39bff; }
.bubble .br-curly { color: #ff8fb0; }
.bubble .br-angle { color: #8ee6ff; }
:root[data-theme="light"] .bubble .br-paren { color: #1f6fd6; }
:root[data-theme="light"] .bubble .br-square { color: #b06a00; }
:root[data-theme="light"] .bubble .br-corner { color: #218838; }
:root[data-theme="light"] .bubble .br-corner2 { color: #0f8f78; }
:root[data-theme="light"] .bubble .br-action { color: #9a6700; }
:root[data-theme="light"] .bubble .br-title { color: #7d46d4; }
:root[data-theme="light"] .bubble .br-curly { color: #d43f74; }
:root[data-theme="light"] .bubble .br-angle { color: #0b7285; }
.bubble table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.bubble th, .bubble td { padding: 7px 10px; border: 1px solid var(--border); }
.bubble img { max-width: min(100%, 360px); height: auto; border-radius: 9px; }
.typing { display: inline-flex; gap: 5px; padding: 7px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }.typing i:nth-child(3) { animation-delay: .4s; }
.composer-wrap { position: absolute; right: 0; bottom: 0; left: 0; z-index: 10; padding: 10px max(22px, calc((100% - 880px) / 2)) max(16px, env(safe-area-inset-bottom)); pointer-events: none; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 18px; border: 1px solid var(--border); border-radius: 26px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 6px 20px #0000001f; backdrop-filter: blur(18px); pointer-events: auto; }
.composer:focus-within { border-color: var(--muted); }
.composer textarea { min-height: 36px; max-height: 180px; flex: 1; resize: none; padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; line-height: 1.5; scrollbar-width: thin; }
.composer textarea::placeholder { color: var(--faint); }
.send-button { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--accent); border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-size: 21px; font-weight: 700; }
.dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); color: var(--text); box-shadow: 0 30px 100px #00000055; }
.dialog::backdrop { background: #00000066; backdrop-filter: blur(5px); }
:root[data-theme="light"] .dialog::backdrop { background: #00000030; }
.dialog-card { padding: 26px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 1.8px; }
.dialog label { display: flex; justify-content: space-between; margin: 16px 0 8px; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.dialog input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), .dialog select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: var(--bg-deep); color: var(--text); }
.dialog input:focus, .dialog select:focus { border-color: var(--muted); }
.dialog input[type="range"] { width: 100%; accent-color: var(--text-soft); }
.dialog .check-row { justify-content: flex-start; align-items: center; gap: 9px; margin: 18px 0 0; font-size: 13px; cursor: pointer; }
.dialog .check-row input[type="checkbox"] { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--accent); }
#api-fields[hidden], #builtin-fields[hidden] { display: none; }
.channel-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.channel-modes .check-row { min-width: 0; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-deep); white-space: nowrap; }
.channel-modes .check-row:has(input:checked) { border-color: var(--muted); background: var(--panel-soft); }
.channel-modes input[type="radio"] { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: var(--accent); }
.password-row { position: relative; }
.password-row input { padding-right: 56px; }
.text-button { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--text); }
.field-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.form-error { min-height: 18px; margin: 12px 0 0; color: #c26a6a; font-size: 12px; }
:root[data-theme="light"] .form-error { color: #a54444; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog-actions.split { justify-content: space-between; }
.dialog-actions.split > div { display: flex; gap: 10px; }
#api-reset[hidden] + div { margin-left: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100% - 32px); padding: 11px 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading-screen { height: 100vh; height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 15px; color: var(--muted); font-size: 13px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--text-soft); border-radius: 50%; animation: spin .8s linear infinite; }
.mobile-only { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes typing { to { opacity: .25; transform: translateY(-3px); } }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } }
.conversation-controls .tabs { grid-template-columns: repeat(3, 1fr); }

/* 输入框左侧加号按钮与弹出菜单 */
.plus-wrap { position: relative; flex: 0 0 auto; }
.plus-button { width: 36px; height: 36px; align-self: flex-end; border: 1px solid var(--border); border-radius: 16px; font-size: 19px; }
.plus-button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.plus-menu { position: absolute; bottom: 46px; left: 0; z-index: 60; display: flex; flex-direction: column; gap: 2px; min-width: 158px; margin: 0; padding: 6px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); box-shadow: var(--shadow); }
.plus-menu button { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
.plus-menu button:hover { background: var(--hover); }

/* 图生图参考图 chip */
.attach-chip { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 8px 12px; padding: 5px 6px 5px 5px; border: 1px solid var(--border); border-radius: 13px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 6px 20px #0000001f; backdrop-filter: blur(18px); pointer-events: auto; }
.attach-chip img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.attach-chip .attach-label { color: var(--muted); font-size: 11px; }
.attach-chip .icon-button { width: 24px; height: 24px; font-size: 14px; }

/* 弹窗 textarea / 文件选择 */
.dialog textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: var(--bg-deep); color: var(--text); font-size: 13px; line-height: 1.6; resize: vertical; }
.dialog textarea:focus { border-color: var(--muted); }
.dialog input[type="file"] { height: auto; padding: 9px 12px; font-size: 12px; }

/* 角色卡（我的角色 + 创建入口） */
.character-card { position: relative; }
.char-letter { display: grid; place-items: center; color: var(--accent-ink); font-weight: 750; background: linear-gradient(135deg, var(--muted), var(--faint)); }
.character-card .char-letter { width: 46px; height: 46px; font-size: 19px; border-radius: 12px; }
.create-character-card { align-items: center; justify-content: center; min-height: 64px; border-style: dashed; color: var(--muted); font-size: 13px; font-weight: 620; }
.create-character-card:hover { color: var(--text); }
.mine-badge { margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: var(--bg-deep); color: var(--muted); font-size: 9px; font-weight: 600; }
.card-edit { position: absolute; top: 8px; right: 8px; padding: 3px 7px; border-radius: 7px; color: var(--faint); font-size: 12px; }
.card-edit:hover { background: var(--hover); color: var(--text); }

/* 社区 */
.community-list { display: grid; grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 2px; }
.comm-toolbar { display: flex; gap: 8px; }
.comm-toolbar .seg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg-deep); }
.comm-toolbar .seg button { min-height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; }
.comm-toolbar .seg button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px #00000026; }
.comm-empty { padding: 18px 8px; text-align: center; }
.like-chip { flex: 0 0 auto; align-self: center; padding: 3px 8px; border: 1px solid var(--border-soft); border-radius: 20px; color: var(--muted); font-size: 11px; }
.like-chip.liked { border-color: color-mix(in srgb, #e05c7a 55%, transparent); color: #e05c7a; }
.like-button.liked { border-color: color-mix(in srgb, #e05c7a 55%, transparent); color: #e05c7a; }
.load-more { width: 100%; margin-top: 4px; }
.community-desc { margin: 10px 0 0; color: var(--text-soft); font-size: 13px; line-height: 1.7; }
.community-content { max-height: 42vh; overflow-y: auto; margin: 12px 0 0; padding: 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-deep); color: var(--text-soft); font-family: inherit; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 世界书 */
.wb-bound { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-deep); color: var(--text-soft); font-size: 12px; }
.wb-list-head { margin: 22px 0 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.wb-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wb-item { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-deep); }
.wb-item .item-title { font-size: 12px; }
.wb-item .text-button, .wb-bound .text-button { position: static; transform: none; flex: 0 0 auto; padding: 4px 8px; border-radius: 7px; font-size: 11px; }
.wb-item .text-button:hover, .wb-bound .text-button:hover { background: var(--hover); }
.danger-text { color: #c26a6a; }

/* 角色编辑 */
.char-avatar-preview-wrap { margin-top: 10px; }
.char-avatar-preview-wrap img { width: 72px; height: 72px; border: 1px solid var(--border-soft); border-radius: 14px; object-fit: cover; }

@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(330px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px #00000040; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: #00000055; backdrop-filter: blur(2px); }
  .mobile-only { display: inline-grid; }
  .chat-pane { height: 100vh; height: 100dvh; }
  .chat-header { min-height: 46px; padding: 6px 10px; gap: 5px; }
  .messages { padding: 20px 14px 90px; }
  .message-row.user { padding-left: 8%; }
  .message-row.assistant { padding-right: 0; gap: 9px; }
  .message-avatar { width: 30px; height: 30px; border-radius: 9px; }
  .composer-wrap { padding: 8px 10px max(12px, env(safe-area-inset-bottom)); }
  .dialog { inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: var(--bg); box-shadow: none; }
  .dialog-card { min-height: 100%; padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left)); }
  .dialog-actions.split { flex-wrap: wrap; row-gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
