/* Local Manrope subset for "Valera AI". The wordmark can paint with the stylesheet. License: fonts/OFL.txt. */
@font-face {
  font-family: "Valera Wordmark";
  src: url("data:font/woff2;base64,d09GMgABAAAAAAa4ABIAAAAADXAAAAZTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGjIbgxYcMD9IVkFSVAZgP1NUQVSBAgBsL2oRCAqDdIMxMINwATYCJAMkCxQABCAFhngHIBviC1HUBcrpQoovDmwi0z2wIuAWelnLYesl/+xl0WsrCt7HeIBSv6Qjot+v7Hkfd0MACskC+3NBF3s6SCoq5aO3/NUJHUcqMv778OvqrZHsI/l35lDB7CSESqRLjJfa8Pz7Gzv38dl+JFIonUpxZkJ1jmIJopshNFt0/sAu/4UR7hqlq4H+ItoX0P8A6AF94n6lG60LVG9brMeTd0WyLqOpBVY/0GXjLV0AJibIBz09oHY9lfAqXhjUy+gEUfHaL8bC3C91+Z+ycEYWFIR/ilgYOygD98KlrA662zwZg+4g/aPQPbqpCehwYfgfgty7kwkIEUSt6EWvZK4LkOXRJTDC1ldCMG0oYdxwrBUNb8CJV+Bnu8OFuUFrhhJbKzLcGFxEdMQ2DlpFpdYYgl5RJV+LRqeHacg0wdheIZyloWvDpkVhm+Lg8SJxKbisT12IjdVg2xZgVLku7Qn03Mh7X03ESN3WJW1DXd/zATyapW0TPj6IlInD1cozjH/g+rW8GA9gQXrI74L+RkWAQH1knMVGXBG9YCkB1mI/OYYoFmC+1VwS5KjQggUW+QAIpMpeUKEoeU2ZIJAu/1MwKndg5hzwI5lXbQQUVFiKI1iK6w5YTImj2ChbsQbd+o0hf4FBpjtkt/UWzBo3VOjoJQlnyKHxcD95fADMAKqNQCSYAaSkInshdRrymrTpyH/SZ0S5AxlnDmVC5mYe1UbIfJFBQmAEFoMxnuIXANTblV+U8+rruqusLm7i4hJ81XyVvFV8FdGIEKRQhAKVkdUqEtsZBqF+l8OXvZ5W2r8Mb/tXSJjsxdfxHTp1HXBezOLatbAOqGaBQhyOcTAk1ADs7/Xcwi73upvAizBvp+lQBx4IxfLLEJG6evLx8KGGG5f1DrrnWABTBvVSG1xb+XU2KnQG89Mqe6XXqtzSgAcBMItjto7SIOnQxvhUU5GniT5iOK5QtxRe3RPSGVTT5F4mFCvKyG8XO34VP7C5Z1/rYoWlJlpKbevexNrhk5Vq6ct8hZaLfp5C3bH/l5uC6S3BE9OCeeVs+c0uV8IXZYPF+dLN3GK9zM2Gq9zBYdm701bObNpcxtxpHZ+43VEi2tdi4Hhx4cf+Q1f/PX8u+x9qPl1rV+qqxWr7OBRqDSkI6Sr1wKM8gM7VD+2TmHm37KkIVHK+CyAFh9SEXaNhG09/jhYFCCLYSQR2A+aRpspMPWy212N4TAA7wA2aANjWbXgBg8X4uBBwoBFERAQQMHg2spiaT0c2tqOvb0dDoYO4ADAUQVF2NvbZ9zJaSwNA1qGEvvFgWDDoBfvZQBNo/hS9rB4A6Kc/CM25ve/EIsEUc/b8T45cUs5hQY/h+Q+Cy0v4s4K8ZLZsWdd62Zhzz1pj3+joPoKpwKZUpLcL0LZcz71QORBEUfwIJ/+P74KKKq7oDMMtycTQ9WITn/gXGldVFOMfKGzHxk5gAY2ekrk3nYwtblkYm14xv/mxqEoDAfS7c7So87lYSS3wSxjG5YYGsbq7B38RpSSc4FNzlZr/W9Ea1EiyYNjw8OkTuFEUzgHRdX/QHG+unTsnfon8n8GK6AEEkLDmjfYiR2k5nCPJc9NGdSundszzRVbY5Qqch01GjRu3yUV4AC+BgQN0e58Exk+a+9cvTkl50ffvQP4P+h/4Pxpn7z8QFl8CQAAAp4pYH/qexQvZf+XGuC4BANzesaJRDPh7/tLyb+ofW/Szh4BWAeF0TR3fQChTrqKj9fyjZsYHfoQng761ZuP6hKpWpSqVvJr2PL0IRqbI3MUXXt9KsCKy8UH1CN+5I7Y6QzHfLCrH/M2sQTRWRxStrdEXL6JNgEqYm6n5iRkvhRyMyjiPUVudKjTmm0VrfQbRmZsf6K3NAYwszC2MbcwrzNGXMeZaWaKYZ3HpXs58m8terklT5hHDBg2hWMSIEi2ZRV06tb99uW4TSAHXJ1yVQh0J9xY7OBuNMmQSEWHhqe4gypSIFGFhg4ax1rQeIb0cHreCkx8yB43pN2DSBEpE2Hijc3s7sVO+ORSiW1nn36Ma/QbRxnQj4oTEixIvVa0i5YqlqvogtcE1lPBwp2ZYqpt0FeMbxY36U/zfMaucoD3W8ILlQrTPMNo4PhoI1n6o40RzTBrTV2BMaELiZ//wJlTteFg6h2dvmOwwAA==") format("woff2");
  font-weight: 400 800;
  font-display: block;
}
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: optional;
}
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-cyrillic.woff2') format('woff2');
  font-weight: 400 800;
  font-display: optional;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
