#ph-root{--bg:#1F2937;--bg2:#161d29;--bg3:#111827;--line:#2b3547;--txt:#e5e7eb;--mut:#9ca3af;--pur:#8B5CF6;--gold:#F59E0B;--blue:#3B82F6;--pink:#EC4899;
font-family:"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--txt);background:var(--bg);border-radius:12px;overflow:hidden;border:1px solid var(--line);position:relative;min-height:480px;box-sizing:border-box;container-type:inline-size;container-name:phroot}
#ph-root *{box-sizing:border-box}
#ph-root .ph-app{display:grid;grid-template-columns:256px 1fr 220px;height:100%}
#ph-root .ph-side{background:var(--bg2);display:flex;flex-direction:column;min-height:0}
#ph-root .ph-brand{padding:14px 16px;font-weight:800;letter-spacing:.5px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,var(--pur),var(--pink));color:#fff}
#ph-root .ph-brand small{display:block;font-weight:500;opacity:.85;letter-spacing:0;font-size:11px}
#ph-root .ph-chlist{flex:1;overflow:auto;padding:8px}
#ph-root .ph-cat{font-size:11px;font-weight:700;color:var(--mut);margin:14px 8px 4px;letter-spacing:.6px}
#ph-root .ph-ch{display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:6px;color:var(--mut);cursor:pointer;font-size:15px;user-select:none}
#ph-root .ph-ch:hover{background:#222c3d;color:var(--txt)}
#ph-root .ph-ch.on{background:#2d3a52;color:#fff}
#ph-root .ph-ch.lock{opacity:.55}
#ph-root .ph-ch .h{color:var(--mut);font-weight:700}
#ph-root .ph-me{display:flex;align-items:center;gap:8px;padding:10px;background:var(--bg3);border-top:1px solid var(--line)}
#ph-root .ph-me .n{font-size:13px;font-weight:600;line-height:1.1}
#ph-root .ph-me .r{font-size:11px;color:var(--mut)}
#ph-root .ph-me button{margin-left:auto}
#ph-root .ph-main{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg)}
#ph-root .ph-head{padding:12px 16px;border-bottom:1px solid var(--line);font-weight:700;display:flex;gap:10px;align-items:center}
#ph-root .ph-head span{font-weight:400;color:var(--mut);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ph-root .ph-msgs{flex:1;overflow:auto;padding:12px 16px}
#ph-root .ph-msg{display:flex;gap:12px;padding:4px 6px;border-radius:6px;position:relative}
#ph-root .ph-msg:hover{background:#222c3d}
#ph-root .ph-msg.first{margin-top:12px}
#ph-root .ph-av{width:38px;height:38px;border-radius:50%;flex:none;background:#374151;object-fit:cover}
#ph-root .ph-gap{width:38px;flex:none}
#ph-root .ph-body{min-width:0;flex:1}
#ph-root .ph-who{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#ph-root .ph-who b{font-size:15px}
#ph-root .ph-tag{font-size:10px;font-weight:700;padding:1px 6px;border-radius:4px;color:#fff}
#ph-root .ph-bdg{font-size:14px;cursor:help}
#ph-root .ph-time{font-size:11px;color:var(--mut)}
#ph-root .ph-txt{font-size:15px;line-height:1.4;word-wrap:break-word;overflow-wrap:anywhere;white-space:pre-wrap}
#ph-root .ph-txt code{background:#0f1623;padding:1px 5px;border-radius:4px;font-size:13px}
#ph-root .ph-txt a{color:#60a5fa}
#ph-root .ph-reply{font-size:12px;color:var(--mut);border-left:3px solid var(--line);padding-left:8px;margin-bottom:2px}
#ph-root .ph-img{max-width:340px;max-height:300px;border-radius:8px;margin-top:6px;display:block}
#ph-root .ph-file{display:inline-flex;gap:8px;align-items:center;background:var(--bg2);border:1px solid var(--line);padding:8px 12px;border-radius:8px;margin-top:6px;color:#60a5fa;text-decoration:none;font-size:14px}
#ph-root .ph-rx{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
#ph-root .ph-rx button{background:#263148;border:1px solid transparent;color:var(--txt);border-radius:8px;padding:1px 7px;cursor:pointer;font-size:13px}
#ph-root .ph-rx button.mine{border-color:var(--pur);background:#33305f}
#ph-root .ph-act{position:absolute;right:8px;top:-12px;display:none;background:var(--bg2);border:1px solid var(--line);border-radius:6px}
#ph-root .ph-msg:hover .ph-act{display:flex}
#ph-root .ph-act button{background:none;border:0;color:var(--txt);padding:3px 7px;cursor:pointer;font-size:14px}
#ph-root .ph-act button:hover{background:#2d3a52}
#ph-root .ph-comp{padding:0 16px 16px;position:relative}
#ph-root .ph-box{display:flex;align-items:flex-end;gap:6px;background:#2a3445;border-radius:10px;padding:6px 8px}
#ph-root .ph-box textarea{flex:1;background:none;border:0;outline:none;color:var(--txt);font:inherit;font-size:15px;resize:none;max-height:140px;padding:6px}
#ph-root .ph-ib{background:none;border:0;color:var(--mut);cursor:pointer;font-size:20px;padding:4px 6px;border-radius:6px}
#ph-root .ph-ib:hover{color:#fff;background:#374462}
#ph-root .ph-pend{font-size:12px;color:var(--mut);padding:4px 8px}
#ph-root .ph-pop{position:absolute;bottom:62px;right:16px;width:320px;max-height:320px;overflow:auto;background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:8px;z-index:20;box-shadow:0 8px 30px #0008}
#ph-root .ph-eg{display:grid;grid-template-columns:repeat(8,1fr);gap:2px}
#ph-root .ph-eg button{background:none;border:0;font-size:22px;cursor:pointer;border-radius:6px;padding:3px}
#ph-root .ph-eg button:hover{background:#2d3a52}
#ph-root .ph-gg{display:grid;grid-template-columns:1fr 1fr;gap:6px}
#ph-root .ph-gg img{width:100%;border-radius:6px;cursor:pointer}
#ph-root .ph-pop input{width:100%;background:#2a3445;border:0;border-radius:6px;color:var(--txt);padding:8px;margin-bottom:8px;outline:none}
#ph-root .ph-mem{overflow:auto;padding:8px}
#ph-root .ph-mh{font-size:11px;font-weight:700;color:var(--mut);margin:12px 8px 4px;letter-spacing:.6px}
#ph-root .ph-m{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;font-size:14px;cursor:pointer;opacity:.5}
#ph-root .ph-m.on{opacity:1}
#ph-root .ph-m:hover{background:#222c3d}
#ph-root .ph-m .ph-av{width:30px;height:30px}
#ph-root .ph-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;margin-left:auto}
#ph-root .ph-lockbox{margin:auto;text-align:center;color:var(--mut);padding:30px}
#ph-root .ph-lockbox div{font-size:48px}
#ph-root .ph-btn{background:linear-gradient(135deg,var(--pur),var(--pink));color:#fff;border:0;border-radius:8px;padding:10px 16px;font-weight:700;cursor:pointer;font-size:14px}
#ph-root .ph-btn.sm{padding:4px 10px;font-size:12px;background:#374151}
#ph-root .ph-auth{display:flex;align-items:center;justify-content:center;height:100%;background:radial-gradient(circle at 30% 20%,#2a1f55,#111827 70%)}
#ph-root .ph-card{width:360px;max-width:92%;background:var(--bg);padding:28px;border-radius:14px;border:1px solid var(--line);box-shadow:0 10px 40px #000a}
#ph-root .ph-card h2{margin:0 0 4px;color:#fff;font-size:22px}
#ph-root .ph-card p{margin:0 0 16px;color:var(--mut);font-size:14px}
#ph-root .ph-card input{width:100%;margin-bottom:10px;background:#111827;border:1px solid var(--line);border-radius:8px;color:var(--txt);padding:11px;font-size:15px;outline:none}
#ph-root .ph-card input:focus{border-color:var(--pur)}
#ph-root .ph-card .ph-btn{width:100%}
#ph-root .ph-sw{margin-top:12px;font-size:13px;color:var(--mut);text-align:center}
#ph-root .ph-sw a{color:#60a5fa;cursor:pointer}
#ph-root .ph-err{color:#f87171;font-size:13px;margin-bottom:8px;min-height:1em}
#ph-root .ph-toast{position:absolute;right:16px;top:16px;background:linear-gradient(135deg,var(--gold),var(--pink));color:#111;padding:12px 16px;border-radius:10px;font-weight:700;z-index:50;box-shadow:0 8px 30px #0008;animation:phin .35s}
#ph-root .ph-toast small{display:block;font-weight:500}
@keyframes phin{from{transform:translateY(-20px);opacity:0}to{transform:none;opacity:1}}
#ph-root .ph-prof{position:absolute;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;z-index:40}
#ph-root .ph-prof .ph-card{text-align:center}
#ph-root .ph-prof .ph-av{width:72px;height:72px;margin-bottom:8px}
#ph-root .ph-badgegrid{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px}
#ph-root .ph-badgegrid div{background:#111827;border-radius:8px;padding:8px 10px;font-size:12px;text-align:left}
#ph-root .ph-badgegrid b{display:block;font-size:13px}
#ph-root .ph-back{display:none}
@media (max-width:860px){
 #ph-root .ph-app{grid-template-columns:200px 1fr}
 #ph-root .ph-mem{display:none}
}
@media (max-width:560px){
 #ph-root .ph-app{grid-template-columns:1fr}
 #ph-root .ph-side{display:none}
 #ph-root.show-ch .ph-side:not(.ph-mem){display:flex}
 #ph-root.show-ch .ph-main{display:none}
 #ph-root .ph-back{display:inline-block}
}

