:root{
  --wall:#EFEAE2; --in:#FFFFFF; --out:#D9FDD3; --text:#111B21; --muted:#667781; --sub:#54656F;
  --green:#00A884; --green-dk:#008069; --tick:#53BDEB; --line:#E9EDEF;
  --note:#FFEECD; --navy:#0B2337; --yellow:#FCCD0C; --shadow:0 1px .5px rgba(11,20,26,.13);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{margin:0;font:15px/1.38 var(--font);color:var(--text);background:#DADBD3;display:flex;justify-content:center;align-items:center;min-height:100dvh}
body::before{content:"";position:fixed;inset:0 0 auto 0;height:130px;background:var(--navy);z-index:-1}

/* ---------- App shell ---------- */
.app{position:relative;width:100%;max-width:480px;height:100dvh;display:flex;flex-direction:column;background:var(--wall);overflow:hidden}
@media (min-width:600px){.app{height:min(900px,calc(100dvh - 40px));border-radius:16px;box-shadow:0 12px 50px rgba(11,20,26,.25)}}

/* ---------- Header ---------- */
.top{flex:none;position:relative;z-index:3;display:flex;align-items:center;gap:11px;
     padding:calc(9px + env(safe-area-inset-top)) 12px 9px 14px;background:#fff;box-shadow:0 1px 2px rgba(11,20,26,.08)}
.logo{width:42px;height:42px;flex:none;border-radius:50%;background:#fff;border:1px solid var(--line);display:grid;place-items:center;overflow:hidden}
.logo img{width:31px;height:31px;object-fit:contain}
.who{flex:1;min-width:0}
.who b{display:block;font-size:16.5px;font-weight:600;color:var(--text);line-height:1.2}
.status{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.status.is-typing{color:var(--green)}
.icon-btn{width:40px;height:40px;flex:none;border-radius:50%;border:0;background:transparent;color:var(--sub);display:grid;place-items:center;cursor:pointer}
.icon-btn:hover{background:#F0F2F5}
.bar{position:absolute;left:0;bottom:0;height:3px;width:0;background:var(--yellow);transition:width .5s ease}

/* ---------- Thread (WhatsApp wallpaper) ---------- */
.thread{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:10px 16px 8px;display:flex;flex-direction:column;
  background-color:var(--wall);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%23000' stroke-opacity='.055' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 40l12-12 9 8 15-17'/%3E%3Cpath d='M44 19h6v6'/%3E%3Ccircle cx='128' cy='28' r='10'/%3E%3Cpath d='M125 24h5a2 2 0 010 4h-4a2 2 0 000 4h5M128 22v2M128 32v2'/%3E%3Crect x='70' y='70' width='28' height='18' rx='2'/%3E%3Cpath d='M77 70v18M84 70v18M91 70v18'/%3E%3Cpath d='M150 96l18-6-6 18-4-8z'/%3E%3Cpath d='M20 110v28h22v-28l-11-8z'/%3E%3Cpath d='M28 138v-8h6v8'/%3E%3Cpath d='M110 150h34M114 150v-12h8v12M126 150v-20h8v20'/%3E%3Ccircle cx='60' cy='160' r='3'/%3E%3Ccircle cx='160' cy='160' r='2'/%3E%3Ccircle cx='96' cy='16' r='2'/%3E%3C/svg%3E")}
.thread::-webkit-scrollbar{width:6px}.thread::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15);border-radius:3px}

.day{align-self:center;margin:8px 0 10px;padding:5px 12px;border-radius:8px;background:#fff;color:var(--sub);font-size:12.5px;box-shadow:var(--shadow)}
.sysnote{align-self:center;max-width:88%;margin:0 0 10px;padding:6px 12px;border-radius:8px;background:var(--note);color:var(--sub);
         font-size:12.5px;line-height:1.4;text-align:center;box-shadow:var(--shadow);cursor:pointer;border:0;font-family:var(--font)}
.sysnote svg{vertical-align:-2px;margin-right:4px}

.row{display:flex;margin-top:10px;animation:pop .22s ease-out both}
.row.cont{margin-top:2px}
.row.me{justify-content:flex-end}
@keyframes pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.bub{position:relative;max-width:82%;padding:6px 8px 8px 9px;border-radius:8px;box-shadow:var(--shadow);font-size:14.8px;word-wrap:break-word}
.bot .bub{background:var(--in)}
.me .bub{background:var(--out)}
.row.bot:not(.cont) .bub{border-top-left-radius:0}
.row.me:not(.cont) .bub{border-top-right-radius:0}
.row.bot:not(.cont) .bub::before{content:"";position:absolute;top:0;left:-8px;width:8px;height:13px;background:var(--in);clip-path:polygon(0 0,100% 0,100% 100%)}
.row.me:not(.cont) .bub::before{content:"";position:absolute;top:0;right:-8px;width:8px;height:13px;background:var(--out);clip-path:polygon(0 0,100% 0,0 100%)}
.txt{white-space:pre-wrap}
.sp{display:inline-block;width:58px;height:1px}
.me .sp{width:74px}
.meta{position:absolute;right:7px;bottom:4px;display:flex;align-items:center;gap:3px;font-size:11px;color:var(--muted);line-height:1}
.meta.block{position:static;justify-content:flex-end;margin-top:4px}
.meta svg{color:var(--tick)}
.bub.rich{padding:5px 5px 6px}
.bub.rich .meta.block{padding-right:3px}
.typing .bub{padding:11px 14px}
.dots{display:flex;gap:4px}
.dots span{width:7px;height:7px;border-radius:50%;background:#9AA6AC;animation:blink 1.3s infinite}
.dots span:nth-child(2){animation-delay:.18s}.dots span:nth-child(3){animation-delay:.36s}
@keyframes blink{0%,60%,100%{opacity:.35}30%{opacity:1}}

/* Interactive reply buttons (WhatsApp Business style) */
.btns{display:flex;flex-direction:column;gap:2px;margin:3px 0 0;width:min(82%,340px);animation:pop .22s ease-out both}
.btns button,.btns a{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;padding:10px 12px;border:0;border-radius:8px;
  background:#fff;color:#027EB5;font:500 14.5px var(--font);box-shadow:var(--shadow);cursor:pointer;text-align:center;text-decoration:none;transition:background .12s}
.btns button:hover:not(:disabled),.btns a:hover{background:#F5F6F6}
.btns button svg{flex:none}
.btns button:disabled{cursor:default;color:#8696A0}
.btns button.picked{color:var(--green-dk);font-weight:600}
.btns.multi button{justify-content:flex-start;color:var(--text)}
.btns.multi .box{width:19px;height:19px;flex:none;border-radius:4px;border:2px solid #8696A0;display:grid;place-items:center;transition:.12s}
.btns.multi button[aria-pressed="true"] .box{background:var(--green);border-color:var(--green)}
.btns.multi button[aria-pressed="true"] .box::after{content:"";width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px)}
.btns.multi .done{justify-content:center;color:#027EB5;font-weight:600;margin-top:2px}
.btns.multi .done:disabled{color:#B0BAC0}

/* Rich content */
.trust{display:grid;grid-template-columns:1fr 1fr 1.2fr;gap:4px}
.trust div{padding:10px 6px 9px;border-radius:6px;background:#F5F6F6;text-align:center}
.trust b{display:block;font-size:17px;font-weight:700;color:var(--navy);white-space:nowrap}
.trust small{display:block;font-size:11px;line-height:1.25;color:var(--muted);margin-top:2px}
.list{list-style:none;margin:8px 0 2px;padding:0;display:flex;flex-direction:column;gap:5px;counter-reset:n}
.list li{display:flex;gap:10px;align-items:flex-start;padding:8px 10px;border-radius:6px;background:#F5F6F6;border-left:3px solid var(--yellow)}
.list li::before{counter-increment:n;content:counter(n);flex:none;width:22px;height:22px;border-radius:50%;background:var(--navy);color:#fff;font-size:12px;font-weight:600;display:grid;place-items:center;margin-top:1px}
.list b{display:block;font-size:14.5px;color:var(--navy)}
.list small{display:block;font-size:12.5px;color:var(--muted)}
.doc{display:flex;gap:10px;align-items:center;padding:10px;border-radius:6px;background:#F5F6F6;min-width:240px}
.doc .ic{width:38px;height:46px;flex:none;border-radius:4px;background:var(--navy);color:var(--yellow);display:grid;place-items:center;position:relative}
.doc .ic::after{content:"";position:absolute;right:0;top:0;border-width:0 9px 9px 0;border-style:solid;border-color:transparent #F5F6F6 transparent transparent}
.doc b{display:block;font-size:14px}
.doc small{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted)}

/* Portfolio sheet carousel (WhatsApp carousel-message style) */
.carousel{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 16px 6px 0;margin-right:-16px}
.carousel::-webkit-scrollbar{height:0}
.card{flex:0 0 84%;scroll-snap-align:start;display:flex;flex-direction:column;background:#fff;border-radius:8px;box-shadow:var(--shadow);overflow:hidden}
.card.solo{flex-basis:100%}
.card .ph{position:relative;aspect-ratio:16/10;background-color:var(--navy);background-size:cover;background-position:center;background-repeat:no-repeat}
.card .ph span{position:absolute;left:8px;top:8px;padding:3px 8px;border-radius:99px;background:rgba(11,35,55,.85);color:#fff;font-size:11px;font-weight:600;letter-spacing:.02em}
.card .bd{padding:10px 12px 4px;flex:1}
.card h3{margin:0;font-size:17px;color:var(--navy)}
.card .tg{margin:2px 0 8px;font-size:13px;color:var(--muted)}
.card dl{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:6px}
.card dl div{padding:7px 8px;border-radius:6px;background:#F5F6F6}
.card dt{font-size:11px;color:var(--muted)}
.card dd{margin:1px 0 0;font-size:13.5px;font-weight:600;color:var(--text)}
.card dl .hl{background:#FFF7D1}
.card .est{margin:5px 0 0;font-size:11px;color:var(--muted)}
.card h4{margin:10px 0 2px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--sub)}
.card p.s{margin:0;font-size:13px;color:var(--text)}
.card ul{list-style:none;margin:0;padding:0}
.card li{position:relative;padding-left:14px;font-size:13px;margin:2px 0}
.card li::before{content:"✓";position:absolute;left:0;color:var(--green);font-weight:700}
.card li.warn{color:#8A5A00}.card li.warn::before{content:"!";color:#C98A00}
.card .ask{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;padding:11px;border-top:1px solid var(--line);
           color:#027EB5;font-weight:500;font-size:14px;text-decoration:none}
.card .ask:hover{background:#F5F6F6}
.swipe{font-size:12px;color:var(--sub);margin:4px 0 0;padding:3px 9px;border-radius:99px;background:rgba(255,255,255,.75);align-self:flex-start;display:inline-block}
.ref{font-weight:700;letter-spacing:.04em;color:var(--navy)}

/* ---------- Composer ---------- */
.dock{flex:none;position:relative;z-index:3;padding:6px 8px calc(8px + env(safe-area-inset-bottom));background:var(--wall)}
.composer{display:flex;gap:6px;align-items:flex-end}
.field{flex:1;min-width:0;display:flex;align-items:center;gap:6px;background:#fff;border-radius:24px;padding:4px 6px 4px 14px;box-shadow:var(--shadow)}
.field svg{flex:none;color:#8696A0}
.field input{flex:1;min-width:0;border:0;outline:none;background:transparent;font:16px var(--font);color:var(--text);padding:9px 2px}
.field input::placeholder{color:#8696A0}
.field input:disabled{background:transparent}
.send{width:48px;height:48px;flex:none;border:0;border-radius:50%;background:var(--green);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow);transition:background .15s,transform .1s}
.send:active{transform:scale(.95)}
.send:disabled{background:#8FD9C6;cursor:default}
.cta{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;padding:14px;border:0;border-radius:24px;background:var(--green);color:#fff;
     font:600 16px var(--font);text-decoration:none;cursor:pointer;box-shadow:0 2px 6px rgba(0,128,105,.3)}
.cta:hover{background:var(--green-dk)}
.again{display:block;width:100%;margin-top:6px;padding:6px;border:0;background:none;color:var(--sub);font:500 13px var(--font);cursor:pointer;text-decoration:underline}

/* ---------- Info dialog ---------- */
dialog{width:min(420px,calc(100vw - 32px));border:0;border-radius:14px;padding:0;color:var(--text);box-shadow:0 10px 40px rgba(11,20,26,.3)}
dialog::backdrop{background:rgba(11,20,26,.45)}
.dh{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid var(--line)}
.dh img{width:34px;height:34px}
.dh b{font-size:16px}
.db{padding:14px 18px 6px;max-height:60dvh;overflow:auto}
.db p{margin:0 0 10px;font-size:13.5px;line-height:1.5;color:var(--sub)}
.df{padding:8px 18px 16px;text-align:right}
.df button{border:0;background:none;color:var(--green-dk);font:600 14px var(--font);cursor:pointer;padding:8px 10px}

.hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
