/* Chat layout: one scrollable conversation between the header and composer. */
:root { --sidebar: 248px; --chat-width: 1160px; --muted: #aaa9a5; --dim: #94938d; --app-height: calc(100dvh - 52px); }
[hidden] { display: none !important; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid #ffc44c; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .45; }
.sr-only, .history-search-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-chat { position: fixed; left: 12px; top: -100px; z-index: 200; padding: 12px; background: #ffc44c; color: #111; border-radius: 8px; }
.skip-chat:focus { top: 12px; }
.app-shell { position: fixed; top: var(--viewport-top, 0px); left: 0; right: 0; height: var(--app-height); transition: none; }
.sidebar { padding: 12px 14px 14px; background: #101111; border-right: 1px solid #252525; }
.sidebar-head { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.sidebar-head .new-chat { flex: 1; min-width: 0; margin: 0; padding: 0 10px; font-size: 13px; }
.sidebar-head .sidebar-toggle { flex: 0 0 36px; min-height: 44px; }
.brand { gap: 10px; }
.brand small { color: #a4a39c; }
.sidebar-toggle { position: static; width: 32px; height: 36px; }
.new-chat { flex: 0 0 auto; display: flex; align-items: center; min-height: 44px; gap: 10px; margin: 0 0 20px; padding: 0 13px; border: 1px solid #645020; border-radius: 12px; background: #242014; font-size: 14px; color: #ffdf96; }
.new-chat:hover { background: #30291a; }
.history-section { display: flex; flex-direction: column; min-height: 60px; flex: 1; margin: 0 0 12px; overflow: hidden; }
#historySearch { width: 100%; flex: 0 0 auto; min-height: 40px; padding: 8px 12px; border: 1px solid #303131; border-radius: 9px; color: #f5f3ed; background: #181a1a; font: inherit; font-size: 13px; }
#historySearch::placeholder { color: #969893; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 18px 4px 8px; }
.history-heading :is(h2,.history-label) { margin: 0; font-size: 12px; letter-spacing: .03em; color: #b8b9b1; font-weight: 600; }
#historyArchiveToggle { min-height: 32px; padding: 4px 6px; font-size: 11px; color: #b4b5ae; border: 0; background: transparent; }
.history-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; max-height: none; scrollbar-width: thin; scrollbar-color: #424340 transparent; }
.history-row { display: flex; align-items: center; gap: 2px; border-radius: 9px; flex: 0 0 auto; }
.history-row.is-active { background: #292921; }
.history-row:hover { background: #252626; }
.history-list .history-open { display: block; width: auto; flex: 1; min-width: 0; height: auto; min-height: 40px; padding: 10px; color: #d6d6cf; font-size: 13px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: transparent; border: 0; }
.history-list .history-open::before { display: none; }
.history-list .history-archive { display: block; flex: 0 0 30px; width: 30px; min-height: 36px; padding: 0; background: transparent; border: 0; border-radius: 8px; color: #b6b6af; font-size: 20px; opacity: 0; }
.history-list .history-archive::before { display: none; }
.history-list .history-archive svg { display: block; width: 16px; height: 16px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.history-row:hover .history-archive, .history-row:focus-within .history-archive { opacity: 1; }
.history-empty { font-size: 12px; color: #b1b1aa; margin: 12px; }
.sidebar-links { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid #2c2c2a; }
.sidebar-links a, .sidebar-links button { display: block; padding: 8px 9px; border: 0; background: transparent; color: #c0c0b8; text-align: left; font-size: 12px; border-radius: 8px; }
.sidebar-links a:hover, .sidebar-links button:hover { background: #252626; color: #fff; }
.plan-box { display: grid; gap: 8px; margin: 0; padding: 12px 8px; border-top: 1px solid #2c2c2a; }
.plan-box div { display: grid; gap: 5px; }
.plan-box strong { font-size: 13px; }
.plan-box span { max-width: none; color: #b3b3aa; font-size: 11px; line-height: 1.55; }
.plan-box a { justify-self: start; color: #ffcf69; font-size: 12px; }
.history-privacy { flex: 0 0 auto; padding: 0 8px; color: #969890; font-size: 10px; line-height: 1.45; }
.history-privacy p { margin: 0 0 4px; }
.history-privacy button, .history-privacy a { padding: 0; margin-right: 8px; border: 0; background: transparent; color: #b3b4ad; text-decoration: underline; font: inherit; }
.chat-area { height: var(--app-height); display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; overflow: hidden; background: radial-gradient(ellipse at 50% 32%,rgba(165,121,28,.035),transparent 48%),#080909; }
.chat-area > * { min-width: 0; }
.history-heading-actions { display: flex; align-items: center; gap: 5px; }
#renameConversation { flex: 0 0 32px; width: 32px; min-height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #bdb8aa; font-size: 19px; }
#renameConversation:hover { background: #27271f; color: #ffdf96; }
.site-home-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; min-height: 38px; padding: 0 12px; border: 1px solid #4c4025; border-radius: 10px; font-size: 12px; white-space: nowrap; color: #f0d9a1; background: #1d1b13; text-decoration: none; }
.site-home-link:hover { background: #2c2618; border-color: #806735; }
.chat-body { position: relative; min-height: 0; overflow: hidden; }
.workspace { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; overflow: clip; }
.conversation { position: absolute; inset: 0; width: 100%; height: 100%; padding: 36px max(32px,calc((100% - var(--chat-width))/2)) 48px; margin: 0; overflow: auto; overflow-anchor: none; scroll-behavior: auto; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; scrollbar-width: thin; scrollbar-color: #535650 transparent; }
.conversation > .message.assistant:last-child { min-height: calc(100% - 48px); }
.conversation::-webkit-scrollbar { display: block; width: 8px; }
.conversation::-webkit-scrollbar-thumb { background: #3a3c37; border-radius: 8px; }
.starter { inset: 0; width: 100%; padding: 32px max(28px,calc((100% - 760px)/2)); align-content: safe center; justify-items: center; overflow: auto; gap: 0; pointer-events: auto; animation: none; scrollbar-width: thin; scrollbar-color: #3a3c37 transparent; }
.starter-logo { width: 48px; height: 48px; margin: 0 auto 12px; box-shadow: 0 0 32px rgba(255,176,0,.08); }
.starter p.starter-eyebrow { margin: 0 0 10px; color: #cbb889; font-size: 11px; letter-spacing: .18em; }
.starter h1 { font-size: clamp(28px,3.3vw,40px); line-height: 1.16; font-weight: 620; letter-spacing: -.03em; }
.starter p:not(.starter-eyebrow) { max-width: 445px; margin: 14px auto 0; color: #aeb0a6; font-size: 14px; line-height: 1.6; }
.chat-mode-tabs { display: flex; justify-content: center; gap: 6px; max-width: 100%; box-sizing: border-box; margin-top: 24px; padding: 4px; border: 1px solid #2d2e29; border-radius: 999px; background: #121413; }
.chat-mode-tabs :is(button,a) { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: #b0b3a9; font-family: inherit; font-size: 12px; line-height: 1.4; white-space: nowrap; text-decoration: none; }
.chat-mode-tabs a:hover { background: #25261e; color: #ffdf9b; }
.chat-mode-tabs a:focus-visible { outline: 2px solid #dfc389; outline-offset: 2px; }
.chat-mode-tabs button.active { background: #3c3320; color: #ffdf9b; }
.starter-grid { width: 100%; max-width: 640px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 20px; }
.starter-card { display: flex; align-items: flex-start; gap: 10px; min-height: 72px; padding: 13px 14px; border: 1px solid #282c28; border-radius: 12px; background: #101311; box-shadow: none; text-align: left; }
.starter-card::before { display: none; }
.starter-card:hover { background: #181c17; transform: none; border-color: #4a4737; box-shadow: none; }
.starter-card .starter-symbol { display: block; flex: 0 0 16px; font-size: 16px; line-height: 1.4; color: #bfa66c; }
.starter-card .starter-copy { display: block; min-width: 0; }
.starter-card strong { display: block; color: #dfe3da; font-size: 13px; font-weight: 500; line-height: 1.4; margin: 0 0 4px; }
.starter-card .starter-copy > span { color: #959d91; font-size: 11px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.starter p.starter-about { font-size: 9px; color: #a6ad9f; margin-top: 12px; }
.starter-about a { color: #c9cbbf; text-decoration: underline; text-underline-offset: 3px; }
.composer, body.sidebar-collapsed .composer { position: relative; inset: auto; width: min(780px,calc(100% - 64px)); padding: 8px 0 max(10px,env(safe-area-inset-bottom)); margin: 0 auto; background: #080909; z-index: 30; }
.composer .input-row { display: grid; grid-template-columns: 36px minmax(0,1fr) auto 36px; grid-template-rows: auto auto auto; align-items: center; gap: 0 6px; min-height: 50px; padding: 6px; border: 1px solid #343a32; border-radius: 24px!important; background: #151916; box-shadow: 0 8px 24px #0002; }
.composer .input-row:focus-within { border-color: #75674b; box-shadow: 0 0 0 1px #d7b97612; }
.composer .input-row textarea { grid-column: 2; grid-row: 2; display: block; width: 100%; min-width: 0; min-height: 28px; max-height: min(180px,calc(var(--app-height)*.25)); padding: 2px 3px; margin: 0; border: 0; background: transparent; color: #f1f2e9; font-size: 16px; line-height: 24px; resize: none; outline: 0; overflow: auto; scrollbar-width: thin; }
.input-row textarea::placeholder { color: #a1a99b; }
.composer-toolbar { display: contents; }
.composer .attachment-list { grid-column: 1 / -1; grid-row: 1; }
.composer .attachment-status { grid-column: 1 / -1; grid-row: 3; }
.composer .attach-btn { grid-column: 1; grid-row: 2; align-self: end; }
.composer .composer-options-trigger { grid-column: 3; grid-row: 2; align-self: end; max-width: 154px; overflow: hidden; text-overflow: ellipsis; }
.composer .send-btn,.composer .stop-btn { grid-column: 4; grid-row: 2; align-self: end; border-radius: 50%; }
.attach-btn { flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; background: transparent; border: 0; color: #c1c9ba; font-size: 24px; padding: 0; }
.composer-options-trigger { display: inline-flex; align-items: center; gap: 7px; width: auto; height: 34px; min-height: 34px; padding: 0 9px; border: 0; border-radius: 12px; background: transparent; color: #b6beb0; font-size: 11px; font-weight: 400; white-space: nowrap; }
.composer-options-trigger::after { content: ""; width: 5px; height: 5px; flex: 0 0 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.composer .composer-options-trigger:hover { background: #242a22; }
.composer .composer-options-trigger:focus-visible { outline: 2px solid #c7ae78; outline-offset: 1px; }
.character-count { position: absolute; right: 12px; bottom: calc(100% - 5px); margin: 0; color: #b4b8aa; font-size: 10px; }
.send-btn, .stop-btn { flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; margin-left: auto; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 0; background: #dbc38e; color: #172015; font-size: 23px; box-shadow: none; }
.composer :is(.attach-btn,.send-btn,.stop-btn) svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.composer .stop-btn svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.composer .attach-btn:hover { color: #e5d3a6; background: #242a22; border-radius: 50%; }
.stop-btn { font-size: 15px; }
.send-btn:disabled { background: #2a3028; color: #7f8a77; opacity: 1; }
.composer-hint { margin: 5px 0 0; text-align: center; color: #a1a99b; font-size: 9px; line-height: 1.45; }
.composer-hint a { margin-left: 5px; color: #c5cbbd; text-decoration: underline; }
.composer > .form-note[data-privacy-notice] { margin: 3px 0 0; font-size: 9px; line-height: 1.45; color: #9aa292; text-align: center; }
.composer > .form-note[data-privacy-notice] a { color: inherit; }
.request-status { min-height: 0; color: #ccb67f; font-size: 12px; line-height: 1.4; padding: 0 10px; }
.request-status:not(:empty) { padding-bottom: 10px; }
/* Keep completion announcements accessible without reserving permanent typing space. */
.composer:not(.is-busy) .request-status { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.attach-menu, .composer-options-menu { position: absolute; left: 0; right: auto; top: auto; bottom: calc(100% - 8px); width: min(380px,100%); max-width: 100%; max-height: min(450px,calc(var(--app-height) - var(--composer-height) - 80px)); overflow: auto; overscroll-behavior: contain; border: 1px solid #4b4938; border-radius: 16px; padding: 12px; background: #191c18; box-shadow: 0 12px 40px #0008; }
.attach-menu button { min-height: 42px; color: #d4d9cd; font-size: 13px; }
.attach-menu { width: min(310px,100%); padding: 7px; }
.attach-menu button[data-attach-kind] { min-height: 64px; padding: 10px 12px; gap: 13px; }
.attach-menu svg { flex: 0 0 23px; width: 23px; height: 23px; fill: none; stroke: #d6bc80; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.attach-menu .attach-option-copy { display: grid; justify-items: start; gap: 4px; width: auto; height: auto; flex: 1; border: 0; border-radius: 0; color: #edece4; font-weight: 400; }
.attach-option-copy strong { font-size: 14px; font-weight: 600; }
.attach-option-copy small { color: #a5aa9e; font-size: 11px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 146px; overflow: auto; padding: 2px 0 10px; scrollbar-width: thin; }
.attachment-card { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; width: 232px; padding: 8px; border: 1px solid #3e4538; border-radius: 12px; background: #252b22; }
.attachment-card img { flex: 0 0 42px; width: 42px; height: 42px; object-fit: cover; border-radius: 7px; }
.attachment-file-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 7px; background: #36392c; color: #dfc88e; font-size: 10px; font-weight: 650; }
.attachment-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.attachment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; color: #e1e5d8; }
.attachment-copy small { color: #b0b7a5; font-size: 10px; line-height: 1.4; }
.attachment-card button { display: grid; place-items: center; flex: 0 0 32px; min-height: 36px; padding: 0; border: 0; border-radius: 8px; color: #d7decf; background: transparent; font-size: 21px; }
.attachment-card button:hover { background: #404735; }
.attachment-status { margin: 4px 2px; font-size: 12px; color: #d8c594; }
.message.user .attachment-card { margin: 0 0 10px; width: 270px; background: #2a3124; }
.message.user .attachment-card img { width: 56px; height: 56px; flex-basis: 56px; }
.composer-options-menu { display: none; gap: 12px; }
.composer-options-menu.open { display: grid; }
.composer-options-menu > div { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-options-menu strong { width: 100%; margin: 0 0 3px; color: #afb9a4; font-size: 11px; }
.composer-options-menu button { min-height: 36px; padding: 7px 12px; color: #d2d9c9; border: 1px solid #394330; border-radius: 9px; background: #222b1d; font-size: 12px; }
.composer-options-menu button.active { border-color: #b19450; background: #473c22; color: #ffe3a4; }
.language-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: #c6d0ba; }
.language-setting select { min-height: 40px; border: 1px solid #4c5841; border-radius: 9px; background: #222b1d; color: #e1e8d7; padding: 6px 9px; font-size: 14px; }
.composer-options-menu{grid-template-columns:minmax(0,1fr);animation:none;max-height:min(580px,calc(var(--app-height,100dvh) - var(--composer-height,150px) - 96px));overflow:auto;overscroll-behavior:contain}
.language-setting{min-width:0;flex-wrap:wrap}.language-setting select{max-width:100%;min-width:0;flex:1}
.ai-option-note{margin:0;color:#aab19f;font-size:11px;line-height:1.6}
.answer-sources{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 10px;align-items:center}
.answer-sources strong{width:100%;font-size:11px;font-weight:500;color:#aeb5a5}
.answer-sources a{max-width:100%;padding:7px 10px;border:1px solid #363b32;border-radius:9px;color:#dfc58c;text-decoration:none;font-size:12px;overflow-wrap:anywhere;background:#151814}
.answer-sources a:hover{border-color:#a79058}.answer-sources a:focus-visible{outline:2px solid #dfc58c;outline-offset:3px}
.answer-provenance{margin:12px 0 0;color:#adb4a4;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
@media(max-width:680px){.answer-sources a{min-height:44px;display:inline-flex;align-items:center}.language-setting select{min-height:44px;font-size:16px}}
.message, .message.user { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 16px; margin: 0 0 36px; animation: none; }
.message.user { grid-template-columns: minmax(0,1fr); padding-left: 40px; }
.message.user .avatar { display: none; }
.message.user .message-content { justify-self: end; width: auto; max-width: min(85%,840px); }
.message-content { min-width: 0; }
.avatar { width: 30px; height: 30px; font-size: 10px; animation: none !important; box-shadow: none; }
.avatar::after { display: none; }
.message.assistant .avatar { border: 0; background: transparent; box-shadow: none; font-size: 0; }
.message.assistant .avatar::before { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; background: #d5b66f; animation: assistant-dot-breathe 2.8s ease-in-out infinite; }
@keyframes assistant-dot-breathe { 0%, 100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
.bubble { font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.message.assistant .bubble { color: #e4e5df; }
.bubble h2, .bubble h3 { margin: 28px 0 12px; line-height: 1.4; letter-spacing: -.02em; }
.bubble li + li { margin-top: 8px; }
.message.user .bubble { padding: 12px 18px; border: 1px solid #363c2f; border-radius: 18px 18px 5px 18px; background: #21271d; color: #e1e6d8; }
.user-text { white-space: pre-wrap; margin: 0; }
.bubble > :first-child { margin-top: 0; }
.bubble > :last-child { margin-bottom: 0; }
.bubble a { color: #f0d18a; text-decoration: underline; text-underline-offset: 3px; }
.bubble pre { padding: 16px; overflow: auto; border: 1px solid #353b2e; border-radius: 12px; background: #131711; line-height: 1.55; font-size: 13px; }
.bubble pre code { white-space: pre; background: transparent; padding: 0; }
.code-block { min-width: 0; margin: 18px 0; border: 1px solid #343733; border-radius: 12px; overflow: hidden; background: #101312; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 12px; border-bottom: 1px solid #343733; color: #aeb5a9; font-size: 12px; }
.code-toolbar button { min-height: 36px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: #e0c687; font: inherit; cursor: pointer; }
.code-toolbar button:hover { background: #25291f; }
.code-toolbar button:focus-visible { outline: 2px solid #d5b66f; outline-offset: -2px; }
.code-block pre { margin: 0; border: 0; border-radius: 0; background: transparent; }
.response-notice { margin: 14px 0 0; padding-left: 12px; border-left: 2px solid #9c824a; color: #c9ba94; font-size: 12px; line-height: 1.6; }
.message-actions button[data-continue] { border-color: #6d5b35; color: #f0d18a; }
.table-scroll { width: 100%; overflow: auto; margin: 18px 0; border: 1px solid #3d4435; border-radius: 10px; }
.bubble table { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.bubble th, .bubble td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #343b2d; vertical-align: top; }
.bubble th { color: #ede2c1; background: #262d20; white-space: nowrap; }
.message-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; opacity: 1; }
.message-actions button, .image-download { min-height: 36px; border: 1px solid transparent; padding: 6px 9px; border-radius: 7px; background: transparent; color: #b9c2ad; font-size: 12px; }
.message-actions button:hover { color: #f2e0af; border-color: #4d513f; background: #222a1d; }
.generated-image { display: block; max-width: 100%; max-height: 520px; height: auto; object-fit: contain; border-radius: 16px; }
.image-download { display: inline-block; color: #e9ce8b; text-decoration: underline; margin-top: 8px; }
.is-pending .bubble { color: #c4b382; }
.is-pending .avatar { opacity: .65; }
.is-error .bubble { padding: 12px; border: 1px solid #61483a; border-radius: 12px; background: #2a211b; color: #e7cabc; }
.is-limit .upgrade-cta { width: min(100%,580px); margin: 0; padding: 20px; gap: 10px; border: 1px solid #494232; border-radius: 16px; background: #191b17; box-shadow: none; }
.is-limit .upgrade-cta strong { color: #ece6d6; font-size: 16px; line-height: 1.4; }
.is-limit .upgrade-cta p { margin: 0; color: #b8b9ad; font-size: 14px; line-height: 1.6; }
.is-limit .upgrade-cta a { min-height: 40px; margin-top: 4px; gap: 10px; padding: 0 14px; border: 1px solid #74603a; border-radius: 10px; background: #322b1d; color: #eed49c; font-size: 13px; font-weight: 600; }
.is-limit .upgrade-cta a:hover { background: #453920; border-color: #b79550; }
.is-limit .upgrade-cta a span { color: inherit; font-size: 16px; }
.scroll-latest { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 15; min-height: 42px; padding: 9px 16px; border-radius: 99px; border: 1px solid #68614b; background: #242720; color: #f1e4bf; font-size: 12px; box-shadow: 0 4px 20px #0006; }
.chat-notice { position: fixed; top: 76px; left: calc(var(--sidebar) + (100% - var(--sidebar))/2); transform: translateX(-50%); max-width: min(580px,calc(100vw - 32px)); width: max-content; padding: 14px 18px; border: 1px solid #807044; border-radius: 12px; background: #292a20; color: #ede2bd; z-index: 180; font-size: 13px; line-height: 1.5; box-shadow: 0 12px 44px #0008; }
.chat-dialog { width: min(420px,calc(100vw - 32px)); padding: 24px; border: 1px solid #5a593e; border-radius: 18px; color: #eee8d5; background: #1d2218; }
.chat-dialog::backdrop { background: #000a; }
.chat-notice { pointer-events: none; }
.chat-dialog h2 { margin: 0 0 20px; font-size: 20px; }
.chat-dialog label { display: block; margin-bottom: 8px; font-size: 13px; }
.chat-dialog input { width: 100%; min-height: 44px; padding: 10px; border: 1px solid #60664b; border-radius: 10px; background: #13190f; color: #eee; font: inherit; }
.chat-dialog form > div { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.chat-dialog button { min-height: 40px; padding: 8px 14px; border: 1px solid #6d6847; border-radius: 9px; color: #e8dfc3; background: #363923; }
body.sidebar-collapsed { --sidebar: 64px; }
@media (min-width:981px) {
  body.sidebar-collapsed .sidebar { width: 64px; padding: 16px 8px; }
  body.sidebar-collapsed .sidebar-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; width: 100%; }
  body.sidebar-collapsed .brand { display: flex; order: 0; margin: 0; width: 36px; height: 36px; }
  body.sidebar-collapsed .sidebar-toggle { position: static; order: 1; margin: 0; width: 36px; }
  body.sidebar-collapsed .brand span:last-child, body.sidebar-collapsed .new-chat span:last-child,
  body.sidebar-collapsed .history-section, body.sidebar-collapsed .sidebar-links, body.sidebar-collapsed .history-privacy, body.sidebar-collapsed .plan-box { display: none !important; }
  body.sidebar-collapsed .sidebar-head .new-chat { flex: 0 0 auto; order: 2; display: flex; justify-content: center; width: 44px; min-height: 44px; margin: 0; padding: 0; }
}
@media (max-width:980px) {
  :root, body.sidebar-collapsed { --sidebar: 0px; }
  .sidebar, body.sidebar-collapsed .sidebar { width: min(286px,84vw); height: var(--app-height); padding: 12px 14px 14px; z-index: 100; }
  .mobile-menu-btn, body.sidebar-open .mobile-menu-btn { display: grid; place-items: center; position: static; flex: 0 0 38px; width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 10px; opacity: 1; color: #d2d7c9; background: #171c13; border-color: #353d2d; box-shadow: none; }
  .sidebar-backdrop { z-index: 90; top: var(--viewport-top,0px); height: var(--app-height); }
  .history-list .history-archive { opacity: 1; }
  .chat-notice { left: 50%; }
}
@media (max-width:680px) {
  .site-home-link { min-height: 36px; padding: 0 10px; font-size: 11px; }
  .site-home-link span { font-size: 14px; }
  .starter { width: 100%; padding: 28px 20px; }
  .starter-logo { width: 42px; height: 42px; margin-bottom: 10px; }
  .starter h1 { font-size: 30px; }
  .starter p.starter-eyebrow { font-size: 10px; margin-bottom: 10px; }
  .starter p:not(.starter-eyebrow) { max-width: 310px; font-size: 13px; margin-top: 12px; line-height: 1.6; }
  .chat-mode-tabs { margin-top: 20px; }
  .chat-mode-tabs { gap: 2px; }
  .chat-mode-tabs :is(button,a) { padding: 8px 10px; min-height: 40px; font-size: 11px; }
  .starter-grid { gap: 8px; margin-top: 18px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .starter-card { display: flex; gap: 8px; min-height: 76px; padding: 11px; border-radius: 12px; }
  .starter-card .starter-symbol { font-size: 15px; margin-bottom: 0; }
  .starter-card strong { font-size: 12px; }
  .starter-card .starter-copy > span { font-size: 11px; -webkit-line-clamp: 1; }
  .starter p.starter-about { font-size: 9px; }
  .conversation { width: 100%; padding: 24px 16px 40px; scrollbar-gutter: auto; }
  .message { grid-template-columns: 22px minmax(0,1fr); gap: 9px; }
  .message.user { padding-left: 24px; }
  .avatar { width: 22px; height: 22px; }
  .bubble { font-size: 15px; line-height: 1.75; }
  .message.user .message-content { max-width: 100%; }
  .message.user .bubble { padding: 10px 14px; }
  .composer, body.sidebar-collapsed .composer { width: calc(100% - 24px); padding: 6px 0 max(8px,env(safe-area-inset-bottom)); }
  .composer .input-row { grid-template-columns: 44px minmax(0,1fr) auto 44px; gap: 0 3px; padding: 5px; }
  .attach-btn, .send-btn, .stop-btn { width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; }
  .composer-options-trigger, .message-actions button, .message-actions select { min-height: 44px; }
  .code-toolbar button { min-height: 44px; }
  .composer .input-row textarea { min-height: 28px; font-size: 16px; padding: 2px; }
  .composer-hint { font-size: 9px; margin-top: 6px; }
  .composer .composer-options-trigger { font-size: 10px; max-width: 92px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
  .character-count { position: absolute; top: -14px; right: 8px; font-size: 9px; }
  .request-status { font-size: 11px; }
  .attach-menu, .composer-options-menu { max-height: max(140px,calc(var(--app-height) - var(--composer-height) - 80px)); }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width:380px) {
  .chat-mode-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; border-radius: 20px; }
}

/* Keep public navigation visible while the conversation scrolls independently. */
body.has-global-nav{--global-nav-height:52px}
.chat-global-header{position:fixed;top:var(--viewport-top,0px);left:0;right:0;height:var(--global-nav-height);display:flex;align-items:center;gap:24px;padding:0 22px;background:#101212;border-bottom:1px solid #30332d;z-index:150;box-sizing:border-box}
.chat-global-brand img{width:24px;height:24px}
.chat-global-brand{display:flex;align-items:center;gap:9px;white-space:nowrap;font-size:14px;font-weight:700;color:#f0eee5;text-decoration:none;flex-shrink:0}
.chat-global-links{display:flex;align-items:center;gap:4px;min-width:0;flex:1;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#51472f transparent;height:100%}
.chat-global-links a{display:flex;align-items:center;flex:0 0 auto;padding:10px 11px;white-space:nowrap;border-radius:8px;color:#c7c9bf;font-size:12px;text-decoration:none}
.chat-global-links a:hover,.chat-global-links a[aria-current]{background:#2c2b20;color:#f2d695}
.chat-global-account{flex-shrink:0;padding:10px 14px;border:1px solid #615332;border-radius:10px;white-space:nowrap;color:#ead6a4;font-size:12px;text-decoration:none}
.chat-global-languages{display:flex;gap:2px;align-items:center;flex-shrink:0}
.chat-global-languages button{min-width:30px;min-height:36px;padding:5px 3px;border:0;border-radius:7px;background:transparent;color:#aab0a7;cursor:pointer;font:inherit;font-size:10px}
.chat-global-languages button.active,.chat-global-languages button[aria-pressed="true"]{color:#efd298;background:#d7b95f13}
.chat-global-languages button:hover{color:#f1dbad}
.chat-global-languages button:focus-visible{outline:2px solid #d5bb7f;outline-offset:2px}
@media(max-width:640px){.chat-global-languages{gap:0}.chat-global-languages button{min-width:26px;font-size:9px}.chat-global-header{gap:6px}.chat-global-account{max-width:90px;overflow:hidden;text-overflow:ellipsis}}
.has-global-nav .app-shell{top:calc(var(--viewport-top,0px) + var(--global-nav-height))}
@media(max-width:980px){.has-global-nav .sidebar,.has-global-nav .sidebar-backdrop{top:calc(var(--viewport-top,0px) + var(--global-nav-height));bottom:auto;height:var(--app-height)}.chat-global-header{gap:12px;padding:0 12px}.chat-global-brand{font-size:0;gap:0}.chat-global-links a{padding:10px;font-size:12px}.chat-global-account{padding:10px}}
@media(max-width:480px){.chat-global-brand{display:flex}.chat-global-header{gap:8px;padding:0 8px}.chat-global-account{font-size:11px}.chat-global-links a{padding:10px 8px}}

/* A single header: leave the full remaining height to messages and the composer. */
.chat-global-header { gap: 16px; }
.chat-global-links { overflow-y: hidden; }
.chat-global-header > .mobile-menu-btn { display: none; }
.chat-global-header .chat-global-account { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; max-width: 40px; padding: 5px; border-radius: 50%; box-sizing: border-box; }
.chat-global-account .account-nav-label { display: none; }
.chat-global-account .account-entry-icon { display: grid; place-items: center; width: 22px; height: 22px; }
.chat-global-account .account-entry-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
@media(max-width:980px) {
  .chat-global-header { gap: 8px; }
  body.has-global-nav .chat-global-header > .mobile-menu-btn { display: grid; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; color: #e0d4b4; background: transparent; border: 1px solid #3c392e; pointer-events: auto; }
  .site-home-link { min-height: 44px; }
  .history-heading-actions #renameConversation { min-height: 44px; width: 36px; flex-basis: 36px; }
}
/* Mobile chat uses one row; all remaining destinations live in the drawer. */
.chat-mobile-tools { display: none; }
.composer .composer-options-trigger { justify-content: center; width: 32px; max-width: 32px; padding: 0; color: #aaa; }
.composer .input-row { background: #1b1d1c; border-color: #383b37; box-shadow: none; }
.composer .send-btn { background: #d8c28e; color: #161815; }
.composer .send-btn:disabled { background: #30342d; color: #818876; }
.message-actions { gap: 1px; align-items: center; position: relative; color: #a7aaa5; }
.message-actions .reply-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 40px; min-height: 40px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: #a7aaa5; cursor: pointer; list-style: none; box-sizing: border-box; }
.reply-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.message-actions .reply-icon:hover, .reply-menu[open] > .reply-icon { background: #252725; color: #eee; }
.message-actions .reply-icon[aria-pressed="true"], .reply-icon[data-copied] { color: #e5c985; background: #d6b86c14; }
.reply-icon:focus-visible { outline: 2px solid #d5bb7f; outline-offset: -2px; }
.message-actions--image{gap:6px;margin-top:12px}
.message-actions--image .reply-image-save{width:auto;gap:7px;padding-inline:11px;color:#dfc78e;border:1px solid #dfc78e2b;background:#dfc78e08;font-size:12px;font-weight:500;text-decoration:none}
.reply-icon:disabled{opacity:.5;cursor:wait}
.reply-icon.is-busy svg{animation:reply-working 1s ease-in-out infinite alternate}
@keyframes reply-working{to{opacity:.35}}
.reply-share-dialog{width:min(420px,calc(100vw - 32px));padding:20px;border:1px solid #dfc78e36;border-radius:20px;background:#11161c;color:#edf0e9;box-sizing:border-box;max-height:calc(100dvh - 32px);overflow:auto}
.reply-share-dialog::backdrop{background:#000b;backdrop-filter:blur(5px)}
.reply-share-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.reply-share-dialog h2{font-size:17px;margin:0;line-height:1.4}
.reply-share-dialog img{display:block;width:100%;max-height:260px;object-fit:contain;border-radius:10px;background:#080b0f}
.reply-share-dialog p{font-size:13px;line-height:1.7;color:#aeb7c2}
.reply-share-dialog>div{display:flex;flex-wrap:wrap;gap:8px}
.reply-share-dialog button,.reply-share-dialog a[data-share-download]{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;padding:10px 14px;border:1px solid #dfc78e40;border-radius:11px;background:#dfc78e0a;color:#e6d09a;font:inherit;font-size:12px;cursor:pointer;text-decoration:none}
.reply-share-dialog button[data-share-close]{min-width:40px;min-height:40px;padding:4px;border:0;background:transparent;font-size:25px;color:#b9c0c9}
.reply-share-dialog button:disabled{opacity:.5;cursor:wait}
.reply-share-dialog button:focus-visible{outline:2px solid #dfc78e;outline-offset:3px}
.reply-share-dialog [hidden]{display:none!important}
.reply-share-status:empty{display:none}
@media(prefers-reduced-motion:reduce){.reply-icon.is-busy svg{animation:none}}
.reply-menu { position: static; }
.reply-menu > summary::-webkit-details-marker { display: none; }
.reply-popover { position: absolute; z-index: 35; left: 0; bottom: calc(100% + 8px); width: min(304px,100%); max-height: min(340px,50dvh); overflow-y: auto; padding: 10px; background: #202321; color: #dbddd7; border: 1px solid #3b3e39; border-radius: 14px; box-shadow: 0 12px 40px #0008; box-sizing: border-box; }
.reply-menu.opens-below .reply-popover { bottom: auto; top: calc(100% + 8px); }
.reply-popover > button { display: block; text-align: left; width: 100%; min-height: 40px; font-size: 13px; }
.reply-popover > strong { display: block; padding: 5px 9px; font-size: 12px; }
.reply-popover > small { display: block; padding: 8px 9px 4px; color: #a6aba1; font-size: 11px; line-height: 1.5; }
.reply-popover .answer-sources { margin: 8px 0 0; padding: 10px 8px; border-top: 1px solid #3b3e39; }
.reply-popover .answer-sources a { display: block; width: auto; margin-top: 8px; padding: 0; border: 0; background: none; font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; }
.reply-popover .answer-provenance { padding: 4px 8px; margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.history-list .history-archive.archive-confirm { flex-basis: auto; width: auto; padding: 0 10px; font-size: 12px; color: #e9d7ab; background: #33352e; }
@media(max-width:640px) {
  body.has-global-nav { --global-nav-height: 56px; }
  .chat-global-header { display: flex; gap: 4px; padding: 0 8px; }
  body.has-global-nav .chat-global-header > .mobile-menu-btn { border: 0; background: #202321; border-radius: 50%; }
  .chat-global-brand, .chat-global-header .chat-global-languages, .chat-global-links { display: none; }
  .chat-mobile-tools { display: flex; flex: 1; min-width: 0; gap: 4px; }
  .chat-mobile-tools > :is(button,a) { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 0; max-width: 108px; min-height: 44px; padding: 5px 6px; box-sizing: border-box; border: 1px solid #d8c28e24; border-radius: 12px; background: #ffffff04; color: #dfd8c7; font: inherit; font-size: 11px; font-weight: 500; line-height: 1.3; text-align: center; text-decoration: none; white-space: normal; cursor: pointer; }
  .chat-mobile-tools > :is(button,a):hover, .chat-mobile-tools button.active { color: #f2dca9; border-color: #d8c28e55; background: #e1c17912; }
  .chat-mobile-tools > :is(button,a):focus-visible { outline: 2px solid #d5bb7f; outline-offset: -2px; }
  .chat-global-header .site-home-link { flex-shrink: 0; margin-left: auto; min-height: 44px; padding: 0 3px; font-size: 10px; border-color: transparent; background: transparent; gap: 3px; }
  .chat-global-header .site-home-link span { font-size: 12px; }
  .chat-global-header .chat-global-account { width: 36px; height: 36px; min-height: 36px; max-width: 36px; flex-basis: 36px; }
  .composer, body.sidebar-collapsed .composer { width: calc(100% - 20px); padding-top: 4px; }
  .composer .input-row { min-height: 50px; grid-template-columns: 36px minmax(0,1fr) 28px 40px; gap: 0 2px; padding: 3px 4px; border-radius: 27px; }
  .composer .attach-btn { width: 36px; min-height: 44px; height: 44px; }
  .composer .send-btn, .composer .stop-btn { width: 40px; height: 40px; min-height: 40px; align-self: center; }
  .composer .composer-options-trigger { width: 28px; max-width: 28px; height: 44px; min-height: 44px; padding: 0; align-self: center; }
  .composer-hint { font-size: 8px; line-height: 1.4; margin-top: 4px; }
  .message.assistant { grid-template-columns: minmax(0,1fr); gap: 0; }
  .message.assistant > .avatar { display: none; }
  .chat-area .message-actions { gap: 0; }
  .message-actions .reply-icon { width: 40px; height: 44px; min-height: 44px; padding: 11px; }
  .reply-popover > button { min-height: 44px; }
  .chat-global-header > .mobile-menu-btn::before { width: 18px; height: 10px; background: transparent; mask: none; -webkit-mask: none; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
}
@media(max-width:360px) { .chat-area .message-actions .reply-icon { width: 36px; padding: 9px; } }
/* Mobile drawer: history owns the available space; account details stay compact. */
@media (max-width:980px) {
  body.has-global-nav .sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 10px 12px max(8px,env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow: hidden;
  }
  body.has-global-nav .sidebar .sidebar-head {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    width: auto;
    margin: 0 0 8px;
  }
  body.has-global-nav .sidebar .new-chat {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 0 10px;
    margin: 0;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    border-radius: 10px;
  }
  body.has-global-nav .sidebar .new-chat span:not(.ui-icon) { display: inline !important; }
  body.has-global-nav .sidebar .sidebar-toggle { flex: 0 0 36px; width: 36px; height: 44px; min-height: 44px; padding: 0; border-radius: 9px; }
  body.has-global-nav .sidebar .history-section { display: flex !important; flex: 1 1 0; min-height: 96px; margin: 0 0 8px; overflow: hidden; }
  body.has-global-nav .sidebar #historySearch { height: 40px; min-height: 40px; padding: 8px 10px; font-size: 16px; }
  body.has-global-nav .sidebar .history-heading { flex: 0 0 auto; display: flex !important; padding: 4px 2px; min-height: 40px; }
  body.has-global-nav .sidebar .history-label { font-size: 11px; letter-spacing: .01em; }
  body.has-global-nav .sidebar #historyArchiveToggle { min-height: 36px; padding: 4px 6px; font-size: 11px; }
  body.has-global-nav .sidebar #renameConversation { width: 32px; flex-basis: 32px; min-height: 36px; font-size: 17px; }
  body.has-global-nav .sidebar .history-list { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; max-height: none; width: auto; gap: 2px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  body.has-global-nav .sidebar .history-row { min-width: 0; min-height: 40px; border-radius: 8px; }
  body.has-global-nav .sidebar .history-open { display: block; width: auto; min-width: 0; height: 40px; min-height: 40px; padding: 8px; font-size: 12px; font-weight: 400; line-height: 24px; }
  body.has-global-nav .sidebar .history-archive { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 40px; min-height: 40px; padding: 0; font-size: 18px; opacity: 1; }
  body.has-global-nav .sidebar .history-archive.archive-confirm { flex-basis: auto; width: auto; padding: 0 8px; font-size: 11px; }
  body.has-global-nav .sidebar .sidebar-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); flex: 0 0 auto; gap: 6px; padding: 5px 0; }
  body.has-global-nav .sidebar .sidebar-links a { display: flex; align-items: center; min-height: 34px; padding: 4px 2px; font-size: 11px; line-height: 1.4; text-decoration: none; }
  body.has-global-nav .sidebar #exportConversation,
  body.has-global-nav .sidebar #historyPrivacyNote { display: none; }
  body.has-global-nav .sidebar .plan-box { position: relative; display: grid !important; flex: 0 0 auto; gap: 0; padding: 8px 2px; }
  body.has-global-nav .sidebar .plan-box > div { display: grid; gap: 3px; }
  body.has-global-nav .sidebar #chatPlanName { padding-right: 104px; font-size: 12px; line-height: 1.5; }
  body.has-global-nav .sidebar #chatPlanLimit { font-size: 10px; line-height: 1.45; }
  body.has-global-nav .sidebar .plan-credits { margin: 4px 0 0; line-height: 1.4; }
  body.has-global-nav .sidebar #chatPlanCredits { font-size: 11px; line-height: 1.4; }
  body.has-global-nav .sidebar #chatCreditsReset { font-size: 9px; line-height: 1.5; }
  body.has-global-nav .sidebar #chatPlanAction { position: absolute; top: 2px; right: 0; display: flex; align-items: center; min-height: 32px; padding: 4px 2px; max-width: 100px; font-size: 11px; line-height: 1.4; text-decoration: none; text-align: right; }
  body.has-global-nav .sidebar .history-privacy { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 0 8px; padding: 0 2px; font-size: 9px; line-height: 1.4; }
  body.has-global-nav .sidebar .history-privacy :is(button,a) { display: inline-flex; align-items: center; min-height: 24px; margin: 0; }
}

.chat-area .message-actions--image .reply-image-save{width:auto;max-width:none;gap:7px;padding-inline:11px;white-space:nowrap}

.history-import{display:block;width:100%;margin:8px 0;padding:9px 8px;border:1px solid rgba(222,193,127,.16);border-radius:10px;background:transparent;color:var(--muted,#aaa);font-size:11px;line-height:1.4;text-align:left;cursor:pointer}.history-import:hover,.history-import:focus-visible{color:var(--gold,#dec17f);border-color:rgba(222,193,127,.4)}
