:root{--font:-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;--radius-lg:28px;--radius-md:18px;--sidebar-w:260px}html[data-theme=light],html:not([data-theme]){--bg:#fff;--sidebar:#f9f9f9;--sidebar-hover:#ececec;--ink:#0d0d0d;--muted:#8f8f8f;--line:#e5e5e5;--user-bubble:#f4f4f4;--composer:#fff;--composer-border:#e5e5e5;--composer-shadow:0 0 0 1px #0000000f, 0 8px 24px #0000000f;--send-bg:#0d0d0d;--send-fg:#fff;--send-disabled:#d9d9d9;--avatar:#0d0d0d;--avatar-fg:#fff;--toast-bg:#f4f4f4;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}html[data-theme=dark]{--bg:#212121;--sidebar:#171717;--sidebar-hover:#2f2f2f;--ink:#ececec;--muted:#afafaf;--line:#2f2f2f;--user-bubble:#2f2f2f;--composer:#2f2f2f;--composer-border:#424242;--composer-shadow:0 0 0 1px #ffffff0f, 0 8px 24px #00000059;--send-bg:#fff;--send-fg:#0d0d0d;--send-disabled:#565656;--avatar:#fff;--avatar-fg:#0d0d0d;--toast-bg:#2f2f2f;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@media (prefers-color-scheme:dark){html:not([data-theme=light]):not([data-theme=dark]){--bg:#212121;--sidebar:#171717;--sidebar-hover:#2f2f2f;--ink:#ececec;--muted:#afafaf;--line:#2f2f2f;--user-bubble:#2f2f2f;--composer:#2f2f2f;--composer-border:#424242;--composer-shadow:0 0 0 1px #ffffff0f, 0 8px 24px #00000059;--send-bg:#fff;--send-fg:#0d0d0d;--send-disabled:#565656;--avatar:#fff;--avatar-fg:#0d0d0d;--toast-bg:#2f2f2f;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}*,:before,:after{box-sizing:border-box}html,body,#root{background:var(--bg);height:100%;color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased;margin:0}#root{overflow:hidden}#root:has(.api-keys-page){overflow:auto}.sr-only{clip:rect(0, 0, 0, 0);border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.shell{height:100%;min-height:0;max-height:100dvh;display:flex;overflow:hidden}.sidebar{width:var(--sidebar-w);background:var(--sidebar);border-right:1px solid var(--line);z-index:30;flex-direction:column;flex-shrink:0;gap:.5rem;padding:.75rem;display:flex}.sidebar-top,.sidebar-mid,.sidebar-bottom{flex-direction:column;gap:.35rem;display:flex}.sidebar-mid{flex:1;min-height:0;overflow:auto}.sidebar-bottom{border-top:1px solid var(--line);margin-top:auto;padding-top:.5rem}.brand{color:var(--ink);border-radius:10px;align-items:center;gap:.6rem;padding:.45rem .5rem;font-size:.95rem;font-weight:600;text-decoration:none;display:flex}.brand:hover{background:var(--sidebar-hover)}.brand-mark{background:var(--avatar);width:1.6rem;height:1.6rem;color:var(--avatar-fg);border-radius:999px;justify-content:center;align-items:center;font-size:.75rem;font-weight:700;display:inline-flex}.btn-ghost,.nav-item{appearance:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:10px;align-items:center;gap:.45rem;width:100%;padding:.55rem .65rem;font-size:.875rem;text-decoration:none;display:flex}.btn-ghost:hover,.nav-item:hover{background:var(--sidebar-hover)}.btn-ghost[hidden]{display:none!important}.topbar .btn-ghost{flex:none;width:auto}.nav-item.is-active{background:var(--sidebar-hover);font-weight:500}.sidebar-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:.75rem .65rem .15rem;font-size:.7rem}.sidebar-meta{color:var(--muted);margin:0;padding:.15rem .65rem;font-size:.75rem}.sidebar-meta.balance{font-variant-numeric:tabular-nums;color:var(--ink)}.balance-row{flex-direction:column;align-items:stretch;gap:.2rem;margin:.15rem 0 .35rem;display:flex}.balance-row .sidebar-meta{padding-bottom:0}.nav-item.balance-topup{margin:0 .35rem;font-weight:500}.api-keys-page{background:var(--bg);max-width:36rem;min-height:100dvh;color:var(--ink);box-sizing:border-box;margin:0 auto;padding:2rem 1.25rem 4rem}.api-keys-back{color:var(--muted);margin-bottom:1.5rem;font-size:.95rem;text-decoration:none;display:inline-block}.api-keys-page h1{letter-spacing:-.03em;text-align:left;margin:0 0 .5rem;font-size:1.5rem;font-weight:700}.api-keys-lead{color:var(--muted);margin:0 0 1.5rem;font-size:.95rem;line-height:1.5}.api-keys-lead a{color:inherit;text-decoration:underline}.api-keys-lead code,.api-key-value{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85rem}.api-keys-lead code{border:1px solid var(--line);background:var(--user-bubble);color:var(--ink);border-radius:4px;padding:.1rem .35rem}.api-keys-list{margin:0 0 1.25rem;padding:0;list-style:none}.api-key-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:.75rem;padding:.75rem 0;display:flex}.api-key-meta{flex-direction:column;gap:.15rem;min-width:0;display:flex}.api-key-name{color:var(--ink);font-size:.95rem}.api-key-prefix{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:.8rem;overflow:hidden}.api-key-empty{color:var(--muted);text-align:left;margin:0 0 1rem;padding:0;font-size:.95rem;list-style:none}.api-key-revoke{color:var(--muted);cursor:pointer;background:0 0;border:0;flex-shrink:0;padding:.25rem .15rem;font-size:.85rem}.api-key-revoke:hover:not(:disabled){color:var(--ink)}.api-key-reveal{border-top:1px solid var(--line);border-bottom:1px solid var(--line);flex-direction:column;gap:.55rem;margin:0 0 1.25rem;padding:.85rem 0;display:flex}.api-key-value{word-break:break-all;color:var(--ink)}.api-keys-actions{flex-wrap:wrap;gap:.5rem;display:flex}.api-keys-btn{appearance:none;border:1px solid var(--line);background:var(--user-bubble);color:var(--ink);font:inherit;cursor:pointer;border-radius:8px;padding:.65rem 1rem;font-size:.95rem}.api-keys-btn:hover:not(:disabled){background:var(--sidebar-hover)}.api-keys-btn:disabled{opacity:.55;cursor:wait}.api-keys-btn-primary{border-color:var(--ink);background:var(--ink);color:var(--bg)}.api-keys-btn-primary:hover:not(:disabled){opacity:.9;background:var(--ink)}.api-keys-error{color:#b42318;margin:.85rem 0 0;font-size:.9rem}.account-row{border-top:1px solid var(--line);flex-direction:column;align-items:stretch;gap:.15rem;margin-top:.35rem;padding-top:.45rem;display:flex}.account-email{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;margin:0;padding:.2rem .65rem;font-size:.8rem;display:block;overflow:hidden}.topup-dialog .auth-lead{text-align:center;color:var(--muted);margin:-.55rem 0 1rem;font-size:.85rem}.topup-packs{grid-template-columns:1fr 1fr;gap:.55rem;display:grid}.topup-pack{border:1px solid var(--line);background:var(--user-bubble);color:var(--ink);font:inherit;font-variant-numeric:tabular-nums;cursor:pointer;border-radius:12px;padding:.85rem .75rem;font-weight:600}.topup-pack:hover:not(:disabled){background:var(--sidebar-hover)}.topup-pack:disabled{opacity:.55;cursor:wait}.topup-custom{margin-top:.85rem}.topup-custom-row{align-items:stretch;gap:.45rem;display:flex}.topup-custom-row input{box-sizing:border-box;border:1px solid var(--line);background:var(--bg);min-width:0;color:var(--ink);font:inherit;font-variant-numeric:tabular-nums;border-radius:12px;flex:1;padding:.7rem .8rem}.topup-custom-go{border:1px solid var(--ink);background:var(--ink);color:var(--bg);font:inherit;cursor:pointer;white-space:nowrap;border-radius:12px;flex:none;padding:.7rem 1rem;font-weight:600}.topup-custom-go:disabled{opacity:.55;cursor:wait}.chat-list{margin:0;padding:0;list-style:none}.chat-list-empty{color:var(--muted);margin:.35rem .65rem .75rem;font-size:.8rem;line-height:1.35}.nav-item-row{align-items:stretch;gap:.15rem;margin:.1rem .35rem;display:flex;position:relative}.nav-item-row .chat-list-item{text-align:left;flex:1;min-width:0;margin:0}.chat-list-title{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.chat-list-more{width:1.75rem;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:.5rem;flex:none;font-size:1rem;line-height:1}.chat-list-more:hover,.chat-list-more[aria-expanded=true]{background:var(--sidebar-hover);color:var(--fg)}.nav-item-menu{z-index:5;border:1px solid var(--line);background:var(--bg);border-radius:.5rem;min-width:9rem;padding:.25rem;position:absolute;top:100%;right:.25rem;box-shadow:0 6px 20px #0000001f}.nav-item-menu button{width:100%;color:var(--fg);text-align:left;font:inherit;cursor:pointer;background:0 0;border:0;border-radius:.35rem;padding:.4rem .55rem;font-size:.85rem;display:block}.nav-item-menu button:hover{background:var(--sidebar-hover)}.nav-item-menu button.is-danger{color:#b42318}#theme-toggle .icon-sun,#theme-toggle .icon-moon{align-items:center;line-height:0;display:none}#theme-toggle .icon-moon,html[data-theme=dark] #theme-toggle .icon-sun{display:inline-flex}html[data-theme=dark] #theme-toggle .icon-moon{display:none}@media (prefers-color-scheme:dark){html:not([data-theme=light]):not([data-theme=dark]) #theme-toggle .icon-sun{display:inline-flex}html:not([data-theme=light]):not([data-theme=dark]) #theme-toggle .icon-moon{display:none}}.sidebar-backdrop{z-index:20;background:#0006;display:none;position:fixed;inset:0}.main{background:var(--bg);flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;overflow:hidden}.chat{overflow-anchor:none;flex:1;min-height:0;padding:0 1rem;scroll-padding-bottom:1rem;overflow-y:auto}.topbar{align-items:center;gap:.5rem;min-height:3.25rem;padding:.65rem 1rem;display:flex}.icon-btn{appearance:none;color:var(--ink);cursor:pointer;background:0 0;border:0;border-radius:10px;justify-content:center;align-items:center;width:2.25rem;height:2.25rem;font-size:1.1rem;display:none}.icon-btn:hover{background:var(--sidebar-hover)}.model-wrap{flex-wrap:wrap;align-items:center;gap:.75rem;display:flex}.model-select{appearance:none;color:var(--ink);font:inherit;cursor:pointer;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238f8f8f' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E") right .35rem center no-repeat;border:0;border-radius:10px;padding:.35rem 1.5rem .35rem .5rem;font-size:1rem;font-weight:600}.model-select:hover{background-color:var(--sidebar-hover)}.thread{flex-direction:column;gap:1.5rem;max-width:48rem;margin:0 auto;padding:1rem 0 4.5rem;display:flex}.turn{gap:.85rem;animation:.3s fadeIn;display:flex}.turn-user{justify-content:flex-end}.bubble{background:var(--user-bubble);max-width:min(85%,36rem);color:var(--ink);border-radius:var(--radius-md);flex-direction:column;gap:.5rem;padding:.75rem 1.1rem;font-size:1rem;line-height:1.55;display:flex}.bubble-image{object-fit:contain;border-radius:10px;max-width:100%;max-height:16rem;display:block}.bubble-text{white-space:pre-wrap;word-break:break-word}.turn-assistant .avatar{background:var(--avatar);width:1.75rem;height:1.75rem;color:var(--avatar-fg);border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;margin-top:.15rem;font-size:.7rem;font-weight:700;display:flex}.turn-assistant.is-thinking .avatar{animation:1.4s ease-in-out infinite avatarPulse}.turn-assistant .content{flex:1;min-width:0;padding-top:.1rem;font-size:1rem;line-height:1.65}.thinking{align-items:center;min-height:1.75rem;padding-top:.35rem;display:flex}.thinking-dots{align-items:center;gap:.35rem;display:inline-flex}.thinking-dots span{background:var(--muted);opacity:.35;border-radius:999px;width:.42rem;height:.42rem;animation:1.2s ease-in-out infinite thinkingDot}.thinking-dots span:nth-child(2){animation-delay:.16s}.thinking-dots span:nth-child(3){animation-delay:.32s}@keyframes thinkingDot{0%,80%,to{opacity:.3;transform:translateY(0)scale(.9)}40%{opacity:1;background:var(--ink);transform:translateY(-.2rem)scale(1)}}@keyframes avatarPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.72;transform:scale(.94)}}.turn-assistant .content p{margin:0}.turn-assistant .content p+p{margin-top:.65rem}.turn-assistant .content.md>:first-child{margin-top:0}.turn-assistant .content.md>:last-child{margin-bottom:0}.turn-assistant .content.md ul,.turn-assistant .content.md ol{margin:.5rem 0;padding-left:1.35rem}.turn-assistant .content.md li+li{margin-top:.25rem}.turn-assistant .content.md pre{background:var(--user-bubble);border-radius:12px;margin:.75rem 0;padding:.85rem 1rem;font-size:.85rem;line-height:1.45;overflow-x:auto}.turn-assistant .content.md code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}.turn-assistant .content.md :not(pre)>code{background:var(--user-bubble);border-radius:6px;padding:.1em .35em}.turn-assistant .content.md a{color:inherit;text-underline-offset:2px;text-decoration:underline}.turn-assistant .content.md blockquote{border-left:3px solid var(--line);color:var(--muted);margin:.65rem 0;padding-left:.85rem}.msg-meta{color:var(--muted);font-size:.75rem!important}@keyframes fadeIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.composer{z-index:2;padding:.5rem 1rem max(1rem, env(safe-area-inset-bottom));background:var(--bg);flex-shrink:0;width:100%;max-width:48rem;margin:0 auto;position:relative}.compose-box{background:var(--composer);border:1px solid var(--composer-border);border-radius:var(--radius-lg);box-shadow:var(--composer-shadow);align-items:flex-end;gap:.5rem;padding:.65rem;display:flex}.compose-preview{max-width:100%;margin:0 0 .55rem .15rem;display:inline-flex;position:relative}.compose-preview img{object-fit:cover;border:1px solid var(--composer-border);border-radius:12px;max-width:12rem;max-height:5.5rem;display:block}.compose-preview-remove{appearance:none;background:var(--ink);width:1.35rem;height:1.35rem;color:var(--composer);cursor:pointer;border:0;border-radius:999px;justify-content:center;align-items:center;font-size:1rem;line-height:1;display:inline-flex;position:absolute;top:-.35rem;right:-.35rem}.attach{appearance:none;width:2.25rem;height:2.25rem;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;transition:color .15s,background .15s;display:inline-flex}.attach:hover:not(:disabled){color:var(--ink);background:color-mix(in srgb, var(--muted) 18%, transparent)}.attach:disabled{opacity:.5;cursor:default}.compose-box textarea,#prompt{resize:none;width:100%;min-width:0;color:var(--ink);font:inherit;background:0 0;border:0;outline:none;flex:auto;min-height:1.45rem;max-height:10rem;padding:.35rem 0;font-size:1rem;line-height:1.45;overflow-y:auto}.compose-box textarea::placeholder,#prompt::placeholder{color:var(--muted)}.send{appearance:none;background:var(--send-bg);width:2.25rem;height:2.25rem;color:var(--send-fg);cursor:pointer;border:0;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;transition:opacity .15s,transform .1s;display:inline-flex}.send:hover{opacity:.88}.send:active{transform:scale(.96)}.compose-hint{text-align:center;color:var(--muted);margin:.55rem 0 0;font-size:.75rem}.compose-hint a{color:var(--ink);text-underline-offset:2px}.compose-counter{color:var(--muted);text-align:right;margin:.35rem .2rem 0;font-size:.75rem}.toast{background:var(--toast-bg);color:var(--ink);text-align:center;border-radius:12px;margin:.65rem 0 0;padding:.7rem .9rem;font-size:.875rem;animation:.25s fadeIn}.legal{text-align:center;color:var(--muted);margin:.75rem 0 0;font-size:.7rem}.legal a{color:var(--muted);text-underline-offset:2px;text-decoration:underline}.legal a:hover{color:var(--ink)}.doc{max-width:40rem;margin:0 auto;padding:2rem 1.25rem 3rem;line-height:1.6}.doc h1{color:var(--ink);margin:0 0 1rem;font-size:1.75rem;font-weight:600}.doc a{color:var(--ink)}.doc p{color:var(--muted)}.doc-bar{justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem;display:flex}.doc .theme-toggle,.doc #theme-toggle{border:1px solid var(--line);background:var(--sidebar);border-radius:999px;width:auto;padding:.4rem .85rem}@media (width<=768px){.sidebar{transition:transform .2s;position:fixed;inset:0 auto 0 0;transform:translate(-105%);box-shadow:8px 0 24px #0000001f}.shell.sidebar-open .sidebar{transform:translate(0)}.sidebar-backdrop,.shell.sidebar-open .sidebar-backdrop{display:block}.sidebar-backdrop[hidden]{display:none!important}.shell.sidebar-open .sidebar-backdrop[hidden]{display:block!important}.sidebar-open{display:inline-flex}.bubble{max-width:92%}}@media (prefers-reduced-motion:reduce){.turn,.toast,.sidebar,.turn-assistant.is-thinking .avatar,.thinking-dots span{transition:none;animation:none}.thinking-dots span{opacity:.65}}.auth-modal{z-index:80;background:color-mix(in srgb, var(--bg) 78%, transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);place-items:center;padding:1rem;display:grid;position:fixed;inset:0}.auth-modal[hidden]{display:none!important}.auth-dialog{background:var(--bg);width:min(400px,100%);color:var(--ink);border:1px solid var(--line);border-radius:22px;padding:1.65rem 1.4rem 1.35rem;position:relative;box-shadow:0 18px 60px #0000002e}.auth-close{color:var(--muted);cursor:pointer;background:0 0;border:0;font-size:1.35rem;line-height:1;position:absolute;top:.7rem;right:.85rem}.auth-dialog h2{letter-spacing:-.02em;text-align:center;margin:0 0 1.15rem;font-size:1.35rem;font-weight:700}.auth-provider{border:1px solid var(--line);background:var(--user-bubble);width:100%;color:var(--ink);font:inherit;cursor:pointer;text-align:left;border-radius:12px;margin:0 0 .55rem;padding:.85rem 1rem;font-weight:500;display:block}.auth-provider:disabled{opacity:.55;cursor:not-allowed;color:var(--muted);background:var(--bg)}.auth-provider#auth-email-btn{color:#fff;background:#0d0d0d;border-color:#0d0d0d;font-weight:600}html[data-theme=dark] .auth-provider#auth-email-btn{color:#0d0d0d;background:#fff;border-color:#fff}.auth-form label{color:var(--muted);margin-bottom:.35rem;font-size:.85rem;display:block}.auth-form input:not(.auth-otp-digit){box-sizing:border-box;border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);font:inherit;border-radius:12px;margin-bottom:.8rem;padding:.7rem .8rem}.auth-otp{grid-template-columns:repeat(6,minmax(0,1fr));gap:.45rem;margin:.25rem 0 1rem;display:grid}.auth-otp-digit{box-sizing:border-box;text-align:center;font-variant-numeric:tabular-nums;border:1.5px solid var(--line);background:var(--bg);width:100%;height:3.25rem;min-height:3.25rem;color:var(--ink);caret-color:var(--ink);border-radius:14px;margin:0;padding:0;font-family:inherit;font-size:1.35rem;font-weight:600}.auth-otp-digit:focus{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink);outline:none}.auth-resend{background:var(--user-bubble);width:100%;min-height:3.4rem;color:var(--muted);font:inherit;cursor:pointer;border:0;border-radius:999px;flex-direction:column;justify-content:center;align-items:center;gap:.15rem;margin:0 0 .85rem;padding:.7rem 1rem;display:flex}.auth-resend:disabled{cursor:not-allowed;opacity:1}.auth-resend:not(:disabled){color:var(--ink);cursor:pointer}.auth-resend:not(:disabled):hover{background:var(--sidebar-hover)}.auth-resend-label{font-size:.95rem;font-weight:500}.auth-resend-timer{color:var(--muted);font-size:.8rem}.auth-resend:not(:disabled) .auth-resend-timer{display:none}.auth-hint{background:var(--user-bubble);color:var(--muted);border-radius:14px;margin:0;padding:.85rem 1rem;font-size:.85rem;line-height:1.45}.auth-hint strong{color:var(--ink);font-weight:600}.auth-submit{background:var(--send-bg);width:100%;color:var(--send-fg);font:inherit;cursor:pointer;border:0;border-radius:12px;padding:.75rem 1rem;font-weight:600}.auth-error{color:#c0392b;text-align:center;margin:.75rem 0 0;font-size:.9rem}.welcome{text-align:center;padding:3rem 1rem 2rem}.welcome-title{letter-spacing:-.03em;margin:0 0 .5rem;font-size:clamp(2rem,5vw,2.8rem);font-weight:700}.welcome-sub{max-width:28rem;color:var(--muted);margin:0 auto;line-height:1.45}.welcome-keys{margin:1rem 0 0}.welcome-keys a{color:var(--ink);font-size:.95rem;text-decoration:underline}
