:root{color-scheme:light;--paper:#f5f7f2;--ink:#243b37;--muted:#73817a;--green:#226b57;--line:#dfe6db;--soft:#e8eee3}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:14px/1.6 system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}main{max-width:760px;margin:auto;padding:14px 20px max(10px,env(safe-area-inset-bottom));height:100vh;height:100dvh}#app{display:flex;flex-direction:column;height:100%;min-height:0}.topline{display:flex;align-items:center;justify-content:space-between;gap:8px}.scope{display:inline-flex;gap:7px;align-items:center;font-size:11px;padding:5px 9px;background:var(--soft);border-radius:99px;min-width:0;flex-wrap:wrap}.dot{width:5px;height:5px;border-radius:50%;background:var(--green)}.divider{color:#a8b9a3}.account-actions{display:flex;gap:12px;white-space:nowrap}button{font:inherit;cursor:pointer;touch-action:manipulation}button:disabled{opacity:.4;cursor:default}.link{background:none;border:0;padding:6px 0;color:var(--muted);font-size:11px}.link:hover{color:var(--green)}.live-status{display:flex;align-items:center;gap:15px;padding:15px 4px 10px}.orb-wrap{width:54px;display:grid;place-items:center;flex-shrink:0}.orb{width:42px;height:42px;border-radius:50%;display:flex;gap:3px;align-items:center;justify-content:center;background:var(--green);box-shadow:0 0 0 5px #e4ecdd}.orb span{width:2px;height:7px;background:#fff;border-radius:3px}.orb span:nth-child(2),.orb span:nth-child(4){height:13px}.orb span:nth-child(3){height:20px}.orb.active span{animation:wave 1.1s ease-in-out infinite alternate}.orb.active span:nth-child(2){animation-delay:-.3s}.orb.active span:nth-child(3){animation-delay:-.7s}.orb.active span:nth-child(4){animation-delay:-.4s}.orb.active span:nth-child(5){animation-delay:-.8s}.orb.speaking{background:#4d8872}.call-state{min-width:0}.call-state h2{font-size:16px;line-height:1.4;font-weight:600;margin:0 0 3px}.call-state p{font-size:10px;color:var(--muted);margin:0;line-height:1.5}.memory-strip{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 0 12px}.memory{display:flex;gap:8px;align-items:center;min-width:0}.memory-icon{font-size:18px;color:var(--green)}.memory strong{display:block;font-size:10px;font-weight:500}.memory small{display:block;color:var(--muted);font-size:9px}.memory.warn .memory-icon,.memory.warn strong{color:#ad6b36}#warm-state{font-size:10px;color:var(--muted);text-align:right;max-width:47%}.lookup{font-size:11px;color:var(--green);margin:0 0 8px}.history-heading{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:8px 0}.history-heading h3{font-size:12px;font-weight:600;margin:0}.history-heading>div{display:flex;align-items:center;gap:12px}#history-limit{font:inherit;font-size:11px;padding:4px 6px;border:1px solid var(--line);border-radius:8px;color:var(--muted);background:transparent}.timeline-wrap{position:relative;flex:1;min-height:100px}.timeline{height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 4px 12px 0;outline-offset:-2px}.chat-turn{margin:8px 0 19px}.turn-meta{display:flex;justify-content:space-between;gap:10px;margin:0 2px 6px;color:var(--muted);font-size:9px}.bubble{padding:12px 14px;border-radius:14px;margin-top:7px;background:#fff;overflow-wrap:anywhere}.bubble.user{background:#e9f0e3;margin-left:32px;border-bottom-right-radius:4px}.bubble.assistant{margin-right:32px;border-bottom-left-radius:4px}.bubble label{font-size:9px;color:var(--green);letter-spacing:.8px}.chat-text{font-size:13px;line-height:1.75;white-space:pre-wrap;margin:5px 0 0}.chat-text.folded{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}.expand-message{border:0;background:none;color:var(--green);font-size:10px;padding:6px 0 0}.missing-reply{color:var(--muted);font-size:11px;font-style:italic}.new-messages{position:absolute;bottom:13px;left:50%;transform:translateX(-50%);border:1px solid #c7d8bd;background:#f5f9ef;color:var(--green);font-size:11px;padding:6px 14px;border-radius:99px;box-shadow:0 3px 15px #18362c15}.empty{color:var(--muted);font-size:12px;text-align:center;padding:40px 10px}.dock{flex-shrink:0;background:var(--paper);border-top:1px solid var(--line);padding-top:10px}#text-form{display:flex;gap:8px}input{border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);padding:11px;min-width:0;font:inherit;width:100%}input:focus,select:focus,button:focus-visible{outline:2px solid #8aaf98;outline-offset:2px}#text-form .secondary{font-size:12px;padding:8px 13px;white-space:nowrap}.controls{display:flex;gap:8px;align-items:center;margin-top:9px}.primary{background:var(--green);color:#fff;border:0;border-radius:13px;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;gap:10px;font-weight:550}.controls .primary{flex:1}.primary span{font-size:19px;line-height:1}.secondary{border:1px solid #d5dfcf;background:transparent;color:var(--green);border-radius:13px;padding:10px 14px}.voice-trigger{display:inline-flex;gap:5px;align-items:center;border:1px solid var(--line);border-radius:99px;background:transparent;color:var(--muted);padding:6px 9px;font-size:10px;max-width:130px;min-height:33px}#voice-current{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.voice-trigger:hover{background:var(--soft);color:var(--green)}.privacy{font-size:8px;color:var(--muted);text-align:center;margin:8px 0 0}.hidden{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.error{color:#a24535;font-size:12px;white-space:pre-wrap}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--muted)}.task{border:1px solid #d0ddc7;padding:12px;border-radius:12px;background:#f0f4e9;margin-bottom:8px;max-height:28vh;overflow:auto;flex-shrink:0}.task h3{font-size:15px;margin:3px 0}.task p{font-size:12px;white-space:pre-wrap;margin:5px 0}.task>div{display:flex;gap:8px;flex-wrap:wrap}.task button{font-size:11px;padding:7px 12px}.task small{font-size:9px;color:var(--muted)}.login{max-width:430px;margin:12vh auto 0}.login h1{font-size:36px;line-height:1.3;margin:12px 0}.login>p{font-size:13px;color:var(--muted)}.login form{margin-top:26px;display:grid;gap:10px}.login label{font-size:12px}.login .small{font-size:11px;margin-top:20px}.login .primary{justify-content:center}#voice-dialog{width:min(360px,calc(100vw - 36px));max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;padding:20px;background:var(--paper);color:var(--ink);box-shadow:0 20px 70px #102b3733}#voice-dialog::backdrop{background:#18302a55;backdrop-filter:blur(3px)}.voice-dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.voice-dialog-heading h3{font-size:16px;font-weight:600;margin:0}.voice-dialog-heading h3 span{font-size:11px;font-weight:400;color:var(--muted);margin-left:6px}.voice-close{border:0;background:none;color:var(--muted);font-size:25px;padding:0 4px;line-height:1}.voice-dialog-actions{display:flex;gap:9px;margin-top:14px}.voice-dialog-actions button{font-size:12px;padding:10px 15px;justify-content:center}.voice-dialog-actions .secondary{flex:1}#voice{width:100%;min-height:216px;max-height:42dvh;border:1px solid var(--line);border-radius:12px;padding:5px;background:#fff;color:var(--ink);font:inherit}#voice option{padding:8px 10px;border-radius:7px}#voice-hint{font-size:10px;color:var(--muted);margin:10px 0 0}#voice-preview{display:none}@keyframes wave{to{transform:scaleY(.35)}}@media(min-width:800px){main{padding:24px 26px 16px}.live-status{padding:20px 4px 14px}.chat-text{font-size:14px}.bubble{padding:14px 17px}.timeline{padding-right:10px}}@media(max-height:600px){.live-status{padding:6px 4px}.memory-strip{padding-bottom:6px}.orb-wrap{width:40px}.orb{width:32px;height:32px}.privacy{display:none}}@media(prefers-reduced-motion:reduce){.orb.active span{animation:none}}
.controls{margin-top:0}.text-trigger{flex-shrink:0;white-space:nowrap;min-height:36px}.text-trigger>span{font-size:15px;line-height:1}#text-dialog{width:min(420px,calc(100vw - 32px));max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;padding:20px;background:var(--paper);color:var(--ink);box-shadow:0 20px 70px #102b3733}#text-dialog::backdrop{background:#18302a55;backdrop-filter:blur(3px)}#text-form{display:block}#text{display:block;width:100%;min-height:112px;max-height:35dvh;resize:vertical;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);padding:12px;font:16px/1.65 inherit;font-family:inherit;font-size:16px;line-height:1.65}#text:focus{outline:2px solid #8aaf98;outline-offset:2px}.text-dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}.text-dialog-actions small{font-size:10px;color:var(--muted)}.text-dialog-actions button{font-size:12px;padding:10px 16px;white-space:nowrap}#text-error{margin:10px 0 0}@media(max-width:420px){.controls{gap:6px}.controls .primary{padding:11px 12px;font-size:12px;gap:6px}.controls .secondary{padding:10px;font-size:12px}.voice-trigger{max-width:96px;padding:6px 8px}.text-trigger{max-width:none}}
/* Keep controls discoverable and touch-sized while giving the timeline room. */
.more-trigger{width:44px;height:40px;border:0;border-radius:12px;background:transparent;color:var(--muted);font-size:15px;letter-spacing:2px}
.more-trigger:hover{background:var(--soft);color:var(--green)}
.voice-short,.memory-badge{display:none}
#info-dialog{width:min(400px,calc(100vw - 32px));max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;padding:20px;background:var(--paper);color:var(--ink);box-shadow:0 20px 70px #102b3733}
#info-dialog::backdrop{background:#18302a55;backdrop-filter:blur(3px)}
.info-list{margin:0}.info-list>div{padding:10px 0;border-bottom:1px solid var(--line)}
.info-list dt{font-size:11px;color:var(--muted);margin-bottom:3px}.info-list dd{margin:0;font-size:13px;overflow-wrap:anywhere}
.info-privacy{font-size:11px;color:var(--muted);margin:16px 0}.info-logout{width:100%;min-height:44px;font-size:13px}
.voice-close{min-width:36px;min-height:36px}
@media(max-width:600px){
  main{padding:4px 14px max(10px,env(safe-area-inset-bottom));overflow:hidden}
  #app{min-width:0}
  .topline{min-height:44px;gap:4px;flex-shrink:0}
  .scope{background:none;padding:0;gap:7px;flex:1;flex-wrap:nowrap;overflow:hidden;font-size:14px;font-weight:550}
  #owner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .scope .divider,.scope #bank{display:none}
  .dot{flex-shrink:0;width:6px;height:6px}
  .account-actions{gap:1px}.account-actions .link{padding:0 8px;min-height:44px;font-size:12px}
  .more-trigger{height:44px;width:40px}
  .live-status{gap:8px;padding:0 0 5px;min-height:33px;flex-shrink:0}
  .orb-wrap{width:21px}.orb{width:18px;height:18px;gap:2px;box-shadow:none}
  .orb span{height:4px;width:1px}.orb span:nth-child(2),.orb span:nth-child(4){height:7px}.orb span:nth-child(3){height:10px}
  .call-state{flex:1;min-width:0}.call-state h2{font-size:12px;font-weight:400;color:var(--muted);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .call-state p,.memory-strip{display:none}
  .memory-badge{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;padding:0 0 0 6px;border:0;background:none;color:var(--green);font-size:10px;min-height:32px;flex-shrink:0}
  .memory-badge.warn{color:#a9602f}
  .lookup{font-size:11px;margin:0 0 6px;line-height:1.5;flex-shrink:0}
  .history-heading{padding:2px 0 5px;min-height:38px;flex-shrink:0}
  .history-heading h3{font-size:11px;font-weight:400;color:var(--muted)}
  .history-heading>div{gap:4px}#history-limit{height:32px;min-width:65px;padding:0 5px;border:0;font-size:12px;background:transparent}
  #refresh-history{width:36px;min-height:32px;font-size:11px}
  .timeline-wrap{min-height:0}.timeline{padding:0 0 8px}
  .chat-turn{margin:12px 0 21px}.turn-meta{font-size:10px;margin:0 2px 5px;line-height:1.5}
  .bubble{padding:10px 12px;border-radius:16px;margin-top:6px}
  .bubble.user{margin-left:36px}.bubble.assistant{margin-right:16px}
  .bubble label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .chat-text{font-size:15px;line-height:1.65;margin:0}.missing-reply{font-size:12px}
  .expand-message{font-size:12px;min-height:34px;padding:5px 0 0}
  .dock{padding-top:8px;border-top-color:var(--line)}.privacy{display:none}
  .controls{gap:8px;margin:0}.controls .primary{min-width:0;min-height:48px;padding:12px 16px;font-size:14px;border-radius:16px}
  .controls .secondary{min-height:48px;padding:10px;font-size:12px;border-radius:14px}
  #interrupt:disabled{display:none}
  .controls .voice-trigger{width:48px;min-width:48px;max-width:48px;min-height:48px;padding:4px;border-radius:14px;display:inline-flex;flex-direction:column;justify-content:center;gap:0;font-size:10px;line-height:1.45;background:var(--soft);border-color:transparent;color:var(--green)}
  .text-trigger>span,.voice-glyph{font-size:17px;line-height:20px}
  #voice-current,.voice-chevron{display:none}.voice-short{display:inline}
  #text-dialog,#voice-dialog,#info-dialog{padding:16px;border-radius:18px;max-height:calc(100dvh - 24px)}
  .voice-dialog-heading{margin-bottom:10px}.voice-dialog-heading h3{font-size:16px}
  #text{min-height:96px}.text-dialog-actions{margin-top:12px}.text-dialog-actions button{min-height:44px}
  .voice-dialog-actions button{min-height:44px}
  .login{margin-top:8vh}.login h1{font-size:32px}.login input{font-size:16px}
}
@media(max-width:350px){
  main{padding-left:10px;padding-right:10px}.controls{gap:6px}.controls .primary{padding:12px;font-size:13px}
  .scope{font-size:13px}.memory-badge{font-size:9px}.account-actions .link{padding:0 5px}
}
@media(max-width:600px) and (max-height:480px){
  main{padding-top:0}.topline{min-height:36px}.account-actions .link,.more-trigger{min-height:36px;height:36px}
  .live-status{min-height:28px;padding-bottom:0}.history-heading{min-height:30px;padding-bottom:1px}
}
.activity-notice{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:24px;pointer-events:none}
.activity-card{width:min(292px,calc(100vw - 48px));display:flex;align-items:center;flex-direction:column;gap:12px;text-align:center;padding:26px 20px 24px;border:1px solid #d3e1ce;border-radius:24px;color:var(--ink);background:#f9fcf7f5;box-shadow:0 18px 65px #183c3933,0 2px 10px #183c3910;backdrop-filter:blur(12px);animation:notice-in .18s ease-out}
.activity-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:50%;background:#e5efdf;color:var(--green);font:600 27px/1 system-ui}
#activity-title{font-size:20px;line-height:1.4;font-weight:650;letter-spacing:.3px}
#activity-detail{font-size:12px;line-height:1.65;color:var(--muted)}
.activity-notice[data-kind=searching] .activity-icon{background:none;border:3px solid #dce9d5;border-top-color:var(--green);animation:notice-spin .85s linear infinite}
.activity-notice[data-kind=interrupted] .activity-card{border-color:#cfddd5}
.activity-notice[data-kind=failed] .activity-icon{color:#a9602f;background:#f3e9dc}
@keyframes notice-spin{to{transform:rotate(360deg)}}
@keyframes notice-in{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}
@media(max-width:600px){.activity-card{width:min(270px,calc(100vw - 44px));padding:24px 16px;border-radius:22px}#activity-title{font-size:19px}#view-history{min-height:32px;font-size:11px;padding:0 6px}}
@media(max-height:450px){.activity-card{padding:16px;gap:8px}.activity-icon{width:36px;height:36px}#activity-title{font-size:18px}}
@media(prefers-reduced-motion:reduce){.activity-card,.activity-notice[data-kind=searching] .activity-icon{animation:none}}
.wake-setting{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 0;border-top:1px solid #dce3da}
.wake-setting strong{display:block;font-size:14px}.wake-setting small{display:block;font-size:11px;color:var(--muted);line-height:1.5;margin-top:4px}
.wake-setting button{flex-shrink:0;min-height:40px;padding:8px 12px;font-size:12px}.wake-setting button[aria-pressed=true]{color:var(--green);background:#e8f0e3}
.account-actions{align-items:center;flex-shrink:0;gap:8px}
.wake-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:76px;min-height:36px;padding:6px 10px;border:1px solid #b7d8ee;border-radius:99px;background:#dceeff;color:#255574;box-shadow:0 2px 10px #84b4d820;font-size:11px;font-weight:600;white-space:nowrap;transition:background .16s,color .16s,box-shadow .16s}
.wake-toggle::before{content:'';width:6px;height:6px;border-radius:50%;background:#397fa5;flex-shrink:0}
.wake-toggle[aria-pressed=true]{background:#e5efc8;border-color:#cbd9ab;color:#4b5d24;box-shadow:0 2px 10px #b3c58d20}
.wake-toggle[aria-pressed=true]::before{background:#758655;box-shadow:0 0 0 3px #dce8bd}
.wake-toggle:hover{filter:brightness(1.06)}
@media(max-width:600px){.account-actions{gap:3px}.wake-toggle{min-width:72px;min-height:38px;padding:6px 8px;font-size:11px}.account-actions .link{padding:0 6px}.more-trigger{width:32px}}
@media(max-width:350px){.wake-toggle{min-width:66px;padding:6px;font-size:10px}.account-actions .link{padding:0 4px}.more-trigger{width:28px}}
@media(prefers-reduced-motion:reduce){.wake-toggle{transition:none}}
.web-sources{font-size:12px;color:#586158;margin:0 0 10px;padding:7px 10px;border-radius:10px;background:#edf0e9;max-height:130px;overflow:auto}.web-sources summary{cursor:pointer}.web-sources a{display:block;color:#3e652f;padding:5px 0;overflow-wrap:anywhere}
