@keyframes pop-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes dot-bounce{0%,60%,to{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}*{margin:0;padding:0;box-sizing:border-box}:root{--bg: #FFF7F1;--bg-soft: #FFEFE5;--bg-deeper: #FFE0C2;--ink: #2A1A14;--ink-soft: #5a3f33;--ink-mute: #8a6b5e;--accent: #FF706D;--accent-hover: #ff5a56;--accent-soft: #FFB8A8;--spark: #F5A623;--card: #ffffff;--border: rgba(42, 26, 20, .08);--border-strong: rgba(42, 26, 20, .14);--shadow-sm: 0 2px 6px rgba(255, 112, 109, .15);--shadow-md: 0 8px 24px rgba(42, 26, 20, .06);--shadow-lg: 0 20px 60px rgba(255, 112, 109, .15);--accent-grad: linear-gradient(120deg, var(--accent) 0%, #ff8a5b 100%);--warm-grad: linear-gradient(135deg, #FFE9DC 0%, #FFC8B6 100%);--radius-sm: 10px;--radius-md: 14px;--radius-lg: 20px;--radius-bubble: 22px;--radius-pill: 999px;--safe-top: env(safe-area-inset-top, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px);--safe-left: env(safe-area-inset-left, 0px);--safe-right: env(safe-area-inset-right, 0px)}html,body,#root{height:100%;width:100%}.btn-primary{background:var(--accent);color:#fff;box-shadow:var(--shadow-sm)}.btn-primary:hover{background:var(--accent-hover)}.btn-primary:disabled{background:var(--accent-soft);color:#fff;box-shadow:none;cursor:not-allowed}.btn-ghost{background:transparent;color:var(--ink-soft);padding:.4rem .7rem;font-size:.78rem;min-height:0}.btn-ghost:hover{color:var(--accent);background:#ff706d14}.app{display:flex;flex-direction:column;height:100%;max-width:640px;margin:0 auto;background:var(--card);box-shadow:var(--shadow-md);padding-left:var(--safe-left);padding-right:var(--safe-right)}.header{display:flex;align-items:center;justify-content:space-between;padding:.7rem 1rem;padding-top:calc(.7rem + var(--safe-top));border-bottom:1px solid var(--border);background:var(--card);gap:.5rem;flex-shrink:0}.header-left{display:flex;align-items:center;gap:.7rem;min-width:0;flex:1}.avatar{width:40px;height:40px;border-radius:50%;background:var(--bg-soft);display:flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;overflow:hidden}.avatar img{width:78%;height:78%;object-fit:contain}.avatar.with-status:after{content:"";position:absolute;bottom:0;right:0;width:11px;height:11px;border-radius:50%;background:var(--ink-mute);border:2px solid var(--card)}.avatar.with-status.online:after{background:#22c55e}.avatar.with-status.warning:after{background:var(--spark)}.header-info{display:flex;flex-direction:column;min-width:0;flex:1}.header-title{font-size:.95rem;font-weight:600;color:var(--ink);line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-subtitle{font-size:.74rem;color:var(--ink-soft);line-height:1.2;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-actions{display:flex;align-items:center;gap:.4rem;flex-shrink:0}.icon-btn{background:transparent;width:36px;height:36px;border-radius:50%;color:var(--ink-soft);display:inline-flex;align-items:center;justify-content:center;padding:0;min-height:0}.icon-btn:hover{background:var(--bg-soft);color:var(--accent)}.content{flex:1;overflow-y:auto;overflow-x:hidden;padding:.75rem 1rem 1rem;-webkit-overflow-scrolling:touch;background:var(--bg);overscroll-behavior:contain}.stream-container{display:flex;flex-direction:column;gap:.25rem}.stream-toolbar{position:sticky;top:0;display:flex;justify-content:flex-end;padding:.25rem 0 .5rem;background:linear-gradient(180deg,var(--bg) 60%,rgba(255,247,241,0));z-index:10}.msg-row{display:flex;align-items:flex-end;gap:.45rem;margin-top:.4rem}.msg-row.user{justify-content:flex-end}.msg-row.agent{justify-content:flex-start}.msg-avatar{width:30px;height:30px;border-radius:50%;flex-shrink:0;background:var(--card);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;overflow:hidden}.msg-avatar img{width:78%;height:78%;object-fit:contain}.msg-bubble{max-width:78%;padding:.6rem .9rem;border-radius:var(--radius-bubble);font-size:.92rem;line-height:1.45;word-wrap:break-word;word-break:break-word;overflow-wrap:anywhere;white-space:pre-wrap;animation:pop-in .2s ease-out}.msg-bubble.agent{background:var(--card);color:var(--ink);border:1px solid var(--border);border-bottom-left-radius:6px}.msg-bubble.user{background:var(--accent-grad);color:#fff;border-bottom-right-radius:6px;box-shadow:var(--shadow-sm)}.system-notice{align-self:center;margin:.5rem auto;padding:.3rem .75rem;font-size:.75rem;color:var(--ink-mute);background:var(--bg-soft);border-radius:var(--radius-pill);max-width:80%;text-align:center}.activity-row{display:flex;align-items:center;gap:.55rem;padding:.5rem .85rem;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);font-size:.82rem;color:var(--ink-soft);margin:.2rem auto;max-width:92%;width:100%}.activity-icon{font-size:1rem;width:22px;text-align:center;flex-shrink:0}.activity-row strong{color:var(--ink);font-weight:600}.activity-row .activity-time{margin-left:auto;font-size:.7rem;color:var(--ink-mute);flex-shrink:0}.activity-row.warn{background:#f5a62314;border-color:#f5a62340;color:#92400e}.activity-row.warn strong{color:#7c2d12}.empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--ink-soft);padding:2rem 1.5rem}.empty-avatar{width:88px;height:88px;border-radius:28px;background:var(--warm-grad);display:flex;align-items:center;justify-content:center;margin-bottom:1.1rem;box-shadow:var(--shadow-lg)}.empty-avatar img{width:70%;height:70%;object-fit:contain}.empty-state h3{font-size:1.05rem;font-weight:600;color:var(--ink);margin-bottom:.35rem}.empty-state p{font-size:.85rem;color:var(--ink-soft);max-width:280px;line-height:1.5}.thinking-bubble{display:inline-flex;align-items:center;gap:4px;padding:.85rem .95rem;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-bubble);border-bottom-left-radius:6px}.thinking-bubble span{width:7px;height:7px;border-radius:50%;background:var(--accent-soft);animation:dot-bounce 1.4s infinite ease-in-out}.thinking-bubble span:nth-child(2){animation-delay:.15s;background:var(--accent)}.thinking-bubble span:nth-child(3){animation-delay:.3s}.prompt-section{padding:.7rem .9rem .95rem;padding-bottom:calc(.95rem + var(--safe-bottom));border-top:1px solid var(--border);background:var(--card);flex-shrink:0}.prompt-row{display:flex;align-items:center;gap:.4rem;background:var(--bg-soft);border:1px solid transparent;border-radius:24px;padding:4px 4px 4px 6px;transition:all .15s}.prompt-row:focus-within{background:var(--card);border-color:#ff706d4d;box-shadow:0 0 0 4px #ff706d1f}.prompt-row input{flex:1;background:transparent;border:none;padding:.55rem .75rem;font-size:16px;min-width:0}.prompt-row input:focus{background:transparent;box-shadow:none;border:none}.prompt-row input:disabled{background:transparent}.send-btn{width:40px;height:40px;border-radius:50%;background:var(--accent);color:#fff;display:inline-flex;align-items:center;justify-content:center;padding:0;flex-shrink:0;box-shadow:var(--shadow-sm);border:none;min-height:0}.send-btn:hover{background:var(--accent-hover)}.send-btn:disabled{background:var(--accent-soft);box-shadow:none;cursor:not-allowed}.pairing-wrap{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;background:var(--warm-grad);padding:1.5rem;padding-top:calc(1.5rem + var(--safe-top));padding-bottom:calc(1.5rem + var(--safe-bottom));padding-left:calc(1.5rem + var(--safe-left));padding-right:calc(1.5rem + var(--safe-right));overflow-y:auto;-webkit-overflow-scrolling:touch}.pairing-card{background:var(--card);border-radius:var(--radius-lg);padding:2rem 1.5rem;box-shadow:var(--shadow-lg);width:100%;max-width:360px;text-align:center;border:1px solid var(--border)}.pairing-logo{width:80px;height:80px;border-radius:26px;background:var(--bg-soft);display:inline-flex;align-items:center;justify-content:center;margin-bottom:1.25rem;box-shadow:var(--shadow-sm)}.pairing-logo img{width:76%;height:76%;object-fit:contain}.pairing-title{font-size:1.4rem;font-weight:700;color:var(--ink);margin-bottom:.4rem;letter-spacing:-.01em}.pairing-sub{color:var(--ink-soft);font-size:.85rem;margin-bottom:1.5rem;line-height:1.5}.security-notice{background:#f5a6231a;border:1px solid rgba(245,166,35,.3);color:#7c2d12;border-radius:var(--radius-md);padding:.7rem .85rem;font-size:.78rem;text-align:left;margin-bottom:1.5rem;line-height:1.5}.code-input{text-align:center;font-size:1.5rem;letter-spacing:.25em;font-family:SF Mono,Menlo,monospace;padding:.85rem;margin-bottom:.85rem;font-weight:600;color:var(--ink)}.full-btn{width:100%;padding:.85rem;font-size:.95rem;font-weight:600;border-radius:var(--radius-md);min-height:44px}.mode-badge{font-family:inherit;font-size:.7rem;font-weight:600;padding:.3rem .65rem;border-radius:var(--radius-pill);border:1px solid transparent;cursor:pointer;white-space:nowrap;letter-spacing:.02em;min-height:0;transition:all .15s ease}.mode-badge-trust{background:#ff706d1a;color:var(--accent);border-color:#ff706d40}.mode-badge-trust:hover{background:#ff706d2e}.mode-badge-readonly{background:#22c55e1a;color:#166534;border-color:#22c55e4d}.mode-badge-readonly:hover{background:#22c55e2e}.mode-badge-approve{background:#f5a6231f;color:#92400e;border-color:#f5a62359}.mode-badge-approve:hover{background:#f5a62333}.mode-menu{position:absolute;top:calc(56px + var(--safe-top));right:12px;width:min(320px,calc(100vw - 24px));background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:.4rem;z-index:50;display:flex;flex-direction:column;gap:2px}.mode-option{width:100%;text-align:left;background:transparent;border:1px solid transparent;border-radius:var(--radius-sm);padding:.65rem .75rem;cursor:pointer;color:var(--ink);min-height:0}.mode-option:hover{background:var(--bg-soft)}.mode-option.active{background:#ff706d14;border-color:#ff706d40}.mode-option-title{font-size:.88rem;font-weight:600;margin-bottom:.2rem;color:var(--ink)}.mode-option-desc{font-size:.74rem;color:var(--ink-soft);line-height:1.4}.tool-call-row{display:flex;align-items:center;gap:.55rem;padding:.4rem .85rem;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);font-size:.8rem;color:var(--ink-soft);margin:.2rem auto;max-width:92%;width:100%;font-family:SF Mono,Menlo,monospace}.tool-call-icon{font-size:.95rem;width:1.1rem;flex-shrink:0;text-align:center}.tool-call-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);font-weight:500;min-width:0}.tool-call-status{font-weight:600;flex-shrink:0;font-size:.85rem}.tool-call-pending{border-left:3px solid var(--ink-mute)}.tool-call-in_progress{border-left:3px solid var(--spark);background:#f5a6230a}.tool-call-in_progress .tool-call-status{color:var(--spark)}.tool-call-completed{border-left:3px solid #22c55e;opacity:.85}.tool-call-completed .tool-call-status{color:#22c55e}.tool-call-failed{border-left:3px solid var(--accent);background:#ff706d0d}.tool-call-failed .tool-call-status{color:var(--accent)}.plan-card{background:linear-gradient(135deg,#ff706d0d,#f5a6230d);border:1px solid rgba(255,112,109,.18);border-radius:var(--radius-md);padding:.7rem .95rem;margin:.4rem 0}.plan-head{font-size:.78rem;font-weight:600;color:var(--ink);margin-bottom:.45rem}.plan-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.3rem}.plan-item{display:flex;align-items:flex-start;gap:.5rem;font-size:.82rem;color:var(--ink-soft);line-height:1.4}.plan-bullet{font-family:SF Mono,Menlo,monospace;width:1rem;flex-shrink:0;color:var(--ink-mute);text-align:center}.plan-completed{color:var(--ink-mute);text-decoration:line-through}.plan-completed .plan-bullet{color:#22c55e}.plan-in_progress .plan-bullet{color:var(--spark)}.permission-prompt{background:var(--card);border:2px solid var(--accent);border-radius:var(--radius-md);padding:.8rem .95rem;margin:.5rem 0;box-shadow:0 4px 16px #ff706d1f;animation:pop-in .25s ease-out}.permission-prompt-head{display:flex;align-items:center;gap:.5rem;margin-bottom:.3rem}.permission-icon{font-size:1.1rem}.permission-title{font-weight:600;font-size:.88rem;color:var(--ink)}.permission-kind{font-size:.74rem;color:var(--ink-mute);margin-bottom:.55rem}.permission-actions{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}.permission-btn{padding:.5rem .95rem;border-radius:var(--radius-sm);border:1px solid var(--border-strong);background:var(--card);color:var(--ink);font-size:.84rem;font-weight:500;cursor:pointer;flex:1 1 auto;min-height:38px;min-width:80px}.permission-btn:hover{background:var(--bg-soft)}.permission-btn.permission-allow{background:var(--accent);color:#fff;border-color:var(--accent)}.permission-btn.permission-allow:hover{background:var(--accent-hover)}.permission-btn.permission-reject{background:var(--bg-soft);color:var(--ink-soft)}.permission-btn.permission-reject:hover{background:var(--bg-deeper);color:var(--ink)}.mode-badge-locked{cursor:default;opacity:.85}.mode-badge-lock{font-size:.85em;margin-left:.15em}.permission-prompt.permission-resolved{border-color:var(--border-strong);border-width:1px;box-shadow:none;opacity:.85}.permission-status{margin-top:.55rem;padding:.4rem .65rem;border-radius:var(--radius-sm);font-size:.82rem;font-weight:500}.permission-status-selected{background:#22c55e1a;color:#166534;border:1px solid rgba(34,197,94,.25)}.permission-status-cancelled,.permission-status-timeout{background:var(--bg-soft);color:var(--ink-soft);border:1px solid var(--border)}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.btn-ghost{padding:.35rem .6rem;font-size:.75rem;min-height:0}.app{max-width:none;margin:0;box-shadow:none;padding-left:0;padding-right:0}.header{padding:.6rem .85rem}.header-left{gap:.55rem}.avatar{width:36px;height:36px}.avatar.with-status:after{width:10px;height:10px}.header-title{font-size:.9rem}.header-subtitle{font-size:.72rem}.header-actions{gap:.35rem}.icon-btn{width:32px;height:32px;min-height:0}.content{padding:.65rem .85rem .85rem}.stream-toolbar{padding:.2rem 0 .4rem}.msg-row{gap:.4rem;margin-top:.3rem}.msg-avatar{width:26px;height:26px}.msg-bubble{max-width:85%;padding:.55rem .85rem;font-size:.86rem;animation:none}.system-notice{margin:.4rem auto;padding:.25rem .65rem;font-size:.72rem;max-width:90%}.activity-row{gap:.5rem;padding:.45rem .7rem;font-size:.78rem;max-width:none}.activity-icon{font-size:.95rem;width:20px}.activity-row .activity-time{font-size:.66rem}.empty-state{padding:1.5rem 1.25rem}.empty-avatar{width:72px;height:72px;border-radius:24px;margin-bottom:.9rem}.empty-state h3{font-size:1rem;margin-bottom:.3rem}.empty-state p{font-size:.82rem}.thinking-bubble{padding:.75rem .9rem}.thinking-bubble span{width:6px;height:6px}.prompt-section{padding:.55rem .7rem .7rem}.prompt-row{gap:.35rem;border-radius:22px;padding:3px 3px 3px 6px}.prompt-row input{padding:.45rem .6rem;font-size:.9rem}.send-btn{width:36px;height:36px;min-height:0}.pairing-wrap{padding:1.25rem}.pairing-card{padding:1.6rem 1.25rem;max-width:320px}.pairing-logo{width:64px;height:64px;border-radius:22px;margin-bottom:1rem}.pairing-title{font-size:1.2rem;margin-bottom:.35rem}.pairing-sub{font-size:.8rem;margin-bottom:1.1rem}.security-notice{padding:.6rem .75rem;font-size:.75rem;margin-bottom:1.1rem}.code-input{font-size:1.3rem;letter-spacing:.22em;font-family:Consolas,SF Mono,Menlo,monospace;padding:.7rem;margin-bottom:.7rem}.full-btn{padding:.75rem;font-size:.92rem;min-height:0}.mode-badge{font-size:.68rem;padding:.25rem .55rem;min-height:0}.mode-menu{top:56px;width:min(300px,calc(100vw - 24px))}.mode-option{padding:.55rem .7rem;min-height:0}.mode-option-title{font-size:.85rem}.mode-option-desc{font-size:.72rem}.tool-call-row{gap:.5rem;padding:.35rem .7rem;font-size:.76rem;font-family:Consolas,SF Mono,Menlo,monospace;max-width:none}.tool-call-icon{font-size:.9rem;width:1.05rem}.tool-call-status{font-size:.8rem}.plan-card{padding:.65rem .85rem;margin:.35rem 0}.plan-head{font-size:.74rem;margin-bottom:.4rem}.plan-list{gap:.25rem}.plan-item{gap:.4rem;font-size:.78rem}.plan-bullet{font-family:Consolas,monospace;width:.95rem}.permission-prompt{padding:.7rem .85rem;margin:.4rem 0;animation:none}.permission-prompt-head{gap:.45rem}.permission-icon{font-size:1.05rem}.permission-title{font-size:.84rem}.permission-kind{font-size:.7rem;margin-bottom:.45rem}.permission-actions{gap:.35rem;margin-top:.4rem}.permission-btn{padding:.4rem .85rem;font-size:.8rem;min-height:0}.permission-status{margin-top:.45rem;padding:.35rem .6rem;font-size:.78rem}body{font-family:Segoe UI,-apple-system,BlinkMacSystemFont,Inter,Roboto,sans-serif;background:var(--bg);color:var(--ink);overflow:hidden;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button{font-family:inherit;cursor:pointer;border:none;border-radius:var(--radius-md);padding:.55rem .9rem;font-size:.85rem;font-weight:500;transition:all .15s ease}button:active{transform:scale(.98)}input,textarea{font-family:inherit;background:var(--bg-soft);border:1px solid transparent;border-radius:var(--radius-md);color:var(--ink);padding:.55rem .8rem;font-size:.9rem;width:100%;outline:none;transition:all .15s}input::placeholder,textarea::placeholder{color:var(--ink-mute)}input:focus,textarea:focus{background:var(--card);border-color:#ff706d4d;box-shadow:0 0 0 4px #ff706d1f}.excel-ops-bar{display:flex;flex-wrap:wrap;gap:.3rem;padding:.4rem .85rem;background:var(--bg-soft);border-top:1px solid var(--border);flex-shrink:0;font-family:Consolas,SF Mono,Menlo,monospace}.excel-op-chip{display:inline-flex;align-items:center;gap:.3rem;padding:.2rem .55rem;border-radius:var(--radius-pill);font-size:.7rem;border:1px solid var(--border);background:var(--card);color:var(--ink-soft);max-width:100%}.excel-op-chip.in-progress{border-color:#f5a62359;background:#f5a6231a;color:#92400e}.excel-op-chip.ok{border-color:#22c55e4d;color:#166534}.excel-op-chip.failed{border-color:#ff706d59;color:var(--accent)}.excel-op-icon{font-weight:600}.excel-op-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
