:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#25324a;background:#f0f3f7;font-synthesis:none;font-size:15px;--blue:#2675f5;--muted:#8b94a4;--line:#edf0f4;--incoming:#f0f2f5;--focus:#1a63d7}
*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:32px 20px;background:radial-gradient(ellipse at 20% 0%,#e9effb 0,transparent 48%),radial-gradient(ellipse at 100% 100%,#e9edf5 0,transparent 50%),#f3f5f8}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default}button,input,textarea,select{-webkit-tap-highlight-color:transparent}button{color:inherit}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid #9bc0ff;outline-offset:4px}button{transition:background .15s,transform .15s,box-shadow .15s}button:active:not(:disabled){transform:translateY(1px)}[hidden]{display:none!important}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icon-definitions{position:absolute;width:0;height:0;overflow:hidden}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-shell{width:min(100%,760px);height:min(880px,calc(100dvh - 64px));min-height:420px;background:white;border:1px solid #fff;border-radius:28px;box-shadow:0 18px 70px #293e6610,0 2px 8px #293e6605;position:relative;overflow:hidden}.screen{height:100%;display:flex;flex-direction:column}.chat-header{display:flex;align-items:center;gap:14px;min-height:104px;padding:24px 30px;border-bottom:1px solid var(--line);background:#ffffffed;flex-shrink:0}.avatar{display:inline-flex;position:relative;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:#e8eefa;color:#5271a4;font-weight:600;letter-spacing:.02em;flex-shrink:0}.avatar img{position:absolute;width:100%;height:100%;inset:0;object-fit:cover}.avatar-header{width:52px;height:52px;font-size:18px}.contact-photo{position:relative;display:flex}.presence-dot{position:absolute;width:13px;height:13px;background:#39bd84;border:3px solid white;border-radius:50%;right:0;bottom:1px}.contact-details h1{margin:0;font-size:17px;font-weight:650;letter-spacing:-.3px;line-height:1.4;max-width:470px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contact-details{min-width:0;flex:1}.contact-details p{display:flex;align-items:center;gap:5px;color:#7f899a;margin:4px 0 0;font-size:12px}.status-dot{display:none}.icon-button{width:40px;height:40px;background:none;border:0;display:grid;place-items:center;border-radius:50%;flex-shrink:0;color:#798599}.icon-button:hover{background:#edf2fa;color:var(--blue)}.settings-button{background:#f5f7fa}.settings-button svg{width:21px;height:21px}
.message-list{flex:1;overflow-y:auto;overflow-x:hidden;padding:10px 28px 24px;scrollbar-width:thin;scrollbar-color:#dfe5ee transparent;overscroll-behavior:contain}.date-separator{text-align:center;margin:25px 0 30px;font-size:11px;font-weight:500;color:#919aa9;letter-spacing:.02em}.message-row{display:flex;align-items:flex-end;gap:9px;margin-top:18px}.message-row.grouped{margin-top:5px}.message-row.outgoing{justify-content:flex-end}.avatar-message,.avatar-spacer{width:29px;height:29px;flex-shrink:0;font-size:10px}.avatar-message{margin-bottom:21px}.avatar-spacer{display:block}.message-stack{display:flex;flex-direction:column;align-items:flex-start;max-width:76%;min-width:0}.outgoing .message-stack{align-items:flex-end}.bubble{padding:12px 16px;border-radius:18px 18px 18px 5px;background:var(--incoming);font-size:14px;line-height:1.65;letter-spacing:.005em;white-space:pre-wrap;overflow-wrap:anywhere;min-width:32px;color:#384358}.outgoing .bubble{color:white;background:var(--blue);border-radius:18px 18px 5px 18px;box-shadow:0 2px 3px #2675f50b}.message-meta{display:flex;align-items:center;gap:5px;min-height:16px;padding:5px 3px 0;font-size:10px;line-height:1.2;color:#949eae}.message-meta svg{width:15px;height:11px;stroke-width:1.8;color:#778fac}.message-meta .delivered{color:#4789e5}.retry-button{border:0;background:none;padding:0;color:#9e5c49;font-size:10px;text-decoration:underline;text-underline-offset:2px}.typing-row{margin-top:18px}.typing-row .avatar-message{margin-bottom:0}.typing-bubble{height:43px;min-width:67px;display:flex;align-items:center;justify-content:center;gap:5px;padding:0 15px}.typing-bubble span{height:6px;width:6px;border-radius:50%;background:#929eaf;animation:typing 1.3s ease-in-out infinite}.typing-bubble span:nth-child(2){animation-delay:.16s}.typing-bubble span:nth-child(3){animation-delay:.32s}@keyframes typing{0%,60%,100%{transform:translateY(0);opacity:.55}30%{transform:translateY(-4px);opacity:1}}.streaming .bubble:after{content:"";display:inline-block;width:3px;height:13px;margin-left:3px;vertical-align:middle;border-radius:1px;background:#9aa8bd;animation:cursor .9s infinite}@keyframes cursor{50%{opacity:0}}.jump-latest{position:absolute;bottom:128px;left:50%;transform:translateX(-50%);border:1px solid #e1e9f5;background:white;box-shadow:0 3px 18px #23395815;border-radius:24px;padding:8px 15px;font-size:12px;color:var(--blue);z-index:2}.jump-latest:active:not(:disabled){transform:translateX(-50%)}.jump-latest span{margin-left:8px}
.composer-area{padding:18px 28px 17px;border-top:1px solid var(--line);background:white;flex-shrink:0}.composer{display:flex;align-items:flex-end;gap:10px;padding:8px 8px 8px 18px;border:1px solid #e9edf3;background:#f6f8fa;border-radius:27px;transition:border-color .2s,box-shadow .2s}.composer:focus-within{border-color:#bbd3fc;box-shadow:0 0 0 3px #2675f508}.composer textarea{width:100%;min-height:36px;max-height:132px;padding:9px 0 6px;background:none;border:0;outline:none;resize:none;color:#344158;font-size:14px;line-height:21px;scrollbar-width:thin}.composer textarea:focus-visible{outline:none}.composer textarea::placeholder{color:#98a1af}.send-button{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border:0;border-radius:50%;background:var(--blue);color:#fff;box-shadow:0 2px 5px #2675f51f}.send-button svg{width:21px;height:21px;stroke-width:1.8;transform:translate(-1px,1px)}.send-button:hover:not(:disabled){background:#1665e4;box-shadow:0 3px 9px #2675f530}.send-button:disabled{background:#dfe7f3;color:#97add0;box-shadow:none}.composer-hint{display:flex;align-items:center;justify-content:center;gap:10px;color:#a2aab7;font-size:10px;letter-spacing:.02em;margin:12px 0 0}.hint-line{display:block;width:19px;height:1px;background:#e7ebf1}
.settings-header{display:flex;align-items:center;gap:12px;min-height:104px;border-bottom:1px solid var(--line);padding:22px 26px;flex-shrink:0}.settings-header h1{font-size:19px;letter-spacing:-.5px;margin:0 0 5px;font-weight:650}.settings-header p{color:var(--muted);font-size:12px;margin:0}.settings-header>div{flex:1}.demo-badge{color:#8a7352;background:#faf4e9;border:1px solid #f0e6d4;padding:5px 9px;border-radius:7px;font-size:10px;letter-spacing:.03em;font-weight:600}.settings-form{display:flex;flex-direction:column;min-height:0;flex:1}.settings-content{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#dfe5ee transparent;flex:1;padding:0 36px}.settings-section{padding:28px 0;border-bottom:1px solid var(--line)}.section-heading{margin-bottom:22px}.section-heading h2,.reset-section h2{font-size:14px;font-weight:650;letter-spacing:-.1px;margin:0 0 6px}.section-heading p,.reset-section p{font-size:12px;color:var(--muted);line-height:1.6;margin:0}.settings-form label:not(.radio-card){display:block;font-size:12px;font-weight:550;color:#59667a;margin:17px 0 8px}.settings-form input:not([type=radio]):not([type=range]),.settings-form select,.settings-form textarea{width:100%;border:1px solid #e4e9f0;border-radius:10px;background:white;color:#3c4960;padding:11px 12px;font-size:13px;line-height:1.5;transition:border-color .15s}.settings-form select{min-height:43px;padding-right:25px}.settings-form input::placeholder,.settings-form textarea::placeholder{color:#a3abba}.settings-form input:hover,.settings-form select:hover,.settings-form textarea:hover{border-color:#cdd7e6}.settings-form textarea{resize:vertical;min-height:166px;line-height:1.8}.field-help{font-size:11px;color:#8b95a6;line-height:1.65;margin:7px 0 0}.profile-editor{display:flex;gap:18px;align-items:center}.avatar-preview{width:66px;height:66px;font-size:22px;border:4px solid #fff;box-shadow:0 0 0 1px #e6ebf2}.profile-fields{flex:1;min-width:0}.settings-form .profile-fields label{margin-top:0}.optional{font-size:10px;color:#a2abba;font-weight:400;margin-left:5px}.demo-notice{display:flex;align-items:flex-start;gap:9px;background:#f5f8fe;border:1px solid #eaf0fb;border-radius:10px;padding:12px 14px;margin-bottom:20px}.demo-notice p{font-size:11px;color:#7c8ba3;line-height:1.7;margin:0}.demo-notice strong{color:#60779b;font-weight:600}.notice-dot{width:6px;height:6px;background:#9db8e1;border-radius:50%;flex-shrink:0;margin-top:6px}.model-label{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:17px}.settings-form .model-label label{margin:0}.text-button{display:inline-flex;align-items:center;gap:5px;color:var(--blue);border:0;background:none;padding:7px 0;font-size:11px;font-weight:550}.text-button svg{width:13px;height:13px}.text-button:hover{color:#145ac2}.text-button:disabled{opacity:.55}.text-button.loading svg{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.range-grid{display:grid;grid-template-columns:1fr 1fr;gap:30px}.range-label{display:flex;align-items:center;justify-content:space-between}.settings-form .range-label label{margin:0}.range-label output{color:var(--blue);font-size:11px;background:#edf4ff;border-radius:5px;padding:3px 6px;font-variant-numeric:tabular-nums}.settings-form input[type=range]{width:100%;accent-color:var(--blue);height:17px;margin:13px 0 0;cursor:pointer}.radio-card{position:relative;display:flex;align-items:center;gap:14px;border:1px solid #e5eaf2;border-radius:12px;margin-top:10px;padding:15px 16px;cursor:pointer;transition:background .15s,border-color .15s}.radio-card:has(input:checked){border-color:#aecbfb;background:#f6f9ff}.radio-card:focus-within{outline:3px solid #9bc0ff;outline-offset:3px}.radio-card input{position:absolute;width:1px;height:1px;opacity:0}.radio-card>span:first-of-type{flex:1}.radio-card strong{display:block;font-size:12px;font-weight:550;color:#44546c}.radio-card small{display:block;font-size:11px;line-height:1.65;color:#8b96a8;margin-top:5px}.radio-indicator{width:16px;height:16px;border:1.5px solid #ccd5e2;border-radius:50%;flex-shrink:0}.radio-card input:checked~.radio-indicator{border:5px solid var(--blue)}.reset-section{padding:26px 0 30px;display:flex;flex-wrap:wrap;align-items:center;gap:16px}.reset-section>div:first-child{flex:1;min-width:180px}.reset-section h2{font-size:12px}.reset-section p{font-size:11px}.reset-button{border:1px solid #e6eaf0;border-radius:8px;background:white;padding:9px 11px;color:#8c7e7c;font-size:11px}.reset-button:hover{border-color:#e6c7c2;background:#fff9f8}.reset-confirm{width:100%;background:#fff8f6;border:1px solid #f1dcd6;border-radius:10px;padding:14px}.reset-confirm>div{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.reset-confirm p{color:#98695f}.settings-footer{display:flex;justify-content:flex-end;gap:10px;padding:17px 36px;border-top:1px solid var(--line);background:#fff;flex-shrink:0}.secondary-button,.primary-button,.danger-button{border:1px solid #e2e8f0;border-radius:9px;background:white;padding:11px 20px;font-size:12px;font-weight:550;min-height:41px}.secondary-button:hover{background:#f6f8fb}.primary-button{background:var(--blue);border-color:var(--blue);color:white;box-shadow:0 3px 8px #2675f51a}.primary-button span{margin-left:18px;font-size:15px}.primary-button:hover{background:#1665e4}.danger-button{background:#a74e40;border-color:#a74e40;color:white}.toast{position:absolute;bottom:112px;left:50%;transform:translateX(-50%);padding:11px 18px;background:#293b53f5;color:white;font-size:12px;line-height:1.5;border-radius:12px;box-shadow:0 4px 20px #28395020;max-width:calc(100% - 40px);width:max-content;text-align:center;z-index:5}
@media(min-width:700px){.message-list{padding-left:34px;padding-right:34px}.composer-area{padding-left:34px;padding-right:34px}.chat-header{padding-left:34px;padding-right:34px}}
@media(max-width:540px){body{padding:0;background:#fff;display:block}.app-shell{width:100%;height:100vh;height:100dvh;min-height:0;border:0;border-radius:0;box-shadow:none}.chat-header{min-height:88px;padding:16px 20px;gap:12px;padding-top:max(16px,env(safe-area-inset-top))}.avatar-header{width:46px;height:46px}.contact-details h1{font-size:16px}.contact-details p{font-size:11px}.message-list{padding:0 16px 20px}.message-stack{max-width:80%}.bubble{font-size:14px;padding:11px 14px;line-height:1.6}.message-row{gap:7px;margin-top:16px}.avatar-message,.avatar-spacer{width:25px;height:25px;font-size:9px}.date-separator{margin:23px 0}.composer-area{padding:14px 16px max(14px,env(safe-area-inset-bottom))}.composer-hint{font-size:9px;margin-top:10px}.settings-header{padding:18px 16px;min-height:88px;padding-top:max(18px,env(safe-area-inset-top))}.settings-content{padding:0 22px}.settings-footer{padding:14px 22px max(14px,env(safe-area-inset-bottom))}.settings-section{padding:25px 0}.settings-form input:not([type=radio]):not([type=range]),.settings-form textarea,.settings-form select{font-size:16px}.range-grid{gap:20px}.radio-card{padding:14px 12px}.profile-editor{gap:14px}.jump-latest{bottom:120px}.toast{bottom:110px}}
/* Seat the circular send control flush inside the composer's right end. */
.composer{gap:8px;padding:0 0 0 18px;overflow:hidden}
.composer textarea{min-height:52px;padding:15px 0 16px}
.send-button{width:52px;height:52px;box-shadow:none}
.send-button svg{width:22px;height:22px;stroke-width:1.9;transform:none}
.send-button:hover:not(:disabled){box-shadow:none}
.send-button:focus-visible{outline-offset:-5px;outline-color:#fff}
.settings-footer .secondary-button,.settings-footer .primary-button{display:inline-flex;align-items:center;justify-content:center;line-height:1;min-height:44px}
.primary-button{gap:18px}
.primary-button span{margin:0;font-size:inherit;line-height:1}
.primary-button svg{width:16px;height:16px}
/* Keep small supporting text legible on the light surfaces. */
.contact-details p,.date-separator,.message-meta,.composer-hint,.settings-header p,.section-heading p,.reset-section p,.field-help,.radio-card small{color:#6b778b}.optional{color:#6b778b}.demo-notice p{color:#667890}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* A clearer edge gives the message field more definition. */
.composer{border:2px solid #c4cedd;border-radius:28px}
.composer:focus-within{border-color:#7c9fd7;box-shadow:0 0 0 3px #2675f50c}

/* Native messaging typography, with a more readable settings scale. */
.header-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.clear-chat-button:hover{background:#fff1ee;color:#a74e40}
.clear-chat-dialog{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid #e5eaf2;border-radius:20px;background:white;color:#25324a;padding:26px;box-shadow:0 18px 70px #17263d30}
.clear-chat-dialog::backdrop{background:#1e2e4959;backdrop-filter:blur(2px)}
.clear-chat-dialog h2{margin:0 0 12px;font-size:21px;font-weight:600;letter-spacing:-.3px}
.clear-chat-dialog>p:not(.field-help):not(.request-error){margin:0 0 12px;font-size:14px;line-height:1.65;color:#59667a}
.clear-chat-dialog .request-error{margin-top:14px}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}
.dialog-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:14px;line-height:1.3}
@media(max-width:440px){.clear-chat-dialog{padding:24px}.dialog-actions{flex-direction:column-reverse}.dialog-actions button{width:100%}}
.presence-dot.offline{background:#a4aebb}
.connection-badge{color:#637893;background:#f0f5fb;border:1px solid #e0e9f5;padding:5px 9px;border-radius:7px;font-size:12px;font-weight:500;white-space:nowrap}
.reasoning-row .typing-bubble{background:#f1ecfa;color:#8762b0}
.reasoning-row .typing-bubble span{background:#9974c3}
.request-error{font-size:12px;line-height:1.6;color:#955c4b;margin:0 0 12px;overflow-wrap:anywhere}
.failed-label{color:#955c4b}.retry-button:disabled{opacity:.5}
.field-help.budget-warning{color:#965c30}
.send-button.is-stopping{background:#667a99;color:white}
.send-button.is-stopping:hover:not(:disabled){background:#526888}
.empty-conversation{text-align:center;padding:65px 18px;color:#758196}
.empty-conversation h2{font-size:18px;font-weight:500;color:#52617a;margin:0 0 10px}
.empty-conversation p{font-size:14px;line-height:1.6;margin:0}
.bubble{font-size:16px;line-height:1.5;letter-spacing:normal}
.composer textarea{font-size:16px}
.contact-details h1{font-size:18px;font-weight:600;letter-spacing:-.2px}
.contact-details p{font-size:13px}
.message-meta{font-size:11px}
.settings-header h1{font-size:24px;font-weight:600;line-height:1.25;letter-spacing:-.4px}
.settings-header p{font-size:14px;line-height:1.5}
.section-heading h2{font-size:18px;font-weight:600;line-height:1.35}
.section-heading p{font-size:14px;line-height:1.6}
.settings-form label:not(.radio-card){font-size:14px;font-weight:500;line-height:1.4}
.settings-form input:not([type=radio]):not([type=range]),.settings-form select,.settings-form textarea{font-size:16px}
.field-help{font-size:13px;line-height:1.6}
.optional{font-size:12px}
.demo-notice p{font-size:13px;line-height:1.6}
.text-button{font-size:13px}
.range-label output{font-size:13px}
.radio-card strong{font-size:15px;font-weight:500}
.radio-card small{font-size:13px;line-height:1.6}
.reset-section h2{font-size:15px;font-weight:600}
.reset-section p,.reset-button{font-size:13px}
.settings-footer .secondary-button,.settings-footer .primary-button,.reset-confirm .secondary-button,.reset-confirm .danger-button{font-size:14px}
.demo-badge{font-size:12px}
@media(max-width:540px){.model-label{align-items:flex-start}.text-button{padding-top:0}.settings-header{min-height:96px}.range-grid{gap:16px}}