/* ---- v1.1 additions ---- */
#ph-root .ph-av.xs{width:22px;height:22px;font-size:13px}
#ph-root .ph-bot{display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#10B981,#3B82F6);font-size:20px}
#ph-root .ph-bot.xs{font-size:12px}
#ph-root .ph-msg.bot .ph-txt{border-left:3px solid #10B981;padding-left:8px}
#ph-root .ph-ch .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ph-root .ph-ch.unread{color:#fff;font-weight:700}
#ph-root .ph-pill{background:#444e66;color:#fff;border-radius:10px;font-size:11px;font-weight:700;padding:1px 7px;margin-left:auto}
#ph-root .ph-pill.hot{background:#ef4444}
#ph-root .ph-hint{font-size:12px;color:var(--mut);padding:2px 10px}
#ph-root .pinbtn{margin-left:auto;font-size:16px}
#ph-root .ph-embed:empty{display:none}
#ph-root .ph-embed{padding:8px 16px;border-bottom:1px solid var(--line);background:var(--bg3)}
#ph-root .ph-embed iframe{width:100%;border:0;border-radius:8px;background:#000}
#ph-root .ph-live{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#ph-root .ph-live audio{flex:1;min-width:200px}
#ph-root .ph-mention{background:#3b4a7a;color:#c7d2fe;border-radius:4px;padding:0 3px;font-weight:600}
#ph-root .ph-mention.me{background:#6b4e1b;color:#fde68a}
#ph-root .ph-cemoji{width:22px;height:22px;vertical-align:middle;object-fit:contain}
#ph-root .ph-cemoji.sm{width:16px;height:16px}
#ph-root .ph-eg .ph-cemoji{width:28px;height:28px}
#ph-root .ph-edit{width:100%;background:#2a3445;border:1px solid var(--pur);border-radius:8px;color:var(--txt);font:inherit;font-size:15px;padding:8px;outline:none;resize:vertical}
#ph-root .ph-ac{position:absolute;left:16px;right:16px;bottom:62px;background:var(--bg2);border:1px solid var(--line);border-radius:10px;overflow:hidden;z-index:25;box-shadow:0 8px 30px #0008}
#ph-root .ph-aci{display:flex;align-items:center;gap:8px;padding:7px 12px;cursor:pointer;font-size:14px}
#ph-root .ph-aci.on,#ph-root .ph-aci:hover{background:#2d3a52}
#ph-root .ph-pop.top{top:50px;bottom:auto;right:16px}
#ph-root .ph-pinrow{border-top:1px solid var(--line);padding:6px 0;font-size:14px}
#ph-root .ph-sub{color:var(--mut);font-size:13px;margin-bottom:6px}
#ph-root .ph-modrow{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
#ph-root .ph-btn.danger{background:#b91c1c}
#ph-root .ph-btn:disabled{opacity:.6;cursor:wait}
#ph-root .ph-toast.err{background:#ef4444;color:#fff}
#ph-root .ph-card.wide{width:520px;max-height:92%;overflow:auto}
#ph-root .ph-rules{white-space:pre-wrap;background:#111827;border-radius:8px;padding:12px;font-size:14px;line-height:1.5;margin-bottom:10px;text-align:left}
#ph-root .ph-acc{display:block;margin:10px 0;font-size:14px;cursor:pointer;text-align:left}
#ph-root .ph-chips{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 14px;justify-content:center}
#ph-root .ph-chip{background:#111827;border:1px solid var(--line);color:var(--txt);border-radius:20px;padding:6px 14px;cursor:pointer;font-size:14px}
#ph-root .ph-chip.on{background:var(--pur);border-color:var(--pur);color:#fff}

