@font-face{font-family:LocalSans;src:local("SF Pro Text"),local("Arial");font-display:swap}
:root{font-family:LocalSans,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#252525;background:#fff;font-synthesis:none;--bg:#fff;--sidebar:#f9f9f9;--hover:#efefef;--surface:#fff;--text:#252525;--muted:#8c8c8c;--secondary:#696969;--border:#e9e9e9;--strong-border:#dedede;--button:#262626;--button-text:#fff;--shadow:0 2px 10px #00000007;--message:#f4f4f4;--sidebar-width:260px;color-scheme:light}
html[data-theme=dark]{--bg:#212121;--sidebar:#171717;--hover:#2c2c2c;--surface:#2b2b2b;--text:#ececec;--muted:#919191;--secondary:#b4b4b4;--border:#383838;--strong-border:#4a4a4a;--button:#f3f3f3;--button-text:#1c1c1c;--shadow:0 2px 12px #0002;--message:#303030;color-scheme:dark}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);height:100dvh;overflow:hidden;font-size:14px;-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{color:inherit;cursor:pointer}button{border:0;background:none}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,a:focus-visible{outline:2px solid #688ba5;outline-offset:3px}button[hidden],[hidden]{display:none!important}button,input,textarea,select{outline-offset:3px}a{color:inherit}svg.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.svg-definitions{position:absolute;width:0;height:0;overflow:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.icon-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:8px;width:36px;height:36px;color:var(--secondary)}.icon-button:hover{background:var(--hover);color:var(--text)}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);background:var(--sidebar);display:flex;flex-direction:column;padding:14px 12px 12px;z-index:30;transition:transform .2s ease}.sidebar-top{display:flex;justify-content:space-between;align-items:center;height:40px;margin-bottom:20px;padding:0 3px}.brand-mark{width:36px;height:36px;display:flex;justify-content:center;align-items:center;border-radius:9px}.brand-mark:hover{background:var(--hover)}.brand-logo{display:block;object-fit:contain;flex-shrink:0}.brand-mark .brand-logo{height:32px;width:32px;border-radius:8px}.primary-nav{display:grid;gap:3px}.nav-button{display:flex;align-items:center;text-align:left;gap:12px;padding:11px 10px;width:100%;border-radius:9px;font-size:14px;font-weight:500}.nav-button:hover{background:var(--hover)}.nav-button kbd{font:11px inherit;color:var(--muted);margin-left:auto;opacity:0}.nav-button:hover kbd{opacity:1}.history-section{margin-top:35px;flex:1;min-height:0;overflow-y:auto}.history-section h2{font-size:12px;color:var(--muted);font-weight:500;margin:0 12px 11px}.history-empty{font-size:12px;line-height:1.7;color:var(--muted);padding:0 12px;margin-top:10px;max-width:190px}.history-list{display:grid;gap:2px}.history-item{display:flex;align-items:center;gap:6px;border-radius:8px;min-width:0}.history-item:hover,.history-item.active{background:var(--hover)}.history-item>button:first-child,.history-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;padding:10px 12px;flex:1;min-width:0;border-radius:8px;width:100%;font-size:13px}.history-item .delete-chat{padding:6px;color:var(--muted);display:none;margin-right:4px}.history-item:hover .delete-chat,.history-item:focus-within .delete-chat{display:block}.history-item .delete-chat:hover{color:#bd4848}.sidebar-footer{padding-top:15px}.sidebar-local-note{display:flex;gap:8px;align-items:center;font-size:11px;color:var(--muted);padding:12px 11px 18px}.sidebar-local-note .icon{width:13px;height:13px}.profile-button{display:flex;align-items:center;gap:10px;width:100%;padding:10px 8px;border-radius:10px;text-align:left}.profile-button:hover{background:var(--hover)}.profile-avatar{display:flex;align-items:center;justify-content:center;background:#e7e7e2;color:#53534c;width:32px;height:32px;border-radius:8px;font-size:12px;font-weight:600}.profile-copy{display:grid;gap:3px;flex:1}.profile-copy strong{font-size:12px;font-weight:550}.profile-copy>span{font-size:11px;color:var(--muted)}.profile-button>.icon{width:17px;height:17px;color:var(--secondary)}.sidebar-backdrop{position:fixed;inset:0;background:#0005;z-index:29}
.chat-main{margin-left:var(--sidebar-width);height:100dvh;display:flex;flex-direction:column;position:relative;transition:margin-left .2s ease}.topbar{height:68px;padding:0 25px 0 22px;display:flex;justify-content:space-between;align-items:center;gap:15px;flex-shrink:0}.topbar-leading{display:flex;align-items:center;gap:5px}#sidebar-toggle{display:none}.model-button{display:flex;align-items:center;gap:8px;font-size:19px;font-weight:550;letter-spacing:-.45px;border-radius:9px;padding:8px 7px}.model-button:hover{background:var(--sidebar)}.model-button>.icon{width:16px;height:16px;color:var(--muted);stroke-width:1.8}.brand-local{font-weight:400;color:var(--secondary)}.status-button{display:flex;align-items:center;gap:7px;border:1px solid var(--border);border-radius:20px;padding:7px 10px;font-size:11px;color:var(--secondary);white-space:nowrap}.status-button:hover{background:var(--sidebar)}.status-button>.icon{width:12px;height:12px;margin-left:3px}.status-dot{width:5px;height:5px;border-radius:50%;background:#83a28c}.chat-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;padding:clamp(90px,18vh,205px) 28px 30px;scroll-behavior:smooth}.empty-state{text-align:center;margin-bottom:33px}.welcome-mark{display:flex;align-items:center;justify-content:center;margin:0 auto 19px;width:52px;height:52px}.welcome-mark .brand-logo{width:52px;height:52px;border-radius:14px}.empty-state h1{font-size:29px;line-height:1.3;font-weight:550;letter-spacing:-1px;margin:0 0 12px}.empty-state>p{font-size:14px;color:var(--muted);margin:0;letter-spacing:.05px}.composer-zone{max-width:768px;width:100%;position:relative}.composer{border:1px solid var(--strong-border);border-radius:28px;background:var(--surface);box-shadow:var(--shadow);padding:19px 15px 12px;transition:border-color .15s}.composer:focus-within{border-color:var(--muted)}#prompt-input{resize:none;background:transparent;border:0;outline:0;width:100%;display:block;color:var(--text);font-size:16px;line-height:1.55;padding:0 7px;min-height:31px;max-height:220px;overflow-y:auto}#prompt-input::placeholder{color:var(--muted)}.composer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}.model-shortcut{display:flex;align-items:center;gap:7px;border-radius:20px;padding:6px 8px;color:var(--secondary);font-size:11px}.model-shortcut:hover{background:var(--hover)}.model-shortcut .icon{width:15px;height:15px}.model-shortcut .chevron-small{width:11px;height:11px;margin-left:1px}.send-button{width:34px;height:34px;border-radius:50%;background:var(--button);color:var(--button-text);display:flex;align-items:center;justify-content:center;flex-shrink:0}.send-button .icon{width:20px;height:20px;stroke-width:2}.send-button:hover{opacity:.8}.stop-button>span{width:12px;height:12px;border-radius:2px;background:currentColor}.composer-status{font-size:11px;color:var(--muted);text-align:center;line-height:1.5;min-height:17px;margin:11px 10px 0}.composer-status.error{color:#b34b43}.prompt-suggestions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap;margin-top:29px}.suggestion{display:flex;align-items:center;gap:7px;border:1px solid var(--border);border-radius:22px;padding:11px 13px;font-size:12px;color:var(--secondary);white-space:nowrap}.suggestion:hover{background:var(--sidebar);border-color:var(--strong-border)}.suggestion .icon{width:16px;height:16px}.suggestion-yellow{color:#b99b50}.suggestion-blue{color:#7293ac}.suggestion-purple{color:#9a85b6}.suggestion-green{color:#7d9e89}.chat-footer{text-align:center;font-size:10px;color:var(--muted);padding:10px 16px 13px;line-height:1.5;flex-shrink:0}.messages{width:100%;max-width:768px;display:none}.has-messages .empty-state,.has-messages .prompt-suggestions{display:none}.has-messages .chat-scroll{padding-top:14px;padding-bottom:0;display:block}.has-messages .messages{display:block;margin:0 auto;min-height:calc(100% - 154px);padding-bottom:32px}.has-messages .composer-zone{position:sticky;bottom:0;margin:0 auto;background:var(--bg);padding-top:13px;padding-bottom:3px}.has-messages .composer-zone::before{content:"";position:absolute;left:0;right:0;top:-15px;height:28px;background:linear-gradient(transparent,var(--bg));pointer-events:none}.has-messages .composer{position:relative}.message{font-size:15px;line-height:1.75;margin:0 0 29px;overflow-wrap:anywhere}.message.user{max-width:85%;width:fit-content;margin-left:auto;background:var(--message);padding:12px 19px;border-radius:23px;white-space:pre-wrap}.message.assistant{padding:4px 1px}.message .message-content{white-space:pre-wrap}.message p{margin:0 0 14px}.message p:last-child{margin-bottom:0}.message pre{white-space:pre;overflow:auto;border-radius:12px;background:var(--sidebar);border:1px solid var(--border);padding:18px;font-size:13px;line-height:1.6}.message code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}.message :not(pre)>code{background:var(--message);padding:2px 5px;border-radius:4px}.message ul,.message ol{padding-left:24px}.message blockquote{border-left:3px solid var(--strong-border);margin-left:0;padding-left:18px;color:var(--secondary)}.message-actions{display:flex;gap:7px;margin-top:10px;color:var(--muted)}.message-actions button{font-size:11px;padding:4px 6px;border-radius:5px}.message-actions button:hover{background:var(--hover);color:var(--text)}.message-label{font-size:11px;color:var(--muted);margin-bottom:6px}.message.error{border:1px solid #d99e9555;background:#d99e9510;border-radius:12px;padding:15px;color:#b34b43}.thinking{color:var(--muted);font-size:13px}.typing-indicator{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--text);animation:pulse 1s ease-in-out infinite}.sidebar-collapsed .sidebar{transform:translateX(-100%)}.sidebar-collapsed .chat-main{margin-left:0}.sidebar-collapsed #sidebar-toggle{display:inline-flex}
dialog{border:1px solid var(--border);padding:0;color:var(--text);background:var(--bg);box-shadow:0 24px 100px #0003;border-radius:20px;max-height:calc(100dvh - 64px);width:min(560px,calc(100vw - 32px));overflow:auto}dialog::backdrop{background:#0005;backdrop-filter:blur(3px)}.dialog-header{display:flex;align-items:center;justify-content:space-between;padding:25px 25px 19px;gap:15px;border-bottom:1px solid var(--border)}.dialog-header h2{font-size:20px;font-weight:550;letter-spacing:-.5px;margin:0}.eyebrow{font-size:9px;letter-spacing:1.5px;color:var(--muted);margin:0 0 8px;font-weight:600}.dialog-body{padding:24px}.model-card{border:1px solid var(--border);background:var(--sidebar);border-radius:14px;padding:18px}.model-card-heading{display:flex;align-items:center;gap:11px}.model-card-heading h3{font-size:14px;font-weight:600;margin:0 0 5px}.model-card-heading p{font-size:11px;color:var(--muted);margin:0}.model-card-icon{height:37px;width:37px;border:1px solid var(--border);border-radius:11px;background:var(--bg);display:flex;align-items:center;justify-content:center;flex-shrink:0}.model-card-icon .icon{width:18px;height:18px}.model-status{margin-left:auto;font-size:10px;background:var(--bg);color:var(--secondary);border:1px solid var(--border);border-radius:14px;padding:5px 8px;white-space:nowrap}.model-status.ready{color:#5f8c6e}.model-status.error{color:#b34b43}.runtime-note{font-size:12px;line-height:1.7;color:var(--secondary);margin:16px 0 11px}.text-link{font-size:11px;color:var(--secondary);display:inline-flex;align-items:center;gap:5px;text-decoration:none}.text-link:hover{text-decoration:underline}.text-link .icon{width:12px;height:12px}.model-actions{display:flex;gap:9px;align-items:center;margin-top:20px}.primary-button,.secondary-button{border-radius:8px;font-size:12px;font-weight:500;padding:10px 15px;line-height:1.4}.primary-button{background:var(--button);color:var(--button-text)}.primary-button:hover{opacity:.85}.secondary-button{border:1px solid var(--strong-border);background:var(--bg)}.secondary-button:hover{background:var(--hover)}.text-button{font-size:12px;padding:7px 3px;color:var(--secondary)}.text-button:hover{text-decoration:underline}.danger-button{color:#b34b43}.device-row{display:flex;align-items:flex-start;gap:12px;padding:20px 2px}.device-row>.icon{color:var(--muted);width:17px;height:17px;margin-top:2px}.device-row strong{font-size:12px;font-weight:500}.device-row p{font-size:11px;color:var(--muted);line-height:1.5;margin:5px 0 0}.settings-section{border-top:1px solid var(--border);padding-top:20px;margin-top:3px}.settings-section h3{font-size:12px;font-weight:600;margin:0 0 14px}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:55px;padding:8px 0}.setting-row label{font-size:12px}.setting-row p{font-size:10px;color:var(--muted);margin:5px 0 0;line-height:1.5}.setting-row select{border:1px solid var(--border);border-radius:7px;padding:7px 9px;background:var(--bg);color:var(--secondary);font-size:11px;min-width:110px}.range-setting{display:flex;align-items:center;gap:9px;flex-shrink:0}.range-setting input{accent-color:var(--text);width:100px}.range-setting output{font-size:11px;color:var(--secondary);width:24px;font-variant-numeric:tabular-nums}.settings-description{font-size:11px;line-height:1.7;color:var(--muted);margin:0}.settings-section:last-child{margin-top:15px}.data-actions{display:flex;gap:18px;align-items:center;margin-top:15px}.download-progress-row{margin-top:18px}.progress-heading{display:flex;justify-content:space-between;gap:10px;font-size:10px;color:var(--secondary);align-items:center;line-height:1.5}progress{width:100%;height:5px;display:block;margin-top:10px;overflow:hidden;border:0;border-radius:4px;accent-color:var(--text)}progress::-webkit-progress-bar{background:var(--border);border-radius:4px}progress::-webkit-progress-value{background:var(--text);border-radius:4px}progress::-moz-progress-bar{background:var(--text);border-radius:4px}.search-dialog .dialog-header{padding-top:21px;padding-bottom:17px}.search-dialog .dialog-header h2{font-size:18px}.search-dialog .dialog-body{padding:18px}.search-field{display:flex;align-items:center;gap:10px;border:1px solid var(--strong-border);padding:12px 14px;border-radius:11px;color:var(--muted)}.search-field input{border:0;outline:0;background:transparent;flex:1;min-width:0;color:var(--text);font-size:13px}.search-field .icon{width:17px;height:17px}.search-results{max-height:50vh;overflow:auto;margin-top:14px;min-height:100px}.empty-search{font-size:12px;color:var(--muted);text-align:center;margin:35px 0}.search-result{display:block;width:100%;padding:12px;border-radius:9px;text-align:left}.search-result:hover{background:var(--hover)}.search-result strong{font-size:13px;font-weight:500;display:block}.search-result p{font-size:11px;color:var(--muted);margin:5px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);background:var(--button);color:var(--button-text);font-size:12px;line-height:1.5;padding:12px 18px;border-radius:12px;box-shadow:0 4px 25px #0002;z-index:100;max-width:min(90vw,500px);text-align:center}
@keyframes pulse{0%,100%{opacity:.35}50%{opacity:1}}
@media(min-width:1500px){.chat-scroll{padding-top:22vh}}
@media(max-width:1100px){:root{--sidebar-width:240px}.topbar{padding-right:20px;padding-left:15px}.chat-scroll{padding-left:26px;padding-right:26px}.suggestion{font-size:11px;padding:10px}.prompt-suggestions{gap:7px}.empty-state h1{font-size:28px}}
@media(max-width:760px){:root{--sidebar-width:270px}.sidebar{transform:translateX(-100%);box-shadow:15px 0 50px #0001}.sidebar-open .sidebar{transform:translateX(0)}.sidebar-open .sidebar-backdrop{display:block!important}.sidebar-collapsed.sidebar-open .sidebar{transform:translateX(0)}.chat-main{margin-left:0}.topbar{height:62px;padding:0 13px 0 9px}#sidebar-toggle{display:inline-flex}.model-button{font-size:17px;gap:6px;padding-left:3px}.status-button{font-size:10px;padding:7px 9px}.status-button>.icon{display:none}.chat-scroll{padding:clamp(80px,16vh,160px) 18px 30px}.empty-state{margin-bottom:30px}.empty-state h1{font-size:27px}.empty-state>p{font-size:13px}.welcome-mark{margin-bottom:18px}.composer{border-radius:25px;padding:16px 12px 10px}.composer-toolbar{margin-top:13px}.prompt-suggestions{max-width:430px;margin:24px auto 0;gap:9px}.suggestion{font-size:11px;padding:10px 12px}.composer-status{font-size:10px}.chat-footer{font-size:9px;padding-bottom:10px}.has-messages .chat-scroll{padding-left:17px;padding-right:17px}.has-messages .messages{min-height:calc(100% - 145px)}.message{font-size:14px}.message.user{max-width:90%}.dialog-header{padding:20px}.dialog-body{padding:18px}.model-card{padding:15px}.model-card-heading{gap:9px}.model-card-heading h3{font-size:13px}.model-status{font-size:9px;padding:5px 6px}.setting-row{gap:10px}.range-setting input{width:83px}dialog{max-height:calc(100dvh - 32px)}}
@media(max-width:390px){.status-button{border:0;padding:6px}.status-button #top-status{font-size:0}.status-button .status-dot{width:6px;height:6px}.model-button{font-size:16px}.empty-state h1{font-size:25px}.model-shortcut{font-size:10px}.model-card-icon{display:none}.setting-row select{min-width:95px}.range-setting input{width:70px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Conversation elements rendered by the local chat controller. */
.history-row{display:flex;align-items:center;gap:3px;border-radius:8px;min-width:0}.history-row:hover,.history-row.active{background:var(--hover)}.history-chat{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;padding:10px 12px;flex:1;min-width:0;border-radius:8px;font-size:13px}.history-delete{font-size:19px;line-height:1;padding:6px;color:var(--muted);opacity:0;margin-right:4px}.history-row:hover .history-delete,.history-row:focus-within .history-delete{opacity:1}.history-delete:hover{color:#bd4848}.message-user{max-width:85%;width:fit-content;margin-left:auto;background:var(--message);padding:12px 19px;border-radius:23px;white-space:pre-wrap}.message-assistant{padding:4px 1px}.message-assistant .message-content{white-space:normal}.thinking{border-left:2px solid var(--strong-border);padding:0 0 0 14px;margin:0 0 20px;color:var(--secondary);font-size:13px}.thinking summary{cursor:pointer;color:var(--muted);margin-bottom:10px}.thinking-indicator{font-size:13px;color:var(--muted)}.thinking-indicator span{animation:pulse 1.2s ease-in-out infinite}.message-actions>span{font-size:11px}.model-requirements{font-size:10px;line-height:1.7;color:var(--muted);margin:14px 0 0}.search-results>p{font-size:12px;color:var(--muted);text-align:center;margin:30px 0}
@media(max-width:760px){.message-user{max-width:90%}.history-delete{opacity:1}}
.sidebar-collapsed .sidebar{visibility:hidden}
@media(max-width:760px){.sidebar{visibility:hidden}.sidebar-open .sidebar{visibility:visible}}
/* Green means the model has finished loading and can accept a message. */
:root{--ready-text:#166534;--ready-bg:#edf9f0;--ready-border:#b8e2c3;--ready-solid:#15803d}
html[data-theme=dark]{--ready-text:#9aefb5;--ready-bg:#183b28;--ready-border:#326b46;--ready-solid:#4ade80}
.status-dot{background:var(--muted);width:7px;height:7px}
.status-button[data-state=loading] .status-dot{background:#d69a2d}
.status-button[data-state=ready],.model-status[data-state=ready]{background:var(--ready-bg);color:var(--ready-text);border-color:var(--ready-border);font-weight:600}
.status-button[data-state=ready] .status-dot{background:var(--ready-solid);box-shadow:0 0 0 3px color-mix(in srgb,var(--ready-solid) 13%,transparent)}
.status-button[data-state=ready]{padding:8px 12px;gap:9px}
.composer-status[data-state=ready]{display:table;margin:12px auto 0;padding:8px 13px;border:1px solid var(--ready-border);border-radius:20px;background:var(--ready-bg);color:var(--ready-text);font-size:12px;font-weight:550}
.composer-status[data-state=error]{color:#c3493b}
.download-progress-row[data-state=ready]{padding:13px;border:1px solid var(--ready-border);border-radius:10px;background:var(--ready-bg)}
.download-progress-row[data-state=ready] .progress-heading{color:var(--ready-text);font-size:12px;font-weight:600}
.download-progress-row[data-state=ready] progress{accent-color:var(--ready-solid)}
.download-progress-row[data-state=ready] progress::-webkit-progress-value{background:var(--ready-solid)}
.download-progress-row[data-state=ready] progress::-moz-progress-bar{background:var(--ready-solid)}
.ready-button{background:#15803d;color:#fff}
.ready-button:hover{background:#166534;opacity:1}
.toast[data-tone=success]{background:var(--ready-bg);color:var(--ready-text);border:1px solid var(--ready-border);font-weight:600}
.model-card-heading{flex-wrap:wrap}
@media(max-width:760px){.composer-status[data-state=ready]{font-size:11px;padding:7px 11px}.model-status[data-state=ready]{font-size:10px}}
@media(max-width:390px){.status-button #top-status{font-size:10px}.status-button[data-state=ready]{padding:7px 9px;gap:7px}.topbar{gap:5px}.model-button{font-size:15px}}
