/* Employee app: phone first. Welcome and forms are one narrow column; the conversation is a 100dvh column of header,
   thread and composer, read like the messenger people already use. */
.boot{display:grid;place-items:center;height:100dvh}

/* welcome / forms */
.gate{min-height:100dvh;display:flex;flex-direction:column;align-items:center;padding:28px max(16px,env(safe-area-inset-right,0px)) 40px max(16px,env(safe-area-inset-left,0px))}
.gate-in{width:100%;max-width:520px;display:grid;gap:18px}
.brand{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px;font-weight:600}
.brand-mark{width:34px;height:34px;border-radius:9px;background:var(--accent);color:var(--on-accent);display:grid;place-items:center}
.brand-mark svg{width:20px;height:20px}
.gate h1{font-size:clamp(23px,6vw,29px);line-height:1.6;margin:0;font-weight:800;text-wrap:balance}
.gate .lede{margin:0;color:var(--muted);font-size:15.5px}
.facts{display:grid;gap:0;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);overflow:hidden}
.facts div{display:grid;grid-template-columns:110px 1fr;gap:12px;padding:10px 14px;border-bottom:1px solid var(--line);font-size:14px}
.facts div:last-child{border-bottom:0}
.facts dt{font-weight:700;color:var(--muted)}
.facts dd{margin:0}
.form{display:grid;gap:14px}
.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.switch-link{background:none;border:0;color:var(--accent);font-weight:600;cursor:pointer;padding:6px 0;text-align:start}

/* chat shell */
.chat{height:100dvh;display:grid;grid-template-rows:auto 1fr auto;background:var(--bg)}
.top{position:sticky;top:0;z-index:5;background:var(--surface);border-bottom:1px solid var(--line);padding:calc(env(safe-area-inset-top,0px) + 6px) max(10px,env(safe-area-inset-right,0px)) 8px max(10px,env(safe-area-inset-left,0px))}
.top-row{display:flex;align-items:center;gap:10px;max-width:780px;margin:0 auto}
.avatar{width:38px;height:38px;border-radius:50%;background:var(--accent-soft);color:var(--accent-ink);display:grid;place-items:center;flex:none}
.avatar svg{width:21px;height:21px}
.who{flex:1;min-width:0;line-height:1.5}
.who b{display:block;font-size:15px}
.who span{display:block;font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prog{display:flex;gap:3px;max-width:780px;margin:8px auto 0;cursor:pointer;border:0;background:none;padding:2px 0;width:100%}
.prog i{flex:1;height:5px;border-radius:3px;background:var(--line)}
.prog i.l1{background:linear-gradient(90deg,var(--line) 50%,var(--accent) 50%)}
.prog i.l2{background:var(--accent)}

.thread{overflow-y:auto;overscroll-behavior:contain;padding:16px max(12px,env(safe-area-inset-right,0px)) 10px max(12px,env(safe-area-inset-left,0px))}
.thread-in{max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:12px}
.msg{max-width:86%;font-size:15.5px;line-height:1.95;white-space:pre-wrap;overflow-wrap:anywhere}
.msg.ai{align-self:flex-start;display:flex;gap:9px}
.msg.ai .body{background:var(--surface);border:1px solid var(--line);border-radius:4px 14px 14px 14px;padding:9px 14px}
.msg.ai .mini{width:28px;height:28px;border-radius:50%;background:var(--accent-soft);color:var(--accent-ink);display:grid;place-items:center;flex:none;margin-top:2px}
.msg.ai .mini svg{width:16px;height:16px}
.msg.me{align-self:flex-end;background:var(--accent-soft);color:var(--ink);border-radius:14px 4px 14px 14px;padding:9px 14px}
.msg.notice .body{background:var(--ok-soft);border-color:transparent}
.msg .tag{display:block;font-size:11.5px;color:var(--faint);margin-bottom:2px}
.msg .files{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;white-space:normal}
.filechip{display:inline-flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:3px 9px;font-size:12.5px;max-width:240px;color:var(--ink);text-decoration:none}
.filechip svg{width:16px;height:16px;flex:none;color:var(--muted)}
.filechip span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.filechip img{width:34px;height:34px;object-fit:cover;border-radius:5px}
.typing{display:inline-flex;gap:4px;padding:6px 2px}
.typing i{width:7px;height:7px;border-radius:50%;background:var(--faint);animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.25}40%{opacity:1}}

