:root{color-scheme:light;--bg:#fff;--side:#f8f8f7;--text:#252525;--muted:#777773;--line:#e8e8e5;--soft:#f1f1ef;--button:#222;--inverse:#fff;--blue:#166fca}
*{box-sizing:border-box}body{margin:0;font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg);display:flex;height:100dvh}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.5}button:focus-visible,a:focus-visible{outline:2px solid var(--blue);outline-offset:3px}[hidden]{display:none!important}aside{width:260px;background:var(--side);border-right:1px solid var(--line);padding:25px 14px 16px;display:flex;flex-direction:column;flex-shrink:0}.brand{display:flex;align-items:center;gap:9px;font-size:23px;font-weight:600;letter-spacing:-1px;padding:0 10px;margin-bottom:31px}.brand-mark{display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;width:29px;height:29px;font:italic 25px Georgia;background:var(--bg)}.nav-action{width:100%;text-align:left;border:0;background:var(--soft);border-radius:9px;padding:10px 12px;font-size:14px;display:flex;align-items:center;gap:10px}.nav-action span{font-size:20px;line-height:1}.nav-action kbd{margin-left:auto;font:11px inherit;color:var(--muted)}#history-area{margin-top:22px;min-height:0;overflow:auto;flex:1}.search{display:flex;gap:8px;align-items:center;padding:7px 10px;border-bottom:1px solid var(--line);color:var(--muted)}.search input{border:0;outline:0;background:transparent;width:100%;font-size:13px;color:var(--text)}aside h2{font-size:12px;font-weight:500;color:var(--muted);margin:23px 12px 8px}.history-row{display:flex;border-radius:8px}.history-row:hover,.history-row.selected{background:var(--soft)}.history-row button{border:0;background:transparent;padding:10px;font-size:13px}.history-open{flex:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:left}.history-delete{color:var(--muted)}#guest-hint{padding:40px 14px;max-width:220px}.small-symbol{font-size:26px;color:var(--muted)}#guest-hint h2{font-size:14px;color:var(--text);margin:10px 0}#guest-hint p{font-size:13px;color:var(--muted);line-height:1.7}.sidebar-bottom{margin-top:auto;border-top:1px solid var(--line);padding:17px 10px 0}#account p{font-size:12px;color:var(--muted);margin:5px 0 12px}#account strong{font-size:13px;word-break:break-word}.login{border:1px solid var(--line);background:var(--bg);border-radius:20px;padding:7px 19px;font-size:13px}.sidebar-bottom .login{width:100%;background:var(--button);color:var(--inverse);border:0}.quiet{border:0;background:none;font-size:12px;color:var(--muted);padding:10px 0}.version{display:block;font-size:10px;color:var(--muted);margin-top:8px}main{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}header{height:76px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0 32px}header>div{display:flex;align-items:center;gap:13px}.app-title{font-size:18px;font-weight:500}.chat-label{font-size:11px;color:var(--muted);border:1px solid var(--line);padding:1px 9px;border-radius:12px}#conversation{flex:1;overflow:auto;min-height:0;scroll-behavior:smooth}#welcome{max-width:780px;margin:clamp(80px,21vh,240px) auto 0;text-align:center;padding:0 20px}.welcome-mark{font:italic 42px Georgia;color:var(--text);margin-bottom:12px}h1{font-size:32px;font-weight:500;letter-spacing:-1px;margin:0}#welcome p{font-size:14px;color:var(--muted);margin-top:10px}#messages{max-width:800px;padding:20px 28px 30px;margin:auto}.message{margin-bottom:32px;overflow-wrap:anywhere}.message.user{margin-left:auto;max-width:85%;width:fit-content;background:var(--soft);padding:10px 18px;border-radius:20px;white-space:pre-wrap}.message.assistant{line-height:1.8}.reply-content p{margin:0 0 14px}.reply-content h1,.reply-content h2,.reply-content h3{font-size:18px;font-weight:600;letter-spacing:0}.reply-content pre{overflow:auto;background:var(--side);padding:18px;border:1px solid var(--line);border-radius:12px;white-space:pre-wrap}.reply-content blockquote{border-left:3px solid var(--line);margin-left:0;padding-left:16px}.reply-content a{color:var(--blue)}.copy{border:0;background:none;color:var(--muted);font-size:12px;padding:4px 0}.message-error{color:var(--muted);font-size:13px}#composer-area{width:min(800px,100%);margin:0 auto;padding:0 28px 15px}body.empty #composer-area{position:absolute;top:calc(clamp(80px,21vh,240px) + 230px);left:50%;transform:translateX(-50%)}#composer{border:1px solid var(--line);border-radius:24px;padding:15px 17px 12px;box-shadow:0 4px 22px #00000006;background:var(--bg)}textarea{display:block;resize:none;border:0;outline:0;background:transparent;color:var(--text);width:100%;max-height:180px;padding:2px 4px;line-height:1.6;overflow:auto}textarea::placeholder{color:var(--muted)}.composer-tools{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:12px}#privacy{font-size:11px;color:var(--muted)}#send{border:0;border-radius:50%;width:34px;height:34px;background:var(--button);color:var(--inverse);font-size:23px;line-height:1}#stop{border:1px solid var(--line);border-radius:18px;background:var(--soft);padding:5px 12px;font-size:12px}.footnote{font-size:11px;color:var(--muted);text-align:center;margin:10px 0 0}#queue{display:flex;align-items:center;gap:14px;background:var(--side);border:1px solid var(--line);border-radius:14px;padding:12px 16px;margin-bottom:12px}#queue strong{font-size:13px;font-weight:500}#queue p{font-size:12px;color:var(--muted);margin:0}.spinner{width:17px;height:17px;border:2px solid var(--line);border-top-color:var(--text);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#notice{margin:0 28px 10px;padding:10px 15px;border-radius:9px;background:var(--soft);font-size:13px}dialog{background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:22px;padding:35px;width:min(430px,90vw);text-align:center}dialog::backdrop{background:#0005;backdrop-filter:blur(3px)}dialog h2{font-size:23px;line-height:1.3}dialog p{font-size:14px;color:var(--muted)}dialog .small{font-size:11px}.google{display:flex;justify-content:center;align-items:center;gap:15px;text-decoration:none;border:1px solid var(--line);border-radius:12px;color:var(--text);padding:12px;margin:24px 0 8px}.google strong{font-size:20px}.icon{border:0;background:transparent;font-size:22px}.dialog-close{position:absolute;top:10px;right:15px}.mobile{display:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}body.dark{color-scheme:dark;--bg:#222322;--side:#1e1f1e;--text:#ededeb;--muted:#aaa9a4;--line:#393a37;--soft:#30312e;--button:#e9e9e5;--inverse:#222;--blue:#85bfff}
@media(max-width:760px){aside{position:fixed;z-index:10;inset:0 auto 0 0;width:275px;transform:translateX(-100%);transition:transform .2s}body.sidebar-open aside{transform:translateX(0)}.mobile{display:inline-block}#close-sidebar{margin-left:auto}.brand{margin-bottom:25px}#scrim{position:fixed;inset:0;background:#0005;border:0;z-index:9}header{height:65px;padding:0 18px}.app-title{font-size:17px}.chat-label{display:none}#welcome{margin-top:16vh}h1{font-size:27px}#welcome p{font-size:13px}#composer-area{padding:0 14px 12px}body.empty #composer-area{top:calc(16vh + 210px)}#messages{padding:20px 20px}#privacy{font-size:10px}.footnote{font-size:10px}#composer{border-radius:22px}#notice{margin:0 14px 10px}}
@media(max-height:600px){body.empty #composer-area{position:static;transform:none}#welcome{margin:25px auto}#conversation{min-height:140px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Kuruken's fox identity: quiet at rest, tail motion while working. */
.brand-mark{border:0;border-radius:0;background:none;width:30px;height:30px}
.welcome-mark{height:62px;display:flex;justify-content:center;align-items:center;margin-bottom:12px}
.welcome-mark img{width:55px;height:55px}
.fox-loader{position:relative;display:block;flex-shrink:0;width:42px;height:42px}
.fox-loader>img{position:absolute;width:26px;height:26px;left:13px;top:7px;animation:fox-listen 3s ease-in-out infinite}
.fox-tail{position:absolute;width:39px;height:39px;left:0;top:2px;transform-origin:60% 85%;animation:tail-sweep 2.4s ease-in-out infinite}
@keyframes tail-sweep{0%,100%{transform:rotate(-9deg)}50%{transform:rotate(16deg)}}
@keyframes fox-listen{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(4deg)}}
@media(prefers-reduced-motion:reduce){.fox-tail,.fox-loader>img{animation:none}}
/* Keep the empty-state heading and composer in one natural flow. */
body.empty #conversation{flex:0 0 auto;overflow:visible}
body.empty #composer-area{position:static;transform:none;margin:24px auto 0}
@media(max-height:600px){body.empty #composer-area{margin-top:8px}}

body.empty #messages{display:none}
.smaller-button{margin-left:auto;flex-shrink:0;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);font-size:12px;padding:8px 12px}.model-label{font-size:11px;color:var(--muted);margin-bottom:8px}@media(max-width:760px){#queue{flex-wrap:wrap}.smaller-button{margin-left:55px}}
#photo-tools{display:flex;gap:3px}.photo-tool{border:0;background:transparent;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-size:24px}.photo-tool:hover{background:var(--soft)}#privacy{flex:1}#attachments,.message-photos{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}.attachment{position:relative}.attachment img{width:76px;height:76px;object-fit:cover;border:1px solid var(--line);border-radius:12px}.attachment button{position:absolute;right:-5px;top:-5px;width:24px;height:24px;line-height:1;border:1px solid var(--line);border-radius:50%;background:var(--bg)}.message-photos img{max-width:min(260px,100%);max-height:230px;object-fit:contain;border-radius:12px}.message-photos{white-space:normal}#camera{width:min(600px,94vw)}#camera-preview{display:block;width:100%;max-height:55vh;object-fit:contain;border-radius:12px;background:var(--side)}#queue>div{min-width:0}#queue{align-items:flex-start}body.empty #conversation{flex-shrink:1;overflow:auto}
/* Shared control geometry prevents icon baseline shifts across devices. */
button svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.composer-tools{gap:6px;margin-top:12px;min-height:36px}
#photo-tools{align-items:center;gap:2px;flex-shrink:0}
.photo-tool,#send{display:flex;align-items:center;justify-content:center;width:36px;height:36px;min-width:36px;padding:0;line-height:1;flex-shrink:0}
#chat-options{border:0;background:transparent;border-radius:18px;padding:8px 10px;display:flex;align-items:center;gap:5px;font-size:12px;line-height:20px;white-space:nowrap}
#chat-options:hover{background:var(--soft)}#chat-options svg{width:14px;height:14px}.composer-spacer{flex:1}
#privacy{text-align:center;font-size:11px;line-height:1.4;margin-top:12px}.footnote{margin-top:3px}
#options-dialog{width:min(480px,94vw);text-align:left;padding:26px}#options-dialog h2{margin:0 0 6px}#options-dialog>p{margin:0 0 22px}
.option-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-top:1px solid var(--line);font-size:14px}.option-row small{display:block;color:var(--muted);font-size:12px;margin-top:3px;line-height:1.5}.option-row select{font:inherit;font-size:13px;background:var(--side);color:var(--text);border:1px solid var(--line);border-radius:9px;padding:8px;min-width:120px}.option-row select:disabled{opacity:.5}
.reply-actions{display:flex;gap:3px;align-items:center;margin-top:7px;white-space:normal}.reply-actions button{display:flex;align-items:center;gap:6px;border:0;background:none;color:var(--muted);padding:6px;border-radius:7px;font-size:12px;min-height:32px}.reply-actions button:hover{background:var(--soft);color:var(--text)}.reply-actions svg{width:16px;height:16px}.message.user .reply-actions{justify-content:flex-end}.reply-note{font-size:11px;color:var(--muted);margin:0 4px}.message.user{white-space:normal}.message.user .reply-content{white-space:pre-wrap}
.message.editing{width:100%;max-width:100%;background:var(--side);padding:16px;border:1px solid var(--line);border-radius:16px}.message-editor textarea{border:1px solid var(--line);border-radius:10px;background:var(--bg);padding:12px;min-height:150px;max-height:45vh;resize:vertical;font-size:14px}.message-editor p{font-size:12px;color:var(--muted);margin:8px 0}.edit-actions{display:flex;justify-content:flex-end;gap:8px}.edit-actions button{border:1px solid var(--line);border-radius:16px;background:var(--bg);font-size:12px;padding:7px 14px}.edit-actions button[type=submit]{background:var(--button);color:var(--inverse)}
@media(max-width:760px){#composer{padding:12px}#chat-options{padding:7px 6px;font-size:11px}.photo-tool,#send{width:38px;height:38px;min-width:38px}#options-dialog{padding:24px 18px}.option-row{gap:10px}.option-row select{min-width:105px}#privacy{font-size:10px;margin-top:8px}.message{margin-bottom:24px}}
.attachment button.attachment-preview{position:static;width:auto;height:auto;border:0;background:transparent;padding:0;display:block;border-radius:12px;cursor:zoom-in}.attachment-preview img{display:block}.message-photo{border:0;padding:0;background:transparent;border-radius:12px;cursor:zoom-in;display:block;max-width:100%}.message-photo img{display:block}#photo-viewer{padding:0;width:min(1100px,94vw);max-width:94vw;height:90dvh;max-height:90dvh;overflow:hidden;text-align:left;border-radius:16px}#photo-viewer[open]{display:flex;flex-direction:column}.viewer-toolbar{display:flex;align-items:center;gap:8px;flex-shrink:0;height:62px;padding:12px 18px;border-bottom:1px solid var(--line)}.viewer-toolbar strong{margin-right:auto;font-size:15px}.viewer-toolbar button{height:36px;min-width:36px;padding:0 10px;background:var(--soft);border:0;border-radius:8px;font-size:18px;line-height:1}.viewer-frame{flex:1;min-height:0;overflow:auto;background:var(--side);padding:12px}.viewer-frame img{display:block;height:auto;max-width:none;margin:auto;cursor:zoom-in}
.history-delete svg{width:14px;height:14px}.icon.dialog-close,.attachment button:not(.attachment-preview){display:grid;place-items:center;padding:0}.icon.dialog-close{width:32px;height:32px}.attachment button:not(.attachment-preview) svg{width:14px;height:14px}
#chat-options{min-width:0;flex-shrink:1}#options-summary{overflow:hidden;text-overflow:ellipsis;min-width:0}.composer-spacer{min-width:0}
#welcome{margin-top:clamp(24px,10vh,100px)}#welcome .mascot-host{height:138px;margin-bottom:4px}.fox-mascot{width:170px;height:145px;border:0;padding:0;background:none;border-radius:50%;cursor:pointer;--fox-look-x:0px;--fox-look-y:0px;--fox-tilt:0deg}.fox-mascot>svg{width:100%;height:100%;stroke:none;overflow:visible}.mascot-tail{transform-origin:150px 163px;animation:fox-tail-idle 5s ease-in-out infinite}.mascot-head{transform-origin:119px 130px;transform:rotate(var(--fox-tilt));transition:transform .25s ease-out}.fox-eye{transform:translate(var(--fox-look-x),var(--fox-look-y));transition:transform .18s ease-out}.fox-eye ellipse{transform-box:fill-box;transform-origin:center;animation:fox-blink 6.7s infinite}.fox-glints{animation:fox-glint-blink 6.7s infinite}.fox-sparkles{opacity:0;transform-origin:119px 100px}.mascot-body{transform-origin:119px 177px;animation:fox-breathe 4s ease-in-out infinite}.fox-mascot:hover .mascot-tail,.fox-mascot:focus-visible .mascot-tail,.fox-mascot.greeting .mascot-tail{animation:fox-tail-happy .5s ease-in-out infinite}.fox-mascot.greeting .mascot-head{animation:fox-hello .65s ease-in-out 2}.fox-mascot.greeting .fox-sparkles{animation:fox-sparkle 1.5s ease-out}.fox-mascot.greeting .mascot-ear{transform-box:fill-box;transform-origin:bottom center;animation:fox-ear .4s ease-in-out 3}
@keyframes fox-tail-idle{0%,65%,100%{transform:rotate(0)}78%{transform:rotate(-8deg)}88%{transform:rotate(3deg)}}
@keyframes fox-tail-happy{0%,100%{transform:rotate(-9deg)}50%{transform:rotate(12deg)}}
@keyframes fox-blink{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.09)}}
@keyframes fox-glint-blink{0%,44%,48%,100%{opacity:1}46%{opacity:0}}
@keyframes fox-breathe{0%,100%{transform:scaleY(1)}50%{transform:scaleY(1.025)}}
@keyframes fox-hello{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-7px) rotate(5deg)}}
@keyframes fox-ear{50%{transform:rotate(-7deg)}}
@keyframes fox-sparkle{0%{opacity:0;transform:scale(.7)}30%,70%{opacity:.8}100%{opacity:0;transform:scale(1.12)}}
@media(max-width:760px){#welcome{margin-top:clamp(20px,8vh,80px)}#welcome .mascot-host{height:124px}.fox-mascot{width:155px;height:132px}}
@media(prefers-reduced-motion:reduce){.fox-mascot *{animation:none!important;transition:none!important}.fox-mascot.greeting .fox-sparkles{opacity:.75}}
/* The selected Playful Explorer character uses local transparent sprite atlases. */
.brand-mark{width:38px;height:38px;object-fit:contain}.brand{gap:7px}.welcome-mark img{width:64px;height:64px}#welcome .explorer-host{height:152px;margin-bottom:3px}.explorer-fox{width:158px;height:158px;border:0;padding:0;background:transparent;border-radius:24px;cursor:pointer;display:block}.fox-state{display:block;width:100%;height:100%;background-image:url('/fox-states.png');background-size:300% 300%;background-repeat:no-repeat;background-position:0 0}.fox-loader{width:44px;height:44px;overflow:visible}.thinking-fox{animation:explorer-think 2.8s ease-in-out infinite}.fox-greeting{animation:explorer-greet .65s ease-in-out 2}.stream-fox{display:inline-block;position:relative;vertical-align:baseline;width:44px;height:0;margin:0 0 0 4px;pointer-events:none;user-select:none}.fox-running{display:block;position:absolute;bottom:-10px;left:0;width:44px;height:44px;background-image:url('/fox-run.png');background-size:300% 200%;background-repeat:no-repeat;animation:explorer-run .72s steps(1,end) infinite}.private-nav{margin-top:5px;background:transparent}.private-nav[aria-pressed=true]{background:var(--soft)}.private-nav svg{width:18px;height:18px}.private-chat #privacy{color:var(--text);font-weight:500}
@keyframes explorer-run{0%{background-position:0 0}16.666%{background-position:50% 0}33.333%{background-position:100% 0}50%{background-position:0 100%}66.666%{background-position:50% 100%}83.333%{background-position:100% 100%}100%{background-position:0 0}}
@keyframes explorer-think{0%,100%{transform:rotate(-4deg) translateY(0)}50%{transform:rotate(4deg) translateY(-2px)}}
@keyframes explorer-greet{50%{transform:translateY(-5px)}}
@media(max-width:760px){#welcome .explorer-host{height:138px}.explorer-fox{width:145px;height:145px}#prompt{font-size:16px}}
@media(prefers-reduced-motion:reduce){.fox-running,.thinking-fox,.fox-greeting{animation:none!important}}
