/* Product presentation. Legacy feature layouts live in a lower cascade layer. */
:root {
  color-scheme: dark;
  --chat-width: 780px;
  --sidebar-width: 248px;
  --ui-speed: 160ms;
  --radius: 8px;
  --ui-shadow: 0 12px 40px #00000026;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #212121; --nav: #181818; --panel: #2a2a2a; --panel2: #303030;
  --soft: #3a3a3a; --field: #303030; --line: #3d3d3d; --line2: #5c5c5c;
  --text: #ececec; --muted: #b4b4b4; --faint: #9a9a9a;
  --accent: #ececec; --accent-strong: #ffffff; --accent-soft: #ececec14; --accent-text: #171717;
  --user: #303030; --user-line: #3d3d3d; --danger: #ef8188; --shadow: 0 18px 48px #00000059;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa; --nav: #eef0f4; --panel: #ffffff; --panel2: #ffffff;
  --soft: #e7eaf0; --field: #ffffff; --line: #dde1e8; --line2: #b3bac6;
  --text: #1c2028; --muted: #5b6372; --faint: #636b79;
  --accent: #2f5fd0; --accent-strong: #244db0; --accent-soft: #2f5fd01a; --accent-text: #ffffff;
  --user: #e5ebf7; --user-line: #cdd7ec; --danger: #a83c45; --shadow: 0 18px 44px #1c202814;
}
html[data-theme="standard"] {
  color-scheme:light;
  --bg:#ffffff; --nav:#f5f5f5; --panel:#ffffff; --panel2:#f7f7f7;
  --soft:#ededed; --field:#ffffff; --line:#e1e1e1; --line2:#b8b8b8;
  --text:#242424; --muted:#666666; --faint:#686868;
  --accent:#262626; --accent-strong:#171717; --accent-soft:#2626260d; --accent-text:#ffffff;
  --user:#f0f0f0; --user-line:#e1e1e1; --danger:#a83c45; --shadow:0 18px 44px #0000001a;
}
html[data-theme="arctic"] { color-scheme:light; --faint:#566b70; }
html[data-theme="standard"] { --text:#171717; --accent:#171717; --accent-strong:#171717; --accent-soft:#1717170d; }
* { letter-spacing: 0; }
body { background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
::selection { background: var(--accent-fill,var(--accent)); color: var(--accent-text); }
:where(button, a, input, textarea, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
:is(.app, .main) { background: var(--bg); color: var(--text); }
.app { position: fixed; inset: var(--visual-top,0px) 0 auto; width:100%; height:var(--visual-vh,100dvh); min-height:0; display:flex; overflow:hidden; transform:none; }
.main { flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.sidebar { position:relative; inset:auto; height:auto; transform:none; flex:0 0 var(--sidebar-width); width:var(--sidebar-width); padding:16px 12px 12px; background:var(--nav); border-right:1px solid color-mix(in srgb,var(--line) 45%,transparent); box-shadow:none; backdrop-filter:none; gap:0; }
.brand { display:flex; align-items:center; height:48px; padding:0 8px 16px; gap:10px; font-size:18px; font-weight:650; }
.logo { width:28px; height:28px; flex:0 0 28px; }
.brand::after, .logo::after, .empty-mark::after, .composer::after, .composer::before { content:none; }
.brand .sidebar-close { margin-left:auto; width:28px; height:28px; min-width:28px; min-height:28px; }
.sidebar-close svg { width:17px; height:17px; }
.mobile-menu { display:grid; }
.app:not(.sidebar-collapsed) .mobile-menu { display:none; }
.app.sidebar-collapsed .sidebar { display:none; }
.new-chat { flex:0 0 42px; min-height:42px; height:42px; justify-content:flex-start; gap:12px; padding:0 12px; margin:4px 0; background:transparent; border:1px solid transparent; border-radius:8px; color:var(--text); font-size:14px; font-weight:550; box-shadow:none; }
.new-chat svg { width:18px; height:18px; }
.new-chat:hover { background:var(--soft); border-color:transparent; transform:none; box-shadow:none; }
.search-wrap { padding:0; margin:4px 0 16px; position:relative; }
.search { height:40px; min-height:40px; background:transparent; border:1px solid transparent; padding:0 12px 0 40px; border-radius:8px; font-size:13px; box-shadow:none; color:var(--text); }
.search:hover { background:var(--panel2); }
.search:focus { background:var(--panel2); border-color:var(--line2); outline:0; box-shadow:none; transform:none; }
.search-icon { position:absolute; top:20px; left:12px; transform:translateY(-50%); width:17px; height:17px; color:var(--muted); }
input::placeholder, textarea::placeholder { color:var(--faint); opacity:1; }
.sidebar-tool { flex:0 0 auto; min-height:40px; margin:1px 0; padding:8px 12px; gap:12px; background:transparent; border:0; border-radius:8px; color:var(--text); }
.sidebar-tool:hover { background:var(--soft); transform:none; box-shadow:none; }
.sidebar-tool-icon { width:18px; height:22px; flex:0 0 18px; background:transparent; border:0; border-radius:0; box-shadow:none; color:var(--muted); }
.sidebar-tool-icon svg { width:18px; height:18px; }
.sidebar-tool-copy { display:block; min-width:0; }
.sidebar-tool-title { font-size:13px; font-weight:500; color:var(--text); }
.sidebar-tool-status, .sidebar-tool-chevron { display:none; }
.section-label { padding:28px 12px 8px; font-size:12px; font-weight:550; text-transform:none; color:var(--muted); }
.history { flex:1; min-height:0; overflow:auto; padding:0; scrollbar-width:thin; scrollbar-color:var(--line2) transparent; }
.chat-row { min-height:38px; margin:2px 0; padding:8px 36px 8px 12px; border-radius:6px; color:var(--muted); box-shadow:none; border:0; }
.chat-row:hover, .chat-row:focus-visible { background:color-mix(in srgb,var(--nav) 90%,var(--text)); color:var(--text); }
.chat-row.active { background:color-mix(in srgb,var(--nav) 84%,var(--text)); color:var(--text); box-shadow:none; }
.chat-row.active:hover { background:color-mix(in srgb,var(--nav) 80%,var(--text)); }
.chat-title { font-size:13px; line-height:22px; }
/* Pinned chats and the recent group in the chat list. */
/* With groups the generic "Chats" heading would be a second title above "Pinned"; groups use its style. */
.sidebar:has(.history-group-label) .section-label { display:none; }
.history-group-label { padding:16px 12px 6px; font-size:12px; font-weight:550; color:var(--muted); text-transform:none; letter-spacing:0; }
.history-group-label:first-child { padding-top:24px; }
.chat-row.pinned { display:flex; align-items:center; gap:6px; }
.chat-row .chat-pin { flex:0 0 auto; width:13px; height:13px; color:var(--muted); }
.chat-row.pinned .chat-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Temporary chat: an outlined toggle in the top bar and its own empty screen. */
.temp-chat-btn.active { background:var(--accent-soft,var(--soft)); color:var(--text); box-shadow:inset 0 0 0 1px var(--line2,var(--line)); }
.temporary-empty { text-align:center; }
.temporary-empty-icon { width:44px; height:44px; margin:0 auto 14px; display:grid; place-items:center; border-radius:50%; border:1px dashed var(--line2,var(--line)); color:var(--muted); }
.temporary-empty-icon svg { width:22px; height:22px; }
.temporary-empty p { max-width:440px; margin:8px auto 0; color:var(--muted); font-size:14px; line-height:1.6; }
body.temporary-chat .composer { border-style:dashed; }
.chat-menu { right:4px; width:30px; height:30px; color:var(--muted); }
.chat-row:focus-within .chat-menu { opacity:1; }
.chat-menu:hover { background:var(--line); color:var(--text); }
.sidebar-foot { padding-top:10px; margin-top:8px; border-top:1px solid var(--line); }
.profile { padding:8px; min-height:52px; border-radius:8px; gap:10px; }
.profile:hover { background:var(--soft); }
.avatar { flex:0 0 32px; width:32px; height:32px; border-radius:50%; background:var(--soft); color:var(--text); font-size:12px; font-weight:600; }
.profile-name { font-size:13px; color:var(--text); }
.profile-email { color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; }
.profile-chevron { width:15px; color:var(--faint); }
.topbar { height:64px; flex:0 0 64px; padding:0 24px; gap:12px; background:var(--bg); border:0; backdrop-filter:none; box-shadow:none; }
.icon-btn { flex-shrink:0; width:36px; height:36px; min-width:36px; min-height:36px; border:0; border-radius:6px; background:transparent; color:var(--muted); }
.icon-btn:hover { background:var(--soft); color:var(--text); }
.icon-btn svg { width:19px; height:19px; }
.model { height:40px; padding:8px 10px; font-size:15px; font-weight:600; border:0; border-radius:6px; background:transparent; color:var(--text); }
.model:hover, .model-wrap.open .model { background:var(--soft); border-color:transparent; }
.model-chevron { width:15px; height:15px; color:var(--muted); }
.top-actions { gap:8px; }
.content { flex:1 1 0; min-height:0; overflow:auto; scroll-padding:24px; }
.chat-stage { width:min(var(--chat-width),calc(100% - 64px)); margin:0 auto; padding:32px 0 24px; }
.chat-stage:has(.empty) { padding:0; height:auto; }
.main:has(.empty) .content { flex:0 1 auto; margin-top:auto; display:flex; align-items:stretch; }
.empty { height:auto; min-height:0; padding:32px 0 24px; display:flex; flex-direction:column; justify-content:center; align-items:center; }
.empty-mark { width:44px; height:44px; flex:0 0 44px; margin:0 0 24px; animation:none; }
.empty h1 { margin:0 0 12px; font-size:32px; line-height:1.25; font-weight:550; color:var(--text); animation:none; }
.empty p { margin:0; font-size:14px; line-height:1.6; color:var(--muted); max-width:440px; animation:none; }
.suggestions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; width:100%; margin:32px 0 0; }
.suggestions .suggestion { min-height:78px; padding:14px; border:1px solid var(--line); border-radius:8px; background:transparent; box-shadow:none; animation:none; color:var(--text); }
.suggestion:hover { background:var(--panel2); border-color:var(--line2); transform:none; box-shadow:none; }
.suggestion b { display:flex; align-items:center; gap:8px; font-size:12px; line-height:1.5; font-weight:550; margin-bottom:5px; }
.suggestion b svg { width:16px; height:16px; flex-shrink:0; color:var(--accent); }
.suggestion span { font-size:12px; line-height:1.5; color:var(--muted); }
.message { gap:14px; margin:0 0 36px; animation:ui-enter 160ms ease-out; }
.message .who { flex:0 0 26px; width:26px; height:26px; margin-top:4px; border:0; border-radius:7px; box-shadow:none; }
.message.user .who { display:none; }
.message.user { justify-content:flex-end; }
.message .bubble { min-width:0; overflow-wrap:anywhere; }
.message.assistant .bubble { flex:1; font-size:15px; line-height:1.8; color:var(--text); }
.message.user .bubble { flex:0 1 auto; max-width:85%; padding:12px 18px; border:0; border-radius:14px; background:var(--user); color:var(--text); font-size:15px; line-height:1.65; }
.bubble > :first-child { margin-top:0; }
.bubble > :last-child { margin-bottom:0; }
.bubble :is(h1,h2,h3,h4) { color:var(--text); line-height:1.4; font-weight:600; margin:28px 0 12px; }
.bubble h1 { font-size:24px; }.bubble h2 { font-size:21px; }.bubble h3 { font-size:18px; }.bubble h4 { font-size:16px; }
.bubble p { margin:0 0 16px; }
.bubble :is(ul,ol) { padding-left:24px; margin:12px 0 20px; }
.bubble li { margin:6px 0; }
.bubble a { color:var(--accent-strong); text-underline-offset:3px; }
.bubble blockquote { margin:20px 0; padding:4px 0 4px 16px; border-left:3px solid var(--line2); background:transparent; color:var(--muted); }
.bubble hr { border:0; border-top:1px solid var(--line); margin:24px 0; }
.bubble :not(pre) > code { color:var(--text); background:var(--soft); border:0; border-radius:4px; padding:2px 5px; font-size:.88em; }
.code-block { margin:20px 0; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--nav); }
.code-head { min-height:40px; padding:8px 14px; background:var(--panel2); border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; }
.code-copy { min-height:28px; border-radius:4px; color:var(--muted); }
.code-block pre { margin:0; padding:16px; background:var(--nav); overflow:auto; }
.code-block code { background:transparent; color:var(--text); font-size:13px; line-height:1.65; }
html[data-appearance-tone="light"] :where(.hljs) :where([class^="hljs-"]) { color:var(--text); }
html[data-appearance-tone="light"] :is(.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-name,.hljs-tag) { color:#a32449; }
html[data-appearance-tone="light"] :is(.hljs-title,.hljs-built_in,.hljs-type) { color:#7044a0; }
html[data-appearance-tone="light"] :is(.hljs-string,.hljs-regexp,.hljs-attr) { color:#17664b; }
html[data-appearance-tone="light"] :is(.hljs-number,.hljs-symbol,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-meta,.hljs-link,.hljs-section,.hljs-template-variable) { color:#175d93; }
html[data-appearance-tone="light"] :is(.hljs-comment,.hljs-quote) { color:#626a70; }
html[data-appearance-tone="light"] .hljs-addition { color:#17664b; background:#e3f0e9; }
html[data-appearance-tone="light"] .hljs-deletion { color:#a32449; background:#f9e6eb; }
.bubble :is(table,th,td) { border-color:var(--line); }
.bubble th { background:var(--panel2); color:var(--text); font-weight:600; }
.bubble td { color:var(--text); }
.composer-shell { position:relative; inset:auto; flex:0 0 auto; width:100%; padding:8px 32px max(12px,env(safe-area-inset-bottom)); background:var(--bg); }
.composer-area { width:min(var(--chat-width),100%); margin:0 auto; }
.composer { padding:12px; border:1px solid var(--line); border-radius:16px; background:var(--panel2); box-shadow:none; transition:border-color var(--ui-speed),box-shadow var(--ui-speed); }
.composer:focus-within { border-color:var(--line2); box-shadow:0 0 0 1px color-mix(in srgb,var(--line2) 24%,transparent); }
.input-row { display:grid; grid-template-columns:36px 36px minmax(0,1fr) 36px; align-items:end; gap:4px; }
.prompt { grid-row:1; grid-column:1/-1; display:block; width:100%; min-width:0; min-height:46px; max-height:min(180px,calc(var(--visual-vh,100dvh)*.28)); margin:0; padding:6px 6px 14px; border:0; border-radius:0; background:transparent; color:var(--text); font-size:16px; line-height:1.6; box-shadow:none; resize:none; overflow:auto; }
.prompt:focus, .prompt:focus-visible { outline:none; box-shadow:none; border:0; }
.circle-btn { width:36px; height:36px; min-width:36px; min-height:36px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; color:var(--muted); box-shadow:none; }
.circle-btn:hover { background:var(--soft); color:var(--text); transform:none; }
.circle-btn svg { width:20px; height:20px; }
.attach { grid-row:2; grid-column:1; }
.web-search { grid-row:2; grid-column:2; }
.web-search.active { background:var(--accent-soft); color:var(--accent-strong); box-shadow:inset 0 0 0 1px var(--accent); }
.send { grid-row:2; grid-column:4; background:var(--text); color:var(--bg); }
.mic { grid-row:2; grid-column:3; justify-self:end; }
.mic.active { background:var(--accent-soft); color:var(--accent-strong,var(--text)); box-shadow:inset 0 0 0 1px var(--accent); }
body.keyboard-open .app .input-row .mic { grid-row:2; grid-column:3; justify-self:end; }
/* Message actions (copy, read aloud, rate, answer again; copy and edit on the user's messages). */
.message-actions { display:flex; flex-wrap:wrap; gap:2px; margin-top:8px; }
.message-actions .msg-action { width:30px; height:30px; display:grid; place-items:center; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.message-actions .msg-action:hover { background:var(--soft); color:var(--text); }
.message-actions .msg-action svg { width:16px; height:16px; }
.message-actions .msg-action[aria-pressed="true"], .message-actions .msg-action.active { color:var(--text); background:var(--soft); }
/* Read aloud: the icon gives way to a small spinner while the voice is being prepared. */
.message-actions .msg-action.loading { position:relative; }
.message-actions .msg-action.loading svg { opacity:0; }
.message-actions .msg-action.loading::after { content:""; position:absolute; inset:0; margin:auto; width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:msg-action-spin .7s linear infinite; }
@keyframes msg-action-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .message-actions .msg-action.loading::after { animation-duration:1.6s; } }
.user-actions { justify-content:flex-end; margin-top:0; opacity:0; transition:opacity .15s; }
.message.user:hover .user-actions, .message.user:focus-within .user-actions { opacity:1; }
@media (hover:none) { .user-actions { opacity:1; } }
.message-edit { display:flex; flex-direction:column; gap:8px; width:min(640px,100%); }
.message-edit textarea { width:100%; padding:12px 14px; border:1px solid var(--line2,var(--line)); border-radius:14px; background:var(--user,var(--panel2)); color:var(--text); font:inherit; font-size:15px; line-height:1.6; resize:vertical; box-sizing:border-box; }
.message-edit-actions { display:flex; justify-content:flex-end; gap:8px; }
.send:hover { background:var(--text); color:var(--bg); opacity:.85; }
.send:disabled { background:var(--soft); color:var(--faint); opacity:.6; }
.send.stop { background:var(--text); color:var(--bg); }
.send.stop svg { width:14px; height:14px; fill:currentColor; }
.composer-foot { margin:0; padding-top:10px; font-size:12px; line-height:1.4; text-align:center; color:var(--muted); }
.main:has(.empty) .composer-shell { margin-bottom:auto; padding-bottom:32px; }
.main:has(.empty) .composer-foot { padding-top:12px; }
.attach-preview { gap:8px; padding:0; margin:0; max-width:100%; }
.attach-preview:not(:empty) { padding:0 4px 12px; }
.attachment-photo { width:72px; height:72px; flex-basis:72px; border-radius:8px; }
.attachment-file { border-radius:8px; border-color:var(--line); background:var(--panel); }
.generated-image { width:min(460px,100%); border:0; border-radius:8px; background:transparent; }
.generated-image-media { border-radius:8px; overflow:hidden; }
.generated-image img { border-radius:8px; max-height:520px; object-fit:contain; }
.generated-image-download, .generated-image-edit { width:36px; height:36px; border-radius:6px; background:#181a1fe6; border:1px solid #ffffff38; color:#fff; }
.generated-file { border:1px solid var(--line); border-radius:8px; background:var(--panel2); padding:14px; gap:12px; }
.generated-file-name { font-size:13px; color:var(--text); }
.generated-file-icon { color:var(--accent); }
/* Sources: one compact button with site icons that opens the list of pages. */
html[data-theme] .message-sources { margin-top:14px; padding-top:0; border-top:0; }
html[data-theme] .message-sources-toggle { display:inline-flex; align-items:center; gap:8px; padding:5px 12px 5px 6px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:13px; font-weight:500; cursor:pointer; list-style:none; user-select:none; }
html[data-theme] .message-sources-toggle::-webkit-details-marker { display:none; }
html[data-theme] .message-sources-toggle:hover, html[data-theme] .message-sources[open] .message-sources-toggle { background:var(--panel2); color:var(--text); }
html[data-theme] .source-icons { display:inline-flex; }
html[data-theme] .source-icons .source-icon + .source-icon { margin-left:-6px; }
html[data-theme] .source-icon { position:relative; display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; width:20px; height:20px; overflow:hidden; border-radius:50%; background:var(--panel2); box-shadow:0 0 0 2px var(--bg); }
html[data-theme] .source-icon img { width:14px; height:14px; object-fit:contain; }
html[data-theme] .source-icon-letter::after { content:attr(data-letter); color:var(--muted); font-size:10px; font-weight:600; }
html[data-theme] .source-count { color:var(--faint, var(--muted)); font-variant-numeric:tabular-nums; }
html[data-theme] .message-sources-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:6px; margin-top:8px; }
html[data-theme] .message-source { display:flex; align-items:center; gap:10px; min-width:0; max-width:100%; min-height:0; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:transparent; color:var(--text); text-decoration:none; font-size:13px; }
html[data-theme] .message-source:hover { background:var(--panel2); border-color:var(--line2, var(--line)); }
html[data-theme] .source-text { display:flex; flex-direction:column; min-width:0; line-height:1.3; }
html[data-theme] .source-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html[data-theme] .source-host { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }
.wait-facts { width:min(440px,100%); padding:12px 0; border:0; background:transparent; box-shadow:none; }
.wait-facts-head { color:var(--muted); font-size:12px; }
.wait-fact-text { color:var(--muted); font-size:13px; line-height:1.65; }
.wait-fact-track { height:2px; background:var(--line); margin-top:12px; }
.wait-fact-track i { background:var(--accent); }
.wait-facts-pulse { box-shadow:none; background:var(--accent); }
/* Menus share one geometry and one surface across every theme. */
:is(.model-menu,.account-menu,.context) { border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--text); box-shadow:var(--ui-shadow); backdrop-filter:none; padding:6px; }
.model-menu { width:340px; max-width:calc(100vw - 32px); top:calc(100% + 8px); }
.model-menu-title { font-size:12px; font-weight:500; color:var(--muted); padding:8px 10px; text-transform:none; letter-spacing:0; }
.model-option { display:flex; width:100%; min-height:68px; padding:12px; gap:12px; border:0; border-radius:6px; background:transparent; color:var(--text); }
.model-option:hover, .model-option.selected { background:var(--soft); border-color:transparent; }
.model-option-icon { width:24px; height:28px; flex:0 0 24px; background:transparent; color:var(--muted); border:0; border-radius:0; }
.model-option-icon svg { width:22px; height:22px; }
.model-option-title { color:var(--text); font-size:13px; font-weight:600; }
.model-option-desc { font-size:12px; line-height:1.5; color:var(--muted); margin-top:4px; }
.model-badge { display:none; }
.model-soon { background:var(--panel2); color:var(--muted); font-size:10px; font-weight:400; padding:2px 5px; border:1px solid var(--line); border-radius:4px; }
.model-check { color:var(--accent); width:17px; }
.model-disabled { opacity:.65; }
.account-menu { display:grid; gap:4px; width:280px; max-width:calc(100vw - 24px); padding:8px; }
.account-menu-user { padding:10px 12px 14px; margin:0 0 4px; border-bottom:1px solid var(--line); }
.account-menu-name { color:var(--text); font-size:14px; }
.account-menu-email, .account-menu-usage { color:var(--muted); font-size:12px; }
.account-menu-usage { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; margin-top:8px; line-height:1.5; }
.account-menu-usage strong { white-space:nowrap; color:var(--text); font-weight:600; font-variant-numeric:tabular-nums; }
.account-menu-btn, .context button { min-height:40px; padding:10px 12px; border-radius:5px; font-size:13px; color:var(--text); }
.account-menu-btn { min-height:44px; gap:12px; background:transparent; }
a.account-menu-btn { display:flex; align-items:center; text-decoration:none; }
a.account-menu-btn[hidden] { display:none; }
.account-menu-btn svg { width:18px; height:18px; flex:0 0 18px; }
.account-menu-btn:hover, .context button:hover { background:var(--soft); }
.account-menu .danger, .context .danger { color:var(--danger); }
.context { min-width:180px; }
.context button { display:flex; align-items:center; gap:10px; width:100%; text-align:left; }
.context button svg { width:16px; height:16px; flex:0 0 16px; color:var(--muted); }
.context .danger svg { color:currentColor; }
/* Settings live in the account menu; the top-bar gear only stands in when the sidebar is hidden. */
@media (min-width:761px) { .app:not(.sidebar-collapsed) #settingsTop { display:none; } }
.message-text > :first-child { margin-top:0; }
.bubble .table-scroll table { min-width:0; width:100%; }
.bubble .table-scroll :is(th,td) { min-width:72px; }
/* Dialogs: pinned headers, a single scroll surface, predictable actions. */
.overlay { top:var(--visual-top,0px); height:var(--visual-vh,100dvh); bottom:auto; padding:32px; background:#00000070; backdrop-filter:none; }
.modal { width:min(720px,100%); min-height:0; max-height:calc(var(--visual-vh,100dvh) - 64px); padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--text); box-shadow:0 24px 80px #00000040; overflow:auto; overscroll-behavior:contain; }
.modal-head { position:sticky; top:-24px; z-index:3; display:flex; align-items:center; margin:-24px -24px 24px; padding:16px 24px; background:var(--panel); border-bottom:1px solid var(--line); gap:16px; }
.modal-head h2 { margin:0; font-size:18px; font-weight:600; line-height:1.4; }
.modal-head .close { margin:0 -6px 0 0; }
.field { margin:0 0 24px; }
.field > label, .preset-label { color:var(--text); font-size:13px; line-height:1.5; font-weight:550; margin-bottom:12px; }
.field input:not([type=checkbox]):not([type=radio]), .api-key-create input, .memory-add input { height:44px; padding:10px 12px; font-size:14px; border:1px solid var(--line2); border-radius:6px; background:var(--field); color:var(--text); box-shadow:none; }
.hint, .usage-settings-sub { font-size:12px; line-height:1.7; color:var(--muted); }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:9px 16px; border:1px solid var(--line2); border-radius:6px; background:transparent; color:var(--text); font-size:13px; font-weight:500; box-shadow:none; }
.btn svg { width:16px; height:16px; }
.btn:hover { background:var(--soft); border-color:var(--line2); transform:none; box-shadow:none; }
.btn.primary { background:var(--text); border-color:transparent; color:var(--bg); }
.btn.primary:hover { background:var(--text); opacity:.9; }
.modal-actions { background:var(--panel); border-color:var(--line); }
#settingsOverlay .modal { display:grid; grid-template-columns:168px minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto auto; width:min(840px,100%); height:min(640px,calc(var(--visual-vh,100dvh) - 64px)); padding:0; overflow:hidden; }
#settingsOverlay .modal-head { grid-column:1/-1; position:static; margin:0; padding:16px 24px; }
.settings-tabs { display:flex; flex-direction:column; gap:4px; padding:20px 12px; margin:0; border:0; border-right:1px solid var(--line); background:var(--nav); overflow:auto; }
.settings-tabs button { min-height:40px; padding:10px 12px; justify-content:flex-start; gap:10px; font-size:13px; border-radius:6px; color:var(--muted); }
.settings-tabs button[aria-selected=true] { background:var(--soft); color:var(--text); font-weight:550; }
.settings-tabs button:hover { background:var(--panel2); color:var(--text); }
.settings-tabs svg { width:17px; height:17px; }
.settings-panels { min-width:0; min-height:0; padding:24px; overflow:auto; overscroll-behavior:contain; }
.settings-panels .theme-section + .theme-section { margin-top:28px; padding-top:24px; border-top:1px solid var(--line); }
.settings-panels .theme-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.settings-panels .theme-card { min-height:80px; padding:12px; gap:10px; background:transparent; color:var(--text); border:1px solid var(--line); border-radius:8px; box-shadow:none; font-size:12px; font-weight:500; }
.theme-card:hover, .theme-card.selected { background:var(--panel2); border-color:var(--accent); box-shadow:none; }
.accent-options { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 20px; }
.accent-option { position:relative; display:grid; place-items:center; width:40px; height:40px; padding:6px; border:2px solid transparent; border-radius:50%; background:transparent; }
.accent-option > span { width:24px; height:24px; background:var(--swatch); border-radius:50%; box-shadow:inset 0 0 0 1px #00000020; }
.accent-option > svg { position:absolute; width:16px; height:16px; color:var(--accent-text); }
.accent-option[data-accent=theme] > span { background:var(--soft); }
.accent-option[data-accent=theme] > svg { color:var(--text); }
.accent-option:hover { background:var(--soft); }
.accent-option[aria-pressed=true] { border-color:var(--text); }
.appearance-color-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; padding:12px 0; border-bottom:1px solid var(--line); }
.appearance-color-row > label { font-size:13px; color:var(--text); }
.appearance-color-inputs { display:flex; align-items:center; gap:8px; }
.appearance-color-inputs input[type=color] { box-sizing:border-box; appearance:none; width:40px; height:40px; padding:4px; border:1px solid var(--line2); border-radius:8px; background:var(--field); cursor:pointer; }
.appearance-color-inputs input[type=color]::-webkit-color-swatch-wrapper { padding:0; }
.appearance-color-inputs input[type=color]::-webkit-color-swatch { border:0; border-radius:4px; }
.appearance-color-inputs input[type=color]::-moz-color-swatch { border:0; border-radius:4px; }
.appearance-color-inputs input[type=text] { width:88px; min-width:0; height:40px; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--field); color:var(--text); font:13px ui-monospace,monospace; }
.appearance-color-inputs input[aria-invalid=true] { border-color:var(--danger); }
.appearance-color-inputs input.custom-selected { box-shadow:0 0 0 2px var(--text); }
.appearance-color-inputs .icon-btn { width:40px; height:40px; }
.appearance-color-inputs .icon-btn:disabled { opacity:.35; }
.appearance-warning { color:var(--danger); font-size:12px; line-height:1.5; }
.appearance-reset { margin-top:20px; gap:8px; }
.appearance-reset svg { width:16px; height:16px; }
html[data-custom-accent=true] :is(.send:not(:disabled),.btn.primary,.music-actions button) { background:var(--accent-fill); color:var(--accent-text); }
.memory-toggle input:checked { --toggle-background:var(--accent-fill,var(--accent)); }
html[data-custom-colors=true] .hljs [class^="hljs-"] { color:var(--text); }
.theme-card > svg { width:14px; height:14px; top:10px; right:10px; }
.settings-panels .theme-swatch { width:44px; height:20px; border-radius:4px; }
.settings-panels .theme-swatch--system { background:linear-gradient(135deg,#ffffff 0 50%,#212121 50% 100%); }
.settings-panels .preset-grid { gap:0; }
.settings-panels .preset-grid { grid-template-columns:1fr; }
/* Pages opened before the attachments update still render this markup; it keeps photos compact there too. */
.chat-upload-image { margin-top:12px; }
.chat-upload-image img { display:block; max-width:min(100%,200px); max-height:200px; object-fit:contain; border-radius:12px; }
/* User turn: attachments above the text bubble, right-aligned; photos as compact previews. */
.message.user .user-turn:has(.message-edit) { flex:1 1 auto; }
.message.user .user-turn { flex:0 1 auto; display:flex; flex-direction:column; align-items:flex-end; gap:8px; min-width:0; max-width:85%; }
.message.user .user-turn > .bubble { max-width:100%; }
.user-attachments { display:flex; flex-direction:column; align-items:flex-end; gap:8px; max-width:100%; }
.user-images { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; max-width:100%; }
.user-images img { display:block; border-radius:16px; background:var(--panel2); object-fit:cover; cursor:zoom-in; }
.user-images img:not([src]) { width:160px; height:120px; }
.user-images img:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.user-images.single img[src] { width:auto; height:auto; max-width:min(100%,200px); max-height:200px; object-fit:contain; }
.user-images.multi { max-width:min(100%,300px); }
.user-images.multi img { width:96px; height:96px; }
.user-files { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; max-width:100%; }
.user-file { display:flex; align-items:center; gap:10px; min-width:0; max-width:min(100%,300px); padding:8px 8px 8px 8px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.user-file-icon { flex:0 0 36px; width:36px; height:36px; display:grid; place-items:center; border-radius:9px; background:var(--accent-soft,var(--panel2)); color:var(--accent); }
.user-file-icon svg { width:18px; height:18px; }
.user-file-info { display:flex; flex-direction:column; min-width:0; padding-right:6px; }
.user-file-name { font-size:13px; font-weight:550; line-height:1.35; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-file-info small { font-size:12px; line-height:1.35; color:var(--muted); }
.user-file-download { flex:0 0 30px; width:30px; height:30px; display:grid; place-items:center; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; }
.user-file-download:hover { background:var(--panel2); color:var(--text); }
.user-file-download svg { width:16px; height:16px; }
@media (max-width:640px) {
  .message.user .user-turn { max-width:90%; }
  .user-images.single img[src] { max-width:min(100%,160px); max-height:160px; }
  .user-images.multi { max-width:min(100%,252px); }
  .user-images.multi img { width:80px; height:80px; }
}
.settings-panels .preset-card { min-height:100px; padding:18px 16px; margin:0 0 10px; border-radius:8px; border:1px solid var(--line); background:transparent; box-shadow:none; }
.preset-card.selected { background:var(--accent-soft); border-color:var(--accent); }
.preset-card-title { font-size:14px; font-weight:550; color:var(--text); }
.preset-card-desc { font-size:13px; line-height:1.6; color:var(--muted); margin-top:6px; }
.preset-card-check { color:var(--accent); background:transparent; border:0; }
.memory-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.memory-heading > span { font-size:16px; font-weight:600; }
.memory-toggle { align-items:center; vertical-align:middle; }
#memoryEnabledLabel { min-width:76px; }
.memory-auto { margin:20px 0; }
.memory-summary { font-size:14px; line-height:1.7; color:var(--text); padding:12px 0; }
.memory-details { border-top:1px solid var(--line); margin-top:16px; padding-top:16px; }
.memory-details summary { font-size:13px; color:var(--muted); cursor:pointer; }
.memory-row { padding:12px 0; gap:12px; border-color:var(--line); font-size:13px; color:var(--text); }
.memory-row button, .memory-add button { width:36px; height:36px; min-width:36px; min-height:36px; border:0; border-radius:6px; background:var(--soft); color:var(--muted); }
.memory-row button svg, .memory-add button svg { width:18px; height:18px; }
.memory-add { align-items:center; gap:8px; margin-top:20px; }
.memory-clear { margin-top:16px; font-size:12px; color:var(--danger); }
.usage-settings-title { font-size:14px; font-weight:550; color:var(--text); }
.usage-settings-list { gap:16px; margin-top:20px; }
.usage-settings-row { padding:0; background:transparent; border:0; border-radius:0; font-size:13px; }
.usage-settings-label { color:var(--muted); }
.usage-settings-label svg { color:var(--accent); }
.usage-settings-row strong { color:var(--text); font-weight:500; font-variant-numeric:tabular-nums; }
.usage-settings-track { height:4px; background:var(--soft); }
.usage-settings-track span { background:var(--accent); }
.account-actions { margin-top:24px; padding-top:24px; gap:8px; border-color:var(--line); }
#settingsOverlay .modal-actions { grid-column:1/-1; position:static; margin:0; padding:14px 24px; border-top:1px solid var(--line); }
#settingsOverlay #saveSettings { min-width:100px; }
#settingsLogoutBtn { border-color:var(--line2); }
/* Libraries and developer platform. */
.api-platform-modal, .image-library-modal, .music-modal { width:min(880px,100%); }
.api-platform-intro, .image-library-intro { padding:0 0 24px; gap:16px; background:transparent; border-color:var(--line); }
.api-platform-mark { width:40px; height:40px; flex-basis:40px; background:var(--soft); color:var(--accent); border-radius:8px; box-shadow:none; }
.api-platform-copy h3, .image-library-copy h3 { margin:0 0 6px; font-size:16px; font-weight:550; color:var(--text); }
.api-platform-copy p, .image-library-copy p { font-size:13px; line-height:1.6; color:var(--muted); }
.api-platform-section { padding:24px 0; border-color:var(--line); }
.api-platform-section h3 { font-size:14px; font-weight:550; color:var(--text); }
.api-platform-muted, .api-key-meta { color:var(--muted); font-size:12px; }
.api-usage, .api-key-row { background:transparent; border-color:var(--line); border-radius:6px; }
.api-usage strong { color:var(--text); font-size:24px; font-weight:500; }
.api-usage-bar { height:4px; background:var(--soft); }
.api-usage-bar span { background:var(--accent); }
.api-key-name { color:var(--text); font-size:13px; }
.api-code { padding:16px; font-size:12px; line-height:1.7; background:var(--nav); color:var(--text); border:1px solid var(--line); border-radius:8px; overflow:auto; }
.api-doc-endpoint { font-size:12px; overflow-wrap:anywhere; color:var(--muted); }
.api-doc-method { flex:0 0 auto; white-space:nowrap; align-self:flex-start; }
.api-doc-endpoint code { color:var(--text); }
.api-secret { background:var(--accent-soft); border:1px solid var(--accent); border-radius:8px; color:var(--text); }
.image-library-usage { color:var(--muted); font-size:11px; }
.image-library-usage strong { color:var(--text); font-size:16px; font-weight:550; }
.api-image-gallery { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding-top:24px; }
.api-image-item { border:1px solid var(--line); background:transparent; border-radius:8px; }
.api-image-item img { aspect-ratio:1; width:100%; object-fit:cover; }
.api-image-item p { color:var(--muted); font-size:12px; }
.api-image-empty, .music-empty { grid-column:1/-1; min-height:200px; display:grid; align-content:center; justify-items:center; gap:12px; border:0; color:var(--muted); text-align:center; font-size:14px; padding:32px 16px; }
.api-image-empty svg, .music-empty svg { width:28px; height:28px; color:var(--faint); }
.music-compose { padding:24px 0; border-color:var(--line); }
.music-compose label { font-size:13px; font-weight:550; }
.music-compose textarea { background:var(--field); border:1px solid var(--line2); padding:14px; font-size:14px; border-radius:8px; }
.music-actions button { background:var(--text); color:var(--bg); min-height:40px; border-radius:6px; font-size:13px; }
.music-actions button svg { width:18px; height:18px; }
.music-track { background:transparent; border:1px solid var(--line); border-radius:8px; padding:16px; }
.music-track-title { font-size:14px; font-weight:550; }
.music-status { font-size:12px; }
.music-track [data-music-load] { background:var(--panel2); border-color:var(--line); }
.toast { background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:8px; box-shadow:var(--ui-shadow); font-size:13px; max-width:calc(100vw - 32px); }
:is(button,.profile,.chat-row) { transition:opacity var(--ui-speed),transform var(--ui-speed); }
.overlay.open .modal, .model-wrap.open .model-menu { animation:ui-enter 160ms ease-out; }
@keyframes ui-enter { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:1024px) { :root { --sidebar-width:228px; } .topbar { padding-inline:16px; } .suggestions { grid-template-columns:repeat(2,minmax(0,1fr)); width:min(520px,100%); } .suggestions .suggestion { min-height:72px; } }
@media (max-width:760px) {
  .app .topbar .mobile-menu { display:grid; }
  .sidebar { position:fixed; top:0; left:0; bottom:0; width:min(288px,calc(100vw - 48px)); height:100%; padding-top:max(16px,env(safe-area-inset-top)); transform:translateX(-100%); transition:transform 180ms ease; z-index:30; }
  .sidebar.open { transform:translateX(0); }
  .topbar { height:56px; flex-basis:56px; padding:0 12px; gap:4px; }
  .icon-btn { width:40px; height:40px; min-width:40px; min-height:40px; }
  .model { font-size:14px; }
  .top-actions { gap:0; }
  .chat-stage { width:100%; padding:24px 16px; }
  .chat-stage:has(.empty) { padding-inline:20px; }
  .empty { padding:32px 0 24px; }
  .empty-mark { width:40px; height:40px; flex-basis:40px; margin-bottom:20px; }
  .empty h1 { font-size:26px; }
  .empty p { max-width:300px; font-size:13px; }
  .suggestions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:24px; }
  .suggestions .suggestion { display:block; padding:12px; min-height:78px; }
  .suggestion b { font-size:12px; gap:6px; }
  .suggestion span { font-size:12px; }
  .composer-shell { padding:8px 12px max(10px,env(safe-area-inset-bottom)); }
  .main:has(.empty) .composer-shell { padding-bottom:max(16px,env(safe-area-inset-bottom)); }
  .composer { border-radius:14px; padding:10px; }
  .input-row { grid-template-columns:40px 40px minmax(0,1fr) 40px; }
  .circle-btn { width:40px; height:40px; min-width:40px; min-height:40px; }
  .composer-foot { font-size:11px; padding-top:8px; }
  .message { gap:10px; margin-bottom:28px; }
  .message.assistant .bubble { font-size:15px; line-height:1.75; }
  .message.assistant .who { width:22px; height:22px; flex-basis:22px; }
  .message.user .bubble { max-width:90%; padding:10px 14px; }
  .overlay { padding:12px; }
  .modal { width:100%; max-height:calc(var(--visual-vh,100dvh) - 24px); padding:20px; border-radius:10px; }
  .modal-head { top:-20px; margin:-20px -20px 20px; padding:12px 20px; }
  #settingsOverlay .modal { grid-template-columns:1fr; grid-template-rows:auto auto minmax(0,1fr) auto auto; height:min(680px,calc(var(--visual-vh,100dvh) - 24px)); }
  #settingsOverlay .modal-head { padding:12px 16px; }
  .settings-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; padding:8px; border-right:0; border-bottom:1px solid var(--line); background:var(--panel); }
  .settings-tabs button { flex-direction:column; justify-content:center; padding:8px 2px; min-height:56px; font-size:10px; gap:6px; }
  .settings-panels { padding:20px 16px; }
  .settings-panels .theme-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .settings-panels .theme-card { min-height:76px; }
  #settingsOverlay .modal-actions { padding:12px 16px; }
  .memory-heading { flex-wrap:wrap; gap:12px; }
  .api-image-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .api-key-create { grid-template-columns:1fr; }
  .api-platform-intro { gap:12px; }
  .api-platform-copy h3 { font-size:15px; }
  .api-usage strong { font-size:20px; }
  .model-menu { position:fixed; top:calc(var(--visual-top,0px) + 56px); left:12px; right:auto; width:min(340px,calc(100vw - 24px)); max-height:calc(var(--visual-vh,100dvh) - 68px); overflow:auto; }
}
@media (max-width:380px) { .topbar { padding-inline:8px; } .model { padding-inline:6px; font-size:13px; } .top-actions { gap:0; } .suggestion b svg { display:none; } .empty h1 { font-size:24px; } .chat-stage:has(.empty) { padding-inline:16px; } }
@media (max-height:650px) { .empty { padding:16px 0; } .empty-mark { margin-bottom:12px; width:32px; height:32px; flex-basis:32px; } .empty h1 { font-size:24px; } .suggestions { margin-top:16px; } .main:has(.empty) .composer-shell { padding-bottom:12px; } }
body.keyboard-open .main .composer-shell { padding-bottom:max(6px,env(safe-area-inset-bottom)); }
body.keyboard-open .empty { min-height:0; padding:12px 0; }
body.keyboard-open .suggestions { display:none; }
body.keyboard-open .empty-mark { display:none; }
body.keyboard-open .app .input-row .prompt { grid-row:1; grid-column:1/-1; min-height:40px; padding:4px 4px 8px; }
body.keyboard-open .app .input-row .attach { grid-row:2; grid-column:1; }
body.keyboard-open .app .input-row .web-search { grid-row:2; grid-column:2; }
body.keyboard-open .app .input-row .send { grid-row:2; grid-column:4; }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }

/* Blocked account (ACCOUNT_BLOCKED from the backend): replaces the chat with a notice. */
.account-blocked { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:16px; background:var(--bg); }
.account-blocked-card { width:min(440px, 100%); padding:28px 24px; border:1px solid var(--line); border-radius:18px; background:var(--panel); text-align:center; }
.account-blocked-icon { width:52px; height:52px; margin:0 auto 14px; display:grid; place-items:center; border-radius:50%; background:var(--soft); color:var(--danger, #a83c45); }
.account-blocked-icon svg { width:24px; height:24px; }
.account-blocked h2 { margin:0 0 8px; font-size:22px; color:var(--text); }
.account-blocked p { margin:0 0 10px; color:var(--muted); line-height:1.5; }
.account-blocked-reason { padding:10px 12px; border-radius:12px; background:var(--soft); color:var(--text) !important; text-align:left; overflow-wrap:anywhere; }
.account-blocked-hint { font-size:14px; }
.account-blocked-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:16px; }
/* Unblocked: the lock opens, turns green, a ring and sparks fly out, then the notice gives way to the chat. */
.account-blocked { --unlock-green:#16a34a; }
.account-blocked-icon { position:relative; transition:background-color .35s ease, color .35s ease; }
.account-blocked-icon svg { width:28px; height:28px; overflow:visible; }
.account-blocked .lock-shackle { transform-box:view-box; transform-origin:32px 22px; }
.account-blocked h2, .account-blocked p, .account-blocked-actions { transition:opacity .3s ease; }
.unlock-ring, .unlock-sparks { position:absolute; inset:0; pointer-events:none; }
.unlock-ring { border-radius:50%; border:2px solid var(--unlock-green); opacity:0; }
.unlock-sparks span { position:absolute; left:50%; top:50%; width:6px; height:6px; margin:-3px; border-radius:50%; background:var(--c); opacity:0; }
.account-blocked.unlocking .account-blocked-icon { color:var(--unlock-green); background:color-mix(in srgb, var(--unlock-green) 16%, transparent); }
.account-blocked.unlocking .lock-shackle { animation:unlock-shackle .6s cubic-bezier(.34,1.56,.64,1) forwards; }
.account-blocked.unlocking .account-blocked-icon { animation:unlock-pop .5s .35s cubic-bezier(.34,1.56,.64,1) both; }
.account-blocked.unlocking .unlock-ring { animation:unlock-ring .8s .4s ease-out forwards; }
.account-blocked.unlocking .unlock-sparks span { animation:unlock-spark .9s .45s cubic-bezier(.2,.8,.3,1) forwards; }
.account-blocked.unlocking .account-blocked-reason, .account-blocked.unlocking .account-blocked-hint, .account-blocked.unlocking .account-blocked-actions { opacity:0; }
.account-blocked.unlocking h2 { animation:unlock-title .5s .3s ease both; }
.account-blocked.leaving { animation:unlock-leave .45s ease forwards; }
@keyframes unlock-shackle { 0% { transform:none; } 45% { transform:translateY(-6px); } 100% { transform:translateY(-5px) rotate(32deg); } }
@keyframes unlock-pop { 0% { transform:scale(1); } 50% { transform:scale(1.18); } 100% { transform:scale(1); } }
@keyframes unlock-ring { 0% { transform:scale(1); opacity:.9; } 100% { transform:scale(2.6); opacity:0; } }
@keyframes unlock-spark { 0% { transform:rotate(var(--a)) translateX(0) scale(1); opacity:1; } 100% { transform:rotate(var(--a)) translateX(var(--d)) scale(.3); opacity:0; } }
@keyframes unlock-title { 0% { opacity:0; transform:translateY(6px); } 100% { opacity:1; transform:none; } }
@keyframes unlock-leave { to { opacity:0; transform:scale(1.03); } }
@media (prefers-reduced-motion: reduce) {
  .account-blocked.unlocking .lock-shackle { animation:none; transform:translateY(-5px) rotate(32deg); }
  .account-blocked.unlocking .account-blocked-icon, .account-blocked.unlocking .unlock-ring, .account-blocked.unlocking .unlock-sparks span, .account-blocked.unlocking h2 { animation:none; }
  .account-blocked.leaving { animation-duration:.2s; }
}
/* Chat search: where the text was found, under the title (renderHistory). */
.chat-match { min-width:0; flex:1; display:flex; flex-direction:column; }
.chat-match .chat-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-snippet { font-size:12px; line-height:16px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-snippet b { color:var(--text); font-weight:600; }

/* A file dragged over the chat: the message box shows where it will land. */
.composer-shell.drop-target .composer { outline:2px dashed var(--muted); outline-offset:3px; }

/* Back to the latest message (updateJumpLatest). */
.composer-shell { position:relative; }
.jump-latest { position:absolute; left:50%; top:-48px; transform:translateX(-50%); width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:var(--panel, var(--bg)); color:var(--text); border:1px solid var(--line, rgba(127,127,127,.25)); box-shadow:0 2px 8px rgba(0,0,0,.12); cursor:pointer; z-index:5; }
.jump-latest[hidden] { display:none; }
.jump-latest svg { width:18px; height:18px; }
.jump-latest:hover { background:var(--soft, var(--panel, var(--bg))); }

/* Keyboard shortcuts (Ctrl+/ or the account menu). */
.shortcuts-modal { max-width:460px; }
.shortcuts-list { margin:4px 0 0; display:grid; gap:2px; }
.shortcuts-list > div { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:9px 2px; border-bottom:1px solid var(--line); }
.shortcuts-list > div:last-child { border-bottom:0; }
.shortcuts-list dt { order:2; white-space:nowrap; color:var(--muted); font-size:12px; }
.shortcuts-list dd { margin:0; font-size:14px; color:var(--text); }
.shortcuts-list kbd { display:inline-block; min-width:22px; padding:2px 6px; border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; background:var(--panel); font:12px/1.4 inherit; text-align:center; color:var(--text); }
/* Shortcuts need a keyboard: hidden on touch devices. */
@media (hover: none) and (pointer: coarse) { .account-menu-btn#shortcutsBtn { display:none; } }

/* Renaming a chat in place in the list (els.renameChat). */
.chat-rename { width:100%; min-width:0; font:inherit; font-size:13px; line-height:20px; color:var(--text); background:var(--panel); border:1px solid var(--line2, var(--line)); border-radius:6px; padding:1px 6px; outline:none; }
.chat-rename:focus { border-color:var(--muted); }

/* uiConfirm: the site's own confirmation, above any open window. */
dialog.confirm-modal { width:min(420px, calc(100vw - 32px)); max-height:none; overflow:hidden; padding:20px 22px 22px; border:1px solid var(--line); border-radius:14px; background:var(--panel); color:var(--text); box-shadow:var(--shadow); }
dialog.confirm-modal::backdrop { background:#00000070; }
.confirm-text { margin:0; font-size:14.5px; line-height:1.5; color:var(--text); white-space:pre-line; }
.confirm-modal .modal-actions { justify-content:flex-end; }
.confirm-modal .btn.danger { background:var(--danger); border-color:transparent; color:#fff; }

/* Code block actions: download and copy. */
.code-actions { display:flex; align-items:center; gap:2px; }
.code-download { padding:0 6px; }
