:root{color-scheme:light;--bg:#f7f4ef;--surface:#fffdf9;--paper:#fff;--ink:#353b36;--muted:#8b8e84;--line:#e8e6df;--accent:#d57761;--accent-soft:#f4e4dd;--sage:#e6ebe2;--bubble:#eceee7;--shadow:0 20px 80px #34372c0c;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;font-synthesis:none}
:root[data-theme=dark]{color-scheme:dark;--bg:#202521;--surface:#272d28;--paper:#303731;--ink:#e9e9df;--muted:#a3ad9e;--line:#3b443d;--accent:#e59b82;--accent-soft:#513c33;--sage:#374238;--bubble:#39433b;--shadow:0 20px 80px #0002}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:14px}button,input,textarea,select{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.45}button{border:0;background:none}input,textarea,select{color:var(--ink);background:var(--paper)}button,input,textarea,select{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button{touch-action:manipulation}h1,h2,h3,p{margin:0}button{min-height:40px}small{font-size:11px}[hidden]{display:none!important}.app-shell{display:grid;grid-template-columns:280px minmax(340px,1fr) 285px;max-width:1580px;margin:auto;height:100vh;height:100dvh;padding-top:env(safe-area-inset-top);overflow:hidden}.sidebar{display:flex;flex-direction:column;padding:30px 22px 18px;border-right:1px solid var(--line);min-height:0}.brand{display:flex;gap:11px;align-items:center}.brand-mark{display:grid;place-items:center;width:42px;height:43px;background:var(--accent);color:#fffaf3;border-radius:14px 14px 14px 3px;font-family:serif;font-size:23px}.brand strong{font-family:serif;font-size:27px;letter-spacing:2px}.brand-dot{color:var(--accent)}.brand small{display:block;color:var(--muted);letter-spacing:2px;margin-top:2px}.icon-btn{font-size:24px;min-width:40px;border-radius:10px}.icon-btn:hover{background:var(--sage)}.theme-toggle{margin-left:auto;font-size:23px}.side-intro{padding:37px 0 31px}.eyebrow{font-size:9px;letter-spacing:1.7px;color:var(--muted)}h1{font-family:serif;font-weight:500;font-size:28px;line-height:1.6;letter-spacing:2px;margin:13px 0 10px}.side-intro p,.rail-top p{font-size:11px;color:var(--muted);line-height:1.8}.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.section-heading h2,.section-heading h3{font-size:13px;font-weight:600}.section-heading h2 span{font-size:11px;color:var(--muted);margin-left:7px}.text-btn{color:var(--accent);font-size:12px;min-height:32px}.search-box{border:1px solid var(--line);display:flex;align-items:center;border-radius:9px;padding:3px 10px;gap:8px;margin-bottom:16px}.search-box span{font-size:23px;color:var(--muted)}.search-box input{border:0;background:none;outline:0;width:100%;font-size:12px;min-height:32px}.person-list{overflow-y:auto;min-height:80px}.person-card{width:100%;display:flex;text-align:left;align-items:center;gap:12px;padding:13px 10px;border-radius:12px;margin-bottom:7px}.person-card.active{background:var(--sage)}.person-card:hover{background:var(--sage)}.avatar{flex-shrink:0;width:44px;height:46px;display:grid;place-items:center;border-radius:16px 16px 16px 5px;font-size:23px;background:#e4e7d8;color:#344336}.avatar[data-color=rose]{background:#efd9d4;color:#79514e}.avatar[data-color=blue]{background:#dce4e8;color:#49616c}.avatar[data-color=gold]{background:#eee2c8;color:#78643b}.person-card .person-info{min-width:0;flex:1}.person-card strong{display:block;font-size:14px;font-weight:600}.person-card p{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;max-width:162px;margin-top:7px}.person-card time{font-size:9px;color:var(--muted);align-self:flex-start;margin-top:3px}.add-card{border:1px dashed #bdbeb0;width:100%;border-radius:10px;color:var(--muted);font-size:12px;min-height:46px;margin:12px 0 20px}.side-bottom{margin-top:auto;padding-top:15px}.privacy-note{display:flex;gap:10px;padding:14px 0;border-top:1px solid var(--line)}.privacy-note>span{color:var(--accent);font-size:22px}.privacy-note strong{font-size:11px;font-weight:500}.privacy-note p{font-size:10px;color:var(--muted);line-height:1.7;margin-top:5px}.wide-btn{width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--line);border-radius:9px;padding:8px 12px;font-size:11px}.side-footer{display:flex;justify-content:space-between;color:var(--muted);font-size:9px;margin-top:21px}.side-footer span:last-child{letter-spacing:1px;font-size:8px}.main{display:flex;flex-direction:column;min-width:0;background:var(--surface);position:relative;min-height:0}.chat-header{height:90px;display:flex;align-items:center;padding:20px 30px;gap:12px;flex-shrink:0;border-bottom:1px solid var(--line)}.chat-header .avatar{width:42px;height:44px}.header-person{flex:1;min-width:0}.header-person h2{font-size:17px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-person p{font-size:10px;color:var(--muted);margin-top:7px}.status-dot{display:inline-block;width:5px;height:5px;background:#92a489;border-radius:50%;margin-right:5px;vertical-align:2px}.demo-pill{background:var(--accent-soft);color:var(--accent);font-size:10px;border:1px solid #d5776125;padding:5px 9px;border-radius:6px;white-space:nowrap}.view-tabs{display:flex;gap:27px;padding:0 30px;border-bottom:1px solid var(--line);height:51px;flex-shrink:0}.view-tabs button{font-size:12px;color:var(--muted);padding:0 3px;border-bottom:2px solid transparent}.view-tabs .selected{color:var(--ink);border-color:var(--accent)}.view-tabs span{font-size:9px;background:var(--sage);padding:2px 5px;border-radius:4px;margin-left:4px}.view{min-height:0;flex:1}.chat-view{display:flex;flex-direction:column}.demo-notice{display:flex;gap:9px;align-items:center;margin:19px 30px 3px;padding:11px 15px;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:10px;line-height:1.9}.demo-notice>span{font-size:21px;color:var(--accent)}.messages{padding:15px 30px 25px;overflow-y:auto;flex:1;overscroll-behavior:contain;scroll-behavior:smooth}.day-divider{text-align:center;font-size:10px;color:var(--muted);margin:13px 0 24px;letter-spacing:1px}.message-row{display:flex;align-items:flex-start;gap:10px;margin:0 0 22px}.message-row.me{flex-direction:row-reverse}.message-row .avatar{width:31px;height:33px;font-size:17px;border-radius:11px 11px 11px 4px}.message-row.me .avatar{background:var(--accent-soft);color:var(--accent)}.message-body{max-width:78%;min-width:65px}.bubble{background:var(--bubble);border-radius:0 13px 13px 13px;padding:12px 15px;font-size:13px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere}.me .bubble{background:var(--accent-soft);border-radius:13px 0 13px 13px}.message-body time{display:block;font-size:9px;color:var(--muted);margin-top:7px}.me time{text-align:right}.message-source{font-size:9px;margin-bottom:5px;color:var(--muted)}.composer-wrap{padding:0 30px calc(19px + env(safe-area-inset-bottom));flex-shrink:0}.suggestions{display:flex;gap:7px;margin-bottom:13px;overflow:auto}.suggestions button{border:1px solid var(--line);border-radius:20px;white-space:nowrap;color:var(--muted);font-size:10px;min-height:30px;padding:0 11px}.suggestions button:hover{background:var(--sage)}.composer{display:flex;align-items:flex-end;border:1px solid var(--line);background:var(--paper);padding:10px 11px 10px 15px;border-radius:13px;gap:10px;box-shadow:var(--shadow)}.composer textarea{border:0;resize:none;outline:none;background:transparent;flex:1;min-width:0;font-size:13px;line-height:24px;max-height:120px;padding:4px 0}.send-btn{background:var(--accent);color:white;font-size:23px;border-radius:9px;min-width:36px;min-height:36px}.composer-meta{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:9px;margin:10px 2px 0}.memory-rail{padding:35px 23px 20px;border-left:1px solid var(--line);overflow-y:auto}.rail-top h2{font-size:18px;font-family:serif;font-weight:500;letter-spacing:1px;margin:14px 0 9px;display:flex;justify-content:space-between}.rail-top h2 span{color:var(--accent);font-size:25px}.mini-profile{padding:21px 0;margin-bottom:21px;border-bottom:1px solid var(--line)}.tag{display:inline-block;padding:5px 8px;border:1px solid var(--line);font-size:10px;border-radius:5px;margin:4px 5px 0 0;color:var(--muted)}.mini-profile p{font-size:11px;color:var(--muted);line-height:1.9;margin-top:10px}.memory-mini{border-left:1px solid #c8cdbd;margin:0 0 0 5px;padding:0 0 21px 17px;position:relative}.memory-mini:before{content:'';position:absolute;left:-4px;top:6px;width:7px;height:7px;background:#a5b398;border-radius:50%;border:2px solid var(--bg)}.memory-mini time{font-size:9px;color:var(--muted);letter-spacing:1px}.memory-mini h4{font-size:12px;font-weight:500;margin:7px 0}.memory-mini p{font-size:10px;color:var(--muted);line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}.quote-card{padding:12px 15px 25px;background:var(--sage);border-radius:3px 25px 3px 3px;margin:16px 0;position:relative;overflow:hidden}.quote-card>span{font-family:Georgia,serif;font-size:45px;color:#a4b098;line-height:1}.quote-card p{font-family:serif;line-height:2;font-size:15px;letter-spacing:1px}.quote-card small{display:block;font-size:8px;letter-spacing:2px;color:var(--muted);margin-top:22px}.flower{position:absolute;right:10px;bottom:5px;font-size:76px;color:#a4b098;transform:rotate(-20deg);opacity:.65}.content-view{overflow:auto;padding:30px}.page-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.page-title h2{font-family:serif;font-size:25px;font-weight:500}.page-subtitle{color:var(--muted);font-size:12px;line-height:1.8;margin-bottom:25px}.primary{background:var(--accent);color:#fff;border-radius:9px;padding:10px 18px;min-height:44px}.secondary{border:1px solid var(--line);border-radius:9px;padding:9px 15px;min-height:44px}.danger{color:#bd6157;border:1px solid #bd61573a;border-radius:9px;padding:9px 15px;min-height:44px}.memory-card,.profile-card{background:var(--paper);border:1px solid var(--line);padding:20px;border-radius:13px;margin-bottom:15px;overflow-wrap:anywhere}.memory-card time{font-size:11px;color:var(--muted)}.memory-card h3{margin:10px 0;font-size:16px}.memory-card p{line-height:1.9;white-space:pre-wrap}.card-actions{display:flex;gap:12px;margin-top:12px}.card-actions button{font-size:12px;color:var(--muted);min-height:34px}.profile-card .avatar{width:64px;height:67px;font-size:32px;margin-bottom:16px}.profile-card h3{font-size:22px;margin-bottom:10px}.profile-fields{display:grid;grid-template-columns:110px 1fr;gap:17px 10px;line-height:1.8;font-size:13px}.profile-fields dt{color:var(--muted)}.profile-fields dd{margin:0;white-space:pre-wrap}.empty-state{text-align:center;margin:auto;padding:40px 20px;color:var(--muted)}.empty-state>span{font-size:45px;color:var(--accent)}.empty-state h2{font-size:18px;color:var(--ink);margin:15px 0}.empty-state p{line-height:1.9;margin-bottom:22px}.mobile-only{display:none}.muted{color:var(--muted);line-height:1.9;font-size:12px}.error{color:#bb6258}.toast{position:fixed;bottom:calc(32px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:var(--ink);color:var(--surface);padding:13px 22px;border-radius:12px;max-width:90vw;width:max-content;z-index:10;box-shadow:var(--shadow);font-size:12px;line-height:1.7}dialog{color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:20px;width:min(560px,94vw);max-height:88vh;max-height:88dvh;padding:24px;box-shadow:0 30px 100px #0003}dialog::backdrop{background:#18251d70;backdrop-filter:blur(4px)}.modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.modal-header h2{font-family:serif;font-size:23px;font-weight:500}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.field{display:flex;flex-direction:column;gap:8px;min-width:0;font-size:12px}.field.full{grid-column:1/-1}.field input,.field textarea,.field select{width:100%;border:1px solid var(--line);padding:11px;border-radius:8px;font-size:16px;min-height:44px}.field textarea{resize:vertical;min-height:83px}.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:25px}.settings-block{padding:17px 0;border-top:1px solid var(--line)}.settings-block h3{font-size:14px;margin-bottom:8px}.settings-block p{margin-bottom:12px}.settings-buttons{display:flex;flex-wrap:wrap;gap:8px}.setting-theme{width:100%;border:1px solid var(--line);padding:10px;border-radius:8px;font-size:16px}.summary-area{width:100%;min-height:120px;border:1px solid var(--line);border-radius:9px;padding:12px;font-size:16px;line-height:1.8;margin:10px 0}.import-preview{max-height:220px;overflow:auto;white-space:pre-wrap;background:var(--sage);border-radius:9px;padding:15px;font-size:12px;line-height:1.8}.loading-note{color:var(--muted);font-size:11px;text-align:center}.form-error{color:#bd6157;font-size:12px;line-height:1.8;margin-top:12px}.no-results{padding:15px 5px;color:var(--muted);font-size:12px}
@media(min-width:1440px){.app-shell{padding:24px;height:100dvh;grid-template-columns:280px minmax(340px,1fr) 285px}.main{border:1px solid var(--line);border-radius:18px}.sidebar,.memory-rail{border:0}.sidebar{padding-left:5px;padding-right:25px}.memory-rail{padding-left:27px;padding-right:5px}}
@media(max-width:1150px){.app-shell{grid-template-columns:255px minmax(340px,1fr)}.memory-rail{display:none}.sidebar{padding:25px 18px}.chat-header{padding:18px 24px}}
@media(max-width:650px){.app-shell{display:block;height:100dvh}.sidebar{height:100%;border:0;padding:22px 22px calc(18px + env(safe-area-inset-bottom))}.main{display:none;height:100%;height:calc(100dvh - env(safe-area-inset-top))}body.in-chat .sidebar{display:none}body.in-chat .main{display:flex}.mobile-only{display:block}.desktop-only{display:none}.chat-header{height:76px;padding:12px 13px;gap:9px}.chat-header .avatar{width:35px;height:38px;font-size:20px}.header-person h2{font-size:16px}.header-person p{font-size:9px}.chat-header .demo-pill{font-size:9px;padding:4px 6px}.view-tabs{padding:0 23px;gap:30px;height:47px}.demo-notice{margin:13px 16px 2px;font-size:10px;padding:9px 11px}.messages{padding:12px 16px 18px}.message-body{max-width:80%}.bubble{font-size:14px;padding:10px 13px}.composer-wrap{padding:0 14px calc(10px + env(safe-area-inset-bottom))}.composer textarea{font-size:16px}.composer-meta{font-size:8px}.suggestions{margin-bottom:9px}.suggestions button{font-size:10px;min-height:32px}.content-view{padding:25px 18px}.person-card{padding:15px 12px}.person-card p{max-width:230px}.side-intro{padding:28px 0}.form-grid{gap:15px 12px}dialog{padding:20px;border-radius:17px}.profile-fields{grid-template-columns:85px 1fr}.page-title h2{font-size:23px}.side-bottom{padding-top:5px}.person-list{flex:1}.side-footer{margin-top:15px}}
@media(max-height:650px){.side-intro{padding:15px 0}.side-intro h1{font-size:23px;line-height:1.4}.side-intro .eyebrow{display:none}.privacy-note{padding:8px 0}.demo-notice{margin-top:8px}.chat-header{height:65px}.suggestions{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
