/* CHAUPAL Chat standalone PWA — teal + saffron */
:root{--ink:#003DA8;--ink2:#1456C8;--saf:#EA580C;--sun:#FB923C;--cream:#FFF8EF;--line:#E3E7E5;--mut:#62706F;--red:#E11D48}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:#EEF1EF;color:#1C2B2B;font:16px/1.4 system-ui,-apple-system,"Noto Sans Devanagari","Segoe UI",Roboto,sans-serif}
button{font:inherit;color:inherit;cursor:pointer}
#cc-root{max-width:640px;margin:0 auto;min-height:100vh;min-height:100dvh;background:#fff;position:relative}
.cc-boot{padding:40vh 0 0;text-align:center;color:var(--mut)}
.cc-top{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:6px;background:var(--ink);color:#fff;padding:calc(8px + env(safe-area-inset-top)) 10px 8px;min-height:56px}
.cc-title{flex:1;font-size:20px;font-weight:700;min-width:0}
.cc-ic{border:0;background:transparent;color:inherit;font-size:20px;min-width:40px;height:40px;border-radius:50%;padding:0 6px}
.cc-ic:active{background:rgba(255,255,255,.15)}
.cc-hd{display:flex;align-items:center;gap:10px;border:0;background:transparent;color:#fff;text-align:left;padding:0;max-width:100%}
.cc-hd b{display:block;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cc-hd small{display:block;font-size:12px;opacity:.8;font-weight:400}
.cc-sw{padding:8px 10px;background:#fff;border-bottom:1px solid var(--line)}
.cc-search,.cc-in{width:100%;border:1px solid var(--line);background:#F3F6F5;border-radius:22px;padding:10px 16px;font:inherit;outline:0}
.cc-in{border-radius:12px;background:#fff;margin-bottom:10px;padding:12px 14px}
.cc-search:focus,.cc-in:focus{border-color:var(--saf)}
.cc-list{padding-bottom:90px}
.cc-row{display:flex;gap:12px;align-items:center;width:100%;border:0;border-bottom:1px solid #F0F3F2;background:#fff;padding:11px 14px;text-align:left}
.cc-row:active{background:#FFF3E6}
.cc-row.unread b{color:var(--ink)}
.cc-avw{position:relative;flex:0 0 auto}
.cc-av{display:inline-flex;align-items:center;justify-content:center;width:50px;height:50px;border-radius:50%;background:linear-gradient(135deg,var(--saf),var(--sun));color:#fff;font-weight:700;font-size:20px;overflow:hidden}
.cc-av.s{width:38px;height:38px;font-size:16px}.cc-av.xl{width:96px;height:96px;font-size:38px}
.cc-av img{width:100%;height:100%;object-fit:cover}
.cc-dot{position:absolute;right:1px;bottom:1px;width:13px;height:13px;border-radius:50%;background:#22C55E;border:2px solid #fff}
.cc-rc{flex:1;min-width:0}.cc-r1,.cc-r2{display:flex;justify-content:space-between;align-items:center;gap:8px}
.cc-r1 b{font-size:16.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cc-r1 small{color:var(--mut);font-size:12px;flex:0 0 auto}
.cc-row.unread .cc-r1 small{color:var(--saf);font-weight:700}
.cc-last{color:var(--mut);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cc-badge{background:var(--saf);color:#fff;border-radius:11px;min-width:22px;height:22px;padding:0 6px;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.cc-fab{position:fixed;right:max(18px,calc(50% - 302px));bottom:calc(22px + env(safe-area-inset-bottom));width:58px;height:58px;border-radius:18px;border:0;background:linear-gradient(135deg,var(--saf),var(--sun));color:#fff;font-size:26px;box-shadow:0 6px 18px rgba(234,88,12,.45);z-index:15}
.cc-empty{padding:60px 24px;text-align:center;color:var(--mut)}.cc-empty div{font-size:46px}
.cc-install{display:flex;align-items:center;gap:8px;background:#FDEFDF;padding:8px 12px;font-size:14px}.cc-install span{flex:1}
.cc-install button{border:0;background:var(--saf);color:#fff;border-radius:16px;padding:6px 12px;font-weight:600}.cc-install button.x{background:transparent;color:var(--mut);padding:4px 8px}
/* login */
.cc-login{min-height:100vh;min-height:100dvh;background:linear-gradient(180deg,var(--ink),var(--ink2));padding:40px 18px;display:flex;flex-direction:column;align-items:center;gap:18px}
.cc-brand{text-align:center;color:#fff}.cc-brand img{width:96px;height:96px;border-radius:24px}.cc-brand h1{margin:10px 0 2px;font-size:28px}.cc-brand p{margin:0;opacity:.8}
.cc-card{width:100%;max-width:380px;background:#fff;border-radius:18px;padding:18px;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.cc-card small{display:block;color:var(--mut);font-size:12px;margin-top:10px}
.cc-btn{display:block;width:100%;text-align:center;text-decoration:none;border:0;background:linear-gradient(135deg,var(--saf),var(--sun));color:#fff;font-weight:700;border-radius:12px;padding:12px}.cc-btn:disabled{opacity:.6}
.cc-note{color:var(--ink);font-size:13px;margin:8px 0 0}
.cc-login .cc-install{width:100%;max-width:380px;border-radius:12px}
/* thread */
.cc-screen.thread{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh;background:linear-gradient(180deg,#F3F8F6,#FFF8EF)}
.cc-msgs{flex:1;padding:10px 10px 12px;display:flex;flex-direction:column;gap:4px}
.cc-day{align-self:center;background:#fff;border-radius:10px;padding:2px 12px;font-size:12px;color:var(--mut);margin:8px 0;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.cc-b{position:relative;max-width:82%;align-self:flex-start;background:#fff;border-radius:16px 16px 16px 5px;padding:7px 10px 4px;box-shadow:0 1px 2px rgba(15,61,62,.12);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;min-width:70px}
.cc-b.me{align-self:flex-end;background:linear-gradient(135deg,var(--ink),var(--ink2));color:#fff;border-radius:16px 16px 5px 16px}
.cc-b p{margin:0;white-space:pre-wrap;word-break:break-word;user-select:text;-webkit-user-select:text}
.cc-b a{color:var(--saf)}.cc-b.me a{color:#FED7AA}
.cc-b.media{padding:4px}.cc-b img,.cc-b video{display:block;max-width:100%;width:260px;max-height:340px;object-fit:cover;border-radius:12px}
.cc-b.hl{outline:2px solid var(--sun)}.cc-b.unsent{opacity:.7;font-style:italic}
.cc-meta{display:flex;justify-content:flex-end;align-items:center;gap:5px;font-size:11px;opacity:.8;padding:0 4px}
.cc-meta em{font-style:italic}.cc-meta small{font-size:11px}
.cc-tick{font-size:12px;letter-spacing:-3px;padding-right:3px;color:#9FB4B4}.cc-tick.read{color:var(--sun)}
.cc-quote{display:block;width:100%;text-align:left;border:0;border-left:3px solid var(--saf);background:rgba(15,61,62,.07);border-radius:8px;padding:5px 8px;margin:0 0 5px}
.cc-b.me .cc-quote{background:rgba(255,255,255,.13);border-left-color:var(--sun)}
.cc-quote b{display:block;font-size:12px;color:var(--saf)}.cc-b.me .cc-quote b{color:#FED7AA}
.cc-quote span{display:block;font-size:13px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}
.cc-fwdtag{font-size:11.5px;font-style:italic;opacity:.7;margin-bottom:3px}
.cc-rx{position:absolute;bottom:-13px;right:8px;display:flex;gap:2px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:1px 5px;font-size:13px;color:#1C2B2B;box-shadow:0 1px 3px rgba(0,0,0,.1)}
.cc-b:has(.cc-rx){margin-bottom:14px}
.cc-audio{display:flex;align-items:center;gap:6px;padding:4px}.cc-audio audio{height:36px;max-width:230px}
.cc-file{display:flex;align-items:center;gap:10px;padding:8px;border-radius:10px;background:rgba(15,61,62,.07);color:inherit;text-decoration:none;min-width:180px}
.cc-b.me .cc-file{background:rgba(255,255,255,.13);color:#fff}.cc-file b{display:block;font-size:14px}.cc-file small{opacity:.75}
.cc-fic{background:var(--saf);color:#fff;font-weight:800;font-size:11px;border-radius:6px;padding:8px 6px}
.cc-compose{position:sticky;bottom:0;background:var(--cream);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.cc-cbar{display:flex;align-items:flex-end;gap:4px;padding:8px}
.cc-cbar .cc-ic{color:var(--ink);flex:0 0 auto}.cc-cbar .cc-ic:active{background:#FDEFDF}
.cc-ta{flex:1;border:1px solid var(--line);border-radius:22px;padding:10px 14px;font:inherit;resize:none;max-height:120px;outline:0;background:#fff}.cc-ta:focus{border-color:var(--saf)}
.cc-send{flex:0 0 44px;height:44px;border-radius:50%;border:0;background:linear-gradient(135deg,var(--saf),var(--sun));color:#fff;font-size:18px}.cc-send:disabled{opacity:.5}
.cc-mic.rec{background:var(--red);color:#fff;border-radius:20px;font-size:13px;animation:p 1.2s infinite}@keyframes p{50%{opacity:.7}}
.cc-replybar{display:flex;align-items:center;gap:6px;padding:6px 10px 0;background:#FFF8EF}.cc-replybar .cc-quote{flex:1;margin:0;min-width:0}.cc-replybar .cc-ic{color:var(--mut)}
.cc-up{padding:6px 12px;font-size:13px;font-weight:600;color:#fff;background:linear-gradient(90deg,var(--saf) var(--p,0%),var(--ink) var(--p,0%))}
/* sheet + toast */
.cc-sheet{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.cc-sheet-in{width:100%;max-width:640px;background:#fff;border-radius:18px 18px 0 0;padding:8px 8px calc(12px + env(safe-area-inset-bottom));max-height:80vh;overflow:auto}
.cc-sheet-in button{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;text-align:left;padding:13px 14px;border-radius:10px;font-size:16px}
.cc-sheet-in button:active{background:#FFF3E6}.cc-sheet-in .red{color:var(--red)}
.cc-sh-t{display:block;padding:8px 14px}
.cc-emo{display:flex;justify-content:space-around;padding:6px 0 10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.cc-sheet-in .cc-emo button{width:auto;font-size:28px;padding:4px 8px;border-radius:50%}.cc-sheet-in .cc-emo .on{background:#FDEFDF}
.cc-prof{text-align:center;padding:18px 10px}.cc-prof b{display:block;font-size:20px;margin-top:8px}.cc-prof small{color:var(--mut)}
.cc-toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:20px;z-index:60;max-width:90%;font-size:14px}.cc-toast.bad{background:var(--red)}

.cc-tl{display:flex;align-items:center;gap:8px}.cc-tl img{width:34px;height:34px;border-radius:9px}
.cc-link{display:block;margin:12px auto 0;border:0;background:transparent;color:var(--mut);text-decoration:underline}
.cc-brand img{box-shadow:0 8px 24px rgba(0,0,0,.35)}
