:root{color-scheme:light;font-family:Inter,"Segoe UI",Arial,sans-serif;--ink:#1b2d27;--muted:#748178;--leaf:#348b61;--leaf2:#e6f3e9;--line:#e7ece5;--surface:#fff;--page:#f8faf5}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--page);color:var(--ink)}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}a{color:var(--leaf)}.hidden{display:none!important}.subdued,.subtitle,.disclaimer{color:var(--muted)}
.login-screen{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(410px,100%);padding:36px;background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:0 24px 60px #18482c0d}.login-symbol{width:72px;height:72px;margin:0 auto 15px}.login-symbol img{width:100%}.login-card{text-align:center}.login-card h1{font-size:32px;margin:2px 0}.login-card p{line-height:1.5}.eyebrow{color:var(--leaf);font-weight:700;text-transform:uppercase;letter-spacing:.15em;font-size:11px}.login-card form{display:grid;gap:17px;text-align:left;margin-top:28px}.login-card form label{display:grid;gap:7px;font-size:13px;font-weight:650}.login-card input,.admin-form input,.admin-form select{width:100%;border:1px solid #d7ded5;border-radius:12px;padding:13px 14px;background:white;outline:0}.login-card input:focus,.compose textarea:focus{border-color:var(--leaf)}.primary{background:var(--leaf);color:#fff;border:0;border-radius:12px;padding:13px 18px;font-weight:650}.primary:hover{background:#28734e}.wide{width:100%}#loginError{min-height:18px;color:#c04444;font-size:13px}
.app{min-height:100vh}.header{height:75px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;gap:15px}.brand{display:flex;align-items:center;gap:12px}.brand img{width:42px;height:42px}.brand span{display:grid;gap:4px}.brand b{font-size:18px}.brand small{font-size:11px;color:var(--muted)}.header-actions{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px}.iconbutton{border:0;background:#f2f6f0;color:#4d5d50;border-radius:10px;width:32px;height:32px;font-size:22px}
.shell{display:grid;grid-template-columns:255px minmax(0,1fr);min-height:calc(100vh - 75px)}.sidebar{background:#fff;border-right:1px solid var(--line);padding:26px 17px;display:flex;flex-direction:column;gap:24px}.sidebar-group{display:grid;gap:12px}.section-label{text-transform:uppercase;letter-spacing:.085em;font-size:11px;color:#89948a;font-weight:750;margin:0;padding:0 10px}.sidebar select{width:100%;min-width:0;padding:12px 9px;border-radius:11px;background:#eef6ee;color:#306847;border:1px solid #d9e9da;font-weight:600}.section-list{display:grid;gap:5px}.sidebar-link,.section-link{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;padding:11px 10px;border:0;border-radius:10px;background:transparent;color:#44584b;font-size:13px}.section-link:hover,.sidebar-link:hover{background:#eff5ed}.section-link::before{content:'•';color:#85b39a;margin-right:8px}.section-link{justify-content:flex-start}.sidebar-link span{background:#eef4ec;color:#568464;border-radius:40px;padding:3px 7px;font-size:11px}.sidebar-footer{margin-top:auto;color:#a0aaa2;font-size:12px;line-height:1.6;padding:0 10px}
.main{min-width:0;display:flex;flex-direction:column;align-items:center;gap:0;padding:22px 22px 16px;max-height:calc(100vh - 75px);overflow:auto}.assistant-top{display:flex;flex-direction:column;align-items:center;text-align:center;width:min(850px,100%)}.hero-robot{width:205px;height:205px;margin-top:4px;filter:drop-shadow(0 10px 12px #2b784015)}.hero-robot svg{width:100%;height:100%;}.hero-robot .eye{transform-box:fill-box;transform-origin:center;animation:blink 4.4s infinite}.hero-robot .soundwaves{opacity:0;transition:opacity .25s}.hero-robot[data-state='listening'] .soundwaves,.hero-robot[data-state='speaking'] .soundwaves{opacity:1;animation:pulse 1s infinite}.hero-robot[data-state='thinking'] svg{animation:breathe 1.9s infinite}.hero-robot[data-state='listening'] .eye{animation:blink 1.2s infinite}.live-status{display:inline-block;background:#eaf5e7;color:#43835d;border-radius:40px;padding:6px 13px;font-size:12px;font-weight:700;margin-top:-6px}.assistant-top h1{font-size:clamp(20px,3.1vw,29px);letter-spacing:-.03em;margin:12px 0 6px}.subtitle{font-size:14px;margin:0 0 14px}.suggestions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.suggestions button{background:#fff;border:1px solid #e0e8dd;border-radius:30px;padding:8px 12px;color:#57735d;font-size:12px}.suggestions button:hover{border-color:#97b89d;background:#f3f7ed}
.conversation{width:min(850px,100%);display:flex;flex-direction:column;gap:17px;flex:1;min-height:40px;margin:18px 0 20px}.message{max-width:92%;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.55}.message.user{align-self:flex-end;background:#e7f1e6;border-radius:17px 17px 4px 17px;padding:13px 16px}.message.bot{align-self:stretch;padding:17px;border-radius:16px;background:#fff;border:1px solid var(--line)}.msg-label{font-size:11px;color:#699275;font-weight:800;letter-spacing:.06em;text-transform:uppercase;margin-bottom:7px}.msg-content{white-space:pre-wrap}.sources{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}.source{border:1px solid #d7e5d7;background:#f5faf5;border-radius:9px;padding:9px 12px;color:#397355;font-size:12px}.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:9px;margin-top:14px}.photo-card{border:1px solid #e3eae1;border-radius:11px;overflow:hidden;background:#fcfdfb}.photo-card img{width:100%;height:115px;object-fit:cover;display:block}.photo-card div{padding:8px;font-size:11px;color:#606c62}.photo-card small{color:#a07630}.voice-row{display:flex;gap:10px;align-items:center;margin-top:13px}.voice-row button{border:0;border-radius:9px;padding:9px 12px;background:#eaf3e8;color:#376d4d;font-weight:700;font-size:12px}.voice-row span{font-size:12px;color:var(--muted)}.notice{width:min(850px,100%);border:1px solid #eecfc1;background:#fff8ee;color:#a75d26;border-radius:11px;padding:10px 12px;margin-bottom:10px;font-size:13px}.compose{width:min(850px,100%);background:#fff;border:1px solid #dce7dc;border-radius:16px;display:flex;align-items:flex-end;gap:9px;padding:9px;box-shadow:0 10px 28px #133c1810}.compose textarea{min-width:0;flex:1;resize:none;border:0;outline:none;padding:12px 10px;max-height:148px;line-height:1.5;background:#fff}.mic-btn,.send-btn{width:44px;height:44px;flex-shrink:0;border:0;border-radius:13px;font-size:20px}.mic-btn{color:var(--leaf);background:#eff7ef}.mic-btn.recording{background:#fbe7e5;color:#c83737;animation:pulse 1s infinite}.send-btn{color:white;background:var(--leaf)}.disclaimer{max-width:850px;font-size:11px;line-height:1.5;margin:8px auto 0;text-align:center}
.right-panel{width:min(410px,100%);background:#fff;border-left:1px solid var(--line);padding:20px;max-height:calc(100vh - 75px);overflow:auto}.right-panel header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:13px}.right-panel h2{font-size:19px;margin:0}.right-panel h3{margin:26px 0 12px;font-size:14px}.document-card{padding:14px 4px;border-bottom:1px solid var(--line);display:grid;gap:8px}.document-card b{font-size:13px}.document-card p{font-size:12px;color:var(--muted);margin:0}.document-card button{color:#348660;background:transparent;text-align:left;border:0;padding:4px 0}.admin-form{display:grid;gap:10px;padding:16px 0}.admin-form label{display:grid;gap:6px;font-size:12px}.checkboxes{display:flex;flex-wrap:wrap;gap:8px}.checkboxes label{display:flex;align-items:center;background:#eef5ee;border-radius:7px;padding:8px}.checkboxes input{width:auto}.admin-list{max-height:230px;overflow:auto;font-size:12px}.admin-list>div{padding:9px 0;border-bottom:1px solid var(--line)}.alert{font-size:12px;color:#8a593d;white-space:pre-wrap}.photo-full{max-width:100%;height:auto;border-radius:12px}.source-text{white-space:pre-wrap;font-size:12px;line-height:1.7;color:#405347}
@keyframes blink{0%,42%,46%,100%{transform:scaleY(1)}44%{transform:scaleY(.13)}}@keyframes pulse{50%{opacity:.42;transform:scale(.99)}}@keyframes breathe{50%{transform:translateY(-6px)}}
@media(max-width:960px){.shell{grid-template-columns:210px minmax(0,1fr)}.right-panel{position:fixed;top:75px;right:0;bottom:0;z-index:5;box-shadow:-12px 0 35px #00000015;max-height:none}}
@media(max-width:650px){.header{height:61px;padding:0 13px}.brand img{width:34px;height:34px}.brand b{font-size:15px}.brand small{font-size:9px}.shell{display:block;min-height:calc(100dvh - 61px)}.sidebar{border-right:0;border-bottom:1px solid var(--line);padding:10px 12px;gap:0}.sidebar-group:not(:first-child),.sidebar-footer,.sidebar>.sidebar-link{display:none}.sidebar-group:first-child{display:flex;align-items:center;justify-content:space-between}.sidebar .section-label{white-space:nowrap}.sidebar select{width:70%;max-width:270px;padding:8px}.main{padding:5px 14px 12px;min-height:calc(100dvh - 120px);max-height:none}.hero-robot{width:176px;height:176px;margin-top:0}.assistant-top h1{font-size:21px;margin-top:10px}.subtitle{font-size:12px;margin-bottom:12px}.conversation{min-height:15vh;margin-top:16px}.message{font-size:13px}.compose{position:sticky;bottom:7px;margin-top:auto}.right-panel{top:61px;left:0;width:100vw;height:calc(100dvh - 61px)}.disclaimer{font-size:10px}.header-actions #username{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.auto-voice{display:flex;gap:9px;align-items:center;margin-top:12px;color:var(--muted);font-size:12px;cursor:pointer}.auto-voice input{accent-color:var(--leaf)}

.admin-entry{display:flex;flex-direction:column;gap:8px;padding:12px 0;border-bottom:1px solid var(--line,#dae6dd)}.admin-entry button{align-self:flex-start}.admin-entry .checkboxes{display:flex;flex-wrap:wrap;gap:8px 12px}.admin-entry .checkboxes label{font-size:12px}.admin-result{color:var(--muted,#647168)}

/* v0.3: chat and document drawer are independent; composer never overlaps messages. */
.app{height:100dvh;overflow:hidden}
.shell{height:calc(100dvh - 75px);min-height:0;grid-template-columns:274px minmax(0,1fr);overflow:hidden;position:relative}
.sidebar{min-width:0;min-height:0;overflow-y:auto;padding:26px 18px;gap:23px}
.sidebar-group{gap:9px}
.sidebar-link,.section-link{font-size:13px;padding:13px 12px;line-height:1.35}
.admin-nav{text-decoration:none;display:flex;align-items:center;justify-content:flex-start;border-top:1px solid var(--line);padding-top:19px}
.main{height:100%;min-height:0;max-height:none;overflow:hidden;display:flex;align-items:center;
      flex-direction:column;padding:18px clamp(16px,3vw,44px) 16px}
.assistant-top{flex:0 0 auto;max-height:48vh}
.hero-robot{width:144px;height:144px;margin-top:0}
.assistant-top h1{font-size:clamp(19px,2.5vw,26px);margin:7px 0 7px}
.suggestions{gap:7px}
.suggestions button{padding:9px 12px;font-size:12px}
.conversation{width:min(920px,100%);flex:1 1 auto;min-height:0;margin:15px auto 12px;
              overflow-y:auto;overflow-x:hidden;padding:4px 9px 12px 2px;scrollbar-gutter:stable}
.message{max-width:90%;font-size:14px;line-height:1.62}
.message.user{max-width:min(80%,720px)}
.message.bot{padding:19px 21px;align-self:stretch;max-width:100%}
.msg-content{white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere}
.msg-content.streaming:empty::after{content:'▋';animation:blink 1s steps(1) infinite;color:var(--leaf)}
.answer-progress{color:#728879;font-size:12px;display:flex;align-items:center;gap:9px;margin-top:6px}
.answer-progress::before{content:'';width:12px;height:12px;border:2px solid #d5e6d9;
 border-top-color:#358e63;border-radius:50%;animation:answer-spin .85s linear infinite}
@keyframes answer-spin{to{transform:rotate(360deg)}}
.assistant-top.chatting{display:none}
.compose{flex:0 0 auto;width:min(920px,100%);position:relative;bottom:auto;z-index:1;margin:0 auto;
         border-radius:17px;padding:8px}
.compose textarea{min-height:50px;max-height:145px}
.auto-voice{flex:0 0 auto;font-size:12px;margin:10px auto 0;max-width:920px;width:100%;
            justify-content:flex-end;padding-right:2px}
.notice{flex-shrink:0;width:min(920px,100%);margin:0 auto 9px}
.source-details{margin-top:13px;border-top:1px solid #ebf1eb;padding-top:10px;
                font-size:12px;white-space:normal}
.source-details summary{cursor:pointer;color:#477c5c;font-weight:600;width:fit-content;padding:5px 0}
.sources{display:flex;align-items:flex-start;gap:8px;margin-top:6px}
.source{font-weight:500;max-width:100%;text-align:left;line-height:1.4}
.photo-grid{grid-template-columns:repeat(auto-fit,minmax(150px,190px));gap:10px}
.photo-card{padding:0;text-align:left;cursor:pointer}
.photo-card span{display:block;padding:8px;font-size:12px}
.voice-row{border-top:1px solid #edf1ed;padding-top:11px;margin-top:13px}
.voice-row audio{max-width:100%;height:38px}
.interrupted{display:block;margin-top:8px;color:#8a988c;font-size:12px}
.right-panel{position:fixed;top:75px;right:0;bottom:0;width:min(540px,95vw);
             height:calc(100dvh - 75px);max-height:none;overflow-y:auto;z-index:20;
             background:#fff;box-shadow:-12px 0 34px #1a342a18;padding:24px 26px}
.right-panel h3{font-size:16px}
.right-panel header{position:sticky;top:-24px;background:white;z-index:1;padding:14px 0}
.source-text{white-space:pre-wrap;overflow-wrap:anywhere}
.disclaimer,.sidebar-footer{display:none!important}
@media(min-width:961px){.right-panel{width:min(540px,45vw)}}
@media(max-width:960px){.shell{grid-template-columns:224px minmax(0,1fr)}
 .sidebar{padding:20px 12px}
 .main{padding:16px 18px}
 .right-panel{top:75px}}
@media(max-width:650px){
 .app{height:100dvh}
 .header{height:61px}
 .shell{height:calc(100dvh - 61px);display:flex;flex-direction:column;overflow:hidden}
 .sidebar{min-height:0;flex:0 0 auto;padding:9px 13px;overflow:visible}
 .sidebar-group:not(:first-child),.sidebar>.sidebar-link{display:none}
 .sidebar-group:first-child{display:flex;align-items:center}
 .main{height:auto;flex:1 1 auto;min-height:0;overflow:hidden;max-height:none;
       padding:12px 12px 10px}
 .assistant-top{max-height:48vh}
 .hero-robot{width:122px;height:122px}
 .assistant-top h1{font-size:19px}
 .subtitle{display:none}
 .suggestions{gap:6px}
 .suggestions button{font-size:11px;padding:8px}
 .conversation{flex:1;min-height:0;margin:8px auto 10px;padding:4px 3px 10px}
 .message.bot{padding:13px 14px}
 .message.user{max-width:90%}
 .compose{position:relative;bottom:auto;padding:6px}
 .compose textarea{padding:9px 7px;min-height:48px}
 .auto-voice{margin-top:7px}
 .right-panel{top:61px;height:calc(100dvh - 61px);left:0;width:100vw;padding:15px}
}
@media(prefers-reduced-motion:reduce){.answer-progress::before{animation:none}}

.header-admin-link{display:none;text-decoration:none;color:var(--leaf);font-weight:650}
@media(max-width:650px){.header-admin-link:not(.hidden){display:inline-flex;font-size:12px;align-items:center;border-radius:8px;background:#eff6ee;padding:9px}}

/* v0.4: private chat photos and self-service account settings */
.account-button{border:1px solid #dbe8dc;background:#f3f8f3;color:#356b4f;
 border-radius:10px;padding:9px 12px;font-size:12px;font-weight:650}
.account-button:hover{background:#e9f3e9}
.attach-btn{width:44px;height:44px;flex:0 0 44px;border:0;border-radius:12px;
 background:#f0f6ee;color:#347b53;font-size:27px;line-height:1}
.attach-btn:hover{background:#e1efe0}
.attachment-preview{width:min(920px,100%);display:flex;flex:0 0 auto;
 flex-wrap:wrap;gap:9px;padding:2px 0 8px}
.attached-item{position:relative;width:75px;height:72px;flex:0 0 auto;
 border-radius:11px;border:1px solid #dce7db;background:#fff;overflow:visible}
.attached-item img{display:block;width:100%;height:100%;object-fit:cover;border-radius:10px}
.remove-attachment{position:absolute;top:-9px;right:-9px;width:25px;height:25px;
 border-radius:50%;background:#223e30;color:#fff;border:2px solid white;
 font-size:17px;line-height:19px;text-align:center}
.user-photo-strip{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.user-photo-strip img{width:min(140px,37vw);height:110px;border-radius:10px;
 object-fit:cover;background:#dfe9dc;cursor:default}
.account-dialog{width:min(440px,calc(100vw - 32px));padding:0;border:1px solid #dfebde;
 border-radius:19px;box-shadow:0 18px 70px #1d3a2744;background:#fff;color:#233a2f}
.account-dialog::backdrop{background:rgba(22,42,31,.44)}
.password-form{display:grid;gap:15px;padding:25px 25px 27px}
.account-dialog-top{display:flex;align-items:center;justify-content:space-between;gap:20px}
.account-dialog h2{margin:0;font-size:21px;letter-spacing:-.02em}
.close-account{border:0;border-radius:10px;background:#f0f5ef;color:#536559;
 font-size:22px;width:35px;height:35px}
.password-form label{display:grid;gap:7px;font-size:13px;font-weight:600}
.password-form input{padding:12px 13px;border:1px solid #d4e1d5;
 outline:none;border-radius:11px;width:100%;background:#fff}
.password-form input:focus{border-color:#328b60}
.password-note{color:#789080;font-size:12px;line-height:1.5;margin:0}
.password-error{color:#af4539;font-size:12px;min-height:17px;margin:0}
#loginError.success{color:#31784d}
@media(max-width:650px){
 .header-actions{gap:7px}
 .account-button{padding:7px 10px;font-size:12px}
 .attach-btn{width:42px;height:42px;flex-basis:42px}
 .mic-btn,.send-btn{width:42px;height:42px}
 .attachment-preview{gap:7px;padding:2px 3px 7px}
 .attached-item{height:59px;width:62px}
 .password-form{padding:18px}
}

.msg-content strong{font-weight:680}
.msg-content{line-height:1.58}

.answer-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px}
.browse-documents{padding:10px 15px;border-radius:11px;border:1px solid #d6e6d8;background:#eff6ef;color:#2e704c;font-weight:650;cursor:pointer}
.browse-documents:hover{background:#e5f2e6}