/* ---- v1.2 additions ---- */
#ph-root .ph-brand{position:relative}
#ph-root .ph-fs{position:absolute;right:12px;top:12px;color:#fff;text-decoration:none;font-size:18px;opacity:.85}
#ph-root .ph-fs:hover{opacity:1}
#ph-root .ph-install{padding:0 10px 8px}
#ph-root .ph-btn.full{width:100%}
#ph-root .ph-rx button:disabled{cursor:default;opacity:.8}
#ph-root.ph-appmode{border-radius:0;border:0}
#ph-root .ph-me > div:nth-child(2){min-width:0;flex:1}
#ph-root .ph-me .n,#ph-root .ph-me .r{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ph-root .ph-me .ph-btn.sm{padding:4px 8px}
#ph-root .ph-card input[type=checkbox]{width:auto;display:inline-block;margin:0 8px 0 0;vertical-align:middle;accent-color:#8B5CF6}
#ph-root .ph-acc{display:flex;align-items:center;justify-content:center}
#ph-root .ph-head{white-space:nowrap}
@media (max-width:560px){
 #ph-root .ph-head span{display:none}
 #ph-root .pinbtn{margin-left:auto}
}

/* container-width versions: the hub adapts to the box it is placed in, not just the screen */
@container phroot (max-width:860px){
 #ph-root .ph-app{grid-template-columns:200px 1fr}
 #ph-root .ph-mem{display:none}
}
@container phroot (max-width:560px){
 #ph-root .ph-app{grid-template-columns:1fr}
 #ph-root .ph-side{display:none}
 #ph-root.show-ch .ph-side:not(.ph-mem){display:flex}
 #ph-root.show-ch .ph-main{display:none}
 #ph-root .ph-back{display:inline-block}
}
@container phroot (max-width:560px){
 #ph-root .ph-head span{display:none}
 #ph-root .pinbtn{margin-left:auto}
}
#ph-root b,#ph-root strong{font-weight:700}
#ph-root em{font-style:italic}

