/* YappChat modern refresh: soft, clean, rounded. Loaded after each page's base styles. Dark mode = html.dark */
:root{--card:#fff;--soft:#eef5fd;--line:#e1ecf7;--ink:#12213F;--muted:#5b6b85;--shadow:0 6px 24px rgba(16,35,74,.12);--r:14px;--field:#fff;--surface:#f7fbff}
html.dark{--card:#16264a;--soft:#1c2f58;--line:#2a3f6b;--ink:#e6eefb;--muted:#9fb2d4;--shadow:0 8px 28px rgba(0,0,0,.45);--field:#0f1d3a;--surface:#13223f;--pale:#1e3463;--mid:#24427a;--bg:#13223f;color-scheme:dark}
body{font-family:var(--sys)!important;font-size:13px;color:var(--ink)}
html.dark body{background:linear-gradient(#0b1630,#00205B) fixed!important;color:var(--ink)}
.win{background:var(--card)!important;border:1px solid var(--line)!important;border-radius:var(--r)!important;box-shadow:var(--shadow)!important}
.tbar{background:linear-gradient(135deg,#00A3E0,#0033A0 60%,#2468D7)!important;text-shadow:none!important;padding:9px 12px!important;font-weight:600!important;letter-spacing:.1px}
.tbar .wb,.wb{border-radius:50%!important;width:18px!important;height:18px!important;line-height:16px!important;border-color:rgba(255,255,255,.7)!important}
.x{border-radius:50%!important;padding:0 6px!important}
button{font-family:var(--sys)!important;border-radius:10px!important;border:1px solid var(--line)!important;background:var(--card)!important;color:var(--ink)!important;padding:6px 14px!important;transition:background .15s,box-shadow .15s}
button:hover:not(:disabled){box-shadow:0 2px 8px rgba(24,119,232,.18);border-color:#9cc4f2!important}
button.pri,#go,#send{background:#0033A0!important;border-color:#0033A0!important;color:#fff!important;font-weight:600}
button.pri:hover,#go:hover,#send:hover{background:#00205B!important}
input[type=text],input[type=password],input[type=email],select,textarea{font-family:var(--sys)!important;font-size:13px!important;border:1px solid var(--line)!important;border-radius:10px!important;padding:7px 10px!important;background:var(--field)!important;color:var(--ink)!important;outline:none}
input:focus,select:focus,textarea:focus{border-color:#00A3E0!important;box-shadow:0 0 0 3px rgba(74,183,242,.25)}
#menu{background:var(--card)!important;border-bottom:1px solid var(--line)!important;padding:3px 8px!important;gap:2px}
#menu>div{border-radius:8px;padding:5px 10px!important}#menu>div:hover,#menu>div.open{background:var(--soft)!important;color:var(--ink)!important}
#menu .dd{background:var(--card)!important;color:var(--ink)!important;border:1px solid var(--line)!important;border-radius:12px!important;box-shadow:var(--shadow)!important;padding:6px!important;margin-top:4px}
#menu .dd div{border-radius:8px;padding:6px 14px!important}#menu .dd div:hover{background:#0033A0!important;color:#fff!important}
.logo .b{color:var(--navy)}html.dark .logo .b{color:#e6eefb}
/* avatars: round */
.av{border-radius:50%!important;border:none!important;object-fit:cover;overflow:hidden;box-shadow:0 0 0 2px var(--card)}
img.av{display:block;background:#DCEBFC}
.ring{box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--rc,#bbb)!important}
.r-available{--rc:#2db52d}.r-busy{--rc:#e0402f}.r-away,.r-brb,.r-idle{--rc:#e8b100}.r-offline,.r-invisible{--rc:#b5bfcc}
/* theme toggle */
#thm{position:fixed;right:14px;top:12px;z-index:300;width:38px;height:38px;padding:0!important;border-radius:50%!important;font-size:17px!important;box-shadow:var(--shadow)}
/* toasts / modals */
.toast{background:var(--card)!important;border:1px solid var(--line)!important;border-radius:14px!important;box-shadow:var(--shadow)!important;color:var(--ink)}
#modal .in{background:var(--card)!important}
#ad-slot{border-radius:12px;border-color:var(--line)!important}
html.dark #log span[style*="color:#000000"],html.dark .bb span[style*="color:#000000"],html.dark .pl{color:#e6eefb!important}
html.dark #topic{color:#5fd38a!important}html.dark .sw[data-c="#000000"]{outline:1px solid #8aa}

/* Purple chat color: lighter in dark mode */
html.dark #log span[style*="#8b5cf6" i],html.dark .bb span[style*="#8b5cf6" i],html.dark [style*="color:#8b5cf6" i],html.dark [style*="color: rgb(139, 92, 246)"]{color:#a78bfa!important}
/* v11.7 mobile layout */
@media (max-width:600px){
 #main{flex-direction:column!important;height:auto!important}
 #mpane{width:auto!important;max-height:34vh;border-left:0!important;border-top:1px solid var(--line)}
 #log{height:46vh!important}
 #vrow,#erow,.hb,#tbar,.tools{flex-wrap:wrap!important;gap:4px}
 textarea,input[type=text],input[type=password],#msg{font-size:16px!important}
 .yprof,#modw>div,#avp,.yset{left:2vw!important;right:2vw!important;width:96vw!important;max-width:96vw!important;transform:none!important;top:6vh!important}
 #menu{white-space:nowrap}
 .im .tools button span{display:none}
 #ad-slot{max-width:100%!important}
 #pwaInstall{bottom:56px!important}
}
/* v13 shared */
.adph{display:flex;align-items:center;justify-content:center;color:var(--muted,#678);font:11px system-ui,Segoe UI,Arial;letter-spacing:.5px;border:1px dashed var(--line,#ccd);background:repeating-linear-gradient(45deg,#f7f9fc,#f7f9fc 8px,#eef2f8 8px,#eef2f8 16px);border-radius:6px}
.adph-b{height:50px;margin:8px 10px 10px;flex:none}
.rtileic{display:inline-flex;align-items:center;justify-content:center;font-size:18px;width:28px;height:28px;border-radius:8px;background:#e6f4fb;flex:none}
.mst{color:#a86f00!important;font-weight:600}

/* v13.1: ad under every compose box */
.adph-c{height:50px;width:calc(100% - 20px);max-width:468px;margin:0 auto 8px;flex:none;box-sizing:border-box}
@media (min-width:500px){.adph-c{height:60px}}
.im .adph-c,.pmwin .adph-c{height:50px;max-width:320px}
/* v13.2 narrow IM + people list */
.im .ihead{min-width:0;flex-wrap:wrap;row-gap:6px}.im .ihead>div:not(.st){min-width:0}
@media (max-width:480px){
 .im .ihead{gap:6px!important;padding:8px 10px!important}
 .im .ihead .ib{width:32px!important;height:32px!important;min-width:32px;padding:0!important}
 .im .ihead .ib svg{width:18px;height:18px}
 .im .ihead .pav{transform:scale(.85)}
 .im .inbox{flex-wrap:wrap!important;gap:6px!important;padding:8px!important}
 .im .inbox>textarea,.im .inbox>input,.im .inbox>.ta,.im .inbox>[contenteditable]{flex:1 1 100%!important;order:-1;min-width:0;width:100%!important}
 .im .inbox>.ib{width:34px!important;height:34px!important;min-width:34px}
}
.mem{min-width:0}.mem .nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto}.mem .gt,.mem .ci,.mem .sdot,.mem .mi{flex:none}
@media (max-width:860px){#fsv{display:none}#fsr{width:56px!important}}
#mem{overflow-x:hidden}
#thm{display:inline-flex!important;align-items:center;justify-content:center}
/* v13.6 narrow menu bar: no scrolling, drop-downs never clipped */
#menu{overflow:visible!important;flex-wrap:wrap;row-gap:0;max-width:100%}
#menu>div{flex:0 0 auto}
@media (max-width:560px){#menu{padding:2px 4px!important;gap:0}#menu>div{padding:4px 7px!important;font-size:12.5px}.ydlogo{padding:0 4px 0 2px!important}.ydlogo>span{display:none}}
@media (max-width:380px){#menu>div{padding:4px 5px!important;font-size:12px}}
#menu .dd.ddfix{position:fixed!important;margin-top:0!important;z-index:9999!important;max-height:calc(100vh - 8px);overflow-y:auto}
/* v13.6 dialogs fit narrow windows */
.yae .bx{max-width:96vw;overflow-x:hidden!important}.yae .tabs{flex-wrap:wrap!important;row-gap:6px}.yae .tabs div{white-space:nowrap}
.yae .ft{flex-wrap:wrap}.yae canvas{max-width:100%}
.yprof{max-width:96vw;max-height:94vh;overflow-x:hidden!important;overflow-y:auto!important}
html.yd.ydpop body{overflow:hidden}
html.yd.ydpop .yae{background:var(--card,#fff)!important;align-items:stretch}
html.yd.ydpop .yae .bx{width:100vw!important;max-width:none!important;max-height:none!important;height:100vh;border-radius:0!important;box-shadow:none!important;overflow-y:auto!important;display:flex;flex-direction:column}
html.yd.ydpop .yae .bx .pn.on{flex:1}html.yd.ydpop .yae .hd{display:none!important}
html.yd.ydpop .yprof{left:0!important;top:0!important;transform:none!important;width:100vw!important;max-width:none!important;height:100vh;max-height:none!important;border:0!important;border-radius:0!important;box-shadow:none!important}

/* Contact profile windows size to their content. */
html body .yprof.contact-profile{width:min(300px,calc(100vw - 16px))!important;max-width:calc(100vw - 16px)!important;left:50%!important;right:auto!important;top:min(56px,8vh)!important;transform:translateX(-50%)!important;max-height:calc(100dvh - min(56px,8vh) - 8px);z-index:5001}
.yprof.contact-profile .tbar{cursor:default}
.contact-profile .pb{padding:10px 12px 12px;overflow-wrap:anywhere}
.contact-profile .pt th{width:88px}
.contact-profile .pav{width:52px;height:52px;border:1px solid #12213f;border-radius:8px}
.contact-profile .profile-social-link{display:inline-block;margin-top:10px;color:var(--blue,#004990)}
.contact-profile .profile-social-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:baseline}
.contact-profile .profile-gallery{display:flex;gap:5px;flex-wrap:wrap;margin-top:10px}
.contact-profile .profile-gallery button{padding:0;background:transparent;border:0}
.contact-profile .profile-gallery img,.profile-gallery-editor img{display:block;width:44px;height:44px;object-fit:cover;border-radius:5px;border:1px solid var(--line,#ccd)}
.profile-gallery-editor{margin-top:12px}.profile-gallery-editor .gallery-row{display:flex;gap:8px;align-items:center;margin-bottom:6px;flex-wrap:wrap}
.profile-gallery-editor .gallery-row label{display:flex;align-items:center;gap:4px}.profile-gallery-editor .gallery-row input{width:auto;margin:0}
.contact-profile .profile-photo-preview{display:block;margin-top:8px;width:100%;max-height:45vh;object-fit:contain}

/* Compact shared Settings and Audio & Video dialogs, including native popouts. */
html body .yprof.razzle-settings-dialog{box-sizing:border-box;width:min(480px,calc(100vw - 20px))!important;max-width:calc(100vw - 20px)!important;height:auto!important;min-height:0!important;max-height:min(560px,calc(100dvh - 24px))!important;top:12px!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;display:flex!important;flex-direction:column;overflow:hidden!important}
.razzle-settings-dialog>.tbar{display:flex!important;align-items:center;gap:8px;min-height:36px;flex-shrink:0;padding:6px 10px!important;font-size:14px!important}.razzle-settings-dialog>.tbar>.sp{flex:1}.razzle-settings-dialog .settings-close{display:grid!important;place-items:center;flex-shrink:0;width:26px;height:26px;padding:0!important;border:0!important;background:transparent!important;color:inherit!important;border-radius:3px;cursor:pointer}.razzle-settings-dialog .settings-close:hover{background:#ffffff33!important}
.razzle-settings-dialog>.pb{overflow:auto!important;min-height:0;min-width:0!important;padding:10px 12px!important;font:13px/1.4 Arial,sans-serif}.razzle-settings-dialog .pb h4{font-size:13px!important;margin:10px 0 4px!important}.razzle-settings-dialog .pb h4:first-child{margin-top:0!important}.razzle-settings-dialog .pb>label:has(input[type=checkbox]){display:flex!important;align-items:flex-start;gap:7px;font-weight:400!important;margin:5px 0!important;padding:0!important;line-height:1.4}.razzle-settings-dialog input[type=checkbox]{appearance:auto!important;flex:0 0 14px;width:14px!important;height:14px!important;min-height:0!important;margin:2px 0 0!important;padding:0!important;display:inline-block!important}.razzle-settings-dialog .pb>br{display:none}.razzle-settings-dialog select{font-size:13px!important;min-height:30px!important;padding:5px 7px!important;margin:3px 0 8px!important}.razzle-settings-dialog .pb>input:not([type=checkbox]){min-height:0!important}.razzle-settings-dialog .pb small{line-height:1.4}.razzle-settings-dialog button{font-size:13px;min-height:28px;padding:5px 9px}.razzle-settings-dialog input[type=range]{margin:3px 0!important;padding:0!important;height:20px!important}
.media-test-area{border-top:1px solid #cfdae5;margin-top:10px;padding-top:2px}.media-test-actions{display:flex;gap:7px;flex-wrap:wrap}.media-test-actions button[aria-pressed=true]{background:#e3effb;color:#004990;border-color:#004990}.media-test-area video{display:block;width:100%;max-height:150px;object-fit:contain;background:#172b42;border-radius:4px;margin-top:8px}.media-test-area video[hidden]{display:none!important}.mic-test-label{display:flex!important;align-items:center;gap:8px;font-size:12px;margin:8px 0 4px!important}.mic-test-label meter{flex:1;min-width:0;width:100%;height:14px}.media-test-area p{margin:5px 0 0!important;font-size:12px;color:#526a80;line-height:1.4}
html.yd.ydpop body .yprof.razzle-settings-dialog{left:0!important;top:0!important;right:0!important;transform:none!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important}.ydpop .razzle-settings-dialog>.pb{flex:1}
@media(max-width:480px){.razzle-settings-dialog select,.razzle-settings-dialog input[type=text]{font-size:16px!important}}

html body .yprof.razzle-settings-dialog{max-height:min(520px,calc(100dvh - 24px))!important}.razzle-settings-dialog>.tbar{box-sizing:border-box;height:38px!important;min-height:38px!important;line-height:20px!important}.razzle-settings-dialog>.settings-actions{flex-shrink:0;margin-top:0!important;padding:8px 12px;background:var(--card,#fff);border-top:1px solid var(--line,#d5e2f0)}.media-test-area video{max-height:120px}
