/* ===== Worldhue accounts, help chat, admin ===== */
.whx-hidden{display:none!important}
/* demo banner */
.demo-bar{position:fixed;top:0;left:0;right:0;z-index:60;background:#2F5D62;color:#F2F2EF;font:600 12px var(--sans);text-align:center;padding:6px 12px}
body.has-demo{padding-top:28px}

/* ---------- auth ---------- */
.auth{position:fixed;inset:0;z-index:50;background:var(--bg);overflow:auto;display:flex;padding:max(40px,env(safe-area-inset-top)) 18px max(40px,env(safe-area-inset-bottom))}
body.has-demo .auth{top:28px}
.authcard{width:min(420px,100%);margin:auto;display:flex;flex-direction:column;gap:18px}
.authlogo{display:flex;align-items:center;gap:8px;margin-bottom:22px}
.authlogo svg{width:24px;height:24px;flex:none}
.authlogo b{font:400 18px var(--serif);letter-spacing:0;color:var(--muted)}
.auth h1{font:400 clamp(36px,9vw,44px)/1.05 var(--serif);margin:0;letter-spacing:-.01em;text-wrap:balance}
.auth h1 em{font-style:italic}
.auth p{margin:0;color:var(--muted);font-size:15px;line-height:1.5}
.auth form{display:flex;flex-direction:column;gap:14px}
.auth .inp{max-width:none;font-size:16px;padding:13px 14px}
.auth .btn{justify-content:center;width:100%;padding:15px 20px}
.authtabs{display:flex;background:var(--soft);border-radius:999px;padding:4px}
.authtabs button{flex:1;appearance:none;border:0;background:transparent;font:600 14px var(--sans);color:var(--muted);padding:10px;border-radius:999px;cursor:pointer}
.authtabs button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.authrow{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.autherr{color:var(--warn);font-size:14px;min-height:0}
.autherr:empty{display:none}
.codein{font:600 30px var(--mono)!important;letter-spacing:.4em;text-align:center}
.pwwrap{position:relative}
.pwwrap .inp{padding-right:64px}
.pwwrap button{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:0;font:600 12px var(--sans);color:var(--muted);cursor:pointer;padding:8px}
.inbox{border:1px dashed var(--line);border-radius:14px;padding:14px 16px;background:var(--surface);display:flex;flex-direction:column;gap:6px}
.inbox code{font:600 24px var(--mono);letter-spacing:.2em}
.authfine{font-size:12.5px!important}

/* ---------- account chip in header ---------- */
.acct{display:flex;align-items:center;gap:8px;margin-left:auto}
.acct .chip-btn{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:600 12px var(--sans);padding:6px 12px;border-radius:999px;cursor:pointer}
.acct .me{appearance:none;display:inline-flex;align-items:center;border:0;background:none;padding:0;cursor:pointer;flex:none;border-radius:50%}
.acct .me:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.acct .me i{width:36px;height:36px;font-size:19px!important;border-radius:50%;display:grid;place-items:center;font:italic 400 17px var(--serif);color:#fff;flex:none;font-style:italic}
.acct .me span{font:italic 400 19px var(--serif);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.01em}
.acctmenu{position:fixed;z-index:45;right:16px;top:64px;width:min(280px,calc(100% - 32px));background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 40px rgba(0,0,0,.14);padding:14px;display:flex;flex-direction:column;gap:6px}
.acctmenu .who{padding:4px 6px 10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.acctmenu .who b{display:block;font-size:15px}
.acctmenu .who span{font-size:13px;color:var(--muted);word-break:break-all}
.acctmenu button{appearance:none;border:0;background:none;text-align:left;font:500 14px var(--sans);color:var(--ink);padding:10px 8px;border-radius:10px;cursor:pointer}
.acctmenu button:hover{background:var(--soft)}

/* ---------- help chat ---------- */
.helpfab{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:30;width:54px;height:54px;border-radius:50%;border:0;background:var(--ink);color:var(--bg);font:600 22px var(--serif);cursor:pointer;box-shadow:0 10px 28px rgba(0,0,0,.22);display:grid;place-items:center}
.helpfab .dot{position:absolute;top:4px;right:4px;width:12px;height:12px;border-radius:50%;background:#C2593A;border:2px solid var(--bg)}
.help{position:fixed;right:18px;bottom:calc(84px + env(safe-area-inset-bottom,0px));z-index:31;width:min(390px,calc(100% - 24px));height:min(620px,calc(100dvh - 120px));background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:0 24px 60px rgba(0,0,0,.2);display:flex;flex-direction:column;overflow:hidden}
@media (max-width:560px){.help{right:12px;left:12px;width:auto;bottom:calc(80px + env(safe-area-inset-bottom,0px));height:calc(100dvh - 120px)}}
.helphead{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.helphead svg{width:30px;height:30px;flex:none}
.helphead div{flex:1;min-width:0}
.helphead b{display:block;font-size:15px}
.helphead span{font-size:12px;color:var(--muted)}
.helphead button{appearance:none;border:0;background:none;font-size:22px;color:var(--muted);cursor:pointer;padding:4px 8px}
.helpbody{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px}
.msg{max-width:86%;padding:10px 13px;border-radius:16px;font-size:14px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.msg.user{align-self:flex-end;background:var(--ink);color:var(--bg);border-bottom-right-radius:5px}
.msg.ai{align-self:flex-start;background:var(--soft);color:var(--ink);border-bottom-left-radius:5px}
.msg.admin{align-self:flex-start;background:#F6E3DA;color:#3B1A10;border-bottom-left-radius:5px}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .msg.admin{background:#4A2A20;color:#F6E3DA}}
.msg .by{display:block;font:600 11px var(--sans);opacity:.7;margin-bottom:3px}
.sysmsg{align-self:center;font-size:12px;color:var(--muted);text-align:center;padding:2px 10px}
.typing{align-self:flex-start;display:flex;gap:4px;padding:12px 14px;background:var(--soft);border-radius:16px}
.typing i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:tp 1s infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes tp{0%,60%,100%{opacity:.3}30%{opacity:1}}
.quick{display:flex;flex-wrap:wrap;gap:6px}
.quick button{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:500 13px var(--sans);padding:7px 11px;border-radius:999px;cursor:pointer;text-align:left}
.helpfoot{border-top:1px solid var(--line);padding:10px 12px;display:flex;flex-direction:column;gap:8px}
.helpfoot form{display:flex;gap:8px}
.helpfoot .inp{max-width:none;border-radius:999px;padding:11px 14px;font-size:15px}
.helpfoot .send{appearance:none;border:0;background:var(--ink);color:var(--bg);width:44px;height:44px;border-radius:50%;flex:none;cursor:pointer;font-size:18px}
.human{appearance:none;border:0;background:none;color:var(--ink);font:600 13px var(--sans);text-decoration:underline;cursor:pointer;align-self:center;padding:4px}
.tform{display:flex;flex-direction:column;gap:10px;background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:14px}
.tform b{font-size:15px}
.tform .inp{max-width:none}
.tform label.chk{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--muted)}

/* ---------- admin ---------- */
.admin{position:fixed;inset:0;z-index:48;background:var(--bg);overflow:auto}
body.has-demo .admin{top:28px}
.adwrap{max-width:1240px;margin:0 auto;padding:22px 20px 80px;display:flex;flex-direction:column;gap:22px}
.adtop{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.adtop h1{font:400 32px var(--serif);margin:0;flex:1}
.adtop svg{width:34px;height:34px}
.tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
@media (max-width:760px){.tiles{grid-template-columns:repeat(2,minmax(0,1fr))}}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px 18px;display:flex;flex-direction:column;gap:6px}
.tile span{font-size:13px;color:var(--muted)}
.tile b{font:400 38px/1 var(--serif)}
.tile small{font-size:12px;color:var(--muted)}
.live{display:inline-block;width:9px;height:9px;border-radius:50%;background:#2E9E5B;box-shadow:0 0 0 0 rgba(46,158,91,.5);animation:pulse 2s infinite;margin-right:6px;vertical-align:1px}
@keyframes pulse{70%{box-shadow:0 0 0 8px rgba(46,158,91,0)}100%{box-shadow:0 0 0 0 rgba(46,158,91,0)}}
.adtabs{display:flex;gap:6px;border-bottom:1px solid var(--line)}
.adtabs button{appearance:none;border:0;background:none;font:600 14px var(--sans);color:var(--muted);padding:12px 14px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.adtabs button[aria-pressed="true"]{color:var(--ink);border-color:var(--ink)}
.adtabs .n{background:#C2593A;color:#fff;border-radius:999px;padding:1px 7px;font-size:11px;margin-left:6px}
.tk{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:860px){.tk{grid-template-columns:minmax(0,1fr)}}
.tklist{display:flex;flex-direction:column;gap:8px}
.tkfilter{display:flex;gap:6px;flex-wrap:wrap}
.tkitem{appearance:none;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:12px 14px;cursor:pointer;display:flex;flex-direction:column;gap:4px;color:var(--ink);font:inherit}
.tkitem[aria-pressed="true"]{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.tkitem b{font-size:14px}
.tkitem span{font-size:12.5px;color:var(--muted)}
.tkitem .row1{display:flex;justify-content:space-between;gap:8px;align-items:center}
.pill-s{font:700 10.5px var(--sans);letter-spacing:.06em;text-transform:uppercase;border-radius:999px;padding:3px 8px;white-space:nowrap}
.pill-s.open{background:#F6E3DA;color:#8E2F1E}
.pill-s.waiting{background:#E9EFE6;color:#3D5A36}
.pill-s.resolved{background:var(--soft);color:var(--muted)}
.tkdetail{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:18px;display:flex;flex-direction:column;gap:16px;min-height:300px}
.tkdetail h2{font:400 26px var(--serif);margin:0}
.who2{display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.view{border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--bg)}
.view h3{margin:0;font:600 12px var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px 16px;font-size:13.5px}
.vgrid span{display:block;font-size:11.5px;color:var(--muted)}
.vpal{display:flex;height:26px;border-radius:8px;overflow:hidden}
.vpal i{flex:1}
.vshot{width:100%;max-height:420px;object-fit:contain;object-position:top;border-radius:12px;border:1px solid var(--line);background:#fff;cursor:zoom-in}
.thread{display:flex;flex-direction:column;gap:8px}
.reply{display:flex;flex-direction:column;gap:8px}
.reply textarea{max-width:none;min-height:80px;resize:vertical;font:500 14px var(--sans)}
.utable{width:100%;border-collapse:collapse;font-size:13.5px;background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.utable th{text-align:left;font:600 11.5px var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:12px 14px;border-bottom:1px solid var(--line);background:var(--soft)}
.utable td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
.utable tr:last-child td{border-bottom:0}
.utable tbody tr{cursor:pointer}
.utable tbody tr:hover{background:var(--soft)}
.uscroll{overflow-x:auto;border-radius:16px}
.on-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#2E9E5B;margin-right:6px}
.off-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--line);margin-right:6px}
.drawer{position:fixed;top:0;right:0;bottom:0;z-index:49;width:min(460px,100%);background:var(--surface);border-left:1px solid var(--line);box-shadow:-20px 0 50px rgba(0,0,0,.14);overflow:auto;padding:20px;display:flex;flex-direction:column;gap:16px}
.search{max-width:320px}
.empty{color:var(--muted);font-size:14px;padding:30px 10px;text-align:center}
body.has-demo .drawer{top:28px}
header.top{align-items:center}
header.top .acct{order:2}
header.top .planbar{order:3;flex-basis:100%}
.adtop .btn:first-of-type{margin-left:auto}
@media (max-width:640px){.utable th:nth-child(n+4),.utable td:nth-child(n+4){display:none}.utable td,.utable th{padding:10px}}

.hiname{display:block;margin-bottom:10px;font:italic 400 20px var(--serif)!important;letter-spacing:0!important;text-transform:none!important;color:var(--ink)!important}
.hiname:empty{display:none}

.whlogo{display:block;object-fit:contain}
.authlogo .whlogo{width:24px;height:24px;flex:none}
.helphead .whlogo{width:30px;height:30px;flex:none}
.adtop .whlogo{width:34px;height:34px;flex:none}

body.has-demo .plans{top:28px}

/* welcome screen */
.authcard.welcome{gap:20px}
.welogo{display:flex;align-items:center;gap:10px}
.welogo .whlogo{width:40px;height:40px}
.welogo b{font:400 24px var(--serif);color:var(--ink)}
.authcard.welcome h1{font-size:clamp(30px,11vw,52px);line-height:1.08}
.authcard.welcome h1 .l{display:block;white-space:nowrap}
.wsteps{list-style:none;margin:4px 0;padding:0;display:flex;flex-direction:column;gap:14px;counter-reset:w}
.wsteps li{display:grid;grid-template-columns:30px 1fr;column-gap:12px;counter-increment:w}
.wsteps li::before{content:counter(w);grid-row:span 2;width:30px;height:30px;border-radius:50%;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font:600 13px var(--sans);color:var(--muted)}
.wsteps b{font-weight:600;font-size:15px}
.wsteps span{font-size:14px;color:var(--muted)}
.authcard.welcome .btn{justify-content:center;width:100%;padding:15px 20px}
.authcard.welcome .link{align-self:center;font-size:14px}