/* ======================= v1.3 ======================= */
#ph-root .ph-logo{display:block;max-width:100%;max-height:44px;object-fit:contain;margin-bottom:2px}
#ph-root .ph-tools{display:flex;gap:4px;padding:6px 8px;border-bottom:1px solid var(--line);background:var(--bg2)}
#ph-root .ph-tb{flex:1;background:#222c3d;border:0;color:var(--txt);border-radius:8px;padding:6px 0;cursor:pointer;font-size:16px;position:relative}
#ph-root .ph-tb:hover{background:#2d3a52}
#ph-root .ph-tb .ph-pill{position:absolute;top:-4px;right:2px;font-size:10px;padding:0 5px;margin:0}
#ph-root .ph-cat.click{cursor:pointer;display:flex;align-items:center;justify-content:space-between}
#ph-root .ph-cat.click:hover{color:var(--txt)}
#ph-root .ph-typing{min-height:18px;padding:0 20px;font-size:12px;color:var(--mut);font-style:italic}
#ph-root .ph-typing:empty{min-height:0}
#ph-root .ph-nolinks{padding-top:0;color:#f59e0b}
#ph-root .ph-pthumb{height:38px;width:38px;object-fit:cover;border-radius:6px;vertical-align:middle;margin-right:8px}
#ph-root .ph-main{position:relative}
#ph-root .ph-main.drop::after{content:"Drop a file to upload";position:absolute;inset:0;background:#8b5cf655;border:3px dashed var(--pur);border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;color:#fff;z-index:30;pointer-events:none}
#ph-root .ph-msg.hit{animation:phhit 2.2s ease-out}
@keyframes phhit{0%,60%{background:#6b4e1b}100%{background:transparent}}
#ph-root .ph-reply.click{cursor:pointer}
#ph-root .ph-reply.click:hover{color:var(--txt);border-left-color:var(--pur)}
#ph-root .ph-threadlink{display:inline-block;margin-top:4px;color:#60a5fa;font-size:13px;cursor:pointer;font-weight:600}
#ph-root .ph-threadlink:hover{text-decoration:underline}
#ph-root .ph-media{display:block;max-width:360px;width:100%;margin-top:6px;border-radius:8px}
#ph-root .ph-jump{text-align:center;padding:10px}
#ph-root .ph-m.idle{opacity:.8}
#ph-root .ph-mn{display:flex;flex-direction:column;min-width:0;flex:1}
#ph-root .ph-mn span,#ph-root .ph-mn small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ph-root .ph-mn small{color:var(--mut);font-size:11px}
#ph-root .ph-dot.idle{background:#f59e0b}
/* link previews */
#ph-root .ph-pv{display:flex;gap:10px;max-width:440px;margin-top:6px;background:var(--bg2);border-left:4px solid var(--pur);border-radius:8px;padding:8px;color:var(--txt);text-decoration:none;overflow:hidden}
#ph-root .ph-pv:hover{background:#222c3d}
#ph-root .ph-pvimg{width:84px;height:84px;object-fit:cover;border-radius:6px;flex:none}
#ph-root .ph-pvtxt{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:13px}
#ph-root .ph-pvtxt small{color:var(--mut);font-size:11px}
#ph-root .ph-pvtxt b{color:#60a5fa;font-size:14px;line-height:1.25}
#ph-root .ph-pvtxt span{color:var(--mut);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* context menu */
#ph-root .ph-ctx{position:absolute;z-index:60;min-width:200px;background:var(--bg3);border:1px solid var(--line);border-radius:10px;padding:6px;box-shadow:0 10px 36px #000a}
#ph-root .ph-ci{padding:8px 12px;border-radius:6px;cursor:pointer;font-size:14px;white-space:nowrap}
#ph-root .ph-ci:hover{background:#2d3a52}
#ph-root .ph-ci.danger{color:#f87171}
/* richer profile card */
#ph-root .ph-card.prof{padding:0 0 22px;overflow:hidden;width:380px}
#ph-root .ph-card.prof>*:not(.ph-banner){margin-left:22px;margin-right:22px}
#ph-root .ph-banner{height:84px;margin:0!important}
#ph-root .ph-avwrap{margin-top:-38px!important}
#ph-root .ph-avwrap .ph-av{width:76px;height:76px;border:4px solid var(--bg)}
#ph-root .ph-status{background:#111827;border-radius:14px;padding:4px 12px;display:inline-block;margin-top:8px;font-size:13px}
#ph-root .ph-bio{margin-top:10px;font-size:14px;color:var(--txt);white-space:pre-wrap}
#ph-root .ph-lvl{margin-top:12px;font-size:12px;color:var(--mut)}
#ph-root .ph-lvl b{color:var(--gold)}
#ph-root .ph-bar{height:6px;background:#111827;border-radius:3px;margin-top:6px;overflow:hidden}
#ph-root .ph-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--pur),var(--pink))}
/* modals: search, events, reports, switcher, settings */
#ph-root .ph-card.wide{text-align:left}
#ph-root .ph-mtitle{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
#ph-root .ph-mtitle h2{margin:0}
#ph-root .ph-card.wide .ph-mh{text-align:left;margin-left:0}
#ph-root .ph-srow{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap}
#ph-root .ph-srow input,#ph-root .ph-srow label{flex:1}
#ph-root .ph-srow label{font-size:12px;color:var(--mut);display:flex;flex-direction:column;gap:4px}
#ph-root .ph-big{width:100%;font-size:16px}
#ph-root .ph-sel{background:#111827;color:var(--txt);border:1px solid var(--line);border-radius:8px;padding:9px;font-size:14px;max-width:100%}
#ph-root .ph-results{max-height:50vh;overflow:auto;margin-top:6px}
#ph-root .ph-sr{padding:9px 10px;border-radius:8px;cursor:pointer;border-bottom:1px solid var(--line);font-size:14px}
#ph-root .ph-sr:hover,#ph-root .ph-sr.on{background:#2d3a52}
#ph-root .ph-srh{font-size:13px;margin-bottom:2px}
#ph-root .ph-ev{display:flex;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
#ph-root .ph-evdate{width:54px;flex:none;text-align:center;background:#111827;border-radius:10px;padding:6px 0;display:flex;flex-direction:column}
#ph-root .ph-evdate b{color:var(--pink);font-size:11px;letter-spacing:.6px}
#ph-root .ph-evdate span{font-size:22px;font-weight:800}
#ph-root .ph-evbody{flex:1;min-width:0}
#ph-root .ph-evrow{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:8px}
#ph-root .ph-btn.sm.on{background:var(--pur)}
#ph-root .ph-evform{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
#ph-root .ph-evform input,#ph-root .ph-evform textarea,#ph-root .ph-evform select{width:100%;margin-bottom:8px;background:#111827;border:1px solid var(--line);border-radius:8px;color:var(--txt);padding:9px;font:inherit;font-size:14px}
#ph-root .ph-frow{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;font-size:14px}
#ph-root .ph-frow>span:first-child{flex:none;max-width:48%}
#ph-root .ph-frow input[type=text],#ph-root .ph-frow input:not([type]),#ph-root .ph-frow textarea{flex:1;max-width:260px}
#ph-root .ph-frow textarea{background:#111827;border:1px solid var(--line);border-radius:8px;color:var(--txt);padding:8px;font:inherit}
#ph-root .ph-inl{display:flex;gap:6px;align-items:center;flex:1;justify-content:flex-end;flex-wrap:wrap}
#ph-root .ph-avrow{display:flex;gap:14px;align-items:center;margin-bottom:12px}
#ph-root .ph-av.big{width:64px;height:64px}
#ph-root .ph-card.wide input[type=color]{width:46px;height:34px;padding:0;margin:0;border:0;background:none}
/* thread panel */
#ph-root .ph-app{position:relative}
#ph-root .ph-thread{position:absolute;top:0;right:0;bottom:0;width:360px;max-width:100%;background:var(--bg2);border-left:1px solid var(--line);display:flex;flex-direction:column;z-index:25;box-shadow:-8px 0 30px #0006}
#ph-root .ph-thead{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
#ph-root .ph-tlist{flex:1;overflow:auto;padding:10px 12px}
#ph-root .ph-tdiv{font-size:11px;font-weight:700;color:var(--mut);letter-spacing:.6px;margin:12px 4px 4px;border-top:1px solid var(--line);padding-top:8px}
#ph-root .ph-tcomp{display:flex;gap:6px;padding:10px;border-top:1px solid var(--line);align-items:flex-end}
#ph-root .ph-tcomp textarea{flex:1;background:#2a3445;border:0;border-radius:8px;color:var(--txt);font:inherit;padding:9px;resize:none;outline:none;max-height:120px}
/* ---- light theme ---- */
#ph-root.light{--bg:#f6f7fb;--bg2:#eceef5;--bg3:#e2e5ee;--line:#d3d7e3;--txt:#1d2230;--mut:#5a6377}
#ph-root.light .ph-ch:hover,#ph-root.light .ph-msg:hover,#ph-root.light .ph-m:hover,#ph-root.light .ph-tb,#ph-root.light .ph-pv:hover{background:#dde1ec}
#ph-root.light .ph-ch.on{background:#cfd6ea;color:#111}
#ph-root.light .ph-ch.unread,#ph-root.light .ph-ch.on .nm{color:#000}
#ph-root.light .ph-box,#ph-root.light .ph-tcomp textarea,#ph-root.light .ph-edit{background:#e4e7f1;color:var(--txt)}
#ph-root.light .ph-box textarea{color:var(--txt)}
#ph-root.light .ph-rx button{background:#dfe3ef;color:var(--txt)}
#ph-root.light .ph-rx button.mine{background:#d6cffc}
#ph-root.light .ph-card,#ph-root.light .ph-pop,#ph-root.light .ph-ctx,#ph-root.light .ph-act,#ph-root.light .ph-ac,#ph-root.light .ph-thread{background:#fff;color:var(--txt)}
#ph-root.light .ph-card input,#ph-root.light .ph-sel,#ph-root.light .ph-evform input,#ph-root.light .ph-evform textarea,#ph-root.light .ph-evform select,#ph-root.light .ph-frow textarea,#ph-root.light .ph-pop input{background:#f0f2f8;color:var(--txt);border-color:var(--line)}
#ph-root.light .ph-ci:hover,#ph-root.light .ph-sr:hover,#ph-root.light .ph-sr.on,#ph-root.light .ph-aci.on,#ph-root.light .ph-aci:hover,#ph-root.light .ph-act button:hover{background:#e3e7f3}
#ph-root.light .ph-txt code,#ph-root.light .ph-rules,#ph-root.light .ph-status,#ph-root.light .ph-bar,#ph-root.light .ph-evdate,#ph-root.light .ph-badgegrid div,#ph-root.light .ph-chip{background:#e6e9f2;color:var(--txt)}
#ph-root.light .ph-tag,#ph-root.light .ph-btn{color:#fff}
#ph-root.light .ph-btn.sm{background:#6b7390}
#ph-root.light .ph-mention{background:#dbe3ff;color:#233a8a}
#ph-root.light .ph-mention.me{background:#fde9b8;color:#7a4d00}
#ph-root.light .ph-embed{background:var(--bg3)}
#ph-root.light .ph-txt a,#ph-root.light .ph-pvtxt b{color:#2563eb}
@container phroot (max-width:700px){
 #ph-root .ph-thread{width:100%}
}
/* v1.3 polish */
#ph-root .ph-evrow .ph-btn,#ph-root .ph-avrow .ph-btn,#ph-root .ph-sr .ph-btn,#ph-root .ph-inl .ph-btn{width:auto;display:inline-block}
#ph-root .ph-modrow .ph-btn{width:auto;flex:1 1 auto;min-width:76px}
#ph-root .ph-inl input:first-child:not(:only-child){flex:0 0 58px;width:58px;text-align:center}
#ph-root .ph-inl input:last-child{flex:1;min-width:0}
#ph-root .ph-status{display:table;margin:8px auto 0}
#ph-root .ph-avrow>div .ph-btn{margin-right:4px}
#ph-root .ph-card.settings .ph-hint{padding:0 0 12px}
#ph-root.light .ph-m{opacity:.72}
#ph-root.light .ph-m.on,#ph-root.light .ph-m.idle{opacity:1}
#ph-root.light .ph-time{color:#6b7488}

/* ======================= v1.4 ======================= */
#ph-root .ph-brand.has-banner{padding:0;background:#111827;overflow:hidden}
#ph-root .ph-bannerimg{display:block;width:100%;height:auto;max-height:240px;object-fit:cover}
#ph-root .banner-tall .ph-bannerimg{height:200px}
#ph-root .ph-bt{display:flex;flex-direction:column;gap:1px}
#ph-root .ph-brand.has-banner .ph-bt{padding:10px 16px 12px;background:linear-gradient(135deg,var(--pur),var(--pink))}
#ph-root .ph-bname{font-weight:800;font-size:17px;line-height:1.2}
#ph-root .ph-brand .ph-pw{opacity:.8;font-size:10px;letter-spacing:.3px;text-transform:none}
#ph-root .ph-brand.has-banner .ph-fs{background:#0008;border-radius:6px;padding:0 6px}
/* live bar */
#ph-root .ph-livebar{background:linear-gradient(90deg,#7f1d1d,#b91c1c);border-bottom:1px solid #ef4444}
#ph-root .ph-livebtn{display:flex;gap:6px;align-items:center;padding:7px 12px;cursor:pointer;font-size:13px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ph-root .ph-livebtn:hover{background:#0002}
#ph-root .ph-livedot{width:9px;height:9px;border-radius:50%;background:#fff;flex:none;animation:phpulse 1.4s infinite}
@keyframes phpulse{0%{box-shadow:0 0 0 0 #fff8}70%{box-shadow:0 0 0 7px #fff0}100%{box-shadow:0 0 0 0 #fff0}}
#ph-root .ph-livenow{display:flex;align-items:center;gap:6px;background:#7f1d1d;color:#fff;padding:10px 12px;border-radius:8px;margin-bottom:10px}
#ph-root .ph-tb.on-air{background:#b91c1c;color:#fff}
#ph-root .ph-tools{flex-wrap:nowrap;gap:3px;padding:6px 6px}
#ph-root .ph-tb{min-width:0;padding:6px 0;font-size:15px}
/* badges with pictures */
#ph-root .ph-bimg{width:20px;height:20px;object-fit:contain;vertical-align:middle;display:inline-block}
#ph-root .ph-bimg.emo{width:auto;height:auto;font-size:16px;line-height:20px}
#ph-root .ph-bimg.lg{width:34px;height:34px}
#ph-root .ph-bimg.lg.emo{font-size:28px;line-height:34px}
#ph-root .ph-bimg.xl{width:58px;height:58px}
#ph-root .ph-bimg.xl.emo{font-size:46px;line-height:58px}
#ph-root .ph-bi{width:16px;height:16px;object-fit:contain;vertical-align:middle}
#ph-root .ph-bi.emo{width:auto;height:auto;font-size:14px;line-height:16px}
#ph-root .ph-badgegrid>div{display:flex;flex-direction:column;align-items:center;text-align:center;width:112px;gap:2px}
#ph-root .ph-badgegrid>div span{display:block;font-size:11px;color:var(--mut)}
#ph-root .ph-chips2{display:flex;gap:4px;flex-wrap:wrap;justify-content:center;margin-top:4px}
#ph-root .ph-mrow .ph-chips2{justify-content:flex-start;margin-top:2px}
/* clickable people */
#ph-root .ph-av.click,#ph-root .ph-uname{cursor:pointer}
#ph-root .ph-uname:hover{text-decoration:underline}
#ph-root .ph-mention.role{background:#12353a}
#ph-root .ph-rdot{width:12px;height:12px;border-radius:50%;display:inline-block;flex:none}
/* welcome */
#ph-root .ph-wpanel{padding:14px 16px;background:linear-gradient(135deg,#2a1f55,#1F2937);border-bottom:1px solid var(--line)}
#ph-root .ph-wpanel h3{margin:0 0 6px}
#ph-root .ph-wpanel .ph-modrow{justify-content:flex-start;margin-top:8px}
#ph-root .ph-panel{white-space:pre-wrap;font-size:14px;line-height:1.55;text-align:left;margin:8px 0;color:var(--txt)}
/* translation */
#ph-root .ph-trans{margin-top:4px;padding:5px 9px;border-left:3px solid #38bdf8;background:#0f2433;border-radius:4px;font-size:14px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
#ph-root .ph-time.click{cursor:pointer;color:#60a5fa}
/* event tags */
#ph-root .ph-evtag{display:inline-block;background:#3b2a52;color:#f5d0fe;border-radius:6px;padding:0 6px;cursor:pointer;font-weight:600}
#ph-root .ph-evtag.gone{opacity:.6;cursor:default}
#ph-root .ph-evcard{display:block;border-left:4px solid var(--pink);background:var(--bg2);border-radius:8px;padding:9px 11px;margin:6px 0;max-width:430px;white-space:normal}
#ph-root .ph-evc-h{display:flex;gap:6px;align-items:center;font-size:15px}
#ph-root .ph-evc-d{font-size:13px;color:var(--mut);margin-top:3px}
#ph-root .ph-evcard .ph-evrow{margin-top:6px}
/* members directory */
#ph-root .ph-mlist{max-height:56vh;overflow:auto;margin-top:6px}
#ph-root .ph-mrow{display:flex;gap:12px;padding:10px 8px;border-bottom:1px solid var(--line);cursor:pointer;align-items:flex-start}
#ph-root .ph-mrow:hover{background:#2d3a52}
#ph-root .ph-mrow-b{flex:1;min-width:0}
#ph-root .ph-mrow-n{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
#ph-root .ph-mrow-badges{margin-top:3px;display:flex;gap:4px;align-items:center}
#ph-root .ph-mrow-mail{font-size:12px;color:#93c5fd;margin-top:2px;overflow-wrap:anywhere}
#ph-root .ph-pager{text-align:center;margin-top:8px}
#ph-root .ph-pager .ph-btn{width:auto;display:inline-block}
/* trophy case */
#ph-root .ph-thead2{display:flex;gap:12px;align-items:center;margin-bottom:8px}
#ph-root .ph-tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:10px;margin-bottom:6px}
#ph-root .ph-tile{background:#111827;border-radius:10px;padding:10px 6px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:3px;border:2px solid transparent;position:relative}
#ph-root .ph-tile b{font-size:13px}
#ph-root .ph-tile small{font-size:11px;color:var(--mut);line-height:1.25}
#ph-root .ph-tile.locked .ph-bimg{filter:grayscale(1);opacity:.35}
#ph-root .ph-tile.locked b{opacity:.6}
#ph-root .ph-tile.pick{cursor:pointer}
#ph-root .ph-tile.pick:hover{border-color:#4b5563}
#ph-root .ph-tile.pinned{border-color:var(--gold)}
#ph-root .ph-tile.pinned::after{content:"📌";position:absolute;top:2px;right:4px;font-size:13px}
#ph-root .ph-tbadge{position:relative;display:inline-block}
#ph-root .ph-lock{position:absolute;right:-6px;bottom:-4px;font-size:16px}
#ph-root .ph-card.trophies{width:640px}
#ph-root .ph-card.members{width:640px}
#ph-root .ph-rolelist .ph-frow.dim{opacity:.5}
#ph-root .ph-card.golive input,#ph-root .ph-card.award select{width:100%;margin-bottom:8px}
/* phones */
#ph-root .ph-fsbtn{display:none}
#ph-root.ph-full{position:fixed!important;left:0!important;top:0!important;right:0!important;width:100vw!important;max-width:100vw!important;margin:0!important;z-index:999999;border-radius:0;border:0}
html.ph-lock,html.ph-lock body{overflow:hidden!important}
@media (max-width:700px){#ph-root .ph-fsbtn{display:inline-block}}
@media (pointer:coarse),(max-width:700px){#ph-root textarea,#ph-root input,#ph-root select{font-size:16px!important}}
#ph-root.ph-appmode .ph-comp{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
/* light theme for new parts */
#ph-root.light .ph-trans{background:#e3f3fc}
#ph-root.light .ph-tile,#ph-root.light .ph-evtag{background:#e6e9f2;color:var(--txt)}
#ph-root.light .ph-wpanel{background:linear-gradient(135deg,#ece8ff,#f6f7fb)}
#ph-root.light .ph-mrow:hover{background:#e3e7f3}
#ph-root.light .ph-livenow{color:#fff}

#ph-root .ph-trans a{color:#60a5fa}
#ph-root.light .ph-trans a{color:#2563eb}
