:root{--black:#000;--pink:#EB4869;--pink-dark:#c93654;--grey:#F5F5F5;--line:#e3e3e3;--ink:#111;--mute:#6b6b6b;--green:#1f9d55;--red:#d93025;--r:14px}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:'Montserrat',system-ui,sans-serif;color:var(--ink);background:var(--grey);font-size:16px;line-height:1.45;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:'Playfair Display',Georgia,serif;margin:0 0 .4em;font-weight:700}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--pink);outline-offset:2px}
a{color:var(--pink)}

/* top bar */
.top{position:fixed;top:0;left:0;right:0;height:60px;background:var(--black);display:flex;align-items:center;justify-content:space-between;padding:0 16px;z-index:30}
.top .logo img{height:30px;display:block}
.top .right{display:flex;align-items:center;gap:6px}
.bubble{background:var(--pink);color:#fff;font-weight:700;border-radius:999px;padding:7px 16px;font-size:15px;text-decoration:none;white-space:nowrap}
.icon-btn{position:relative;color:#fff;width:44px;height:44px;border-radius:50%;display:grid;place-items:center}
.icon-btn:hover{background:#222}
.icon-btn svg{width:24px;height:24px;stroke:#fff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.badge{position:absolute;top:4px;right:2px;min-width:20px;height:20px;border-radius:10px;background:var(--pink);color:#fff;font-size:12px;font-weight:700;display:none;place-items:center;padding:0 5px}
.badge.on{display:grid}
.status-dot{display:flex;align-items:center;gap:7px;color:#cfcfcf;font-size:13px;margin-right:6px}
.status-dot i{width:10px;height:10px;border-radius:50%;background:#777;display:block}
.status-dot.ready i{background:#2ecc71}
.status-dot.busy i{background:var(--pink)}

/* layout */
.shell{position:fixed;top:60px;bottom:0;left:0;right:0;display:flex}
.nav{width:190px;background:#fff;border-right:1px solid var(--line);padding:14px 10px;display:flex;flex-direction:column;gap:6px}
.nav button{display:flex;align-items:center;gap:12px;padding:14px 14px;border-radius:12px;font-weight:600;font-size:17px;text-align:left;position:relative}
.nav button svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.nav button.on{background:var(--black);color:#fff}
.nav button .badge{position:static;margin-left:auto;display:none}
.nav button .badge.on{display:grid}
.nav .foot{margin-top:auto;font-size:13px;color:var(--mute);padding:10px 14px}
.nav .foot a{color:var(--mute)}
.main{flex:1;min-width:0;display:flex}
.pane{flex:1;min-width:0;display:none;flex-direction:column}
.pane.on{display:flex}

/* texts */
.split{flex:1;display:flex;min-height:0}
.list-col{width:350px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}
.list-top{padding:12px;display:flex;flex-direction:column;gap:10px;border-bottom:1px solid var(--line)}
.search{width:100%;padding:13px 16px;border:1.5px solid var(--line);border-radius:999px;background:var(--grey);font-size:16px}
.search:focus{border-color:var(--pink);outline:0;background:#fff}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:13px 22px;border-radius:999px;font-weight:700;font-size:16px;background:var(--pink);color:#fff;border:2px solid var(--black)}
.btn:hover{background:var(--pink-dark)}
.btn.ghost{background:#fff;color:var(--black);border:2px solid var(--black)}
.btn.ghost:hover{background:var(--grey)}
.btn.green{background:var(--green);border-color:var(--green)}
.btn.red{background:var(--red);border-color:var(--red)}
.btn.small{padding:8px 14px;font-size:14px}
.btn[disabled]{opacity:.5;cursor:default}
.btn svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.items{overflow:auto;flex:1}
.item{display:flex;gap:12px;padding:14px;border-bottom:1px solid var(--line);align-items:center;cursor:pointer;width:100%;text-align:left;background:#fff}
.item:hover,.item.on{background:var(--grey)}
.avatar{width:46px;height:46px;border-radius:50%;background:var(--black);color:#fff;display:grid;place-items:center;font-weight:700;flex:none;font-family:'Playfair Display',serif;font-size:18px}
.item .mid{flex:1;min-width:0}
.item .nm{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item .sn{color:var(--mute);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item.unread .sn{color:var(--ink);font-weight:600}
.item .tm{font-size:12px;color:var(--mute);text-align:right;flex:none}
.item .dot{width:12px;height:12px;border-radius:50%;background:var(--pink);margin:6px 0 0 auto}
.empty{padding:40px 24px;text-align:center;color:var(--mute)}
.empty h3{color:var(--ink)}

.thread-col{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--grey);min-height:0}
.thread-head{display:flex;align-items:center;gap:12px;padding:10px 14px;background:#fff;border-bottom:1px solid var(--line)}
.thread-head .who{flex:1;min-width:0}
.thread-head .who b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread-head .who span{font-size:13px;color:var(--mute)}
.back{display:none;width:44px;height:44px;border-radius:50%;place-items:center}
.back svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.msgs{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:8px}
.bub{max-width:min(78%,520px);padding:10px 14px;border-radius:18px;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere}
.bub.in{background:#fff;align-self:flex-start;border-bottom-left-radius:5px}
.bub.out{background:var(--pink);color:#fff;align-self:flex-end;border-bottom-right-radius:5px}
.bub img{max-width:100%;border-radius:10px;display:block;margin-top:6px}
.meta{font-size:12px;color:var(--mute);align-self:flex-end;margin-top:-4px}
.meta.in{align-self:flex-start}
.meta.bad{color:var(--red);font-weight:600}
.day{align-self:center;font-size:12px;color:var(--mute);margin:8px 0 2px}
.compose{background:#fff;border-top:1px solid var(--line);padding:10px 12px;display:flex;flex-direction:column;gap:8px}
.compose textarea{width:100%;border:1.5px solid var(--line);border-radius:16px;padding:12px 14px;resize:none;max-height:160px;min-height:50px;background:var(--grey)}
.compose textarea:focus{outline:0;border-color:var(--pink);background:#fff}
.compose .row{display:flex;gap:8px;align-items:center}
.compose .row .grow{flex:1}
.banner{background:var(--black);color:#fff;padding:12px 16px;display:flex;gap:12px;align-items:center;justify-content:space-between;font-size:15px}
.note{padding:12px 16px;background:#fff7e6;border-bottom:1px solid #f0d9a8;font-size:14px}
.hide{display:none!important}

/* call */
.call-wrap{flex:1;overflow:auto;display:flex;justify-content:center;padding:20px}
.call-card{width:100%;max-width:420px;display:flex;flex-direction:column;gap:14px}
.call-card .dialbox{background:#fff;border-radius:var(--r);padding:16px;border:1px solid var(--line)}
.numin{width:100%;border:0;font-size:30px;font-weight:700;text-align:center;padding:8px;font-family:'Montserrat',sans-serif;background:transparent;letter-spacing:.5px}
.numin:focus{outline:0}
.results{background:#fff;border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.results .item{padding:10px 14px}
.pad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.pad button{background:#fff;border:1px solid var(--line);border-radius:16px;height:64px;font-size:26px;font-weight:600}
.pad button small{display:block;font-size:10px;color:var(--mute);letter-spacing:2px;margin-top:-4px}
.pad button:active{background:var(--grey)}
.callbar{display:flex;gap:10px;margin-top:12px}
.callas{display:flex;gap:8px;align-items:center;justify-content:center;font-size:14px;color:var(--mute)}
.callas select{padding:8px 12px;border-radius:999px;border:1.5px solid var(--line);background:#fff}
.livecall{background:var(--black);color:#fff;border-radius:var(--r);padding:26px 20px;text-align:center}
.livecall .nm{font-family:'Playfair Display',serif;font-size:28px}
.livecall .st{color:#cfcfcf;margin:6px 0 18px}
.livecall .tm{font-size:34px;font-weight:700;letter-spacing:1px}
.livecall .acts{display:flex;gap:12px;justify-content:center;margin-top:18px}

/* lists */
.page{flex:1;overflow:auto;padding:16px;display:flex;justify-content:center}
.page .inner{width:100%;max-width:760px;display:flex;flex-direction:column;gap:12px}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px;display:flex;gap:12px;align-items:center}
.card .mid{flex:1;min-width:0}
.card .nm{font-weight:700}
.card .sub{font-size:14px;color:var(--mute)}
.card .acts{display:flex;gap:8px;flex-wrap:wrap}
.card.col{flex-direction:column;align-items:stretch}
.ico-in{color:var(--green)}.ico-out{color:var(--ink)}.ico-miss{color:var(--red)}
.callrow{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:12px 14px}
.callrow .top2{display:flex;gap:12px;align-items:center}
.callrow .glyph{width:40px;height:40px;border-radius:50%;background:var(--grey);display:grid;place-items:center;flex:none}
.callrow .glyph svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.callrow.new{border-color:var(--pink)}
.callrow .more{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.callrow textarea{width:100%;border:1.5px solid var(--line);border-radius:12px;padding:10px;min-height:70px;background:var(--grey)}
.callrow audio{width:100%}

/* modal */
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:center;justify-content:center;z-index:60;padding:16px}
.modal-bg.on{display:flex}
.modal{background:#fff;border-radius:18px;padding:22px;width:100%;max-width:440px;max-height:90vh;overflow:auto;display:flex;flex-direction:column;gap:12px}
.modal label{font-weight:600;font-size:14px;display:flex;flex-direction:column;gap:6px}
.modal input,.modal textarea,.modal select,.fld{border:1.5px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--grey);width:100%}
.modal input:focus,.modal textarea:focus,.fld:focus{outline:0;border-color:var(--pink);background:#fff}
.modal .row{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.incoming{position:fixed;left:0;right:0;top:60px;background:var(--black);color:#fff;z-index:70;padding:18px 16px;display:none;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap;box-shadow:0 8px 30px rgba(0,0,0,.4)}
.incoming.on{display:flex}
.incoming .nm{font-family:'Playfair Display',serif;font-size:24px}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:var(--black);color:#fff;padding:12px 20px;border-radius:999px;z-index:80;font-weight:600;display:none;max-width:90vw;text-align:center}
.toast.on{display:block}
.toast.err{background:var(--red)}
.pop{position:absolute;right:8px;top:56px;background:#fff;color:var(--ink);border-radius:var(--r);box-shadow:0 10px 30px rgba(0,0,0,.25);width:260px;display:none;z-index:50;overflow:hidden}
.pop.on{display:block}
.pop button{display:block;width:100%;text-align:left;padding:14px 16px;font-weight:600;border-bottom:1px solid var(--line)}
.pop button:hover{background:var(--grey)}
.pop .none{padding:16px;color:var(--mute)}

/* admin pages */
.wrap{max-width:1000px;margin:84px auto 40px;padding:0 16px}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:18px;margin-bottom:16px}
.tbl{width:100%;border-collapse:collapse}
.tbl th{text-align:left;font-size:13px;color:var(--mute);padding:8px 6px;border-bottom:1px solid var(--line)}
.tbl td{padding:8px 6px;border-bottom:1px solid var(--line);vertical-align:middle}
.tbl input,.tbl select{padding:8px 10px;border:1.5px solid var(--line);border-radius:10px;background:var(--grey);width:100%;min-width:100px}
.ok{color:var(--green);font-weight:700}.bad{color:var(--red);font-weight:700}.wait{color:var(--mute);font-weight:700}
.line{display:flex;gap:8px;align-items:center;margin:8px 0}
.line code{flex:1;background:var(--grey);border:1px solid var(--line);border-radius:10px;padding:10px 12px;overflow:auto;white-space:nowrap;font-size:13px}
.step{display:flex;gap:14px;align-items:flex-start}
.step .n{width:34px;height:34px;border-radius:50%;background:var(--black);color:#fff;display:grid;place-items:center;font-weight:700;flex:none}
.footer{text-align:center;color:var(--mute);font-size:13px;padding:18px 0 28px}
.login{min-height:100%;display:grid;place-items:center;background:var(--black);padding:20px}
.login .box{background:#fff;border-radius:20px;padding:34px 28px;max-width:420px;width:100%;text-align:center}
.login img{height:40px;margin-bottom:18px;background:var(--black);padding:10px 16px;border-radius:12px}

@media(max-width:860px){
  .shell{bottom:0}
  .nav{position:fixed;bottom:0;left:0;right:0;top:auto;width:auto;flex-direction:row;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border-right:0;border-top:1px solid var(--line);z-index:40;gap:4px}
  .nav button{flex:1;flex-direction:column;gap:2px;padding:8px 4px;font-size:12px;text-align:center;justify-content:center}
  .nav button .badge{position:absolute;top:2px;right:18%;margin:0}
  .nav .foot{display:none}
  .main{padding-bottom:70px}
  .status-dot span{display:none}
  .list-col{width:100%;border-right:0}
  .thread-col{position:fixed;inset:60px 0 0 0;z-index:35;display:none}
  .thread-col.open{display:flex}
  .thread-col .back{display:grid}
  .toast{bottom:90px}
}
@media(max-width:860px){
  .call-wrap{padding:12px 16px 20px}
  .pad button{height:54px;font-size:24px}
  .pad{gap:8px}
  .callrow .top2{flex-wrap:wrap}
  .callrow .top2 .acts{flex-basis:100%}
  .callrow .top2 .mid{flex:1 1 150px!important}
  .card{flex-wrap:wrap}
  .card .mid{flex:1 1 150px}
  .card .acts{flex-basis:100%}
  .callbar{position:sticky;bottom:0;background:var(--grey);padding:10px 0 6px}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* 1.1 additions */
.panel .line{justify-content:space-between}
.msbtn{background:#fff;color:#2f2f2f;border:1.5px solid #8c8c8c;display:flex;align-items:center;justify-content:center;gap:12px;font-weight:600}
.msbtn:hover{background:#f3f3f3}
.hint{flex:none;font-size:14px;color:var(--mute);margin:8px 0}
.hide{display:none!important}
.speakbig{width:100%;display:flex;align-items:center;justify-content:center;gap:10px;padding:18px 12px;font-size:16px;border-radius:var(--r)}
.speakbig svg{width:26px;height:26px;stroke:#fff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.speakbig.live{background:var(--black)}
.chips{display:flex;flex:none;gap:8px;overflow-x:auto;padding:2px 0 8px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;padding:9px 14px;border-radius:999px;border:1.5px solid var(--line);background:#fff;font-weight:600;font-size:14px;white-space:nowrap}
.chip small{color:var(--mute);margin-left:6px;font-weight:600}
.chip.on{background:var(--black);border-color:var(--black);color:#fff}
.chip.on small{color:#cfcfcf}
.tag{display:inline-block;font-size:12px;font-weight:700;padding:2px 8px;border-radius:999px;background:var(--grey);color:var(--mute);margin-left:6px;vertical-align:1px}
.tag.pink{background:#fde7ec;color:var(--pink-dark)}

/* 1.2 additions: shared inbox and the wide desktop layout */
.seg{display:flex;gap:4px;background:var(--grey);border-radius:999px;padding:4px}
.seg button{flex:1;padding:9px 10px;border-radius:999px;font-weight:600;font-size:14px;display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.seg button.on{background:var(--black);color:#fff}
.pill{display:none;min-width:20px;height:20px;border-radius:10px;background:var(--pink);color:#fff;font-size:12px;font-weight:700;place-items:center;padding:0 5px}
.pill.on{display:inline-grid}
.phone-title{display:none}
.list-top{display:flex;flex-direction:column;gap:10px}
@media(min-width:1180px){
  .nav button[data-tab=call]{display:none}
  .main .pane{order:1}
  .main #pane-call{order:2;display:flex!important;flex:none;width:384px;border-left:1px solid var(--line);background:#fff}
  .main #pane-call .call-wrap{padding:8px 20px 20px}
  .phone-title{display:block;font-family:'Playfair Display',Georgia,serif;font-weight:700;font-size:22px;padding:18px 20px 0}
}