.summary{align-self:stretch;max-width:100%;background:var(--surface);border:1.5px solid var(--accent);border-radius:14px;padding:14px 16px;white-space:normal;box-shadow:var(--shadow)}
.summary .sh{font-weight:800;font-size:15px;margin-bottom:6px;display:flex;gap:8px;align-items:center}
.summary .acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.waiting{align-self:center;font-size:13px;color:var(--muted);display:flex;gap:8px;align-items:center}

/* composer */
.composer{background:var(--surface);border-top:1px solid var(--line);padding:8px max(10px,env(safe-area-inset-right,0px)) calc(env(safe-area-inset-bottom,0px) + 8px) max(10px,env(safe-area-inset-left,0px))}
.composer-in{max-width:780px;margin:0 auto;display:grid;gap:6px}
.pending{display:flex;flex-wrap:wrap;gap:6px}
.pending .filechip button{border:0;background:none;color:var(--faint);cursor:pointer;padding:0;display:grid}
.pending .filechip button svg{width:15px;height:15px}
.bar{display:flex;align-items:flex-end;gap:4px}
.bar textarea{flex:1;min-height:44px;max-height:160px;resize:none;border:1px solid var(--line-strong);border-radius:22px;padding:9px 16px;background:var(--bg);font-size:16px;line-height:1.7}
.bar textarea:focus{outline:none;border-color:var(--accent)}
.send{width:46px;height:46px;border-radius:50%;border:0;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;cursor:pointer;flex:none}
.send svg{width:22px;height:22px}
.send[disabled]{opacity:.5}
.rec{display:flex;align-items:center;gap:10px;padding:4px 6px}
.rec .pulse{width:12px;height:12px;border-radius:50%;background:var(--clash);animation:blink 1s infinite}
.rec .time{flex:1;font-weight:700}
.hint{font-size:12px;color:var(--faint);text-align:center}

/* sheets */
.sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:40;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--surface);width:100%;max-width:640px;max-height:88dvh;overflow:auto;border-radius:16px 16px 0 0;padding:16px max(16px,env(safe-area-inset-right,0px)) calc(env(safe-area-inset-bottom,0px) + 18px) max(16px,env(safe-area-inset-left,0px))}
.sheet-h{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.sheet-h h2{flex:1;margin:0;font-size:17px}
.menu-list{display:grid;gap:2px}
.menu-list button{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:0 10px;border:0;border-radius:9px;background:none;cursor:pointer;text-align:start;font-size:15px}
.menu-list button:hover{background:var(--sunk)}
.menu-list svg{width:20px;height:20px;color:var(--muted)}
.topics{display:grid;gap:8px}
.topic{display:flex;align-items:center;gap:10px;font-size:14.5px}
.topic .st{margin-inline-start:auto}
.rec-group{margin:14px 0 0}
.rec-group h3{font-size:14px;margin:0 0 6px;color:var(--muted)}
.rec-item{display:flex;gap:10px;align-items:flex-start;padding:7px 0;border-top:1px solid var(--line);font-size:14px}
.rec-item p{flex:1;margin:0}
.rec-item .k{font-size:11.5px;color:var(--faint);display:block}

@media (min-width:700px){
  .sheet-bg{align-items:center}
  .sheet{border-radius:16px}
}
@media (max-width:420px){.form .row2{grid-template-columns:1fr}.facts div{grid-template-columns:1fr;gap:0}}
