:root{font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;color:#243e3a;background:#f4f5ef;font-size:15px;line-height:1.65;--green:#204f48;--muted:#74817a;--line:#dce2d8}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a,input,textarea,select{outline-offset:4px}button{cursor:pointer;border:0;border-radius:10px;background:var(--green);color:white;padding:10px 20px;font-weight:600}button:disabled{opacity:.5;cursor:wait}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}.top{height:88px;max-width:1200px;margin:auto;padding:0 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{font-size:26px;font-weight:750;letter-spacing:3px}.brand span{display:inline-block;font-size:10px;letter-spacing:2px;color:var(--muted);margin-left:15px;font-weight:500}nav{display:flex;align-items:center;gap:24px;font-size:13px}main{max-width:1100px;min-height:calc(100vh - 175px);padding:48px 24px;margin:auto}footer{text-align:center;color:var(--muted);font-size:11px;letter-spacing:1px;padding:24px}h1{font-size:36px;letter-spacing:-1px;line-height:1.3;margin:12px 0}h2{font-size:22px;margin:0 0 16px}h3{font-size:16px;margin:8px 0}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--muted)}p{margin:10px 0 22px}.muted{color:var(--muted)}.hero{display:flex;justify-content:space-between;align-items:center;margin-bottom:36px}.hero p{max-width:600px}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(275px,1fr));gap:20px}.card{padding:28px;border:1px solid var(--line);border-radius:18px;background:#fffefa;box-shadow:0 6px 24px #233c3505}.avatar{height:58px;width:58px;background:#e3eadd;border-radius:18px;display:grid;place-items:center;font-size:24px;color:var(--green);margin-bottom:22px}.person-head{display:flex;gap:16px;align-items:center}.person-head .avatar{margin:0}.pill{display:inline-block;font-size:11px;padding:3px 8px;border-radius:6px;margin-right:6px;background:#edf1e7;color:#486744}.pill.off{background:#f1eee7;color:#8c8473}.stats{display:flex;gap:20px;border-top:1px solid var(--line);margin-top:24px;padding-top:18px}.stats strong{font-size:24px;display:block}.stats span{font-size:12px;color:var(--muted)}.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:22px}.actions a{padding:9px 14px}.secondary{background:#e9ede4;color:var(--green)}.quiet{background:transparent;color:var(--muted);padding:8px}.danger{background:#f5e8e5;color:#994c42}.notice{padding:14px 18px;background:#eeeadc;color:#71643d;border-radius:10px;margin:0 0 24px;font-size:13px}.empty{padding:70px 24px;text-align:center;border:1px dashed #bcc9b7;border-radius:18px}.empty .avatar{margin:0 auto 24px}.narrow{max-width:700px;margin:auto}.login{max-width:420px;margin:60px auto}label{display:block;font-size:13px;font-weight:600;margin:18px 0 7px}input,textarea,select{width:100%;padding:11px 13px;border:1px solid #cfd8cb;border-radius:9px;background:#fff;color:#243e3a}textarea{resize:vertical;min-height:100px}input[type=checkbox]{width:auto;margin-right:8px}input[type=file]{background:#f5f7f0;border:1px dashed #aebda5;padding:20px;font-size:13px}.steps{display:flex;gap:12px;flex-wrap:wrap;margin:25px 0;color:var(--muted);font-size:12px}.steps .active{color:var(--green);font-weight:700}.two{display:grid;grid-template-columns:1fr 1fr;gap:18px}.back{font-size:13px;color:var(--muted)}.section{margin-bottom:24px}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.metric{padding:16px;background:#f0f3eb;border-radius:10px;font-size:12px}.metric b{display:block;font-size:22px}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f2f4ed;border-radius:8px;padding:14px;font:12px/1.8 monospace;max-height:350px;overflow:auto}.example{padding:12px 16px;border-left:2px solid #afc2a2;margin:14px 0;font-size:13px}.chat-shell{max-width:820px;margin:auto;border:1px solid var(--line);background:#fffefa;border-radius:18px;overflow:hidden}.chat-header{display:flex;justify-content:space-between;align-items:center;padding:18px 24px;border-bottom:1px solid var(--line)}.chat-header .avatar{width:40px;height:40px;border-radius:12px;font-size:18px}.messages{height:52vh;min-height:280px;overflow:auto;padding:24px;display:flex;flex-direction:column;gap:18px;background:#f2f4ed}.msg{max-width:78%;align-self:flex-start}.msg.user{align-self:flex-end}.bubble{padding:12px 17px;border-radius:14px 14px 14px 3px;background:white;border:1px solid #e1e7dd;white-space:pre-wrap;overflow-wrap:anywhere}.user .bubble{background:#dce8d5;border:0;border-radius:14px 14px 3px 14px}.msg-tools{display:flex;gap:4px;align-items:center;margin-top:4px;font-size:11px;color:var(--muted)}.msg-tools button{font-size:11px;padding:3px 8px;background:transparent;color:var(--muted)}.msg-tools button.selected{color:var(--green);background:#dce8d5}.composer{padding:18px 22px}.compose-row{display:flex;gap:10px;align-items:flex-end}.compose-row textarea{min-height:48px;height:48px;max-height:130px}.compose-row button{flex-shrink:0}.hint{font-size:11px;color:var(--muted);margin-top:8px}.typing{font-size:12px;color:var(--muted);padding:0 24px;height:24px}.audio{display:block;width:220px;height:30px;margin-top:8px}.row{display:flex;justify-content:space-between;align-items:center;gap:16px}#toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);max-width:90vw;background:#233e37;color:white;border-radius:12px;padding:14px 24px;box-shadow:0 5px 30px #0002;z-index:99}.error{color:#a34537}.linkbtn{display:inline-block;border-radius:10px;padding:10px 20px;background:var(--green);color:white}.check-label{font-weight:400}.loading{padding:60px;text-align:center;color:var(--muted)}@media(max-width:650px){.top{height:70px;padding:0 20px}.brand span{display:none}main{padding:26px 16px}.hero{align-items:flex-start;gap:18px;flex-direction:column}h1{font-size:29px}.card{padding:20px}.two{grid-template-columns:1fr}.metrics{grid-template-columns:repeat(2,1fr)}.messages{padding:16px;height:51vh}.composer{padding:12px}.compose-row{gap:6px}.compose-row button{padding:10px 12px}.chat-header{padding:14px}.msg{max-width:88%}.chat-shell{border-radius:12px}}

main.chat-mode{padding-top:24px;padding-bottom:12px;min-height:0}.chat-mode .chat-shell{height:calc(100dvh - 180px);min-height:440px;display:flex;flex-direction:column}.chat-mode .chat-header,.chat-mode .composer,.chat-mode .typing,.chat-mode .notice{flex-shrink:0}.chat-mode .messages{flex:1;min-height:0;height:auto}.chat-mode .notice{margin:0;border-radius:0}.chat-mode .msg[hidden],.chat-mode button[hidden]{display:none}@media(max-width:650px){main.chat-mode{padding-top:14px}.chat-mode .chat-shell{height:calc(100dvh - 150px);min-height:400px}}

/* Mobile layouts: keep controls reachable without horizontal scrolling. */
[hidden]{display:none!important}
input,textarea,select,.person-head,.person-head>div,.grid>*{min-width:0}
h1,h2,h3,.muted,.notice,.example,.metric{overflow-wrap:anywhere}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
.audio{max-width:100%}
@media(max-width:650px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
 .top{height:auto;min-height:64px;padding:8px 16px;padding-top:max(8px,env(safe-area-inset-top));gap:12px}
 .brand{flex-shrink:0;font-size:24px}
 nav{gap:6px;min-width:0;font-size:12px;justify-content:flex-end}
 nav>a{flex-shrink:0;padding:10px 4px}
 #logout{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;min-width:0}
 main{padding:22px 14px;min-height:calc(100dvh - 140px)}
 .login{margin:8px auto 16px;width:100%;max-width:420px;padding:22px 20px}
 .login h1{font-size:28px;margin-top:8px}
 .login .actions{display:grid;grid-template-columns:1fr;gap:8px}
 .login .actions button{width:100%}
 .login p{margin-bottom:16px}
 button,.linkbtn,input:not([type=checkbox]),select{min-height:44px}
 input,select,textarea{font-size:16px}
 input[type=file]{max-width:100%;padding:12px 8px;font-size:13px;overflow:hidden}
 input[type=file]::file-selector-button{min-height:36px;border:0;border-radius:6px;padding:6px 10px;margin-right:8px;background:#e0e8d9;color:var(--green)}
 .grid{grid-template-columns:minmax(0,1fr);gap:14px}
 .card{padding:20px 16px;border-radius:14px}
 .hero{gap:14px;margin-bottom:24px}
 .hero .linkbtn{width:100%;text-align:center}
 .hero h1{font-size:28px}
 .empty{padding:36px 16px}
 .actions{gap:8px}
 .actions>a,.actions>button{flex:1 1 120px;text-align:center}
 .row{flex-wrap:wrap;gap:8px}
 .row h2{margin-bottom:4px}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .metric{padding:12px 10px}
 .metric b{font-size:20px}
 .steps{gap:6px;margin:18px 0}
 .pill{margin-right:0;max-width:100%;overflow-wrap:anywhere}
 details>summary{padding:12px 0;min-height:44px;cursor:pointer}
 .check-label{display:flex;align-items:flex-start;gap:8px;line-height:1.7}
 input[type=checkbox]{width:20px;height:20px;flex-shrink:0;margin:3px 0 0}
 footer{padding:16px 12px max(16px,env(safe-area-inset-bottom))}
 #toast{bottom:max(16px,env(safe-area-inset-bottom));padding:12px 16px;width:max-content;max-width:calc(100% - 28px);font-size:13px;overflow-wrap:anywhere}
 body:has(main.chat-mode){height:var(--visual-height,100dvh);overflow:hidden}
 body:has(main.chat-mode)>.top,body:has(main.chat-mode)>footer{display:none}
 main.chat-mode{max-width:none;padding:0;height:100%;min-height:0}
 .chat-mode .chat-shell{width:100%;max-width:none;height:100%;min-height:0;border:0;border-radius:0}
 .chat-mode .chat-header{padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));gap:8px;min-height:64px}
 .chat-header .person-head{flex:1;gap:8px;overflow:hidden}
 .chat-header .person-head>a{display:grid;place-items:center;min-width:32px;min-height:44px;flex-shrink:0}
 .chat-header .avatar{width:34px;height:34px;flex-shrink:0}
 .chat-header .person-head b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .chat-header>a{font-size:12px;flex-shrink:0;padding:10px 4px}
 .chat-header .hint{font-size:10px;margin-top:0}
 .chat-mode .messages{padding:16px 12px;gap:14px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 .msg{max-width:90%;min-width:0;flex-shrink:0}
 .bubble{padding:10px 13px;font-size:15px;line-height:1.65}
 .msg-tools{flex-wrap:wrap;gap:0}
 .msg-tools button{min-height:40px;padding:6px 8px;font-size:12px}
 .chat-mode .typing{height:20px;padding:0 12px;font-size:11px;overflow:hidden}
 .chat-mode .composer{padding:10px 10px max(10px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fffefa}
 .compose-row{gap:6px;align-items:flex-end}
 .compose-row textarea{flex:1;width:0;min-width:0;min-height:44px;height:44px;max-height:96px;resize:none;padding:9px 10px}
 .compose-row button{min-height:44px;padding:10px 12px}
 #mic{min-width:40px;padding:8px}
 .composer>.hint{font-size:10px;line-height:1.5;margin-top:6px}
 .chat-mode .notice{padding:8px 12px;font-size:12px}
}
@media(max-width:360px){nav{gap:2px}#logout{max-width:115px}.brand{font-size:22px}.login{padding:20px 16px}.card{padding:18px 14px}.chat-header .avatar{display:none}.compose-row button{padding:10px}.chat-header .hint{max-width:170px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}
/* Voice-first conversation and import guidance. */
.import-choice{display:grid;grid-template-columns:1fr auto 1fr;gap:20px;align-items:stretch;margin-top:20px}.import-choice>div:not(.or-divider){padding:16px;background:#f5f7f0;border-radius:12px}.or-divider{align-self:center;color:var(--muted);font-size:13px}.import-preview{border-top:1px solid var(--line);margin-top:20px;padding-top:18px}.modal-backdrop{position:fixed;inset:0;z-index:120;background:#142a267a;display:grid;place-items:center;padding:20px}.guide-card{position:relative;width:min(680px,100%);max-height:min(780px,calc(100dvh - 40px));overflow:auto;background:#fffefa;border-radius:18px;padding:30px;box-shadow:0 24px 80px #0005}.guide-card h2{padding-right:36px}.guide-close{position:absolute;top:16px;right:16px;font-size:24px;line-height:1;padding:7px 11px}.guide-steps{display:grid;gap:10px;margin:20px 0}.guide-steps article{padding:14px 16px;border-radius:11px;background:#f1f4ed;border-left:3px solid #9db391}.guide-steps p{margin:7px 0 0;font-size:13px;line-height:1.65;color:var(--muted)}.guide-steps code{font:12px/1.5 monospace;color:#36534d}.privacy-note{padding:12px 14px;background:#eeeadc;border-radius:10px;font-size:13px;color:#71643d}

.voice-shell{max-width:820px;margin:0 auto;min-height:calc(100dvh - 180px);border:1px solid var(--line);border-radius:22px;background:radial-gradient(circle at 50% 42%,#f6faef 0,#fffefa 55%,#f4f0e8 100%);overflow:hidden;display:flex;flex-direction:column}.voice-header{display:flex;align-items:center;gap:12px;padding:18px 22px;border-bottom:1px solid #e2e7dd;background:#fffefa}.voice-header>.avatar{margin:0;width:42px;height:42px;border-radius:13px;font-size:18px}.voice-header>div{flex:1;min-width:0}.voice-header b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.voice-header p{margin:3px 0 0;color:var(--muted);font-size:12px}.voice-header>a{font-size:13px;color:var(--muted)}.voice-main{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:520px;padding:38px 24px;text-align:center}.voice-orbit{height:212px;width:212px;display:grid;place-items:center;border-radius:50%;background:radial-gradient(circle,#dbead4 0 28%,#eaf3e3 29% 46%,transparent 47%);position:relative}.voice-orbit:before,.voice-orbit:after{content:"";position:absolute;inset:0;border:1px solid #b6cdb066;border-radius:50%;animation:voice-pulse 2.6s ease-out infinite}.voice-orbit:after{animation-delay:1.25s}.voice-orb{height:118px;width:118px;border-radius:50%;display:grid;place-items:center;background:#244f48;color:#fffefa;font-size:42px;box-shadow:0 12px 32px #21453a40;transition:transform .25s,background .25s}.voice-status{margin:20px 0 18px}.voice-status strong{display:block;font-size:19px;color:var(--green)}.voice-status p{max-width:430px;margin:8px 0 0;color:var(--muted);line-height:1.6}.mic-button{width:158px;height:158px;border-radius:50%;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:7px;background:#2e665d;box-shadow:0 12px 30px #1d53463b;border:5px solid #fffefa;transition:transform .18s,background .18s}.mic-button span{font-size:36px}.mic-button b{font-size:14px}.mic-button:hover:not(:disabled){transform:scale(1.035);background:#204f48}.mic-button:disabled{opacity:.58}.voice-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:24px}.voice-actions button{font-size:13px}.voice-main>.hint{max-width:480px;margin:14px 0 0;line-height:1.6}.voice-shell[data-voice-state="listening"] .voice-orb{background:#ad5e50;transform:scale(1.08);animation:voice-breathe .9s ease-in-out infinite}.voice-shell[data-voice-state="listening"] .voice-orbit:before,.voice-shell[data-voice-state="listening"] .voice-orbit:after{border-color:#c8716188;animation-duration:1.35s}.voice-shell[data-voice-state="thinking"] .voice-orb,.voice-shell[data-voice-state="synthesizing"] .voice-orb{animation:voice-spin 1.2s linear infinite}.voice-shell[data-voice-state="speaking"] .voice-orb{background:#3d7a63;animation:voice-breathe .55s ease-in-out infinite}.voice-shell[data-voice-state="error"] .voice-orb{background:#a95a4c}.text-panel{border-top:1px solid var(--line);background:#fffefa}.text-panel-head{padding:18px 22px 4px}.text-panel-head h2{font-size:18px;margin:0}.text-panel-head p{font-size:12px;color:var(--muted);margin:6px 0}.text-panel .messages{height:420px;min-height:180px}.text-panel .composer{border-top:1px solid var(--line)}@keyframes voice-pulse{0%{transform:scale(.75);opacity:.8}100%{transform:scale(1.18);opacity:0}}@keyframes voice-breathe{50%{transform:scale(1.1)}}@keyframes voice-spin{to{transform:rotate(360deg)}}

@media(max-width:650px){.import-choice{grid-template-columns:1fr;gap:12px}.or-divider{justify-self:center}.guide-card{padding:24px 18px;border-radius:15px}.guide-steps article{padding:12px}.voice-shell{height:100%;min-height:0;border:0;border-radius:0}.voice-header{padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top))}.voice-header>a:last-child{font-size:12px;white-space:nowrap}.voice-main{min-height:0;padding:24px 16px;justify-content:center}.voice-orbit{width:180px;height:180px}.voice-orb{width:106px;height:106px;font-size:36px}.mic-button{width:142px;height:142px}.voice-status{margin:16px 0}.voice-actions{margin-top:20px}.text-panel .messages{height:38dvh}.text-panel .composer{padding-bottom:max(10px,env(safe-area-inset-bottom))}}
/* Voice-first styles end. */
