:root{color-scheme:light;--bg:#f5f5f7;--paper:#fff;--ink:#1d1d1f;--muted:#86868b;--blue:#0071e3;--line:rgba(29,29,31,.07);--ease:cubic-bezier(.22,1,.36,1);--view-height:100dvh;--view-top:0px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",sans-serif;-webkit-text-size-adjust:100%}button,input,textarea{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:transform .18s var(--ease),background .2s ease}button:active:not(:disabled){transform:scale(.95)}button:disabled{opacity:.4;cursor:default}button:focus-visible{outline:3px solid #8fc6ff;outline-offset:3px}button,textarea,input{outline-offset:3px}.hidden{display:none!important}h1,h2,p{margin:0}h1{font-size:29px;letter-spacing:-1px}h2{font-size:19px}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.phone-shell{max-width:600px;margin:auto;min-height:100dvh}.app-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;padding:calc(16px + env(safe-area-inset-top)) 22px 17px;background:rgba(245,245,247,.91);backdrop-filter:blur(24px);border-bottom:1px solid var(--line)}.connection{font-size:11px;letter-spacing:.1px;color:var(--muted);margin-bottom:4px}.connection.online:before{content:"";display:inline-block;width:6px;height:6px;background:#34a866;border-radius:50%;margin-right:5px}.connection.offline{color:#b42318}.header-actions{display:flex;align-items:center;gap:12px}.plus-button{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:13px;background:#1d1d1f;color:#fff;font-size:27px;box-shadow:0 5px 12px #00000010}.quota-chip{border:1px solid var(--line);border-radius:999px;padding:8px 10px;color:var(--muted);background:#fff;font-size:11px;font-weight:600}.quota-chip.low{background:#fff0ed;color:#b42318}.page{display:none;padding-bottom:calc(100px + env(safe-area-inset-bottom));animation:page-in .38s var(--ease) both}.page.active{display:block}.list-caption{padding:13px 22px 10px;display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted)}.text-button{border:0;background:transparent;color:var(--blue);padding:8px;font-size:13px;min-height:36px}.conversation-list{background:#fff}.conversation-row{position:relative;display:flex;gap:13px;align-items:center;width:100%;padding:17px 22px;border:0;background:#fff;text-align:left}.conversation-row:after{content:"";position:absolute;left:87px;right:0;bottom:0;height:1px;background:var(--line)}.conversation-row:active{background:#f0f1f4;transform:scale(.99)}.row-avatar,.message-avatar{flex:none;display:grid;place-items:center;width:50px;height:50px;border-radius:16px;background:#e9eef5;color:#48678e;font-weight:750;font-size:21px}.tone-1{background:#e9edf8;color:#6775a5}.tone-2{background:#e7f1ef;color:#538b7b}.tone-3{background:#f4eee6;color:#a38a62}.tone-4{background:#eeebf6;color:#8a73ad}.row-body{min-width:0;flex:1}.row-heading{display:flex;align-items:center;gap:8px;margin-bottom:7px}.row-heading strong{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:650}.row-heading time{font-size:10px;color:#a2a2a8;flex:none}.row-preview{display:flex;gap:6px;align-items:center;min-width:0}.row-preview p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#929299;line-height:1.4}.running-label{flex:none;font-size:10px;color:var(--blue);background:#eaf3ff;padding:2px 5px;border-radius:4px}.unread-dot{width:7px;height:7px;flex:none;border-radius:50%;background:var(--blue)}.list-note{padding:24px;text-align:center;color:#a1a1a7;font-size:11px}.empty{padding:70px 25px;text-align:center;color:var(--muted)}.empty strong{display:block;color:var(--ink);margin-bottom:10px;font-size:18px}.empty p{font-size:13px;line-height:1.7}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,600px);display:flex;z-index:12;border-top:1px solid var(--line);padding:8px 10px calc(10px + env(safe-area-inset-bottom));background:rgba(250,250,252,.95);backdrop-filter:blur(22px)}.nav-item{flex:1;border:0;background:transparent;color:#a2a2a8;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:10px;min-height:45px}.nav-item.active{color:var(--blue)}.nav-item.active svg{stroke-width:2}.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}#quotaPage,#settingsPage{padding:24px 20px calc(100px + env(safe-area-inset-bottom))}.quota-window{padding:22px;background:#fff;border:1px solid var(--line);border-radius:22px;margin-bottom:13px}.quota-window header{display:flex;align-items:center;justify-content:space-between;font-size:14px}.quota-window .percent{font-size:36px;font-weight:700;letter-spacing:-1.3px;margin:13px 0}.quota-window .percent small{font-size:12px;color:var(--muted);font-weight:400;letter-spacing:0}.quota-track{height:6px;background:#edf0f4;border-radius:9px;overflow:hidden;margin-bottom:15px}.quota-fill{height:100%;background:var(--blue);border-radius:inherit;transition:width .7s var(--ease)}.quota-window.low .percent{color:#c03827}.quota-window.low .quota-fill{background:#d85038}.quota-window footer,.quota-source{font-size:11px;color:var(--muted);line-height:1.8}.quota-source{padding:5px 5px 15px}.footnote{font-size:12px;color:var(--muted);line-height:1.8;margin-top:20px}.profile-card{display:flex;align-items:center;gap:14px;padding:15px 0 26px}.profile-card p{font-size:12px;color:var(--muted);margin-top:7px}.setting-list{background:#fff;border-radius:20px;padding:0 16px}.setting-list>div{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line);font-size:13px}.setting-list>div:last-child{border:0}.setting-list span{flex:none;color:var(--muted)}.setting-list strong{max-width:65%;font-size:12px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.secondary-button{width:100%;padding:15px;margin-top:24px;border:0;border-radius:15px;background:#e8eef6;color:var(--blue);font-size:14px}.full-page{position:fixed;z-index:30;inset:auto 0;top:var(--view-top);height:var(--view-height);background:#f1f2f5;display:flex;flex-direction:column;animation:chat-in .42s var(--ease) both;overflow:hidden}.chat-header{flex:none;display:flex;align-items:center;gap:10px;padding:calc(8px + env(safe-area-inset-top)) 12px 9px;border-bottom:1px solid var(--line);background:rgba(248,248,250,.96);min-height:70px}.icon-button{flex:none;min-width:40px;height:40px;border:0;border-radius:12px;background:transparent;color:var(--ink);font-size:28px;display:grid;place-items:center}.chat-heading{flex:1;min-width:0;text-align:center}.chat-heading h2{font-size:15px;font-weight:650;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.chat-heading p{margin-top:4px;font-size:10px;color:#98989f}.conversation-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 13px 22px;scrollbar-width:thin}.message-time{text-align:center;margin:8px 0 20px;color:#a1a1a9;font-size:10px}.message-row{display:flex;gap:9px;align-items:flex-start;margin-bottom:21px;overflow-anchor:none}.message-row.from-user{flex-direction:row-reverse}.message-avatar{width:32px;height:32px;border-radius:11px;font-size:12px;color:#67788f;background:#e0e5ee;margin-top:3px}.from-user .message-avatar{background:#d5e7fb;color:var(--blue)}.message-stack{min-width:0;max-width:calc(100% - 58px)}.message-label{font-size:9px;color:#a1a1a8;margin:0 2px 5px}.from-user .message-label{text-align:right}.message-bubble{position:relative;background:#fff;border:1px solid #e8e9ee;border-radius:4px 15px 15px 15px;padding:12px 14px;font-size:15px;line-height:1.75;overflow-wrap:anywhere;white-space:pre-wrap;box-shadow:0 2px 5px #26375703}.from-user .message-bubble{border-radius:15px 4px 15px 15px;background:#e1edff;border-color:#d6e6fd;color:#154b84}.message-bubble code{font-size:12px;background:#00000007;padding:2px 4px;border-radius:4px}.progress-message{margin:0 42px 14px;color:#8d8d96;font-size:11px;line-height:1.6}.progress-message summary{cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progress-message>div{white-space:pre-wrap;padding:9px 0;font-size:12px}.message-fresh{animation:message-in .45s var(--ease) both}.chat-footer{flex:none;border-top:1px solid var(--line);background:#f8f8fa;padding:8px 12px calc(10px + env(safe-area-inset-bottom))}.input-rail{display:flex;align-items:center;gap:8px}.input-mark{font-size:23px;color:#757780}.compose-entry{flex:1;min-width:0;min-height:40px;padding:10px 12px;border:1px solid #e4e5e9;border-radius:10px;background:#fff;color:#a0a0a7;text-align:left;font-size:14px}.chat-footer .icon-button{min-width:32px;width:32px;border:1px solid #b3b4bd;height:30px;border-radius:50%;font-size:24px;color:#71727d}.receipt{font-size:11px;line-height:1.6;color:#547197;margin:0 2px 8px;overflow-wrap:anywhere}.receipt:empty{display:none}.new-messages{position:absolute;right:18px;bottom:110px;z-index:2;background:#fff;color:var(--blue);border:1px solid var(--line);border-radius:22px;padding:10px 15px;font-size:12px;box-shadow:0 5px 25px #00000012}.composer-backdrop{position:absolute;inset:0;background:#18233122;z-index:4;animation:fade-in .22s ease both}.session-composer{position:absolute;z-index:5;bottom:0;left:0;right:0;border-radius:23px 23px 0 0;padding:16px 18px calc(16px + env(safe-area-inset-bottom));background:#fafbfc;box-shadow:0 -14px 60px #17243920;animation:composer-in .42s var(--ease) both}.composer-top,.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted)}.session-composer textarea{display:block;width:100%;height:115px;max-height:28dvh;min-height:70px;resize:none;border:1px solid #dfe2e8;border-radius:14px;padding:12px;background:#fff;color:var(--ink);font-size:16px;line-height:1.6;margin:8px 0 12px}.composer-bottom button,.primary-button,.gate-input-row button{padding:11px 22px;color:#fff;background:var(--blue);border:0;border-radius:11px;font-size:14px;font-weight:650}.new-task-page{z-index:40;background:#fff}.new-task-page .chat-header{justify-content:space-between;background:#fff}.new-task-page .chat-header h2{font-size:16px}.header-spacer{width:44px}.new-task-form{flex:1;min-height:0;display:flex;flex-direction:column;padding:28px 23px calc(22px + env(safe-area-inset-bottom));overflow:auto}.new-task-form label{font-size:25px;font-weight:650;letter-spacing:-.5px}.new-task-form>p:not(.receipt){margin-top:12px;font-size:12px;color:var(--muted);line-height:1.7}.new-task-form textarea{flex:1;min-height:140px;width:100%;border:0;resize:none;background:#fff;color:var(--ink);font-size:17px;line-height:1.8;padding:23px 0}.new-task-form textarea::placeholder{color:#b4b4bc}.new-task-foot{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:18px;border-top:1px solid var(--line)}.new-task-foot>span{font-size:10px;color:var(--muted)}.menu-backdrop{position:fixed;z-index:60;inset:0;background:#11182855;display:flex;align-items:flex-end;justify-content:center;backdrop-filter:blur(3px);animation:fade-in .2s ease both}.action-menu{width:min(100%,600px);background:#fbfbfd;border-radius:24px 24px 0 0;padding:16px 18px calc(15px + env(safe-area-inset-bottom));animation:composer-in .35s var(--ease) both}.action-menu button{display:block;width:100%;min-height:52px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);font-size:15px}.action-menu>p{font-size:11px;color:var(--muted);text-align:center;line-height:1.7;padding:9px}.action-menu #stopSessionButton{color:#bd4234}.action-menu #closeMenuButton{margin-top:8px;border:0;background:#f0f0f4;border-radius:13px}.brand-mark{display:grid;place-items:center;width:66px;height:66px;border-radius:22px;background:#1d1d1f;color:#fff;font-size:32px;font-weight:650;box-shadow:0 10px 28px #00000013}.brand-mark.small{width:52px;height:52px;border-radius:17px;font-size:25px}.gate-view{min-height:100dvh;padding:80px 28px 35px;display:flex;flex-direction:column;justify-content:center}.gate-view .brand-mark{margin-bottom:30px}.kicker{color:var(--muted);font-size:12px;margin-bottom:9px}.gate-view h1{font-size:44px}.gate-copy{color:var(--muted);font-size:15px;margin:15px 0 38px}.gate-view label{display:block;margin-bottom:10px;font-size:12px}.gate-input-row{display:flex;gap:8px}.gate-input-row input{flex:1;min-width:0;border:1px solid #dddfe6;background:#fff;border-radius:12px;padding:14px;font-size:16px}.gate-view .receipt{margin-top:12px}.chat-empty{text-align:center;color:var(--muted);font-size:12px;padding:50px 10px}
@keyframes page-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}@keyframes chat-in{from{opacity:.6;transform:translateX(50px)}to{opacity:1;transform:none}}@keyframes composer-in{from{opacity:0;transform:translateY(65px) scale(.98)}to{opacity:1;transform:none}}@keyframes message-in{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:none}}@keyframes fade-in{from{opacity:0}to{opacity:1}}
@media(min-width:650px){.phone-shell{border-left:1px solid var(--line);border-right:1px solid var(--line)}.full-page{left:50%;right:auto;width:600px;margin-left:-300px;border-left:1px solid var(--line);border-right:1px solid var(--line)}}
.agent-tabs{display:flex;gap:5px;margin:14px 22px 0;padding:4px;background:#e8e8ed;border-radius:13px}.agent-tabs button{flex:1;min-height:42px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-size:14px;font-weight:600}.agent-tabs button.active{background:#fff;color:var(--ink);box-shadow:0 2px 6px #0000000b}.agent-tabs small{font-size:10px;font-weight:400;margin-left:3px}.compose-entry:disabled{opacity:1;color:var(--muted)}
.session-composer{position:relative;inset:auto;flex:none;border-radius:0;margin:0;padding:10px 16px calc(10px + env(safe-area-inset-bottom));box-shadow:none;border-top:1px solid var(--line);background:#f5f5f7;animation:none;display:flex;align-items:flex-end;gap:10px}.session-composer textarea{flex:1;width:0;min-width:0;height:48px;min-height:48px;max-height:140px;margin:0;padding:12px;border-radius:12px;background:white;font-size:16px;resize:none}.session-composer .composer-top,.session-composer .composer-bottom span,.chat-footer .input-rail{display:none}.session-composer .composer-bottom{margin:0;padding:0;flex:none}.session-composer button[type=submit]{min-height:46px;padding:0 18px;border-radius:11px}.chat-footer{padding:4px 18px 0}.chat-footer .receipt:empty{display:none}.message-bubble{border-radius:14px;line-height:1.7}.from-user .message-bubble{border-top-right-radius:4px}.from-agent .message-bubble{border-top-left-radius:4px}.message-label{display:none}.new-messages{bottom:100px}
.theme-toggle{flex:none;min-width:36px;height:36px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);font-size:21px}
:root[data-theme=dark]{color-scheme:dark;--bg:#111315;--paper:#1c1f23;--ink:#e2e5e9;--muted:#9ba2ad;--blue:#69aeff;--line:rgba(255,255,255,.09)}
[data-theme=dark] .app-header,[data-theme=dark] .chat-header,[data-theme=dark] .bottom-nav{background:rgba(23,26,29,.96)}
[data-theme=dark] .conversation-list,[data-theme=dark] .conversation-row,[data-theme=dark] .setting-list,[data-theme=dark] .quota-window,[data-theme=dark] .quota-chip,[data-theme=dark] .message-bubble,[data-theme=dark] .new-messages,[data-theme=dark] .action-menu,[data-theme=dark] .new-task-page,[data-theme=dark] .new-task-form textarea{background:var(--paper);color:var(--ink)}
[data-theme=dark] .full-page{background:#111315}
[data-theme=dark] .chat-footer,[data-theme=dark] .session-composer{background:#171a1e}
[data-theme=dark] .session-composer textarea,[data-theme=dark] .gate-input-row input,[data-theme=dark] .compose-entry{background:#25292f;color:var(--ink);border-color:#373d46}
[data-theme=dark] .message-bubble{border-color:#2b3037;box-shadow:none}
[data-theme=dark] .from-user .message-bubble{background:#203e60;border-color:#2b5078;color:#dcecff}
[data-theme=dark] .message-bubble code{background:#ffffff12}
[data-theme=dark] .agent-tabs,[data-theme=dark] .quota-track,[data-theme=dark] #closeMenuButton{background:#25292f}
[data-theme=dark] .agent-tabs button.active{background:#383e47;color:var(--ink)}
[data-theme=dark] .row-avatar,[data-theme=dark] .message-avatar{background:#2a3543;color:#b4c7e0}
[data-theme=dark] .from-user .message-avatar,[data-theme=dark] .running-label,[data-theme=dark] .secondary-button{background:#20364f;color:#a3cdff}
[data-theme=dark] .receipt{color:#a3c3e8}
[data-theme=dark] .quota-chip.low{background:#482b2b;color:#ffb0a1}
[data-theme=dark] .quota-window.low .percent,[data-theme=dark] #stopSessionButton,[data-theme=dark] .connection.offline{color:#ffab9b}
[data-theme=dark] .conversation-row:active{background:#292f36}
[data-theme=dark] .primary-button,[data-theme=dark] .composer-bottom button,[data-theme=dark] .gate-input-row button{background:#296cba;color:#fff}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
