:root{color-scheme:dark;font-family:Inter,"Segoe UI",Arial,sans-serif;color:#f7f0f1;background:#100d13;font-size:16px;--gold:#e4b789;--muted:#c7b9c4}*{box-sizing:border-box}body{margin:0;min-height:100dvh;display:grid;place-items:center;background:radial-gradient(ellipse at 55% 30%,#393039 0%,#1a151c 43%,#0b0b0f 85%)}button,textarea{font:inherit}button{color:inherit;cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent}button:focus-visible,textarea:focus-visible,.timeline:focus-visible{outline:2px solid var(--gold);outline-offset:3px}button:hover{filter:brightness(1.18)}button:active{transform:scale(.97)}button:disabled{cursor:default;filter:none}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}.phone{position:relative;isolation:isolate;display:flex;flex-direction:column;width:min(100%,414px);height:min(900px,calc(100dvh - 40px));min-height:440px;overflow:hidden;border-radius:30px;border:1px solid #4c404a;background:#100e13;box-shadow:0 30px 100px #0009}.character-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:-3;transition:filter .35s,transform 6s}.shade{position:absolute;inset:0;z-index:-2;background:linear-gradient(#080b10b8, #080b1014 18%,#100d130d 35%,#100d1373 53%,#141016d4 82%,#100d13fd)}.phone.dimmed .character-bg{filter:brightness(.5)}.phone.scene-play .character-bg{transform:scale(1.07)}.status{height:44px;padding:14px 26px 0;display:flex;justify-content:space-between;align-items:flex-start;flex:none;font-size:15px;font-weight:650}.status-right{display:flex;gap:7px;align-items:center}.status-right svg{width:19px;height:16px;stroke-width:2}.signal{font-size:12px;letter-spacing:-1px}.battery{width:22px;height:11px;border:1px solid white;border-radius:3px;position:relative}.battery:before{content:"";position:absolute;inset:2px;background:white;border-radius:1px}.battery:after{content:"";position:absolute;right:-3px;top:3px;height:4px;width:2px;background:#fff8;border-radius:1px}.chat-header{height:62px;display:flex;gap:2px;align-items:center;padding:0 10px;flex:none;z-index:3}.icon-button{width:44px;min-width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%}.identity{display:flex;align-items:center;gap:11px;flex:1;min-width:0;padding:0;text-align:left}.identity img{width:38px;height:38px;border:1px solid #fff5;object-fit:cover;border-radius:50%}.identity strong{font-size:17px;display:flex;align-items:center;gap:7px;font-weight:600}.identity strong svg{width:16px;height:16px}.identity small{font-size:12px;display:flex;align-items:center;gap:7px;color:var(--muted);margin-top:4px}.demo-label{font-size:10px;color:#e5c6aa;border:1px solid #dbb59755;border-radius:4px;padding:1px 4px;white-space:nowrap}.scene-actions{position:absolute;right:16px;top:32%;display:grid;gap:10px;z-index:2;transition:opacity .2s}.scene-button{width:44px;height:44px;border-radius:50%;border:1px solid #a18b7c6b;background:#211c2099;backdrop-filter:blur(12px);display:grid;place-items:center}.scene-button svg{width:23px;height:23px}.phone.chatting .scene-actions{opacity:0;pointer-events:none}.timeline{flex:1;min-height:0;overflow:auto;scrollbar-width:none;overscroll-behavior:contain;scroll-behavior:smooth}.timeline::-webkit-scrollbar{display:none}.conversation{min-height:100%;padding:clamp(100px,25dvh,225px) 16px 6px;display:flex;flex-direction:column;justify-content:flex-end}.tagline{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;border-radius:12px;padding:11px 12px;background:#161216bd;backdrop-filter:blur(12px);width:100%;margin-bottom:15px}.tagline>span:first-child{display:grid;gap:5px}.tagline small{font-size:12px;color:#d9b38f;font-weight:600}.tagline span span{font-size:13px;color:#e7d9df;line-height:1.4}.tagline>span:last-child{color:#b9a8b4}#messages{display:flex;flex-direction:column;gap:14px}.message{max-width:89%;align-self:flex-start;animation:appear .22s ease}.bubble{padding:13px 14px;border-radius:15px;border:1px solid #ae826838;background:linear-gradient(135deg,#725044e0,#4b3837eb);backdrop-filter:blur(12px);font-size:15px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.bubble p{margin:0}.bubble .narration{color:#ddc8bb;font-size:14px;font-style:italic;margin-bottom:12px;line-height:1.45}.message.user{align-self:flex-end;max-width:82%}.message.user .bubble{background:#463a49eb;border-color:#83708352;font-size:15px}.voice-chip{position:relative;z-index:1;height:25px;min-width:57px;margin-bottom:-4px;padding:3px 10px;border-radius:20px;color:#573d2b;background:#dfb07e;display:flex;align-items:center;gap:5px;font-size:12px}.voice-chip svg{width:14px;height:14px}.typing .bubble{display:flex;gap:5px;align-items:center;padding:18px;min-width:64px}.typing i{width:5px;height:5px;border-radius:50%;background:#e6c6b3;animation:pulse 1s infinite}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}.composer-area{flex:none;padding:0 16px;background:linear-gradient(transparent,#100d13ee 65%);z-index:3}.toolbar{display:flex;align-items:center;height:52px;gap:2px}.toolbar .icon-button{color:#c7b4bf}.toolbar .icon-button[aria-pressed=true]{background:#e4b78922;color:var(--gold)}.toolbar-space{flex:1}.role-button{display:flex;align-items:center;gap:6px;background:#2f252acc;border-radius:16px;padding:8px 12px;font-size:13px}.role-button svg{width:15px;height:15px}.composer{display:flex;align-items:flex-end;gap:2px;padding:5px 6px 5px 15px;min-height:50px;background:#4b414bd1;backdrop-filter:blur(20px);border:1px solid #82748180;border-radius:26px}.composer textarea{resize:none;min-width:0;flex:1;color:#f7f0f1;background:transparent;border:0;outline:none;line-height:22px;font-size:16px;max-height:104px;height:36px;padding:7px 0;scrollbar-width:thin}.composer textarea::placeholder{color:#c5b7c3}.composer textarea:focus-visible{outline:none}.composer:focus-within{border-color:#c99f7d}.composer .icon-button{width:34px;min-width:34px;height:36px;color:#decfdb}.send-button{display:grid;place-items:center;background:linear-gradient(135deg,#f0c593,#c38b66);color:#402b22;width:36px;height:36px;min-width:36px;border-radius:50%;margin-bottom:1px;transition:opacity .2s}.send-button svg{width:22px;height:22px}.send-button:disabled{opacity:.4}.home-indicator{height:4px;width:126px;background:#f6eff5;border-radius:4px;margin:16px auto 9px}.suggestions{display:flex;gap:7px;overflow:auto;padding:0 0 10px;scrollbar-width:none}.suggestions button{border:1px solid #a48a7977;border-radius:20px;padding:8px 10px;white-space:nowrap;background:#32262edb;font-size:13px}.toast{position:absolute;top:111px;left:20px;right:20px;text-align:center;z-index:10;padding:12px 15px;background:#231c26f2;border:1px solid #80657980;box-shadow:0 8px 20px #0004;border-radius:12px;line-height:1.6;font-size:14px}.menu{position:absolute;right:16px;top:99px;z-index:8;width:170px;padding:5px;background:#251e29f5;border:1px solid #685667;border-radius:12px;box-shadow:0 10px 25px #0005}.menu button{display:block;width:100%;text-align:left;padding:12px;font-size:14px;border-radius:8px}.menu button:hover{background:#ffffff0a}dialog{color:#eee5ed;position:absolute;inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:85%;border:1px solid #695663;border-radius:24px 24px 0 0;background:#241c27f7;padding:28px 24px 30px;box-shadow:0 -15px 55px #0005;overflow:auto}dialog::backdrop{background:#09060aa6;backdrop-filter:blur(5px)}.sheet-handle{position:absolute;top:10px;left:calc(50% - 20px);width:40px;height:4px;border-radius:5px;background:#7d6b7a}.close-dialog{position:absolute;top:16px;right:12px}.profile-pic{width:72px;height:72px;object-fit:cover;border-radius:20px;border:1px solid #ddbd9e77}dialog h2{font-size:24px;margin:16px 0 5px;font-weight:600}dialog p{font-size:15px;line-height:1.7;color:#d3c1ce}dialog small{color:#b79faa;font-size:13px}.profile-tags{display:flex;gap:7px;margin:18px 0}.profile-tags span{padding:5px 10px;border:1px solid #a780625c;border-radius:15px;color:#e5bd98;font-size:12px}.sheet-button{background:var(--gold);color:#3f2a24;border-radius:20px;width:100%;padding:12px 16px;font-size:15px;margin-top:10px}.sheet-photo{display:block;max-height:63dvh;max-width:100%;margin:14px auto 0;border-radius:12px;object-fit:contain}.history-item{border-bottom:1px solid #8b6d852f;padding:10px 0;font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.history-item b{color:var(--gold);display:block;font-size:12px}[hidden]{display:none!important}@keyframes appear{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes pulse{50%{opacity:.3;transform:translateY(-3px)}}@media(max-width:540px){body{display:block}.phone{width:100%;height:100dvh;min-height:0;border:0;border-radius:0}.home-indicator{margin-bottom:max(9px,env(safe-area-inset-bottom))}}@media(max-height:690px){.status{display:none}.conversation{padding-top:80px}.scene-actions{top:22%}.home-indicator{margin-top:10px;margin-bottom:7px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

.bubble p{white-space:pre-wrap;overflow-wrap:anywhere}.reply-error .bubble{background:#3a252c;border:1px solid #c6818877}.retry-button{padding:9px 12px;background:var(--gold);color:#3f2a24;border-radius:16px;margin-top:10px;font-size:14px}

.streaming .bubble p:after{content:"▍";color:var(--gold);animation:pulse 1s infinite}.voice-chip:disabled{opacity:.5}

#memory-form label{display:block;margin:14px 0;font-size:13px;color:#e7ba89}
#memory-form input,#memory-form textarea{display:block;box-sizing:border-box;width:100%;margin-top:7px;border:1px solid #ffffff20;border-radius:12px;padding:11px;color:#f4edf3;background:#ffffff08;font:inherit;resize:vertical}
.memory-note{font-size:12px!important;color:#bdb0be!important;line-height:1.6}
.memory-summary{white-space:pre-wrap;padding:14px;background:#ffffff08;border-radius:12px}
.sheet-button.secondary{background:#ffffff10;color:#e6dfe7}
.sheet-button.danger{background:#5b303b;color:#ffd7db;margin-top:12px}
#memory-save-status{font-size:12px;color:#e7ba89}
#story-picker{display:block;width:100%;margin:10px 0;padding:10px;border-radius:10px;color:#f4edf3;background:#332a37;border:1px solid #ffffff20}
dialog{width:min(100%,414px);max-width:414px;left:50%;right:auto;transform:translateX(-50%)}
.memory-chip{display:block;margin:8px 0 0;padding:5px 10px;border:1px solid #e4b78944;border-radius:14px;color:#e4b789;background:#201820c9;font-size:11px}
.retrieval-panel{margin-top:24px;padding-top:6px;border-top:1px solid #ffffff15}
.retrieval-panel h4{font-size:13px;font-weight:500;color:#c7b9c4;margin:20px 0 10px}
.memory-source{padding:12px;margin:10px 0;border:1px solid #ffffff16;border-radius:14px;background:#ffffff05}
.memory-source p{font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;margin:10px 0}
.memory-source small{font-size:11px;color:#c19c7c}
.source-link{color:#e4b789;font-size:12px;padding:5px 0}
#memory-search-form label{display:block;font-size:13px;color:#e7ba89;margin:14px 0}
#memory-search-form input,#memory-search-form select{display:block;width:100%;box-sizing:border-box;padding:12px;margin-top:7px;border:1px solid #ffffff20;border-radius:12px;background:#332a37;color:#f4edf3;font:inherit}

.chat-view{display:flex;flex-direction:column;flex:1;min-height:0}
.phone.exploring .character-bg,.phone.exploring .shade{display:none}