:root {
  color-scheme: dark;
  --page: #151515; --rail: #101010; --panel: #1c1c1c; --field: #242424;
  --line: #343434; --soft-line: #282828; --over: #2c2c2b;
  --ink: #f3f2ee; --muted: #aeaeaa; --dim: #898985; --inverse: #151514;
  --accent: #d6c797; --accent-bg: #29271f; --green: #a7c7aa;
  --error: #f2ac9d; --rail-width: 238px; --topbar-height: 65px;
  font: 14px/1.5 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #fcfcfa; --rail: #f1f1ee; --panel: #fafaf7; --field: #fff;
  --line: #d7d7d1; --soft-line: #e2e2dc; --over: #e8e8e3;
  --ink: #1b1b19; --muted: #555550; --dim: #686862; --inverse: #fff;
  --accent: #71602f; --accent-bg: #ede9db; --green: #426b49; --error: #973b33;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .5; }
button, a, textarea, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: #93805f77; }
a { color: inherit; text-underline-offset: .2em; }
svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
[hidden] { display: none !important; }
.sprite, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  width: var(--rail-width); flex: none; display: flex; flex-direction: column;
  padding: 18px 12px 12px; background: var(--rail); border-right: 1px solid var(--soft-line);
}
.sidebar-head, .topbar, .trail, .brand, .nav-row, .profile, .balance-chip, .compose-tools,
.tools-left, .tools-right, .tool-pill, .model-button,
.dialog-head, .dialog-tabs, .line, .ledger-row, .file-slot, .answer-head, .msg-actions {
  display: flex; align-items: center;
}
.sidebar-head { justify-content: space-between; padding: 1px 4px 18px 9px; }
.sidebar-controls { display: flex; margin-left: auto; }
.sidebar-controls .icon { width: 30px; }
#topSearch, .collapsed .sidebar-controls { display: none; }
.collapsed #topSearch { display: grid; }
.brand { gap: 6px; font-size: 24px; font-weight: 680; letter-spacing: -.07em; word-spacing: .1em; white-space: nowrap; }
.brand svg { width: 31px; height: 31px; }
.brand, .hero-brand, #modelName, .answer-head > span { font-family: "Valera Wordmark", Manrope, sans-serif; }
.icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); flex: none; }
.icon:hover, .icon:focus-visible { background: var(--over); color: var(--ink); }
.icon.small { width: 29px; height: 29px; }
.icon.small svg { width: 16px; height: 16px; }
.navigation { display: grid; gap: 3px; }
.navigation a { text-decoration: none; }
.nav-row {
  gap: 12px; min-height: 42px; width: 100%; padding: 0 12px;
  text-align: left; border-radius: 11px; font-weight: 550; color: var(--muted);
}
.nav-row:hover, .profile:hover, .history-item:hover { color: var(--ink); background: var(--over); }
.nav-row.new { margin-bottom: 5px; background: var(--field); color: var(--ink); }
.nav-row svg { width: 19px; height: 19px; }
.navigation a:any-link, .navigation a:any-link > span { text-decoration: none; }
kbd { margin-left: auto; font: 10px/1.6 Manrope, sans-serif; letter-spacing: .02em; color: var(--dim); }
.history { flex: 1; min-height: 0; overflow-y: auto; margin-top: 30px; scrollbar-width: thin; scrollbar-gutter: stable; }
.restoring-history :is(#historyList, #moreHistory) { visibility: hidden; }
.history-heading { position: sticky; top: 0; z-index: 1; background: var(--rail); display: flex; justify-content: space-between; align-items: center; padding: 0 3px 2px 9px; }
.history h2 { margin: 0; font-size: 14px; font-weight: 620; color: var(--ink); }
#historyToolsToggle { display: flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 3px; border-radius: 6px; }
#historyToolsToggle svg { width: 15px; height: 15px; color: var(--muted); }
.history-tools { display: flex; gap: 2px; visibility: hidden; }
.history-heading:has(:focus-visible, [aria-expanded="true"]) .history-tools { visibility: visible; }
@media (hover: hover) { .history-heading:hover .history-tools { visibility: visible; } }
@media (hover: none) {
  #historyToolsToggle, .history-tools .icon { min-height: 44px; }
  .history-tools .icon { width: 44px; }
}
.history-tools .icon[aria-expanded="true"], #historyFilters.filtered { background: var(--field); color: var(--ink); }
#deleteAllChats:enabled:is(:hover,:focus-visible) { color: var(--error); }
.side-heading { padding: 8px 12px 4px; }
.history-group:not([hidden]), #projectsSection { margin-bottom: 13px; }
.nav-row.compact-projects { display: none; }
.collapsed .nav-row.compact-projects { display: flex; }
.project-heading, .project-row, .project-open, .project-source, .project-welcome > div, .project-welcome button { display: flex; align-items: center; }
.project-heading { justify-content: space-between; padding: 0 3px 0 12px; min-height: 36px; }
.project-heading h2 button { display: flex; align-items: center; gap: 5px; text-align: left; min-height: 36px; }
#toggleProjects svg { width: 14px; height: 14px; color: var(--muted); }
#toggleProjects[aria-expanded="false"] svg { transform: rotate(-90deg); }
.project-heading #createProject { opacity: 0; pointer-events: none; }
.project-heading:hover #createProject, .project-heading:focus-within #createProject { opacity: 1; pointer-events: auto; }
.project-folder { --project-name-inset: 35px; }
.project-row { min-width: 0; padding-inline-end: 4px; border-radius: 8px; }
.project-row .project-fold { width: var(--project-name-inset); }
.project-row:has(.active), .project-row:hover, .project-row:focus-within { background: var(--over); }
.project-actions { display: none; flex: none; align-items: center; }
.project-row:is(:hover, :focus-within, :has(.project-more[aria-expanded="true"])) .project-actions { display: flex; }
.project-folder.drop-target > .project-row { background: var(--field); outline: 2px solid var(--accent); outline-offset: -2px; }
.project-fold .fold-glyph { display: none; transform: rotate(-90deg); }
.project-fold[aria-expanded="true"] .fold-glyph { transform: none; }
.project-row:is(:hover,:focus-within) .folder-glyph { display: none; }
.project-row:is(:hover,:focus-within) .fold-glyph { display: block; }
.project-open { flex: 1; gap: 7px; min-height: 36px; min-width: 0; text-align: left; font-size: 13px; padding-right: 4px; }
.project-open span, .project-trail { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-open svg, .project-new svg { width: 16px; height: 16px; }
.project-contents { margin-block: 2px 7px; }
.project-contents :is(.history-open, .folder-empty, .project-more-chats) { padding-inline-start: var(--project-name-inset); }
.project-chats .history-item { padding-inline-end: 4px; }
.project-chats .history-item:where(:has(:focus-visible, .history-more[aria-expanded="true"])) { background: var(--over); color: var(--ink); }
.folder-empty { margin: 0; padding: 7px 1px; color: var(--dim); font-size: 13px; }
.project-chats:not(:empty) + .folder-empty { display: none; }
.project-more-chats { min-height: 35px; padding: 4px 1px; color: var(--muted); font-size: 13px; text-align: left; }
.project-more-chats:hover { color: var(--ink); }
.project-trail { max-width: min(22vw, 200px); color: var(--muted); }
.project-trail:hover { color: var(--ink); text-decoration: underline; }
.chat-body.idle.project-home { justify-content: flex-start; }
.project-home .compose-region { width: min(100% - 36px, 710px); padding-top: clamp(22px, 4vh, 48px); }
.project-welcome { margin: 0 0 23px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-welcome > div { gap: 12px; min-width: 0; }
.project-welcome h1 { margin: 0; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -.04em; overflow-wrap: anywhere; line-height: 1.2; }
.project-welcome > div svg { width: 28px; height: 28px; }
.project-welcome button { gap: 8px; }
.project-welcome button svg, .project-source svg { width: 16px; height: 16px; }
.project-welcome > div:first-child svg { flex: none; }
.project-welcome .project-home-actions { flex: none; gap: 7px; }
.project-home-actions button { border: 1px solid var(--line); border-radius: 99px; color: var(--ink); justify-content: center; height: 36px; }
.project-home-actions .share-current { padding-inline: 12px; }
.workspace-tabs { display: flex; gap: 6px; align-items: center; margin: 23px 0 16px; }
.workspace-tabs :is(a,button) { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 15px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 550; }
.workspace-tabs :is([aria-selected="true"],[aria-current="page"],a:hover,button:hover) { color: var(--ink); background: var(--over); }
.project-blank { display: grid; align-content: center; justify-items: center; min-height: clamp(180px, 44vh, 390px); gap: 5px; text-align: center; color: var(--muted); }
.project-blank strong { color: var(--ink); font-size: 16px; font-weight: 550; }
.project-blank p { margin: 0; overflow-wrap: anywhere; }
.source-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.source-actions button, .project-resource { display: flex; align-items: center; gap: 8px; }
.source-actions svg, .project-resource svg { width: 17px; height: 17px; flex: none; }
.project-resource { padding: 12px 4px; border-bottom: 1px solid var(--soft-line); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.project-resource:hover { text-decoration: underline; }
.project-notes { margin-bottom: 15px; }
.project-notes h2 { font-size: 15px; }
.project-notes p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.project-rooms .history-item { border-bottom: 1px solid var(--soft-line); }
.project-rooms .history-open { min-height: 45px; }
.project-home .composer { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto auto auto; align-items: center; gap: 0 3px; border-radius: 27px; padding: 6px; }
.project-home .composer :is(.compose-tools,.tools-left,.tools-right) { display: contents; }
.project-home :is(#attach,#prompt,#web,#chooseModel,#dictate,#send) { grid-row: 2; }
.project-home #attach { grid-column: 1; }
.project-home #prompt { grid-column: 2; min-height: 30px; height: 30px; padding: 3px 4px; }
@supports (field-sizing: content) {
  .project-home #prompt { field-sizing: content; height: auto; max-height: 140px; }
}
.project-home #web { grid-column: 3; width: 32px; padding: 0; }
.project-home #web[aria-pressed="false"] { display: none; }
.project-home #web span { display: none; }
.project-home #chooseModel { grid-column: 4; }
.project-home #dictate { grid-column: 5; }
.project-home #send { grid-column: 6; }
.project-home .file-slot { grid-column: 1/-1; grid-row: 1; }
.project-home .mic-monitor { grid-column: 1/-1; grid-row: 3; }
.chat-body.idle.project-home .composer-feedback { min-height: 0; }
@container composer (max-width: 450px) {
  .project-home #modelName { display: none; }
  .project-home #brainBadge { font-size: 13px; }
  .project-home .composer { gap: 0; }
}
.project-form, .share-controls { display: grid; gap: 12px; }
.project-form :is(.field,p), .share-controls :is(.field,p) { margin: 0; }
.project-form :is(input,select,textarea) { width: 100%; min-width: 0; }
.project-form .helper, .share-controls .helper { color: var(--muted); }
.project-source { gap: 8px; min-width: 0; }
.project-source a { overflow-wrap: anywhere; }
.project-source .icon { margin-left: auto; }
.project-source.marked a { text-decoration: line-through; color: var(--dim); }
.share-chat-title { overflow-wrap: anywhere; }
.share-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(170px,100%),1fr)); gap: 8px; }
.share-actions > * { display: inline-flex; justify-content: center; align-items: center; text-align: center; text-decoration: none; }
@media (hover:none), (pointer:coarse), (max-width:680px) {
  .project-folder { --project-name-inset: 44px; }
  .project-heading #createProject { opacity: 1; pointer-events: auto; }
  .project-actions { display: flex; }
  .project-heading #createProject, .project-actions .icon, .project-chats .history-more { width: 38px; height: 42px; }
  .project-heading h2 button, .project-fold, .project-open, .project-chats .history-open { min-height: 42px; }
}
.history-empty { color: var(--dim); font-size: 12px; margin: 10px 12px; line-height: 1.65; }
#resetHistoryFilter { display: block; margin-top: 4px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.history-item {
  display: flex; width: 100%; text-align: left; padding: 0 2px 0 0;
  font-size: 13px; color: var(--muted); border-radius: 8px; align-items: center;
}
.history-open { display: flex; align-items: center; flex: 1; min-width: 0; gap: 7px; text-align: left; padding: 9px 4px 9px 12px;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.shell:has(.project-folder) .history-open { cursor: grab; }
.history-item.dragging { opacity: .55; }
.chat-drag-preview { position: fixed; z-index: 8; left: 0; top: 0; pointer-events: none; max-width: min(200px, 70vw);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 12px; border-radius: 9px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 18px #0004; font-size: 13px; }
.history-open:focus-visible { outline-offset: -2px; border-radius: 8px; }
.history-item[data-busy] .history-open::after {
  content: ""; width: 11px; height: 11px; flex: 0 0 11px; margin-left: auto;
  border: 1.5px solid var(--line); border-top-color: currentColor; border-right-color: currentColor;
  border-radius: 50%; animation: history-pending .85s linear infinite;
}
@keyframes history-pending { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .history-item[data-busy] .history-open::after { animation: none; }
}
.history-more { opacity: 0; }
.history-item:hover .history-more, .history-item:focus-within .history-more, .history-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .history-more { opacity: 1; } }
#historyMenu { position: fixed; z-index: 6; width: min(216px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; }
#historyMenu.filter-menu { width: min(242px, calc(100vw - 16px)); }
#historyMenu[aria-label="Действия с проектом"] { width: min(238px, calc(100vw - 16px)); padding: 8px; }
#historyMenu[aria-label="Действия с проектом"] button:nth-child(5) { position: relative; margin-top: 11px; }
#historyMenu[aria-label="Действия с проектом"] button:nth-child(5)::before { content: ""; position: absolute; top: -6px; inset-inline: 6px; border-top: 1px solid var(--line); }
#historyMenu .selection-mark { margin-left: auto; color: var(--ink); }
#historyMenu .filter-back { color: var(--muted); }
#historyMenu .filter-back svg { transform: rotate(90deg); }
#moreHistory { margin: 7px 10px; }
.danger-text, #historyMenu .danger-text svg { color: var(--error); }
.confirm-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 20px; }
.confirm-actions button { width: 100%; min-width: 0; min-height: 42px; }
.confirm-actions .form-error { grid-column: 1/-1; grid-row: 1; }
.confirm-actions .primary { background: #9d3b31; color: white; }
.delete-detail { color: var(--muted); overflow-wrap: anywhere; }
.history-item span, .trail #chatTitle, .profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item.active { background: var(--field); color: var(--ink); }
.history-item svg { width: 13px; height: 13px; }
.image-price { margin: 6px 0; color: var(--muted); font-size: 12px; text-align: center; }
.sidebar-foot { position: relative; padding-top: 12px; }
.account-menu { position: absolute; z-index: 5; bottom: 53px; left: 0; width: min(222px, calc(100vw - 32px)); }
.account-menu-list {
  display: grid; gap: 2px; padding: 6px; max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 10px 36px #0004;
}
.account-menu-list a, .account-menu-list button {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 8px 10px;
  border-radius: 9px; font-size: 13px; text-align: start; text-decoration: none; line-height: 1.4;
}
.account-menu-list a:hover, .account-menu-list button:hover, .account-menu-list :focus-visible,
.account-menu-list [aria-expanded="true"] { background: var(--over); }
.account-menu-list svg { width: 17px; height: 17px; color: var(--muted); }
.account-menu-list .towards { width: 14px; margin-left: auto; transform: rotate(-90deg); }
.account-menu-list hr { width: calc(100% - 12px); margin: 4px auto; border: 0; border-top: 1px solid var(--line); }
.workspace-choice span, #workspaceToggle span, #accountToggle small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-choice svg:last-child:not(:first-child) { margin-left: auto; flex: none; }
.workspace-choice[aria-pressed="true"] { background: var(--over); }
.family-context { display: block; width: fit-content; max-width: 100%; margin: 0 0 7px; color: var(--muted); font-size: 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-context:hover { color: var(--ink); }
.help-menu { position: absolute; bottom: 0; left: calc(100% + 5px); width: 300px; }
.workspace-menu { position:absolute; top:0; left:100%; width:230px; }
#workspaceChoices:empty { display:none; }
#workspaceToggle .towards { flex:none; }
#helpBack,#workspaceBack { display: none; }
.wallet-link { margin-bottom: 9px; }
.wallet-link svg { color: var(--accent); }
.wallet-link b { margin-left: auto; color: var(--dim); font-weight: 400; }
.profile { width: 100%; border-top: 1px solid var(--soft-line); gap: 10px; padding: 13px 8px 3px; text-align: left; }
.avatar {
  --sky: #46443f; --face: #efd8a0;
  width: 35px; aspect-ratio: 1; border-radius: 50%; flex: none; display: grid; place-items: center;
  position: relative; overflow: hidden; background: var(--sky); color: #302d26;
}
.avatar[data-avatar="guest"] { background: var(--field); color: var(--muted); }
.avatar[data-palette="1"] { --sky: #51445f; --face: #e3c8ff; }
.avatar[data-palette="2"] { --sky: #3d594c; --face: #c4e5c3; }
.avatar[data-palette="3"] { --sky: #61433d; --face: #ffc6a8; }
.avatar[data-palette="4"] { --sky: #3d5164; --face: #b4dbf7; }
.avatar[data-palette="5"] { --sky: #624052; --face: #f7c4d9; }
.avatar[data-palette="6"] { --sky: #405b57; --face: #aee4db; }
.avatar[data-palette="7"] { --sky: #56513d; --face: #e8e4a5; }
.avatar-face {
  display: block; position: relative; width: 66%; height: 48%; margin-top: 7%;
  color: #343039; border-radius: 28% 28% 39% 39%;
  background: radial-gradient(ellipse at 30% 43%, currentColor 0 7%, transparent 8%),
              radial-gradient(ellipse at 70% 43%, currentColor 0 7%, transparent 8%), var(--face);
}
.avatar-face::before, .avatar-face::after { content: ""; position: absolute; }
.avatar-face::before { width: 15%; height: 31%; bottom: 92%; left: 42%; background: var(--face); border-radius: 70% 70% 0 0; }
.avatar-face::after { width: 22%; height: 15%; left: 39%; top: 62%; border-bottom: 2px solid; border-radius: 0 0 50% 50%; }
.avatar[data-shape="1"] .avatar-face { border-radius: 50% 48% 32% 32%; }
.avatar[data-shape="1"] .avatar-face::before { left: 17%; transform: rotate(-31deg); }
.avatar[data-shape="2"] .avatar-face { border-radius: 45% 45% 48% 48%; }
.avatar[data-shape="2"] .avatar-face::before { width: 66%; height: 24%; left: 17%; bottom: 83%; border-radius: 50%; }
.avatar[data-shape="3"] .avatar-face { border-radius: 18% 40% 26% 40%; }
.avatar[data-shape="3"] .avatar-face::before { left: 64%; transform: rotate(25deg); }
.profile > span:nth-child(2) { display: grid; min-width: 0; }
.profile strong { font-size: 13px; font-weight: 600; }
.profile small { font-size: 11px; color: var(--dim); }
.profile > svg { margin-left: auto; width: 18px; color: var(--dim); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar { height: var(--topbar-height); flex: none; padding: 0 26px; gap: 12px; justify-content: space-between; }
.header-actions, .share-current { display: flex; align-items: center; flex: none; gap: 8px; }
.share-current { gap: 6px; min-height: 34px; padding: 4px 9px; color: var(--muted); font-size: 13px; border-radius: 10px; }
.share-current:hover, .share-current:focus-visible { background: var(--over); color: var(--ink); }
.share-current svg { width: 17px; height: 17px; }
@media (max-width:680px) {
  .header-actions { gap: 2px; }
  .share-current { justify-content: center; width: 36px; min-height: 42px; padding: 0; }
  .share-current span { display: none; }
}
.trail { gap: 10px; min-width: 0; font-size: 13px; letter-spacing: -.01em; }
.trail-base, .slash { color: var(--dim); }
.trail #chatTitle { min-width: 0; }
#expand { display: none; }
.balance-chip {
  border: 1px solid var(--line); border-radius: 22px; padding: 5px 6px 5px 10px;
  font-size: 12px; font-weight: 650; gap: 7px; flex: none;
}
.balance-chip:hover { background: var(--over); }
.balance-chip > svg { width: 18px; height: 18px; color: var(--accent); }
.badge-plus { display: grid; place-items: center; width: 21px; height: 21px; font-size: 16px; border-radius: 50%; background: var(--field); }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-body.idle { justify-content: center; overflow-y: auto; }
.compose-region {
  container: composer / inline-size; --composer-control-size: 40px;
  width: min(100% - 60px, 744px); margin: 0 auto; flex: none;
}
.idle .compose-region { padding-bottom: clamp(20px, 8vh, 86px); }
.chat-body:not(.idle) .compose-region { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.welcome { text-align: center; margin: 0 0 31px; }
.hero-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  margin: 0; font-size: clamp(58px, 5.4vw, 81px); line-height: 1.05; font-weight: 620; letter-spacing: -.083em;
}
.hero-brand svg { width: .99em; height: .99em; }
.hero-brand span { transform: skew(-5deg); padding-right: .08em; word-spacing: .1em; white-space: nowrap; }
.composer {
  border: 1px solid var(--line); border-radius: 25px; background: var(--field);
  padding: 16px 14px 11px; box-shadow: 0 3px 14px #0000000e;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--line) 60%, var(--dim)); }
.composer textarea {
  display: block; width: 100%; height: 54px; max-height: 150px; min-height: 48px; resize: none;
  padding: 2px 6px; background: none; border: 0; outline: 0; font-size: 16px; line-height: 1.5;
}
.composer textarea::placeholder { color: var(--muted); }
.compose-tools { justify-content: space-between; gap: 8px; }
.tools-left, .tools-right { gap: 4px; min-width: 0; }
.tools-left { flex: none; }
.tools-right { justify-content: flex-end; }
.compose-tools .icon, .send { width: var(--composer-control-size); height: var(--composer-control-size); }
.tool-pill, .model-button {
  height: var(--composer-control-size); justify-content: center; gap: 6px; border-radius: 999px; padding: 0 10px;
  color: var(--muted); font-size: 13px; line-height: 1.25; font-weight: 550; white-space: nowrap;
}
.model-button, #modelName { min-width: 0; }
#modelName { overflow: hidden; text-overflow: ellipsis; }
.tool-pill:hover, .model-button:hover, .tool-pill[aria-pressed="true"] { background: var(--over); color: var(--ink); }
.tool-pill[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--dim); }
.tool-pill svg { width: 16px; height: 16px; }
.model-button svg { width: 14px; height: 14px; }
#brainBadge { min-width: 1.4em; text-align: center; color: var(--dim); font-size: 11px; font-weight: 700; white-space: nowrap; }
#brainBadge:empty::before { content: var(--initial-badge, "I"); }
:root:not(.has-dictation) #dictate { display: none; }
.model-button[aria-expanded="true"] { background: var(--over); color: var(--ink); }
.brain-picker {
  position: fixed; z-index: 4; width: min(318px, calc(100vw - 16px)); max-height: calc(100dvh - 16px);
  overflow: auto; overscroll-behavior: contain; padding: 10px 13px 12px; border: 1px solid var(--line);
  border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: 0 10px 32px #0004;
}
.brain-head { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: start; gap: 6px; }
.brain-heading { display: grid; gap: 3px; padding: 4px 3px; }
.brain-heading strong { font-size: 16px; line-height: 1.3; letter-spacing: -.025em; }
.brain-heading span { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.brain-control { min-height: 42px; width: 42px; display: inline-grid; align-content: center; justify-items: center; gap: 1px; border-radius: 11px; color: var(--muted); }
.brain-control svg { width: 19px; height: 19px; }
.brain-control:hover, .brain-control:focus-visible { background: var(--over); color: var(--ink); }
.brain-slider { --fill: 14px; position: relative; display: grid; align-items: center; height: 44px; margin: 5px 0 4px; }
.brain-slider[data-level="2"] { --fill: 50%; }
.brain-slider[data-level="3"] { --fill: calc(100% - 14px); }
.brain-slider.inactive { opacity: .38; }
.brain-track { position: absolute; inset-inline: 0; height: 24px; top: 10px; overflow: hidden; border-radius: 20px; background: var(--line); }
.brain-ticks { position: absolute; inset: 0 12px; display: flex; align-items: center; justify-content: space-between; }
.brain-ticks i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.brain-track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--fill); background: var(--ink); }
#brainRange { appearance: none; -webkit-appearance: none; cursor: pointer; position: relative; width: 100%; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 18px; background: transparent; }
#brainRange:disabled { cursor: default; }
#brainRange::-webkit-slider-runnable-track { height: 28px; background: transparent; }
#brainRange::-webkit-slider-thumb { appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); border: 1px solid #80808030; box-shadow: 0 1px 3px #0002; }
#brainRange::-moz-range-track { height: 28px; background: transparent; }
#brainRange::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); border: 1px solid #80808030; box-shadow: 0 1px 3px #0002; }
.brain-levels { display: flex; justify-content: space-between; margin: -6px 0 7px; }
.brain-levels button { min-height: 30px; font-size: 12px; color: var(--dim); padding: 0 3px; }
.brain-levels button[aria-pressed="true"] { color: var(--ink); font-weight: 650; }
.brain-price { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 3px 0; border-top: 1px solid var(--line); }
.brain-price span { color: var(--muted); font-size: 12px; }
.brain-price strong { font-size: 14px; font-variant-numeric: tabular-nums; }
#brainStatus { margin: 9px 3px 0; }
.memory-note { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.memory-note > span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-note button { flex: none; }
dialog[data-panel="memory"] #dialogBody > button { display: block; margin-top: 14px; }
.send {
  background: var(--ink); color: var(--inverse); flex: none;
  display: grid; place-items: center; border-radius: 50%;
}
.send:disabled { background: var(--over); color: var(--muted); opacity: .95; }
.dictate[aria-pressed="true"] { color: var(--accent); background: var(--accent-bg); }
.mic-monitor { display: flex; align-items: center; gap: 12px; min-height: 30px; margin: 2px 6px 8px; color: var(--accent); }
.mic-monitor span { font-size: 12px; font-weight: 600; }
.mic-monitor canvas { width: min(45%, 150px); height: 24px; }
.stop-square { width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.composer-feedback { display: flow-root; }
.idle .composer-feedback { min-height: calc(var(--composer-control-size) + 12px); }
.ideas {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  width: min(100%, 31.5rem); margin: 12px auto 0;
}
.ideas button, .soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 20px; font-size: 12px; font-weight: 550;
}
.ideas button {
  min-width: 0; min-height: var(--composer-control-size); padding: 7px 10px; border-radius: 999px;
  color: var(--muted); font-size: 13px; line-height: 1.25; text-align: center;
}
.ideas button:hover, .soft:hover { color: var(--ink); background: var(--over); }
.ideas svg { width: 15px; height: 15px; }
.compose-error, .form-error { font-size: 13px; color: var(--error); overflow-wrap: anywhere; }
.compose-error {
  margin: 12px 0 0; padding: 9px 14px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--error) 24%, var(--line));
  background: color-mix(in srgb, var(--error) 5%, var(--page));
}
.compose-error:not([hidden]) + .ideas, .form-error:empty { display: none; }
.form-error { margin: 8px 0; }
.file-slot { width: fit-content; max-width: 100%; gap: 6px; margin: 0 4px 8px; background: var(--over); border-radius: 8px; padding: 1px 2px 1px 9px; font-size: 12px; overflow-wrap: anywhere; }
.conversation { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; overflow-anchor: none; }
#chatLoading { text-align: center; margin: 26px 0; font-size: 13px; color: var(--muted); }
.opening-chat #welcome, .opening-chat #ideas { display: none; }
.opening-chat #chatTitle { visibility: hidden; }
.opening-chat .chat-body.idle { justify-content: flex-end; overflow: hidden; }
.opening-chat .idle .compose-region { padding-bottom: 0; }
#messages { width: min(100% - 64px, 736px); margin: auto; padding: 26px 0 16px; }
.turn { margin: 0 0 30px; }
.question { text-align: right; }
.bubble { display: inline-block; background: var(--field); border-radius: 18px; padding: 11px 16px; text-align: left; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer { margin-top: 23px; }
.answer-head { gap: 8px; font-weight: 700; font-size: 13px; }
.answer-head svg { width: 24px; height: 24px; }
.answer-head small, .msg-actions, .file-caption, .turn-state, .helper { color: var(--muted); font-size: 12px; font-weight: 450; }
.interaction-card { margin: 12px 0 4px; overflow-wrap: anywhere; }
.followup-form, .followup-summary { display: grid; gap: 17px; max-width: 570px; margin: 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.followup-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.followup-field + .followup-field { padding-top: 4px; }
.followup-field legend, .followup-summary dt { padding: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.followup-options, .quick-replies { display: flex; flex-wrap: wrap; gap: 7px; }
.followup-options { margin-top: 9px; }
.followup-hint { display: block; margin-top: 3px; color: var(--muted); }
.followup-choice, .quick-reply { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-size: 13px; text-align: start; }
.followup-choice { cursor: pointer; }
.followup-choice input { flex: none; width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.followup-choice:has(:checked) { background: var(--accent-bg); border-color: var(--accent); }
.followup-choice:has(:focus-visible), .quick-reply:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.followup-choice:hover, button.quick-reply:hover { background: var(--over); }
.followup-text { display: block; resize: vertical; width: 100%; min-height: 54px; margin-top: 9px; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 10px; }
.followup-send { justify-self: start; }
.followup-summary { gap: 3px; }
.followup-summary dt:not(:first-child) { margin-top: 9px; }
.followup-summary dd { margin: 0; color: var(--muted); white-space: pre-wrap; }
.past-choice { color: var(--muted); }
.past-choice svg { width: 15px; height: 15px; }
@media (max-width: 680px) {
  .followup-form, .followup-summary { padding: 14px; }
  .followup-text { font-size: 16px; }
  .followup-send { justify-self: stretch; }
  .followup-choice, button.quick-reply, .followup-form .primary { min-height: 44px; }
}
.md { min-width: 0; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.answer > .md { margin: 11px 0; }
.bubble.md { white-space: normal; font-size: inherit; text-align: start; }
.bubble.md:has(.chat-chart) { width: min(88%, 620px); }
.md.plain-message { white-space: pre-wrap; }
.md p, .md ul, .md ol { margin: .7em 0; }
.md :is(h1,h2,h3,h4,h5,h6) { margin: 1em 0 .35em; line-height: 1.32; letter-spacing: -.022em; }
.md h1 { font-size: 1.72em; } .md h2 { font-size: 1.42em; } .md h3 { font-size: 1.22em; }
.md h4 { font-size: 1.08em; } .md h5, .md h6 { font-size: 1em; } .md h6 { color: var(--muted); }
.md ul, .md ol { padding-inline-start: 1.6em; }
.md li { margin: .18em 0; }
.md li > :is(ul,ol,p) { margin-block: .22em; }
.md .task-item { list-style: none; }
.task-item > input, .task-item > p > input { width: 1em; height: 1em; margin: 0 .45em 0 -1.45em; vertical-align: -.08em; accent-color: var(--accent); }
.md blockquote { margin: .9em 0; border-inline-start: 3px solid var(--dim); padding-inline-start: 14px; color: var(--muted); }
.md hr { height: 1px; margin: 1.2em 0; border: 0; background: var(--line); }
.md a { text-decoration: underline; text-underline-offset: 3px; }
.md code { font: .9em/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--over); border-radius: 4px; padding: .08em .3em; }
.code-block { max-width: 100%; margin: 12px 0; background: var(--rail); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 10px 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.copy-code { display: inline-flex; align-items: center; gap: 5px; color: inherit; min-height: 32px; padding: 0 5px; }
.copy-code:hover { color: var(--ink); }
.copy-code svg { width: 14px; height: 14px; }
.md pre { margin: 0; padding: 12px 14px; overflow: auto; white-space: pre; overflow-wrap: normal; tab-size: 4; scrollbar-width: thin; }
.md pre code { font-size: 13px; background: none; padding: 0; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; overscroll-behavior-x: contain; scrollbar-width: thin; }
.md table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.5; }
.md th, .md td { min-width: 5ch; max-width: min(32ch, 65vw); padding: 8px 12px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); text-align: start; vertical-align: top; }
.md thead th { background: var(--field); font-weight: 650; }
.md tbody th { font-weight: 550; }
.md tr > :last-child { border-inline-end: 0; }
.md tbody tr:last-child > * { border-bottom: 0; }
.md .align-left { text-align: left; } .md .align-center { text-align: center; } .md .align-right { text-align: right; }
.chat-chart { margin: 14px 0; padding: 15px; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; text-align: start; }
.chat-chart figcaption { margin: 0 0 12px; font-weight: 650; line-height: 1.4; }
valera-plot { display: block; position: relative; height: clamp(210px, 38vw, 300px); min-width: 0; }
valera-plot canvas { display: block; max-width: 100%; }
.chart-data { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.chart-data summary, .chart-fallback summary { width: fit-content; padding: 5px 0; cursor: pointer; color: var(--muted); font-size: 13px; }
.chart-data .table-scroll { margin: 6px 0 0; }
.md .chart-pending { display: grid; min-height: 190px; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; }
.md > :first-child, .md blockquote > :first-child { margin-top: 0; }
.md > :last-child, .md blockquote > :last-child { margin-bottom: 0; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.sources a { font-size: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 4px 8px; text-decoration: none; }
.illustration-frame { display: grid; width: min(100%, 500px); margin: 12px 0; border-radius: 16px; background: var(--field); }
.illustration-placeholder, .illustration-link { grid-area: 1 / 1; min-width: 0; border-radius: inherit; }
.illustration-placeholder {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1; display: grid; place-content: center;
  justify-items: center; gap: 11px; padding: 18px; text-align: center; font-weight: 600; font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.illustration-placeholder::before {
  content: ""; position: absolute; z-index: -1; inset: -25%; pointer-events: none;
  background: radial-gradient(ellipse at 27% 26%, #9b81994f, transparent 49%),
              radial-gradient(ellipse at 76% 53%, #628f9754, transparent 48%),
              radial-gradient(ellipse at 32% 79%, #ba9b6547, transparent 44%);
}
.illustration-placeholder svg { width: 30px; height: 30px; color: var(--muted); }
.illustration-link { display: block; align-self: start; }
.illustration-frame[data-format="wide"] .illustration-placeholder { aspect-ratio: 16 / 9; }
.illustration-link[aria-hidden="true"] { opacity: 0; pointer-events: none; }
.generated { display: block; width: 100%; height: auto; border-radius: inherit; }
.illustration-frame[data-phase="failed"] .illustration-placeholder { aspect-ratio: auto; min-height: 120px; }
@media (prefers-reduced-motion: no-preference) {
  .illustration-frame:is([data-phase="drawing"], [data-phase="loading"]) .illustration-placeholder::before {
    animation: illustration-drift 4.5s ease-in-out infinite alternate;
  }
  .illustration-frame[data-phase="ready"] .generated { animation: illustration-reveal .25s ease-out; }
  @keyframes illustration-drift { from { transform: translate(-6%, -4%) scale(1.06); } to { transform: translate(6%, 4%) scale(.94); } }
  @keyframes illustration-reveal { from { opacity: 0; } to { opacity: 1; } }
}
.receipt-link:hover { color: var(--ink); text-decoration: underline; }
.msg-actions { gap: 7px; margin-top: 8px; }
.msg-actions .icon { width: 27px; height: 27px; }
.msg-actions svg { width: 15px; height: 15px; }
.turn-state { display: block; margin-top: 8px; }
.dialog-head { gap: 10px; flex: none; padding: 20px var(--dialog-gutter) 12px; }
#closeDialog { margin-left: auto; }
#walletBack svg { transform: rotate(180deg); }
dialog {
  --dialog-gutter: 24px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  width: min(510px, calc(100vw - 24px)); max-height: min(85dvh, 790px); padding: 0; box-shadow: 0 26px 90px #0005;
  overflow-y: auto; scrollbar-width: thin;
}
dialog.wide { width: min(660px, calc(100vw - 24px)); }
dialog::backdrop { background: #0009; backdrop-filter: blur(4px); }
.dialog-head h2 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.025em; }
#dialogBody { padding: 0 var(--dialog-gutter) 24px; }
.dialog-tabs { flex-wrap: wrap; gap: 4px; padding-bottom: 14px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.dialog-tabs :is(button,a) { padding: 6px 10px; border-radius: 15px; color: var(--muted); font-size: 13px; text-decoration: none; }
.dialog-tabs :is(button,a):hover { background: var(--over); }
.dialog-tabs button.active { background: var(--over); color: var(--ink); }
.wallet-card { position: relative; padding: 20px 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--field); isolation: isolate; }
.wallet-card::after {
  content: ''; position: absolute; width: 230px; height: 230px; border-radius: 50%;
  background: repeating-radial-gradient(ellipse, transparent 0 8px, #a899712a 8.5px 9.5px, transparent 10px 13px);
  right: -54px; top: -65px; transform: rotate(-32deg) scaleX(.69); z-index: -1;
}
.wallet-card .helper { margin: 0; }
.amount { font-size: 42px; font-weight: 600; letter-spacing: -.065em; margin: 4px 0 12px; }
.amount small { font-size: 15px; letter-spacing: -.02em; font-weight: 500; margin-left: 7px; }
.primary, .secondary { min-height: 39px; padding: 8px 17px; border-radius: 12px; font-weight: 650; font-size: 13px; }
.primary { background: var(--ink); color: var(--inverse); }
.primary:hover { opacity: .9; }
.secondary { border: 1px solid var(--line); color: var(--ink); }
.secondary:hover { background: var(--over); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.section-title { font-size: 15px; font-weight: 650; margin: 20px 0 8px; }
.ledger-row, .list-item { border-bottom: 1px solid var(--soft-line); }
.ledger-row { gap: 10px; padding: 11px 0; }
.ledger-row:last-child, .list-item:last-child { border-bottom: 0; }
.ledger-icon { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.ledger-icon svg { width: 16px; }
.ledger-row strong, .ledger-row small { display: block; }
.ledger-row strong, .list-item { font-size: 13px; font-weight: 600; }
.ledger-row small { color: var(--muted); font-size: 11px; }
.ledger-row > b { margin-left: auto; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.pack-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.pack { padding: 12px 8px; border: 1px solid var(--line); border-radius: 13px; text-align: center; }
.pack b, .pack small { display: block; }
.pack b { font-size: 20px; letter-spacing: -.035em; }
.pack small { color: var(--muted); }
.pack.active { background: var(--over); border-color: var(--muted); }
.topup-range { width: 100%; margin: 10px 0 0; height: 28px; accent-color: var(--accent); cursor: pointer; }
.range-stops { display: flex; justify-content: space-between; margin: -3px 8px 18px; color: var(--muted); }
.range-stops > span { position: relative; width: 0; height: 17px; }
.range-stops small { position: absolute; left: 0; top: 3px; transform: translateX(-50%); font-size: clamp(9px, 2.3vw, 11px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.range-stops small::before { content: ""; position: absolute; left: 50%; top: -5px; height: 3px; border-left: 1px solid var(--dim); }
.purchase-total .topup-amount { width: 126px; min-height: 42px; text-align: right; font-size: 17px; font-variant-numeric: tabular-nums; }
.topup-amount[aria-invalid="true"] { border-color: var(--error); }
dialog[open]:has(.payment-footer) { display: flex; flex-direction: column; overflow: hidden; }
dialog:has(.payment-footer) #dialogBody { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.purchase-content { min-height: 0; overflow-y: auto; padding: 0 var(--dialog-gutter) 16px; }
.purchase-content .pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.purchase-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.purchase-total span { font-size: 13px; }
.purchase-total strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.payment-footer {
  flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px;
  padding: 14px var(--dialog-gutter) max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--panel);
}
.payment-footer:has(.form-error:only-child) { display: none; }
.payment-footer .form-error { grid-column: 1 / -1; margin: 0; }
.payment-footer button { display: grid; place-items: center; min-height: 46px; line-height: 1.35; padding: 10px; }
.line { justify-content: space-between; gap: 12px; margin: 10px 0; }
.helper { line-height: 1.65; margin: 8px 0; }
.order-reference { overflow-wrap: anywhere; user-select: all; }
.input, .field input, .field select, .field textarea {
  display: block; width: 100%; min-height: 42px; background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
.field { display: grid; gap: 6px; margin: 13px 0; font-size: 13px; }
.field textarea { resize: vertical; }
.account-identity { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.account-identity .avatar { width: 52px; }
.account-identity > div { min-width: 0; }
.account-identity strong, .account-identity .helper { display: block; overflow-wrap: anywhere; margin: 0; }
.account-identity strong { font-size: 20px; letter-spacing: -.025em; }
.profile-details { border-block: 1px solid var(--line); }
.profile-detail { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 12px; padding: 12px 2px; }
.profile-detail + .profile-detail { border-top: 1px solid var(--soft-line); }
.profile-detail strong, .profile-detail small { display: block; }
.profile-detail strong { font-size: 14px; }
.profile-detail small, .profile-detail svg { color: var(--muted); }
.profile-detail:hover svg { color: var(--ink); }
.profile-detail svg { width: 17px; height: 17px; }
.country-settings { margin-block: 14px; }
.country-settings summary { width: fit-content; cursor: pointer; color: var(--muted); }
dialog[data-panel="search"] { width: min(720px, calc(100vw - 24px)); max-height: min(77dvh, 590px); border-radius: 17px; background: color-mix(in srgb, var(--panel) 97%, var(--ink)); }
dialog[data-panel="search"][open] { display: flex; flex-direction: column; overflow: hidden; }
dialog[data-panel="search"]::backdrop { background: #0008; backdrop-filter: none; }
dialog[data-panel="search"] .dialog-head { padding: 12px 16px 8px 24px; }
dialog[data-panel="search"] #dialogTitle { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
#chatSearch { flex: 1; width: 0; height: 44px; min-width: 0; padding: 0; background: none; border: none; outline: 0; font-size: 19px; color: var(--ink); }
#chatSearch::-webkit-search-cancel-button { display: none; }
dialog[data-panel="search"] #dialogBody { padding: 0 12px 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.search-group h3, .search-results > .helper { font-size: 14px; font-weight: 500; color: var(--muted); margin: 8px 12px 6px; }
.search-group + .search-group { margin-top: 14px; }
.search-group .list-item { width: 100%; min-height: 48px; gap: 16px; border: 0; border-radius: 9px; padding: 9px 14px; text-align: left; }
.search-group .list-item:hover, .search-group .list-item:focus-visible { background: var(--over); }
.search-group .list-item strong { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-group .list-item svg { width: 19px; height: 19px; }
.setup-screen { width: 100%; height: 100vh; height: 100dvh; background: var(--page); }
.setup-form { display: flex; flex-direction: column; height: 100%; margin: 0; }
.setup-header {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(18px, 4vw, 60px) 14px;
}
.setup-exit { min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-size: 13px; }
.setup-exit:hover { background: var(--over); color: var(--ink); }
.setup-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 20px clamp(16px, 8vh, 84px); }
.setup-flow { display: flex; flex-direction: column; width: min(100%, 448px); max-height: 100%; min-height: 0; }
.setup-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.setup-content { display: grid; align-content: start; gap: 12px; padding: 5px 5px 6px; }
.setup-progress, .setup-hint { margin: 0; color: var(--muted); }
.setup-progress { font-size: 13px; font-weight: 600; }
.setup-tracker { display: flex; gap: 5px; width: 92px; margin: -4px 0 10px; }
.setup-tracker i { height: 3px; flex: 1; border-radius: 2px; background: var(--line); }
.setup-tracker .complete { background: var(--accent); }
.setup-content h1 { margin: 0 0 14px; font-size: clamp(32px, 3.5vw, 40px); line-height: 1.15; letter-spacing: -.045em; }
.setup-content h1:focus { outline: none; }
.setup-content .field { min-width: 0; margin: 0; gap: 8px; font-size: 14px; }
.setup-content .field input { width: 100%; min-width: 0; min-height: 50px; font-size: 16px; text-align: start; }
.setup-hint { font-size: 13px; }
.setup-hint.invalid { color: var(--error); }
.setup-actions { flex: none; display: grid; gap: 8px; padding: 20px 5px 5px; }
.setup-actions button { width: 100%; min-height: 46px; border-radius: 12px; padding: 10px 14px; font-size: 14px; text-align: center; }
.setup-actions .form-error { margin: 0; }
.preference-group { min-width: 0; border: 0; margin: 1px 0 3px; padding: 0; }
.preference-group legend { padding: 0; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.preference-options { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { min-height: 38px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 22px; font-size: 13px; }
.choice:hover { background: var(--over); }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--inverse); }
.auth-address { justify-self: start; max-width: 100%; display: flex; align-items: center; gap: 9px; padding: 5px 11px; margin-top: -5px;
  border: 1px solid var(--line); border-radius: 20px; color: var(--muted); }
.auth-address span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-address svg { width: 14px; height: 14px; }
.password-field { position: relative; }
.setup-content .password-field input { padding-inline-end: 84px; }
.password-reveal { position: absolute; right: 3px; top: 3px; bottom: 3px; padding: 0 10px; color: var(--muted); font-size: 12px; }
.auth-switch, .auth-terms { color: var(--muted); }
.auth-switch:hover, .auth-address:hover, .password-reveal:hover { color: var(--ink); background: var(--over); }
.auth-terms { margin: 2px 0 0; font-size: 12px; line-height: 1.6; }
.auth-terms a { text-decoration-color: var(--dim); }
@media (prefers-reduced-motion: no-preference) {
  .setup-screen:not([hidden]) { animation: setup-enter .28s ease-out both; }
  .setup-flow { animation: setup-step .32s cubic-bezier(.22,.7,.25,1) both; }
  @keyframes setup-enter { from { opacity: .15; } to { opacity: 1; } }
  @keyframes setup-step { from { opacity: .1; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}
.list-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 8px; }
.list-item:hover { background: var(--over); }
.list-item > span:last-child:not(:first-child) { margin-left: auto; }
.toast {
  --toast-gap: clamp(12px, 2vw, 20px);
  position: fixed; z-index: 7;
  top: max(var(--toast-top, 0px), calc(env(safe-area-inset-top) + var(--toast-gap)));
  right: calc(env(safe-area-inset-right) + var(--toast-gap));
  width: max-content;
  max-width: min(26rem, calc(100vw - 2 * var(--toast-gap) - env(safe-area-inset-left) - env(safe-area-inset-right)));
  padding: 9px 16px; border-radius: 15px; background: var(--ink); color: var(--inverse);
  font-size: 13px; overflow-wrap: anywhere; pointer-events: none;
}
.shell:not([hidden]) ~ .toast, .shared-bar ~ .toast { --toast-top: calc(var(--topbar-height) + 6px); }
.menu-shade { display: none; }
.collapsed .sidebar { --rail-width: 62px; padding-inline: 8px; }
.collapsed .sidebar-head { padding: 1px 0 18px; justify-content: center; }
.collapsed .brand span, .collapsed #collapse, .collapsed .nav-row span, .collapsed kbd, .collapsed .history,
.collapsed .profile > span:nth-child(2), .collapsed .profile > svg, .collapsed .wallet-link b { display: none; }
.collapsed .nav-row, .collapsed .profile { justify-content: center; }
.collapsed .sidebar-foot { margin-top: auto; }
.collapsed #expand { display: grid; }
@media (max-width: 850px) {
  :root { --rail-width: 198px; }
  .sidebar-head { padding-inline: 2px 0; }
  .sidebar-head .brand { font-size: 21px; gap: 3px; }
  .sidebar-head .brand svg { width: 26px; height: 26px; }
  .sidebar-controls .icon { width: 28px; }
  .topbar { padding: 0 16px; }
  .compose-region, #messages { width: calc(100% - 36px); }
}
@media (max-width: 680px) {
  :root { --topbar-height: 54px; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw);
    z-index: 3; transform: translateX(-100%); visibility: hidden; padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .shell.menu-open .sidebar { visibility: visible; transform: none; }
  .menu-shade { display: block; position: fixed; inset: 0; z-index: 2; background: #0009; }
  #expand, #topSearch { display: grid; }
  .topbar { padding: 0 11px; }
  .trail { gap: 5px; }
  .trail-base, .slash { display: none; }
  .compose-region, #messages { width: calc(100% - 24px); }
  .compose-region { --composer-control-size: 44px; }
  .idle .compose-region { padding-bottom: 8vh; }
  .welcome { margin-bottom: 24px; }
  .hero-brand { font-size: clamp(48px, 16vw, 64px); }
  .composer { border-radius: 21px; padding: 13px 9px 9px; }
  .tools-left, .tools-right { gap: 3px; }
  .tool-pill, .model-button { padding-inline: 6px; }
  .model-button { font-size: 12px; }
  .ideas { gap: 6px; }
  .ideas button { gap: 5px; padding-inline: 5px; font-size: 12px; }
  .account-menu { width: 100%; }
  .account-menu:is(.show-help,.show-workspaces) > nav:first-child { display: none; }
  .help-menu,.workspace-menu { position: static; width: 100%; }
  #helpBack,#workspaceBack { display: flex; }
  #helpBack svg,#workspaceBack svg { transform: rotate(180deg); }
  #messages { padding-inline: 3px; }
  .field input, .field textarea, .field select, .input { font-size: 16px; }
  dialog { --dialog-gutter: 16px; }
  #dialogBody { padding: 0 var(--dialog-gutter) 20px; }
  .dialog-head { padding: 15px var(--dialog-gutter) 9px; }
  .setup-header { padding: max(8px, env(safe-area-inset-top)) 14px 8px; }
  .setup-stage { align-items: stretch; padding: 8px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .setup-flow { max-height: none; }
  .setup-scroll { flex: 1; display: flex; flex-direction: column; }
  .setup-content { flex: none; margin-block: auto; }
  .choice { min-height: 44px; padding-inline: 10px; }
}
@media (max-width: 480px) {
  .payment-footer { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 500px) {
  .sidebar { overflow-y: auto; }
  .sidebar-head, .navigation, .sidebar-foot { flex: none; }
  .history { flex: 1 0 auto; overflow: visible; margin-top: 14px; }
}
@media (max-height: 480px) and (min-width: 520px) {
  .setup-header { padding-block: 4px; }
  .setup-stage { padding-block: 4px max(8px, env(safe-area-inset-bottom)); }
  .setup-content { gap: 8px; }
  .setup-content h1 { margin-bottom: 4px; }
  .setup-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 10px; }
  .setup-actions button:only-of-type, .setup-actions .form-error { grid-column: 1 / -1; }
}
@container composer (max-width: 480px) {
  .tool-pill { width: var(--composer-control-size); padding: 0; }
  .tool-pill span { display: none; }
}
@container composer (max-width: 400px) {
  .ideas button svg { display: none; }
  .model-button { gap: 4px; padding-inline: 3px; }
  #modelName { white-space: normal; text-align: start; line-height: 1.2; }
}
@container composer (max-width: 330px) {
  .compose-tools { gap: 4px; }
  .tools-left, .tools-right { gap: 2px; }
  .ideas button { padding-inline: 2px; }
}
@media (max-width: 390px) {
  .dialog-tabs button { padding-inline: 8px; }
}
@media (max-height: 460px) {
  .idle .compose-region { padding-bottom: 2px; }
  .hero-brand { font-size: 40px; }
  .welcome { margin-bottom: 8px; }
}
