/* NammudeSpace frontend — clean rewrite.
   Perf rules: transform/opacity-only animation, no backdrop-filter, no transition:all,
   no permanent will-change. .lite (auto on low-end devices) shortens motion + drops shadows. */
:root{
  color-scheme:dark;
  --bg:#0b1020;--panel:#111d31;--line:#7894c42b;--text:#f1f5ff;--muted:#9aa9c5;
  --teal:#67d5d0;--teal2:#a4f0e8;--ink:#dceaff;
  --bg-grad:radial-gradient(ellipse at 50% -24%,#233d68 0,transparent 48%),linear-gradient(145deg,#0b1020,#0d1526 58%,#10182a);
  --ease:cubic-bezier(.22,.8,.3,1);
  --d1:.22s;--d2:.34s;--dl:.1s;
  --sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px);
}
:root.lite{--d1:.14s;--d2:.2s;--dl:.04s}
:root.lite .dock,:root.lite .room-option,:root.lite .dm-popup,:root.lite .toast,:root.lite .brand-mark,:root.lite .dock-pill{box-shadow:none}
:root.lite .chat-messages>*,:root.lite .home-intro,:root.lite .room-option{animation:none!important}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;margin:0;overflow:hidden;overscroll-behavior:none;touch-action:manipulation}
body{display:flex;flex-direction:column;height:100vh;height:100dvh;background:var(--bg-grad);background-color:var(--bg);color:var(--text);font:15px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer}
button:focus-visible,a:focus-visible{outline:2px solid var(--teal);outline-offset:3px}
[hidden]{display:none!important}

/* Icons */
.ico{width:22px;height:22px;flex:none;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.d{fill:currentColor;fill-opacity:.17}

/* Home layer + top bar */
.home-layer{flex:1;min-height:0;display:flex;flex-direction:column}
.topbar{flex:none;padding-top:var(--sat);background:var(--bg);border-bottom:1px solid #9db9ff18}
.topbar-inner{height:clamp(58px,8vh,72px);padding:0 clamp(12px,2.5vw,38px);display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--text);min-width:0}
.brand-mark{width:40px;height:40px;border-radius:13px;background:linear-gradient(145deg,#b7f4ec,#548bc4);color:#071b2a;display:grid;place-items:center;font-weight:900;font-size:22px;transform:rotate(-4deg);box-shadow:0 6px 20px #5cb9d733}
.brand-name{font-weight:850;letter-spacing:-.6px;font-size:20px;white-space:nowrap}
.brand-name span{color:var(--teal)}
.header-actions{display:flex;align-items:center;gap:8px}
.icon-btn,.hbtn{display:grid;place-items:center;flex:none;color:var(--ink);background:#17243b;border:1px solid #9db9ff14;transition:background-color var(--d1),border-color var(--d1),transform .12s}
.icon-btn{width:42px;height:42px;border-radius:14px}
.icon-btn:active,.hbtn:active,.chat-add:active,.chat-send:active,.dm-close:active{transform:scale(.9)}
.icon-btn .ico{width:21px;height:21px}

.home-scroll{flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 clamp(12px,2vw,30px) calc(96px + var(--sab));scrollbar-width:thin;scrollbar-color:#49658c transparent}
.home-view{width:100%;max-width:1120px;margin:0 auto;padding:clamp(24px,5vh,60px) clamp(4px,3vw,40px) 24px;display:flex;flex-direction:column;gap:clamp(22px,4vh,40px)}
.home-intro{max-width:700px;animation:rise .5s var(--ease) both}
.home-eyebrow{display:block;color:#80e5dc;font-size:11px;font-weight:850;letter-spacing:2px;margin-bottom:12px}
.home-intro h1{font-size:clamp(28px,4vw,48px);line-height:1.08;letter-spacing:-1.5px;margin:0 0 12px}
.home-intro p{margin:0;color:var(--muted);font-size:clamp(14px,1.5vw,17px)}
.room-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(12px,2vw,22px)}
.room-option{position:relative;overflow:hidden;min-height:clamp(130px,20vh,200px);padding:clamp(16px,2.4vw,28px);border:1px solid var(--line);border-radius:22px;background:linear-gradient(145deg,#172943,#111d31 72%);display:flex;align-items:flex-start;gap:16px;text-align:left;box-shadow:0 14px 34px #02061733;transition:transform var(--d1) var(--ease),border-color var(--d1);animation:rise .5s var(--ease) both}
.room-option:nth-child(2){animation-delay:.07s}
.room-option:before{content:"";position:absolute;right:-50px;top:-50px;width:170px;height:170px;border-radius:50%;background:radial-gradient(circle,#61d7c826,transparent 70%);pointer-events:none}
.game-opt:before{background:radial-gradient(circle,#8f7dff26,transparent 70%)}
.room-option:active{transform:scale(.98)}
@media(hover:hover){.room-option:hover{transform:translateY(-4px);border-color:#61d7c8a0}.icon-btn:hover,.hbtn:hover{background:#233755;border-color:#5476a5}}
.option-icon{position:relative;width:52px;height:52px;flex:none;border-radius:16px;display:grid;place-items:center;background:linear-gradient(145deg,#2c6a78,#244d62);color:#b9fff4}
.option-icon .ico{width:27px;height:27px}
.game-icon{background:linear-gradient(145deg,#5a4fa0,#3a355e);color:#e0d9ff}
.option-copy{position:relative;display:flex;flex-direction:column;gap:7px;padding-top:3px;min-width:0}
.option-copy strong{font-size:clamp(17px,2vw,22px);letter-spacing:-.35px}
.option-copy small{font-size:13px;line-height:1.5;color:#a9bad4;max-width:260px}
.option-arrow{position:relative;margin-left:auto;width:34px;height:34px;flex:none;border-radius:50%;background:#ffffff0d;color:#80e5dc;display:grid;place-items:center}
.option-arrow .ico{width:18px;height:18px}

/* Bottom dock: sliding pill, drops down + fades when chat opens */
.dock-wrap{position:fixed;z-index:45;left:0;right:0;margin-inline:auto;bottom:max(10px,var(--sab));width:min(400px,calc(100% - 28px));
  transition:transform var(--d2) var(--ease) calc(var(--dl) + .04s),opacity var(--d1) ease calc(var(--dl) + .04s),visibility 0s}
body.in-chat .dock-wrap{transform:translate3d(0,calc(100% + 36px),0);opacity:0;visibility:hidden;
  transition:transform var(--d1) cubic-bezier(.5,0,.9,.5),opacity var(--d1) ease,visibility 0s linear var(--d1)}
.dock{position:relative;height:58px;padding:5px;display:grid;grid-template-columns:repeat(3,1fr);border-radius:20px;background:#111c30;border:1px solid #91b1e52b;box-shadow:0 10px 28px #02061790}
.dock-pill{position:absolute;top:5px;bottom:5px;left:5px;width:calc((100% - 10px)/3);border-radius:15px;background:linear-gradient(145deg,#2a5568,#1f3e55);box-shadow:inset 0 0 0 1px #64c9c055,0 0 16px #4fd1c52e;transform:translate3d(calc(var(--i,1)*100%),0,0);transition:transform .38s cubic-bezier(.3,1.25,.5,1)}
:root.lite .dock-pill{transition-duration:.18s;transition-timing-function:ease-out}
.dock-btn{position:relative;z-index:1;display:grid;place-items:center;border-radius:15px;color:#9fb1cf;transition:color var(--d1),transform .12s}
.dock-btn .ico{width:24px;height:24px;transition:transform var(--d1) var(--ease)}
.dock-btn[aria-current]{color:#b6fff2}
.dock-btn[aria-current] .ico{transform:scale(1.1)}
.dock-btn:active{transform:scale(.88)}

/* Main chat: full-screen layer that slides up + fades in */
.chat-layer{position:fixed;inset:0;z-index:40;background:var(--bg-grad);background-color:var(--bg);contain:layout paint;
  opacity:0;visibility:hidden;pointer-events:none;transform:translate3d(0,26px,0) scale(.985);
  transition:opacity var(--d1) ease,transform var(--d1) ease,visibility 0s linear var(--d1)}
body.in-chat .chat-layer{opacity:1;visibility:visible;pointer-events:auto;transform:none;will-change:transform,opacity;
  transition:opacity var(--d2) ease var(--dl),transform var(--d2) var(--ease) var(--dl),visibility 0s}
.chat-shell{height:100%;display:grid;grid-template-columns:minmax(0,1fr)}
.chat-room{min-width:0;min-height:0;display:flex;flex-direction:column;background:#0e1728;overflow:hidden}
.sidebar{display:none}

.chat-head{flex:none;display:flex;align-items:center;gap:10px;padding:calc(10px + var(--sat)) clamp(10px,2vw,20px) 10px;background:linear-gradient(100deg,#172843,#18243a);border-bottom:1px solid #8ea9d51c}
.hbtn{width:40px;height:40px;border-radius:13px;background:#101d30;border-color:#7894c433;color:#cfe4ff}
.hbtn .ico{width:21px;height:21px}
.room-id{flex:1;min-width:0;display:flex;align-items:center;gap:10px}
.room-symbol{width:38px;height:38px;flex:none;border-radius:12px;background:linear-gradient(145deg,#2c6a78,#244d62);color:#b9fff4;display:grid;place-items:center}
.room-symbol .ico{width:20px;height:20px}
.room-meta{min-width:0}
.room-meta strong{display:block;font-size:15px;line-height:1.2;letter-spacing:-.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.room-meta small{display:flex;align-items:center;gap:6px;font-size:11px;color:#9de9df}
.live-dot{width:7px;height:7px;flex:none;border-radius:50%;background:#61d7c8;box-shadow:0 0 8px #61d7c8}
.head-actions{display:flex;gap:8px;flex:none}
.profile-btn{background:linear-gradient(145deg,#cfe0ff,#6689c9);color:#0b1730;border-color:#405b8c}
@media(hover:hover){.profile-btn:hover{background:linear-gradient(145deg,#e0ebff,#7b9bd8)}}

.chat-messages{flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;contain:content;display:flex;flex-direction:column;gap:clamp(14px,2vh,22px);padding:clamp(16px,2.2vw,32px);scrollbar-width:thin;scrollbar-color:#49658c transparent}
.chat-messages::-webkit-scrollbar{width:7px}
.chat-messages::-webkit-scrollbar-thumb{background:#405b80;border-radius:20px}
body.in-chat .chat-messages>*{animation:rise .42s var(--ease) both;animation-delay:calc(var(--dl) + var(--n,0)*.05s)}
.chat-messages>:nth-child(2){--n:1}.chat-messages>:nth-child(3){--n:2}.chat-messages>:nth-child(4){--n:3}.chat-messages>:nth-child(5){--n:4}.chat-messages>:nth-child(n+6){--n:5}
.chat-date{text-align:center;color:#82958a;font-size:10px;letter-spacing:1.5px;font-weight:700}
.chat-line{display:flex;align-items:flex-start;gap:9px;max-width:88%}
.chat-user-avatar{width:31px;height:31px;flex:none;border-radius:11px;background:linear-gradient(140deg,#edc99d,#9a7653);display:grid;place-items:center;color:#271b12;font-size:12px;font-weight:850}
.chat-user-avatar.alt{background:linear-gradient(140deg,#b7d7ec,#587d9c);color:#102333}
.chat-message-wrap{min-width:0}
.chat-user{font-size:11px;font-weight:750;color:#c7d9f5;margin:0 0 5px}
.chat-user small{font-size:10px;color:#8297b8;font-weight:400;margin-left:6px}
.chat-bubble{background:#1a2940;border:1px solid #314765;border-radius:4px 14px 14px 14px;padding:10px 12px;color:#e2ebfb;font-size:13px;line-height:1.55;overflow-wrap:anywhere}
.chat-line.own{align-self:flex-end;justify-content:flex-end}
.chat-line.own .chat-message-wrap{display:flex;flex-direction:column;align-items:flex-end}
.chat-line.own .chat-bubble{background:#174b50;border-color:#267b7d;border-radius:14px 4px 14px 14px}
.welcome-system-line{position:relative;z-index:1;flex:none;max-width:none;margin:10px clamp(10px,2vw,20px) 0;transition:opacity var(--d1) ease,transform var(--d1) ease}
.welcome-system-line.leaving{opacity:0;transform:translate3d(18px,0,0) scale(.97)}
.welcome-system-line .chat-message-wrap{width:100%}
.welcome-system-bubble{position:relative;width:100%;padding:16px 56px 16px 20px;background:linear-gradient(110deg,#193b4c,#1b2b45 78%);border-color:#3b7183;border-radius:8px 18px 18px 18px;box-shadow:inset 4px 0 #61d7c8}
.welcome-kicker{display:block;margin-bottom:9px;color:#80e5dc;font-size:11px;font-weight:850;letter-spacing:1.8px}
.welcome-system-bubble strong{display:block;color:#f1fbff;font-size:clamp(18px,2.4vw,25px);line-height:1.22;letter-spacing:-.45px;font-weight:780}
.welcome-system-bubble p{margin:10px 0 0;color:#c1d7e8;font-size:14px;line-height:1.6;max-width:760px}
.welcome-dismiss{position:absolute;top:11px;right:12px;width:30px;height:30px;border-radius:9px;background:#ffffff0a;color:#a9b9ae;display:grid;place-items:center;transition:background-color var(--d1),transform .12s}
.welcome-dismiss:active{transform:scale(.88)}
.welcome-dismiss .ico{width:16px;height:16px}

.chat-composer{flex:none;display:flex;align-items:center;gap:9px;padding:11px clamp(10px,1.5vw,20px) calc(11px + var(--sab));background:#142139;border-top:1px solid #8ea9d51c}
.chat-add,.chat-send{width:40px;height:40px;flex:none;border-radius:13px;display:grid;place-items:center;transition:transform .12s}
.chat-add{background:#24465a;color:#a9f0e7}
.chat-send{background:linear-gradient(145deg,#b4f3ea,#7fdcd2);color:#08252c}
.chat-add .ico,.chat-send .ico{width:20px;height:20px}
.chat-input{flex:1;min-width:0;height:40px;padding:0 14px;text-align:left;background:#101c30;border:1px solid #344c6b;color:#a8bad5;border-radius:13px;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.side-card{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:20px}
.side-card h3{margin:0 0 14px;font-size:14px;color:#e6efff}
.trend{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid #9db9ff16}
.trend:first-of-type{border-top:0;padding-top:0}
.trend strong{display:block;font-size:12px;color:#d8e6ff}
.trend small,.online small{color:#91a7c7;font-size:11px}
.online{display:flex;align-items:center;gap:10px;margin:12px 0}
.online span{font-size:12px;color:#d0e0f5}
.online small{display:block;font-size:10px}

/* DM popup: overlay fades, card slides up + scales; both animate on close too */
.dm-overlay{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;padding:18px 14px calc(84px + var(--sab));background:#020817b8;
  opacity:0;visibility:hidden;transition:opacity var(--d1) ease,visibility 0s linear var(--d1)}
.dm-overlay.open{opacity:1;visibility:visible;transition:opacity var(--d1) ease,visibility 0s}
.dm-popup{width:min(560px,100%);max-height:min(68dvh,600px);display:flex;flex-direction:column;overflow:hidden;border:1px solid #7894c44a;border-radius:24px;background:linear-gradient(155deg,#17243b,#101a2d 68%,#0e1728);box-shadow:0 24px 80px #000b;outline:none;
  opacity:0;transform:translate3d(0,30px,0) scale(.97);transition:opacity var(--d1) ease,transform var(--d1) ease}
.dm-overlay.open .dm-popup{opacity:1;transform:none;transition:opacity var(--d2) ease,transform var(--d2) var(--ease)}
.dm-popup-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid #8ea9d51c}
.dm-popup-head h2{margin:0;font-size:18px;line-height:1.2;letter-spacing:-.6px}
.dm-close{width:34px;height:34px;flex:none;border:1px solid #ffffff12;border-radius:12px;background:#ffffff09;color:#b9c9e5;display:grid;place-items:center;transition:transform .12s}
.dm-close .ico{width:18px;height:18px}
.dm-popup-scroll{min-height:150px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:14px;scrollbar-width:thin;scrollbar-color:#49658c transparent}
.dm-empty{min-height:170px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:25px 22px}
.dm-empty-icon{width:58px;height:58px;margin-bottom:14px;border:1px solid #5ccdc833;border-radius:19px;background:#1d3a50;color:#8de6df;display:grid;place-items:center}
.dm-empty-icon .ico{width:28px;height:28px}
.dm-empty strong{font-size:15px;font-weight:750}
.dm-empty p{max-width:280px;margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.6}

.toast{position:fixed;left:0;right:0;margin-inline:auto;width:max-content;max-width:calc(100% - 32px);bottom:calc(88px + var(--sab));z-index:70;background:#b8f3eb;color:#09252c;padding:10px 16px;border-radius:12px;font-size:13px;font-weight:700;box-shadow:0 12px 30px #0006;opacity:0;visibility:hidden;pointer-events:none;transform:translate3d(0,12px,0);transition:opacity var(--d1),transform var(--d1) var(--ease),visibility 0s linear var(--d1)}
.toast.show{opacity:1;visibility:visible;transform:none;transition:opacity var(--d1),transform var(--d1) var(--ease),visibility 0s}

@keyframes rise{from{opacity:0;transform:translate3d(0,14px,0)}to{opacity:1;transform:none}}

/* Desktop: chat + side rail */
@media(min-width:1000px){
  .chat-shell{grid-template-columns:minmax(0,1fr) clamp(280px,24vw,360px);gap:16px;padding:16px}
  .chat-room{border:1px solid var(--line);border-radius:22px}
  .chat-head{padding-top:12px}
  .chat-composer{padding-bottom:11px}
  .sidebar{display:flex;flex-direction:column;gap:14px;min-height:0;overflow:auto}
  .dm-overlay{align-items:center;padding:24px}
  .dm-popup{max-height:min(76dvh,720px)}
}
@media(max-width:820px){.room-options{grid-template-columns:1fr}.room-option{min-height:118px}}
@media(max-width:599px){
  .topbar-inner{height:56px;padding:0 11px}
  .brand{gap:8px}.brand-mark{width:34px;height:34px;border-radius:11px;font-size:19px}.brand-name{font-size:16px;letter-spacing:-.5px}
  .header-actions{gap:4px}.icon-btn{width:36px;height:36px;border-radius:11px}.icon-btn .ico{width:20px;height:20px}
  .home-scroll{padding-inline:8px}.home-view{padding:24px 8px 24px}
  .home-intro h1{font-size:29px}
  .room-option{padding:16px;border-radius:18px;gap:12px}.option-icon{width:44px;height:44px;border-radius:13px}.option-copy strong{font-size:16px}.option-copy small{font-size:12px}
  .dock{height:54px;border-radius:18px}.dock-pill{border-radius:13px}
  .chat-messages{padding:16px 12px}.chat-line{max-width:96%}.chat-bubble{font-size:13px}
  .welcome-system-bubble{padding:16px 44px 16px 15px}.welcome-system-bubble p{font-size:13px}
  .dm-overlay{padding:10px 10px calc(78px + var(--sab))}.dm-popup{border-radius:21px}
}
@media(max-width:340px){.hide-small{display:none}}
@media(max-height:520px) and (orientation:landscape){
  .topbar-inner{height:48px}.brand-mark{width:30px;height:30px}.brand-name{font-size:16px}.icon-btn{width:32px;height:32px}
  .home-view{padding:14px 20px;gap:14px}.home-intro h1{font-size:24px}.room-options{grid-template-columns:repeat(2,minmax(0,1fr))}.room-option{min-height:84px;padding:12px}.option-icon{width:38px;height:38px}
  .dock{height:46px}.chat-head{padding-block:calc(6px + var(--sat)) 6px}.hbtn{width:34px;height:34px}.chat-composer{padding-block:6px}
  .dm-overlay{padding:8px}.dm-popup{max-height:92dvh}
}
@media(prefers-reduced-motion:reduce){
  :root{--d1:.01s;--d2:.01s;--dl:0s}
  *,*:before{animation:none!important}
  .dock-pill{transition-duration:.01s}
}

/* Supabase-connected private message thread layered over the Messages popup. */
.dm-popup{position:relative}
.dm-conversation{width:100%;display:flex;align-items:center;gap:12px;padding:12px;border:0;border-radius:15px;background:transparent;text-align:left;color:var(--text);cursor:pointer}
.dm-conversation:hover{background:#ffffff09}
.dm-avatar{width:42px;height:42px;flex:none;border-radius:14px;background:linear-gradient(145deg,#b7f4ec,#548bc4);color:#071b2a;display:grid;place-items:center;font-weight:850;font-size:15px}
.dm-conversation-copy{flex:1;min-width:0}
.dm-conversation-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.dm-conversation-top strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-conversation-top small{flex:none;color:#8196b5;font-size:10px}
.dm-conversation-preview{display:block;margin-top:3px;color:#9eafca;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-thread{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;min-height:0;background:linear-gradient(155deg,#17243b,#101a2d 68%,#0e1728)}
.dm-thread[hidden]{display:none!important}
.dm-thread-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 14px;border-bottom:1px solid #8ea9d51c}
.dm-thread-person{display:flex;align-items:center;gap:10px;min-width:0}
.dm-thread-person>div{min-width:0}
.dm-thread-person strong{display:block;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-thread-person small{display:block;color:#8fa4c4;font-size:10px}
.dm-thread-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:12px}
.dm-thread-line{max-width:88%;display:flex;flex-direction:column;align-self:flex-start;gap:3px}
.dm-thread-line.own{align-self:flex-end;align-items:flex-end}
.dm-thread-bubble{padding:9px 12px;border-radius:4px 13px 13px 13px;background:#1a2940;border:1px solid #314765;color:#e2ebfb;font-size:12px;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap}
.dm-thread-line.own .dm-thread-bubble{background:#174b50;border-color:#267b7d;border-radius:13px 4px 13px 13px}
.dm-thread-time{font-size:9px;color:#8297b8}
.dm-thread-composer{flex:none;display:flex;gap:8px;align-items:center;padding:10px 12px calc(10px + var(--sab));border-top:1px solid #8ea9d51c;background:#142139}
.dm-thread-composer input{height:40px;flex:1;min-width:0;border:1px solid #344c6b;border-radius:13px;background:#101c30;color:var(--text);padding:0 12px;font:inherit;font-size:12px;outline:none}
.dm-thread-composer input:focus,.chat-input:focus{border-color:#67d5d0}
.dm-thread-composer .chat-send{width:40px;height:40px}

/* Sign-in / sign-up gate. */
.auth-overlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;overflow-y:auto;padding:24px 16px;background:radial-gradient(ellipse at 50% -20%,#233d68 0,transparent 52%),#080e1b}
.auth-overlay[hidden]{display:none!important}
.auth-card{width:min(440px,100%);padding:clamp(22px,5vw,34px);border:1px solid #7894c44a;border-radius:24px;background:linear-gradient(155deg,#17243b,#101a2d 68%,#0e1728);box-shadow:0 24px 80px #0009}
.auth-brand{display:flex;align-items:center;gap:11px;margin-bottom:26px}
.auth-eyebrow{display:block;margin-bottom:8px;color:#80e5dc;font-size:10px;font-weight:850;letter-spacing:1.8px}
.auth-card h1{margin:0;color:#f1f5ff;font-size:clamp(25px,6vw,32px);letter-spacing:-1px;line-height:1.15}
.auth-subtitle{margin:8px 0 22px;color:var(--muted);font-size:13px}
.auth-field{display:block;margin:0 0 13px;color:#c8d7ee;font-size:11px;font-weight:700}
.auth-field input{display:block;width:100%;height:44px;margin-top:6px;padding:0 12px;border:1px solid #344c6b;border-radius:12px;background:#101c30;color:var(--text);font:inherit;font-size:13px;outline:none;color-scheme:dark}
.auth-field input:focus{border-color:var(--teal)}
.auth-note{margin:-3px 0 13px;color:#91a7c7;font-size:10px;line-height:1.5}
.auth-submit{width:100%;height:46px;margin-top:5px;border-radius:13px;background:linear-gradient(145deg,#b4f3ea,#7fdcd2);color:#08252c;font-size:13px;font-weight:850}
.auth-submit:disabled{opacity:.6;cursor:wait}
.auth-toggle{display:block;margin:16px auto 0;color:#9fe9e1;font-size:12px;font-weight:700}
.auth-message{min-height:18px;margin:14px 0 0;color:#9fe9e1;font-size:11px;line-height:1.5;text-align:center}
.auth-message.error{color:#ffb3b3}

.chat-composer{border:0}
.chat-input{display:block;width:100%;outline:none;font:inherit;font-size:13px;}
.chat-send:disabled{opacity:.55;cursor:wait}
@media(max-width:599px){
  .dm-conversation{padding:10px 8px}
  .dm-thread-head{padding:9px 11px}
  .dm-thread-messages{padding:11px}
  .auth-card{border-radius:20px}
}


/* Profile, settings and theme studio — NammudeSpace visual language */
:root[data-theme="ocean"]{--bg:#071522;--panel:#10283b;--line:#3b8cb64a;--text:#effaff;--muted:#9abbd0;--teal:#54c9f2;--teal2:#a0e9ff;--ink:#d8f5ff;--bg-grad:radial-gradient(ellipse at 50% -24%,#145078 0,transparent 48%),linear-gradient(145deg,#071522,#0a1c2d 58%,#10283b)}
:root[data-theme="forest"]{--bg:#091a16;--panel:#142b23;--line:#5a9b7545;--text:#effff5;--muted:#a2c3b0;--teal:#69d69b;--teal2:#b0f3ca;--ink:#e1ffed;--bg-grad:radial-gradient(ellipse at 50% -24%,#23583e 0,transparent 48%),linear-gradient(145deg,#091a16,#10251c 58%,#142b23)}
:root[data-theme="lavender"]{--bg:#151126;--panel:#241d3b;--line:#a18bd84a;--text:#f8f3ff;--muted:#c0b3d8;--teal:#b69aff;--teal2:#ddceff;--ink:#f0eaff;--bg-grad:radial-gradient(ellipse at 50% -24%,#514078 0,transparent 48%),linear-gradient(145deg,#151126,#1d1830 58%,#241d3b)}
:root[data-theme="sunset"]{--bg:#1b111b;--panel:#30202d;--line:#d78a8745;--text:#fff4f0;--muted:#d1b2ae;--teal:#ff947e;--teal2:#ffc1ad;--ink:#fff0e8;--bg-grad:radial-gradient(ellipse at 50% -24%,#713c4d 0,transparent 48%),linear-gradient(145deg,#1b111b,#281923 58%,#30202d)}
:root[data-theme]{color-scheme:light;--bg:#f2f6fb;--panel:#ffffff;--line:#8da2bd55;--text:#18283b;--muted:#62748b;--teal:#147d82;--teal2:#0b6269;--ink:#20354c;--bg-grad:radial-gradient(ellipse at 50% -24%,#d8e9f3 0,transparent 48%),linear-gradient(145deg,#f2f6fb,#eaf1f7 58%,#e2edf4)}
:root[data-theme="default"]{color-scheme:dark}
.app-page{width:min(900px,100%);margin:0 auto;padding:clamp(18px,3vw,34px) clamp(14px,3vw,34px) calc(40px + var(--sab));gap:18px;overflow:auto;max-height:100%;animation:page-in .22s var(--ease) both}
@keyframes page-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
.page-head{display:flex;align-items:center;gap:14px;margin:0 0 8px}
.page-head>div{flex:1;min-width:0}
.page-head h1{font-size:clamp(24px,4vw,32px);letter-spacing:-.8px;margin:0;line-height:1.15}
.page-head .home-eyebrow{font-size:10px}
.page-back,.page-action{height:40px;min-width:42px;padding:0 13px;border:1px solid var(--line);border-radius:13px;background:var(--panel);color:var(--text)}
.page-action{color:var(--teal2);font-weight:750}
.profile-hero{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:22px;overflow:hidden;padding:0 22px 22px}
.profile-cover-art{height:clamp(100px,18vw,160px);margin:0 -22px;background:radial-gradient(circle at 75% 15%,#a4f0e855,transparent 28%),linear-gradient(120deg,#1d3e59,#1b5360 55%,#203d68)}
.profile-avatar-large{width:88px;height:88px;border:5px solid var(--panel);border-radius:27px;margin-top:-44px;position:relative;display:grid;place-items:center;background:linear-gradient(145deg,var(--teal2),#547fa8);color:#071b2a;font-size:34px;font-weight:900}
.profile-identity h2{margin:12px 0 0;font-size:24px;letter-spacing:-.5px}
.profile-identity p{margin:3px 0;color:var(--muted)}
#profileBioText{margin-top:12px;color:var(--text);max-width:680px;white-space:pre-wrap}
.profile-facts{display:flex;gap:9px;flex-wrap:wrap}
.profile-fact{padding:8px 12px;border:1px solid var(--line);background:var(--panel);border-radius:999px;color:var(--muted);font-size:13px}
.page-card{background:var(--panel);border:1px solid var(--line);border-radius:20px;padding:clamp(16px,2.5vw,24px);margin-top:14px}
.page-card h3{margin:0 0 4px;font-size:17px}
.page-card>p,.page-lead,.settings-note{color:var(--muted);font-size:13px}
.page-actions{display:grid;gap:2px;margin-top:12px}
.settings-menu{padding:6px 18px}
.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:64px;text-align:left;padding:12px 2px;border-bottom:1px solid var(--line);color:var(--text)}
.settings-row:last-child{border-bottom:0}
.settings-row>span:first-child{display:grid;gap:3px}
.settings-row small{color:var(--muted);font-size:12px}
.settings-row>span:last-child{color:var(--teal);font-size:23px}
.setting-control input{width:19px;height:19px;accent-color:var(--teal);flex:none}
.danger-action{margin-top:14px;padding:12px 18px;border:1px solid #e47c7c66;border-radius:13px;color:#ff9e9e;font-weight:750}
.edit-form{display:grid;gap:15px}
.edit-form>label{display:grid;gap:7px;font-weight:700;font-size:13px;color:var(--muted)}
.edit-form input,.edit-form textarea,.edit-form select{width:100%;min-height:45px;border:1px solid var(--line);border-radius:12px;padding:11px 13px;background:var(--bg);color:var(--text);font:inherit;outline:none}
.edit-form textarea{resize:vertical;min-height:100px}
.edit-form input:focus,.edit-form textarea:focus,.edit-form select:focus{border-color:var(--teal)}
.profile-visibility{border:1px solid var(--line);border-radius:13px;padding:12px;display:flex;gap:16px;flex-wrap:wrap}
.profile-visibility legend{padding:0 7px;color:var(--muted);font-size:12px}
.profile-visibility label{display:flex;align-items:center;gap:7px;font-size:13px}
.profile-visibility input{accent-color:var(--teal)}
.primary-action{min-height:46px;padding:0 18px;border-radius:13px;background:linear-gradient(120deg,var(--teal),var(--teal2));color:#071b2a;font-weight:850}
.account-card{display:grid;gap:16px}
.account-card>div{display:grid;gap:4px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.account-card small{color:var(--muted)}
.account-card strong{overflow-wrap:anywhere}
.theme-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}
.theme-choice{min-width:0;text-align:left;display:grid;gap:7px;padding:10px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text)}
.theme-choice[aria-pressed="true"]{border-color:var(--teal);box-shadow:0 0 0 1px var(--teal) inset}
.theme-choice strong{font-size:13px}
.theme-choice small{font-size:11px;color:var(--muted);line-height:1.35}
.theme-swatch{height:54px;border-radius:10px;display:block;background:linear-gradient(135deg,#0b1020 0 55%,#67d5d0 55%)}
.swatch-ocean{background:linear-gradient(135deg,#071522 0 55%,#54c9f2 55%)}
.swatch-forest{background:linear-gradient(135deg,#091a16 0 55%,#69d69b 55%)}
.swatch-lavender{background:linear-gradient(135deg,#151126 0 55%,#b69aff 55%)}
.swatch-sunset{background:linear-gradient(135deg,#1b111b 0 55%,#ff947e 55%)}
.swatch-light{background:linear-gradient(135deg,#f2f6fb 0 55%,#147d82 55%)}
.swatch-midnight{background:linear-gradient(135deg,#080d1b 0 55%,#8aa8ff 55%)}
.swatch-aurora{background:linear-gradient(135deg,#10152a 0 55%,#7be0cf 55%)}
.swatch-crimson{background:linear-gradient(135deg,#1c0d16 0 55%,#ff6b86 55%)}
.swatch-neon{background:linear-gradient(135deg,#080f18 0 55%,#36f5d0 55%)}
.swatch-obsidian{background:linear-gradient(135deg,#090909 0 55%,#d5d5d5 55%)}
.theme-preview-panel{border:1px solid var(--line);border-radius:20px;padding:14px;background:var(--panel);overflow:hidden}
.theme-preview-panel{color:var(--text)}
.theme-preview-panel .theme-preview-bubbles span{color:var(--text)}
.theme-preview-panel .theme-preview-chat-head,.theme-preview-panel .preview-messages-list,.theme-preview-panel .preview-profile-card,.theme-preview-panel .preview-settings-list{color:var(--text)}
.theme-preview-panel small,.theme-preview-panel time{color:var(--muted)}
.theme-preview-heading{display:flex;justify-content:space-between;gap:10px;font-size:13px;margin-bottom:12px}
.theme-preview-heading span{font-size:9px;letter-spacing:1px;color:var(--teal);font-weight:800}
.theme-preview-chat{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--bg)}
.theme-preview-chat-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line)}
.theme-preview-chat-head small{margin-left:auto;color:var(--muted)}
.preview-dot{width:8px;height:8px;background:var(--teal);border-radius:50%}
.theme-preview-bubbles{display:grid;gap:9px;padding:16px;min-height:120px}
.theme-preview-bubbles span{justify-self:start;padding:9px 12px;border-radius:13px;background:var(--panel);font-size:12px;max-width:80%}
.theme-preview-bubbles .preview-own{justify-self:end;background:color-mix(in srgb,var(--teal) 24%,var(--panel))}
.theme-preview-input{margin:0 10px 10px;padding:10px 12px;border:1px solid var(--line);border-radius:11px;color:var(--muted);font-size:12px}
.theme-preview-input b{float:right;color:var(--teal)}
.theme-preview-profile{display:flex;align-items:center;gap:10px;margin-top:12px;padding:10px;border:1px solid var(--line);border-radius:12px}
.preview-avatar{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:var(--teal);color:#071b2a;font-weight:900}
.theme-preview-profile>span:last-child{display:grid;font-size:12px}
.theme-preview-profile small{color:var(--muted)}
.apply-theme-action{width:100%;margin-top:14px}
@media(max-width:560px){.theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-head h1{font-size:25px}.profile-hero{padding:0 16px 18px}.profile-cover-art{margin:0 -16px}.settings-menu{padding:4px 14px}}

.preview-tabs{display:flex;gap:5px;overflow-x:auto;margin:0 0 12px;padding:3px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.preview-tabs button{flex:1;min-width:58px;padding:8px 9px;border-radius:9px;color:var(--muted);font-size:11px;font-weight:750}
.preview-tabs button[aria-selected="true"]{background:var(--panel);color:var(--teal2);box-shadow:0 1px 5px #0002}
.preview-screen{min-height:218px}
.preview-messages-list,.preview-settings-list{display:grid;gap:0;background:var(--bg);border:1px solid var(--line);border-radius:14px;padding:4px 13px}
.preview-messages-list>div,.preview-settings-list>div{display:flex;align-items:center;gap:10px;padding:13px 0;border-bottom:1px solid var(--line)}
.preview-messages-list>div:last-child,.preview-settings-list>div:last-child{border-bottom:0}
.preview-messages-list i{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:var(--panel);color:var(--teal2);font-style:normal;font-weight:850}
.preview-messages-list span,.preview-settings-list span{display:grid;gap:2px;min-width:0;flex:1}
.preview-messages-list b,.preview-settings-list b{font-size:12px}
.preview-messages-list small,.preview-settings-list small{font-size:11px;color:var(--muted)}
.preview-messages-list time,.preview-settings-list em{font-size:10px;color:var(--muted);font-style:normal}
.preview-profile-card{background:var(--bg);border:1px solid var(--line);border-radius:14px;overflow:hidden;padding:0 14px 14px;display:grid;justify-items:start}
.preview-cover{height:65px;width:calc(100% + 28px);margin:0 -14px;background:linear-gradient(120deg,var(--teal),var(--panel) 72%)}
.preview-profile-card .preview-avatar{margin-top:-19px;border:3px solid var(--bg);width:48px;height:48px;border-radius:15px}
.preview-profile-card>strong{margin-top:7px;font-size:14px}
.preview-profile-card>small,.preview-profile-card p{color:var(--muted);font-size:11px;margin:2px 0}
.preview-profile-card>div:last-child{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
.preview-profile-card>div:last-child span{font-size:10px;padding:5px 8px;border-radius:99px;background:var(--panel);color:var(--muted)}

/* Main Chat optimistic delivery states */
.chat-line.delivery-pending{opacity:.48;transition:opacity .18s ease}
.chat-line.delivery-pending .chat-bubble{filter:saturate(.55)}
.chat-line.delivery-failed{opacity:.62}
.chat-user .delivery-label{font-size:10px;color:#9bb0c9;font-style:italic}
.chat-line.delivery-failed .delivery-label{color:#ff9b9b}

.ns-sheet{position:fixed;inset:0;z-index:65;display:flex;align-items:flex-end;justify-content:center;padding:18px 14px calc(18px + var(--sab));background:#020817b8;opacity:0;visibility:hidden;transition:opacity var(--d1),visibility 0s linear var(--d1)}
.ns-sheet.open{opacity:1;visibility:visible;transition:opacity var(--d1),visibility 0s}
.ns-card{width:min(560px,100%);max-height:80dvh;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--line);border-radius:24px;background:var(--panel);color:var(--text);transform:translateY(16px);transition:transform var(--d2) var(--ease)}
.ns-sheet.open .ns-card{transform:none}
.ns-card>header{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line)}
.ns-card h2{margin:0;font-size:17px}.ns-body{overflow-y:auto;padding:12px 14px 16px;display:grid;gap:8px}
.ns-row{display:flex;align-items:center;gap:12px;padding:11px 12px;border:1px solid var(--line);border-radius:14px;background:#ffffff08;text-align:left;color:inherit;font:inherit;width:100%}
.ns-row.unread{border-color:var(--teal)}.ns-row b{display:block;font-size:14px}.ns-row small,.ns-muted{color:var(--muted);font-size:12.5px}
.ns-av{flex:none;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--teal);color:#06242a;font-weight:800}
.ns-grow{flex:1;min-width:0}.ns-acts{display:flex;gap:8px;flex-wrap:wrap}
.ns-btn{border:1px solid var(--line);background:#ffffff0d;color:var(--text);padding:9px 14px;border-radius:12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.ns-btn.pri{background:var(--teal);color:#06242a;border-color:transparent}.ns-btn.bad{color:#ff8f8f}.ns-btn:disabled{opacity:.5}
.ns-body textarea,.ns-body select,.ns-body input{width:100%;padding:11px 12px;border-radius:12px;border:1px solid var(--line);background:#ffffff0d;color:var(--text);font:inherit}
.ns-body textarea{min-height:96px;resize:vertical}
.icon-btn{position:relative}.icon-btn.has-badge::after{content:attr(data-badge);position:absolute;top:-3px;right:-3px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#ff5d6c;color:#fff;font-size:10px;font-weight:800;display:grid;place-items:center}
.chat-user-avatar,.chat-user{cursor:pointer}

/* Profile/pages: let the outer scroller do the scrolling and never squash children (fixes clipped hero on Safari/PC/mobile) */
.app-page{overflow:visible;max-height:none;min-height:min-content;flex:none;box-sizing:border-box}
.app-page>*{flex-shrink:0;min-width:0}
.home-view{flex-shrink:0}
.profile-hero{flex:none;min-height:0;overflow:hidden;isolation:isolate}
.profile-cover-art{flex:none;min-height:100px;background-size:cover;background-position:center}
.profile-avatar-large{flex:none;margin-bottom:0}
.profile-identity{min-width:0}.profile-identity h2,.profile-identity p{overflow-wrap:anywhere}
.profile-facts{padding:0 2px}
.page-head{flex-wrap:wrap}.page-head .page-action{flex:none;white-space:nowrap}
@media(max-width:380px){.page-head>div{flex-basis:calc(100% - 60px)}.page-head .page-action{order:3;width:100%}}
@media(min-width:1000px){.profile-hero{padding:0 30px 26px}.profile-cover-art{margin:0 -30px;height:190px}.profile-avatar-large{width:104px;height:104px;margin-top:-52px}}
.attach-menu{position:absolute;left:12px;bottom:calc(100% + 8px);z-index:20;min-width:170px;padding:6px;border:1px solid var(--line);border-radius:16px;background:var(--panel);box-shadow:0 16px 40px #0007;display:none}
.attach-menu.open{display:grid;gap:2px}
.attach-menu button{display:flex;align-items:center;gap:10px;padding:11px 12px;border:0;border-radius:11px;background:none;color:var(--text);font:inherit;font-weight:700;text-align:left;cursor:pointer}
.attach-menu button:hover{background:#ffffff12}
.chat-composer{position:relative}
.chat-img{display:block;max-width:min(260px,100%);max-height:300px;border-radius:12px;cursor:zoom-in;background:#ffffff10}
.guest-box{margin-top:14px;padding-top:14px;border-top:1px solid var(--line);display:grid;gap:10px}
.guest-box input{width:100%;padding:11px 12px;border-radius:12px;border:1px solid var(--line);background:#ffffff0d;color:var(--text);font:inherit}
.guest-btn{padding:12px;border-radius:14px;border:1px solid var(--line);background:#ffffff0d;color:var(--text);font:inherit;font-weight:800;cursor:pointer}

/* Roomier private chat: popup grows when a conversation is open */
.dm-popup.thread-open{width:min(760px,100%);height:min(88dvh,820px);max-height:none}
.dm-overlay.thread-open{align-items:center;padding:12px 12px calc(12px + var(--sab))}
.dm-thread-head{padding:13px 16px}.dm-thread-person strong{font-size:16px}.dm-thread-person small{font-size:12px}
.dm-thread-messages{padding:16px;gap:14px}
.dm-thread-line{max-width:82%}
.dm-thread-bubble{font-size:15px;padding:10px 14px}.dm-thread-time{font-size:11px}
.dm-thread-composer{padding:12px 14px calc(12px + var(--sab))}
.dm-thread-composer input{height:46px;font-size:16px;border-radius:15px;padding:0 14px}.dm-thread-composer .chat-send{width:46px;height:46px}
@media(max-width:599px){.dm-popup.thread-open{width:100%;height:calc(100dvh - 12px - var(--sab));border-radius:20px}.dm-overlay.thread-open{padding:6px}}

.dm-thread-composer{position:relative}.dm-thread-composer .attach-menu{left:12px}
.dm-thread-bubble .chat-img{max-width:min(300px,100%)}

/* guest */
.guest-box{border-top:0;margin-top:6px;padding-top:0;text-align:center}
.guest-link{background:none;border:0;color:var(--muted);font:inherit;font-size:12.5px;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:6px}
.guest-panel{display:grid;gap:12px}.guest-panel[hidden]{display:none}.guest-panel h2{margin:0;font-size:22px}
.guest-panel input{width:100%;box-sizing:border-box;min-width:0}
.guest-warn{margin:0;padding:11px 13px;border-radius:12px;border:1px solid #ffb86b66;background:#ffb86b14;color:#ffd7a3;font-size:12.5px;line-height:1.5}
/* visibility ticks: normal size */
.edit-form .profile-visibility input[type=checkbox]{width:18px;height:18px;min-height:0;padding:0;margin:0;flex:none;border-radius:5px;accent-color:var(--teal)}
.profile-visibility{gap:10px 18px}
/* profile media editor */
.media-edit{position:relative;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:var(--bg)}
.media-cover{height:110px;background:linear-gradient(120deg,#1d3e59,#1b5360 55%,#203d68) center/cover no-repeat}
.media-avatar{width:72px;height:72px;margin:-36px 0 0 16px;border:4px solid var(--panel);border-radius:22px;position:relative;display:grid;place-items:center;background:linear-gradient(145deg,var(--teal2),#547fa8) center/cover no-repeat;color:#071b2a;font-size:28px;font-weight:900}
.media-btns{display:flex;flex-wrap:wrap;gap:8px;padding:12px 14px 14px}
.profile-avatar-large,.chat-user-avatar{background-size:cover;background-position:center}
/* image editor */
.ed-card{width:min(560px,100%);max-height:94dvh}.ed-body{gap:12px}
.ed-canvas{display:block;width:auto;height:auto;max-width:100%;max-height:42dvh;margin:0 auto;border-radius:14px;background:#000;touch-action:none;cursor:grab}
.ed-tabs,.ed-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ed-tabs .ns-btn[aria-pressed=true],.ed-row .ns-btn[aria-pressed=true]{background:var(--teal);color:#06242a}
.ed-row label{display:flex;align-items:center;gap:10px;flex:1;min-width:150px;font-size:12.5px;color:var(--muted)}
.ed-row input[type=range]{flex:1;padding:0;accent-color:var(--teal);border:0;background:none}
.ed-foot{display:flex;gap:10px;justify-content:flex-end}
.ed-body [hidden]{display:none!important}
.auth-card [hidden]{display:none!important}

.lightbox{position:fixed;inset:0;z-index:90;display:grid;place-items:center;background:#000d;padding:calc(64px + var(--sat)) 12px calc(16px + var(--sab));animation:page-in .18s var(--ease) both}
.lightbox-img{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px;user-select:none;-webkit-user-drag:none}
.lightbox-bar{position:absolute;top:calc(12px + var(--sat));right:12px;display:flex;gap:10px;z-index:2}
.lightbox-btn{width:44px;height:44px;border-radius:14px;border:1px solid #ffffff3a;background:#101a2de6;color:#fff;display:grid;place-items:center;cursor:pointer}
.lightbox-btn .ico{width:22px;height:22px}.lightbox-btn:disabled{opacity:.5}

/* Banner: always the same 3:1 shape as the cropped upload, so it is never re-cropped on other screens */
.profile-cover-art{height:auto!important;min-height:0!important;aspect-ratio:3/1;background-size:cover;background-position:center;background-repeat:no-repeat}
.media-cover{height:auto;aspect-ratio:3/1}

/* Left slide bar: members online/offline. Column split 70% online / 30% offline. transform/opacity only. */
.icon-btn{position:relative}
.people-backdrop{position:fixed;inset:0;z-index:66;background:#020817b8;opacity:0;visibility:hidden;transition:opacity var(--d1),visibility 0s linear var(--d2)}
.people-backdrop.open{opacity:1;visibility:visible;transition:opacity var(--d1),visibility 0s}
.people-drawer{position:fixed;z-index:67;left:0;top:0;bottom:0;width:min(86vw,340px);display:flex;flex-direction:column;padding:calc(10px + var(--sat)) 0 calc(10px + var(--sab));background:var(--panel);border-right:1px solid var(--line);border-radius:0 24px 24px 0;box-shadow:12px 0 40px #02061799;transform:translate3d(-104%,0,0);visibility:hidden;transition:transform var(--d2) var(--ease),visibility 0s linear var(--d2);touch-action:pan-y}
.people-drawer.open{transform:none;visibility:visible;transition:transform var(--d2) var(--ease),visibility 0s}
.people-drawer.dragging{transition:none}
:root.lite .people-drawer{box-shadow:none}
.people-head{flex:none;display:flex;align-items:center;justify-content:space-between;padding:6px 16px 10px 18px}
.people-head h2{margin:0;font-size:18px;letter-spacing:-.3px}
.people-sec{display:flex;flex-direction:column;min-height:0;border-top:1px solid var(--line)}
.people-online{flex:7 1 0}
.people-offline{flex:3 1 0}
.people-title{flex:none;display:flex;align-items:center;gap:8px;margin:0;padding:12px 18px 8px;font-size:11.5px;font-weight:850;letter-spacing:1.6px;text-transform:uppercase;color:#80e5dc}
.people-offline .people-title{color:var(--muted)}
.people-title span{margin-left:auto;padding:1px 8px;border-radius:10px;background:#ffffff12;font-size:11px;letter-spacing:0;color:var(--ink)}
.off-dot{width:7px;height:7px;flex:none;border-radius:50%;background:#6c7d99}
.people-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 10px 8px;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin;scrollbar-color:#49658c transparent}
.person{position:relative;display:flex;align-items:center;gap:11px;width:100%;padding:8px;border-radius:14px;text-align:left;color:inherit;transition:background-color var(--d1)}
.person:active{background:#ffffff10}
@media(hover:hover){.person:hover{background:#ffffff0c}}
.person .ns-av{width:38px;height:38px;background-size:cover;background-position:center;position:relative}
.person.is-offline .ns-av{filter:grayscale(.85);opacity:.6}
.person .ns-av:after{content:"";position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;border:2px solid var(--panel);background:#61d7c8}
.person.is-offline .ns-av:after{background:#6c7d99}
.person-copy{min-width:0;display:flex;flex-direction:column}
.person-copy b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person-copy small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person.is-offline .person-copy b{color:#a9b6cc;font-weight:600}
.people-empty{padding:10px 8px;color:var(--muted);font-size:12.5px}
@media(min-width:900px){.people-drawer{width:360px}}

/* People bar: tabs + rows with actions */
.hbtn{position:relative}
.people-tabs{flex:none;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:0 14px 10px;padding:4px;border-radius:16px;background:#0c1626;border:1px solid var(--line)}
.people-tab{position:relative;height:40px;display:grid;place-items:center;border-radius:12px;color:#9fb1cf;transition:background-color var(--d1),color var(--d1),transform .12s}
.people-tab:active{transform:scale(.92)}
.people-tab[aria-selected=true]{background:linear-gradient(145deg,#2a5568,#1f3e55);color:#b6fff2;box-shadow:inset 0 0 0 1px #64c9c055}
.tab-dot{position:absolute;top:6px;right:9px;width:9px;height:9px;border-radius:50%;background:#ff8f8f;border:2px solid #0c1626}
.people-panel{flex:1;min-height:0;display:flex;flex-direction:column}
.people-panel[hidden]{display:none}
.people-panel>.people-sec:first-child{border-top:1px solid var(--line)}
.people-scroll{border-top:1px solid var(--line);padding-top:6px}
.people-search{flex:none;padding:0 14px 10px}
.people-search input{width:100%;height:42px;padding:0 14px;border-radius:13px;border:1px solid var(--line);background:#0c1626;color:var(--text);font:inherit;font-size:16px;outline:none}
.people-search input:focus{border-color:var(--teal)}
.people-sub{margin:10px 8px 4px;font-size:11px;font-weight:850;letter-spacing:1.4px;text-transform:uppercase;color:var(--muted)}
.person{padding:0;gap:4px;align-items:center}
.person-main{flex:1;min-width:0;display:flex;align-items:center;gap:11px;padding:8px;border-radius:14px;text-align:left;color:inherit}
.person-main:active{background:#ffffff10}
@media(hover:hover){.person-main:hover{background:#ffffff0c}}
.person .ns-btn{flex:none;padding:7px 11px;font-size:12px;margin-right:4px}
.person-acts{display:flex;gap:6px;flex:none}
.role-tag{margin-left:6px;padding:1px 7px;border-radius:8px;font-size:10px;font-weight:850;letter-spacing:.5px;text-transform:uppercase;background:#67d5d02e;color:#9ff3ea;vertical-align:1px}
.role-tag.owner{background:#ffcf6a2e;color:#ffd98a}
.role-tag.admin{background:#8f7dff2e;color:#cfc6ff}
.person-copy b{display:block}

.people-tabs{grid-template-columns:repeat(5,1fr);gap:4px}

/* ===== Role badges — artwork + animations ported from Talkative (badges.css / styles-3.css) ===== */

.ns-badge{--nsb:1.3em;display:inline-flex;align-items:center;justify-content:center;width:var(--nsb);height:var(--nsb);
  vertical-align:-.28em;flex:none;margin-left:3px;line-height:0;cursor:default}
.ns-badge svg{display:block;width:100%;height:100%;overflow:visible}
.ns-badge-elite{color:var(--primary-dark,#7054c5)}
.ns-badge-admin{color:#e0457b}
.ns-badge-moderator{color:#2a9d8f}
.ns-badge-ai{color:#6d5ef0}
.ns-badge-idv{color:#1f9d6b}

/* ELITE: the star turns once, pops, then rests. Transform only, no glow. */
.ns-e-star{transform-box:fill-box;transform-origin:50% 56%;fill:color-mix(in srgb,currentColor 16%,transparent);
  animation:nsEliteSpin 5.6s cubic-bezier(.65,0,.35,1) infinite}
@keyframes nsEliteSpin{0%{transform:rotate(0) scale(1)}30%{transform:rotate(360deg) scale(1.2)}40%{transform:rotate(360deg) scale(1)}100%{transform:rotate(360deg) scale(1)}}

/* ADMIN: the headset pops up with a little overshoot, settles back, then rests. One transform, no glow, no filters. */
.ns-a-hs{color:color-mix(in srgb,currentColor 48%,#1c0612);transform-box:view-box;transform-origin:24px 28px;animation:nsAdminHs 4.2s ease-in-out infinite;will-change:transform}
@keyframes nsAdminHs{0%,50%,100%{transform:none}64%{transform:translateY(-5px) scale(1.12)}74%{transform:translateY(1px) scale(.97)}84%{transform:none}}

/* OWNER (gear head): the gear makes one full turn and rests, then the tie swings. Transform-only, no glow. Fixed pixel origins so it spins on every browser. */
.ns-ow-gear{transform-box:view-box;transform-origin:24px 13.5px;animation:nsOwnGear 6s cubic-bezier(.45,0,.2,1) infinite;will-change:transform}
.ns-o-tie{transform-box:view-box;transform-origin:24px 32.2px;animation:nsOwnTie 6s ease-in-out infinite}
@keyframes nsOwnGear{0%,6%{transform:rotate(0)}40%,100%{transform:rotate(360deg)}}
@keyframes nsOwnTie{0%,44%,80%,100%{transform:rotate(0)}52%{transform:rotate(9deg)}60%{transform:rotate(-8deg)}68%{transform:rotate(4deg)}74%{transform:rotate(-2deg)}}

/* MODERATOR (meeting room): the gear eases round one tooth and rests, then the three heads hop in a wave. Transform-only (no glow, no filters). */
.ns-m-gear{transform-box:fill-box;transform-origin:50% 50%;animation:nsModGear 5s cubic-bezier(.45,0,.2,1) infinite;will-change:transform}
.ns-m-h{animation:nsModHop 5s cubic-bezier(.3,0,.3,1) infinite}
.ns-m-h1{animation-delay:.05s}.ns-m-h2{animation-delay:.2s}.ns-m-h3{animation-delay:.12s}
@keyframes nsModGear{0%,6%{transform:rotate(0)}38%,100%{transform:rotate(45deg)}}
@keyframes nsModHop{0%,50%,72%,100%{transform:translateY(0)}58%{transform:translateY(-3px)}65%{transform:translateY(.6px)}}

/* AI: the big sparkle breathes (scale) while the small spark twinkles out of phase. Transform + opacity only, no glow, no filters. */
.ns-ai-main{transform-box:fill-box;transform-origin:50% 50%;animation:nsAiMain 3.6s ease-in-out infinite}
.ns-ai-spark{transform-box:fill-box;transform-origin:50% 50%;animation:nsAiSpark 3.6s ease-in-out infinite}
@keyframes nsAiMain{0%,60%,100%{transform:scale(1) rotate(0)}30%{transform:scale(.86) rotate(45deg)}}
@keyframes nsAiSpark{0%,40%{transform:scale(.4);opacity:.35}55%{transform:scale(1.25) rotate(90deg);opacity:1}75%,100%{transform:scale(.4);opacity:.35}}
.ns-badge-ai,.ns-badge-idv{contain:layout paint}

/* ELITE membership card hero */

@media (prefers-reduced-motion:reduce){.ns-e-star,.ns-ai-main,.ns-ai-spark,.ns-a-hs,.ns-ow-gear,.ns-o-tie,.ns-m-gear,.ns-m-h{animation:none!important}}

.ns-badge{--nsb:1.3em}
/* colours tuned a little brighter on the dark themes so they read on the dark panels */
.ns-badge-elite{color:#b79cff}.ns-badge-admin{color:#ee5e90}.ns-badge-moderator{color:#34b8a7}.ns-badge-ai{color:#8f83ff}.ns-badge-idv{color:#2fc58a}
:root[data-theme] .ns-badge-elite{color:#7054c5}:root[data-theme] .ns-badge-admin{color:#e0457b}:root[data-theme] .ns-badge-moderator{color:#2a9d8f}:root[data-theme] .ns-badge-ai{color:#6d5ef0}:root[data-theme] .ns-badge-idv{color:#1f9d6b}
/* VERIFIED MEMBER seal: pops in once, tick draws itself, soft ring every few seconds */
.ns-vbadge{position:relative;display:inline-flex;flex:none;width:var(--nsv,15px);height:var(--nsv,15px);margin-left:4px;vertical-align:-.17em;border-radius:50%;animation:nsVPop .55s cubic-bezier(.34,1.56,.64,1) both}
.ns-vbadge svg{width:100%;height:100%;display:block;overflow:visible}
.ns-v-bg{fill:#3b82f6}
.ns-v-tick{fill:none;stroke:#fff;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16;animation:nsVDraw .5s .2s ease-out both}
.ns-vbadge::after{content:"";position:absolute;inset:0;border-radius:50%;animation:nsVRing 6s ease-out 1.5s infinite;pointer-events:none}
@keyframes nsVPop{from{transform:scale(.3);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes nsVDraw{from{stroke-dashoffset:16}to{stroke-dashoffset:0}}
@keyframes nsVRing{0%,80%{box-shadow:0 0 0 0 rgba(59,130,246,0)}82%{box-shadow:0 0 0 0 rgba(59,130,246,.38)}100%{box-shadow:0 0 0 6px rgba(59,130,246,0)}}
@media (prefers-reduced-motion:reduce){.ns-vbadge,.ns-vbadge::after,.ns-v-tick{animation:none}}
:root.lite .ns-vbadge::after{animation:none}
.name-badges{display:inline-flex;align-items:center;gap:2px;margin-left:4px;vertical-align:middle}
.name-badges .ns-vbadge{margin-left:0}
.name-badges .ns-badge{margin-left:0}
.ns-badge{display:inline-flex;align-items:center;justify-content:center;width:var(--nsb);height:var(--nsb);vertical-align:-.28em;flex:none;line-height:0;cursor:default}
.ns-badge svg{display:block;width:100%;height:100%;overflow:visible}
.chat-user .ns-badge{--nsb:16px}.chat-user .ns-vbadge{--nsv:13px}
.person-copy b .ns-badge{--nsb:18px}.person-copy b .ns-vbadge{--nsv:14px}
.mp-name .ns-badge{--nsb:24px}.mp-name .ns-vbadge{--nsv:18px}
h1.mp-name .ns-badge{--nsb:30px}h1.mp-name .ns-vbadge{--nsv:22px}
.mp-tag .ns-badge{--nsb:17px}.mp-tag .ns-vbadge{--nsv:16px;margin:0}

/* ===== Members button: small dot for friend requests (replaces the online-count number) ===== */
.people-dot{position:absolute;top:-3px;right:-3px;width:12px;height:12px;border-radius:50%;background:#ff5d6c;border:2px solid var(--bg);pointer-events:none}
.hbtn .people-dot{border-color:#18243a}

/* instant layer swap (used when a page is opened from inside Main chat) */
body.instant-nav .chat-layer{transition:none!important}

/* ===== Member popup + full-screen profile ===== */
.mp-pop{position:fixed;inset:0;z-index:69;display:flex;align-items:flex-end;justify-content:center;padding:16px 12px calc(16px + var(--sab));background:#020817b8;opacity:0;visibility:hidden;transition:opacity var(--d1),visibility 0s linear var(--d1)}
.mp-pop.open{opacity:1;visibility:visible;transition:opacity var(--d1),visibility 0s}
.mp-card{width:min(400px,100%);max-height:88dvh;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:26px;background:var(--panel);color:var(--text);transform:translateY(18px);transition:transform var(--d2) var(--ease)}
.mp-pop.open .mp-card{transform:none}
@media(min-width:600px){.mp-pop{align-items:center}}
.mp-hero{position:relative}
.mp-banner{aspect-ratio:3/1;background:linear-gradient(120deg,color-mix(in srgb,var(--teal) 55%,var(--panel)),color-mix(in srgb,var(--panel) 80%,#000) 85%) center/cover no-repeat}
.mp-x,.mp-back{position:absolute;top:10px;width:36px;height:36px;display:grid;place-items:center;border-radius:12px;background:#0b1020b3;color:#fff;border:1px solid #ffffff2e}
.mp-x{right:10px}.mp-back{left:12px;top:calc(12px + var(--sat))}
.mp-x .ico,.mp-back .ico{width:19px;height:19px}
.mp-body{position:relative;padding:0 18px 18px;display:flex;flex-direction:column;gap:6px}
.mp-avatar{position:relative;width:80px;height:80px;margin-top:-40px;flex:none;border:4px solid var(--panel);border-radius:26px;display:grid;place-items:center;background:linear-gradient(145deg,var(--teal2),#547fa8) center/cover no-repeat;color:#071b2a;font-size:30px;font-weight:900}
.mp-online{position:absolute;right:-4px;bottom:-4px;width:18px;height:18px;border-radius:50%;background:#61d7c8;border:3px solid var(--panel)}
.mp-name{margin:6px 0 0;font-size:21px;line-height:1.25;letter-spacing:-.4px;overflow-wrap:anywhere}
.mp-handle{margin:0;color:var(--muted);font-size:13.5px}
.mp-bio{margin:6px 0 0;color:var(--ink);font-size:14px;line-height:1.55;overflow-wrap:anywhere;white-space:pre-wrap}
.mp-bio.clamp{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.mp-bio.muted{color:var(--muted)}
.mp-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.mp-tag{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 7px;border-radius:999px;font-size:12px;font-weight:650;line-height:1.2;border:1px solid var(--line);background:#ffffff0a;color:var(--text)}
.mp-tag .mp-dot{width:11px;height:11px;border-radius:50%;flex:none}
.mp-tag-female .mp-dot{background:#ec4899}.mp-tag-male .mp-dot{background:#3b82f6}
.mp-tag-elite{border-color:color-mix(in srgb,#d4a017 55%,var(--line));background:color-mix(in srgb,#f5c542 14%,transparent)}
.mp-tag-ai{border-color:color-mix(in srgb,#6d5ef0 55%,var(--line));background:color-mix(in srgb,#6d5ef0 14%,transparent)}
.mp-tag-idv{border-color:color-mix(in srgb,#1f9d6b 55%,var(--line));background:color-mix(in srgb,#1f9d6b 14%,transparent)}
.mp-tag-owner{border-color:color-mix(in srgb,#f7c85a 55%,var(--line));background:color-mix(in srgb,#f7c85a 13%,transparent)}
.mp-tag-admin{border-color:color-mix(in srgb,#e0457b 55%,var(--line));background:color-mix(in srgb,#e0457b 13%,transparent)}
.mp-tag-moderator{border-color:color-mix(in srgb,#2a9d8f 55%,var(--line));background:color-mix(in srgb,#2a9d8f 13%,transparent)}
.mp-tag-verified{border-color:color-mix(in srgb,#3b82f6 55%,var(--line));background:color-mix(in srgb,#3b82f6 13%,transparent)}
.mp-acts{display:grid;gap:8px;margin-top:12px}
.mp-row{display:flex;gap:8px;flex-wrap:wrap}
.mp-row .ns-btn{flex:1 1 0;min-width:fit-content;text-align:center}
.mp-loading{margin:0;padding:20px 18px;color:var(--muted);text-align:center}
.mp-full{position:fixed;inset:0;z-index:68;background:var(--bg-grad);background-color:var(--bg);color:var(--text);transform:translate3d(0,100%,0);visibility:hidden;transition:transform var(--d2) var(--ease),visibility 0s linear var(--d2)}
.mp-full.open{transform:none;visibility:visible;transition:transform var(--d2) var(--ease),visibility 0s}
.mp-full-scroll{height:100%;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.mp-full-in{width:min(820px,100%);margin:0 auto;padding-bottom:calc(40px + var(--sab));min-height:100%;background:var(--panel)}
@media(min-width:860px){.mp-full-in{border-inline:1px solid var(--line)}}
.mp-full .mp-banner{aspect-ratio:3/1;min-height:110px}
.mp-full .mp-body{padding:0 clamp(16px,4vw,32px) 8px;gap:8px}
.mp-full .mp-avatar{width:104px;height:104px;margin-top:-52px;border-radius:32px;font-size:40px}
.mp-full .mp-name{font-size:clamp(24px,5vw,32px)}
.mp-stats{display:flex;gap:10px;margin-top:6px}
.mp-stat{flex:1;padding:10px 14px;border:1px solid var(--line);border-radius:16px;background:#ffffff08;display:flex;flex-direction:column}
.mp-stat b{font-size:16px}.mp-stat small{color:var(--muted);font-size:12px}
.mp-sec{margin-top:10px;padding:14px 16px;border:1px solid var(--line);border-radius:18px;background:#ffffff06}
.mp-sec h3{margin:0 0 6px;font-size:11px;font-weight:850;letter-spacing:1.5px;text-transform:uppercase;color:var(--muted)}
.mp-sec .mp-bio{margin:0}.mp-sec .mp-tags{margin-top:0}
:root[data-theme] .mp-tag,:root[data-theme] .mp-stat,:root[data-theme] .mp-sec{background:#00000006}
/* "Reduce motion" (Settings) also stops the badge animations */
:root.lite .ns-e-star,:root.lite .ns-ai-main,:root.lite .ns-ai-spark,:root.lite .ns-a-hs,:root.lite .ns-ow-gear,:root.lite .ns-o-tie,:root.lite .ns-m-gear,:root.lite .ns-m-h,:root.lite .ns-v-tick{animation:none!important}

/* Own profile: name badges + tag chips (same animated badges as the member popup) */
#profileName .ns-badge{--nsb:26px}#profileName .ns-vbadge{--nsv:20px}
#profileFacts .mp-tag .ns-badge{--nsb:18px}
#profileFacts{display:flex;flex-wrap:wrap;gap:6px}
/* auto low-end mode keeps badge animation; only the Settings 'Reduce motion' switch stops it */
:root.lite:not(.user-reduced) .ns-e-star{animation:nsEliteSpin 5.6s cubic-bezier(.65,0,.35,1) infinite!important}
:root.lite:not(.user-reduced) .ns-a-hs{animation:nsAdminHs 4.2s ease-in-out infinite!important}
:root.lite:not(.user-reduced) .ns-ow-gear{animation:nsOwnGear 6s cubic-bezier(.45,0,.2,1) infinite!important}
:root.lite:not(.user-reduced) .ns-o-tie{animation:nsOwnTie 6s ease-in-out infinite!important}
:root.lite:not(.user-reduced) .ns-m-gear{animation:nsModGear 5s cubic-bezier(.45,0,.2,1) infinite!important}
:root.lite:not(.user-reduced) .ns-m-h{animation:nsModHop 5s cubic-bezier(.3,0,.3,1) infinite!important}
:root.lite:not(.user-reduced) .ns-ai-main{animation:nsAiMain 3.6s ease-in-out infinite!important}
:root.lite:not(.user-reduced) .ns-ai-spark{animation:nsAiSpark 3.6s ease-in-out infinite!important}

/* ===== Top-bar icon animations (from Talkative motion.css) — transform only ===== */
.brand-mark.ns-go{animation:nsLogo 3.6s ease-in-out infinite}
@keyframes nsLogo{0%,100%{transform:rotate(-4deg) translateY(0) scale(1)}50%{transform:rotate(-4deg) translateY(-2px) scale(1.07)}}
#openPeople.ns-go .ico{animation:nsBreathe 3s ease-in-out infinite}
@keyframes nsBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.18)}}
#openFeedback.ns-go .ico{animation:nsPlus 2.2s ease-in-out infinite}
@keyframes nsPlus{0%,60%,100%{transform:rotate(0) scale(1)}25%{transform:rotate(90deg) scale(1.2)}}
#openNotifs .ico{transform-origin:50% 12%}
#openNotifs.ns-go .ico{animation:nsRing 4s ease-in-out infinite}
@keyframes nsRing{0%{transform:rotate(0)}3%{transform:rotate(18deg)}6%{transform:rotate(-16deg)}9%{transform:rotate(13deg)}12%{transform:rotate(-10deg)}15%{transform:rotate(6deg)}18%{transform:rotate(-3deg)}21%,100%{transform:rotate(0)}}
#openSettings.ns-go .ico{animation:nsCog 2.4s ease-in-out infinite}
@keyframes nsCog{0%,100%{transform:rotate(0)}40%{transform:rotate(-14deg) scale(1.15)}70%{transform:rotate(10deg)}}
.icon-btn .ico{transform-box:fill-box}

/* Badge + tag animations must play even when the OS/preview asks for reduced motion (they are tiny transforms);
   the in-app Settings > Reduce motion switch still turns them off. */
@media(prefers-reduced-motion:reduce){
  :root:not(.user-reduced) .ns-e-star{animation:nsEliteSpin 5.6s cubic-bezier(.65,0,.35,1) infinite!important}
  :root:not(.user-reduced) .ns-a-hs{animation:nsAdminHs 4.2s ease-in-out infinite!important}
  :root:not(.user-reduced) .ns-ow-gear{animation:nsOwnGear 6s cubic-bezier(.45,0,.2,1) infinite!important}
  :root:not(.user-reduced) .ns-o-tie{animation:nsOwnTie 6s ease-in-out infinite!important}
  :root:not(.user-reduced) .ns-m-gear{animation:nsModGear 5s cubic-bezier(.45,0,.2,1) infinite!important}
  :root:not(.user-reduced) .ns-m-h{animation:nsModHop 5s cubic-bezier(.3,0,.3,1) infinite!important}
  :root:not(.user-reduced) .ns-m-h1{animation-delay:.05s!important}:root:not(.user-reduced) .ns-m-h2{animation-delay:.2s!important}:root:not(.user-reduced) .ns-m-h3{animation-delay:.12s!important}
  :root:not(.user-reduced) .ns-ai-main{animation:nsAiMain 3.6s ease-in-out infinite!important}
  :root:not(.user-reduced) .ns-ai-spark{animation:nsAiSpark 3.6s ease-in-out infinite!important}
  :root:not(.user-reduced) .ns-v-tick{animation:nsVDraw .5s .2s ease-out both!important}
  :root:not(.user-reduced) .ns-vbadge::after{animation:nsVRing 6s ease-out 1.5s infinite!important}
}

.dm-avatar.has-img{background-size:cover;background-position:center;font-size:0}
.dm-thread-person{cursor:pointer;border-radius:14px;padding:2px 8px 2px 2px;margin:-2px 0 -2px -2px;-webkit-tap-highlight-color:transparent}
.dm-thread-person:active{background:#ffffff12}
@media(hover:hover){.dm-thread-person:hover{background:#ffffff0c}}
.dm-thread-person small{display:block}
.dm-conversation-top strong .name-badges{vertical-align:middle}
.dm-conversation-top strong .ns-badge{--nsb:16px}.dm-conversation-top strong .ns-vbadge{--nsv:13px}
#dmThreadName .ns-badge{--nsb:16px}#dmThreadName .ns-vbadge{--nsv:13px}
.room-locked-note{margin:18px auto;max-width:300px;padding:12px 14px;border-radius:14px;border:1px solid var(--line);background:#ffffff0a;color:var(--muted);font-size:13px;text-align:center;line-height:1.45}

.room-option.is-locked{opacity:.45;filter:grayscale(.85);cursor:not-allowed;animation:none!important}
.room-option.is-locked:before{display:none}
.room-option.is-locked:active{transform:none}
@media(hover:hover){.room-option.is-locked:hover{transform:none;border-color:var(--line)}}

/* Date of birth fields: iOS Safari renders date inputs oddly (overflow, centred text) */
input[type="date"]{-webkit-appearance:none;appearance:none;display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;min-height:48px;text-align:left;line-height:1.2;font:inherit;color:var(--text)}
input[type="date"]::-webkit-date-and-time-value{text-align:left;margin:0;min-height:1.2em;padding:0}
input[type="date"]::-webkit-datetime-edit{padding:0;text-align:left}
input[type="date"]::-webkit-calendar-picker-indicator{opacity:.7;filter:invert(.85)}
:root[data-theme] input[type="date"]::-webkit-calendar-picker-indicator{filter:none}
.auth-field,.guest-panel .auth-field{min-width:0}

/* ===== Owner Staff Centre ===== */
.staff-backdrop{position:fixed;inset:0;z-index:73;background:#020817a8;opacity:0;visibility:hidden;transition:opacity var(--d1),visibility 0s linear var(--d1)}
.staff-backdrop.open{opacity:1;visibility:visible;transition:opacity var(--d1),visibility 0s}
.staff-drawer{position:fixed;z-index:74;top:50%;left:50%;right:auto;bottom:auto;width:min(900px,calc(100vw - 28px));height:min(88dvh,850px);display:flex;flex-direction:column;padding:calc(12px + var(--sat)) 0 calc(12px + var(--sab));background:var(--panel);border:1px solid var(--line);border-radius:22px;box-shadow:0 24px 72px #020617bb;transform:translate(-50%,-47%) scale(.985);visibility:hidden;transition:transform var(--d2) var(--ease),visibility 0s linear var(--d2);overscroll-behavior:contain}
.staff-drawer.open{transform:translate(-50%,-50%) scale(1);visibility:visible;transition:transform var(--d2) var(--ease),visibility 0s}
.staff-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:10px 18px 15px;border-bottom:1px solid var(--line)}
.staff-eyebrow{display:block;color:var(--teal);font-size:9px;font-weight:900;letter-spacing:1.8px}
.staff-head h2{margin:3px 0 2px;font-size:20px;letter-spacing:-.5px}
.staff-head p{margin:0;color:var(--muted);font-size:11px}
.staff-nav{display:flex;gap:5px;padding:10px 12px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}
.staff-nav::-webkit-scrollbar{display:none}
.staff-nav button{position:relative;flex:1 0 auto;min-width:62px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:7px 8px;border:1px solid transparent;border-radius:12px;color:var(--muted);font-size:10px;font-weight:750;white-space:nowrap}
.staff-nav button .ico{width:18px;height:18px}
.staff-nav button[aria-current="page"]{color:var(--teal2);background:#67d5d014;border-color:#67d5d02b}
.staff-nav button i{position:absolute;top:4px;right:calc(50% - 18px);width:7px;height:7px;border-radius:50%;background:#ff6678}
.staff-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 15px 24px;-webkit-overflow-scrolling:touch}
.staff-view{display:grid;gap:12px}
.staff-loading,.staff-empty{padding:22px 12px;color:var(--muted);font-size:12px;text-align:center}
.staff-welcome{padding:16px;border:1px solid var(--line);border-radius:17px;background:linear-gradient(135deg,#1b3b4a,#15263a 75%)}
.staff-welcome h3{margin:4px 0;font-size:20px;letter-spacing:-.5px}
.staff-welcome p{margin:0;color:#b5cbd5;font-size:11px}
.staff-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.staff-stat{min-width:0;padding:12px 10px;border:1px solid var(--line);border-radius:14px;background:#ffffff07;display:flex;flex-direction:column;gap:3px}
.staff-stat b{font-size:20px;line-height:1.1;font-weight:850}
.staff-stat small{font-size:10px;color:var(--muted)}
.staff-section-title{margin:4px 0 0;font-size:14px;letter-spacing:-.2px}
.staff-note{margin:0;color:var(--muted);font-size:11px;line-height:1.5}
.staff-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.staff-action-card{min-width:0;display:grid;grid-template-columns:30px 1fr 12px;align-items:center;gap:8px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#ffffff08;text-align:left;font-size:11px}
.staff-action-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:#67d5d018;color:var(--teal2)}
.staff-action-icon .ico{width:17px;height:17px}
.staff-action-arrow{color:var(--muted);font-size:20px}
.staff-search{width:100%;height:40px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:#0c1626;color:var(--text);font:inherit;font-size:12px;outline:none}
.staff-search:focus{border-color:var(--teal)}
.staff-directory-list,.staff-report-list,.staff-log-list{display:grid;gap:8px}
.staff-list-row{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid var(--line);border-radius:13px;background:#ffffff06}
.staff-list-name{flex:1;min-width:0;display:grid;gap:2px}
.staff-list-name b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.staff-list-name small,.staff-list-meta{font-size:10px;color:var(--muted)}
.staff-list-meta{flex:none;padding:3px 7px;border-radius:8px;background:#ffffff0a}
.staff-list-actions{display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end}
.staff-list-actions .ns-btn{padding:6px 9px;font-size:10px;min-height:30px}
.staff-report-card,.staff-log-card,.staff-team-card{padding:12px;border:1px solid var(--line);border-radius:14px;background:#ffffff06;display:grid;gap:7px}
.staff-report-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.staff-report-top b,.staff-log-card>b{font-size:12px}
.staff-status{padding:3px 7px;border-radius:8px;background:#ffffff12;color:var(--muted);font-size:9px;text-transform:uppercase;font-weight:850}
.staff-status.status-open{background:#ffb65a20;color:#ffc982}.staff-status.status-reviewing{background:#4c9de520;color:#8ccaff}.staff-status.status-actioned{background:#42b88320;color:#7de0ae}.staff-status.status-dismissed{background:#ffffff12;color:var(--muted)}
.staff-report-detail,.staff-report-body,.staff-log-card p{margin:0;font-size:11px;line-height:1.45;color:var(--muted);overflow-wrap:anywhere}
.staff-report-body{color:var(--text)}
.staff-report-time,.staff-log-card small,.staff-log-card time{font-size:9px;color:var(--muted)}
.staff-team-controls{display:flex;gap:8px;padding-top:8px;border-top:1px solid var(--line)}
.staff-team-controls .owner-role-select{flex:1}
.staff-team-controls .ns-btn{font-size:10px;padding:6px 10px}
.staff-quick-backdrop{position:fixed;inset:0;z-index:78;background:#02081770;opacity:0;visibility:hidden;transition:opacity var(--d1),visibility 0s linear var(--d1)}
.staff-quick-backdrop.open{opacity:1;visibility:visible;transition:opacity var(--d1),visibility 0s}
.staff-quick{position:fixed;z-index:79;left:50%;bottom:calc(78px + var(--sab));width:min(420px,calc(100% - 24px));max-height:min(70dvh,540px);overflow:auto;padding:14px;border:1px solid var(--line);border-radius:19px;background:var(--panel);box-shadow:0 18px 48px #020617a8;opacity:0;visibility:hidden;transform:translate(-50%,12px);transition:opacity var(--d1),transform var(--d2) var(--ease),visibility 0s linear var(--d1)}
.staff-quick.open{opacity:1;visibility:visible;transform:translate(-50%,0);transition:opacity var(--d1),transform var(--d2) var(--ease),visibility 0s}
.staff-quick>header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.staff-quick>header strong{display:block;font-size:14px}
.staff-quick-link{width:100%;display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:12px;background:#ffffff07;text-align:left}
.staff-quick-link>.ico{color:var(--teal);width:20px;height:20px}
.staff-quick-link>span:nth-child(2){flex:1;display:grid;gap:2px}
.staff-quick-link b{font-size:11px}.staff-quick-link small{font-size:10px;color:var(--muted)}
.staff-search-label{display:block;margin:13px 0 6px;color:var(--muted);font-size:10px;font-weight:750}
.staff-quick-results{display:grid;gap:5px;margin-top:8px}
.staff-quick-results>p{margin:0;padding:8px;color:var(--muted);font-size:11px}
.staff-quick-result{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px;border-radius:11px;background:#ffffff07;text-align:left}
.staff-quick-result-copy{display:grid;gap:2px}.staff-quick-result b{font-size:11px}.staff-quick-result small{font-size:10px;color:var(--muted)}
.chat-staff-quick{width:38px;height:38px;flex:none;display:grid;place-items:center;border:1px solid #67d5d044;border-radius:13px;background:#67d5d018;color:var(--teal2)}
.chat-staff-quick .ico{width:19px;height:19px}
.owner-controls{border-color:#67d5d044;background:#67d5d008}
.owner-controls h3{color:var(--teal2)}
.owner-control-row,.owner-role-control{display:flex;align-items:center;gap:9px;padding:8px 0;border-bottom:1px solid var(--line)}
.owner-control-copy{flex:1;min-width:0;display:grid;gap:2px}
.owner-control-copy b{font-size:11px}.owner-control-copy small{font-size:9px;color:var(--muted)}
.owner-control-row .ns-btn,.owner-role-control .ns-btn{padding:6px 10px;min-height:30px;font-size:10px}
.owner-role-select{min-width:96px;max-width:120px;height:32px;padding:0 7px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);font:inherit;font-size:10px}
.owner-control-note{margin:7px 0 0;color:var(--muted);font-size:9px;line-height:1.45}

/* ===== Compact UI pass: reduce the complete mobile interface proportionately ===== */
@media(max-width:820px){
  body{font-size:14px}
  .ico{width:20px;height:20px}
  .topbar-inner{height:54px;padding-inline:10px;gap:8px}
  .brand{gap:7px}.brand-mark{width:33px;height:33px;border-radius:10px;font-size:18px}.brand-name{font-size:16px}
  .header-actions{gap:4px}.icon-btn{width:34px;height:34px;border-radius:11px}.icon-btn .ico{width:18px;height:18px}
  .home-scroll{padding-inline:9px;padding-bottom:calc(84px + var(--sab))}
  .home-view{padding:20px 9px 20px;gap:18px}
  .home-eyebrow{font-size:9px;letter-spacing:1.5px;margin-bottom:8px}
  .home-intro h1{font-size:clamp(24px,4.3vw,36px);letter-spacing:-1px;margin-bottom:8px}
  .home-intro p{font-size:13px}
  .room-options{gap:10px}.room-option{min-height:116px;padding:13px;border-radius:17px;gap:10px}
  .option-icon{width:42px;height:42px;border-radius:12px}.option-icon .ico{width:22px;height:22px}
  .option-copy{gap:5px}.option-copy strong{font-size:15px}.option-copy small{font-size:11px}
  .option-arrow{width:29px;height:29px}.option-arrow .ico{width:16px;height:16px}
  .dock-wrap{width:min(360px,calc(100% - 24px));bottom:max(8px,var(--sab))}.dock{height:51px;border-radius:16px;padding:4px}.dock-pill{top:4px;bottom:4px;left:4px;border-radius:12px}.dock-btn{border-radius:12px}.dock-btn .ico{width:21px;height:21px}
  .chat-head{gap:7px;padding:calc(7px + var(--sat)) 9px 7px}.hbtn{width:34px;height:34px;border-radius:11px}.hbtn .ico{width:18px;height:18px}
  .room-id{gap:7px}.room-symbol{width:32px;height:32px;border-radius:10px}.room-symbol .ico{width:17px;height:17px}.room-meta strong{font-size:13px}.room-meta small{font-size:10px}
  .head-actions{gap:5px}
  .chat-messages{padding:12px 10px}.chat-line{max-width:94%;margin-bottom:8px}.chat-bubble{font-size:12px;line-height:1.42;padding:8px 10px;border-radius:12px}
  .chat-user{font-size:10px;gap:5px}.chat-user-avatar{width:28px;height:28px}.chat-date{font-size:9px;margin:8px auto 12px}
  .chat-composer{gap:6px;padding:7px 8px calc(7px + var(--sab))}.chat-add,.chat-send{width:35px;height:35px;border-radius:11px}.chat-add .ico,.chat-send .ico{width:18px;height:18px}.chat-input{font-size:13px;min-height:35px}
  .chat-staff-quick{width:35px;height:35px;border-radius:11px}.chat-staff-quick .ico{width:17px;height:17px}
  .people-drawer{width:min(84vw,310px);border-radius:0 19px 19px 0}.people-head{padding:10px 13px}.people-head h2{font-size:16px}.people-tabs{padding:8px 9px;gap:4px}.people-tab{min-width:38px;padding:7px}.people-tab .ico{width:18px;height:18px}
  .people-title{padding:10px 14px 7px;font-size:10px}.person{gap:7px;padding:7px 9px}.ns-av{width:34px;height:34px;border-radius:11px}.person-copy b{font-size:12px}.person-copy small{font-size:10px}.person .ns-btn{padding:6px 8px;font-size:10px}
  .dm-overlay{padding:8px 8px calc(70px + var(--sab))}.dm-popup{border-radius:18px}.dm-popup-head{padding:10px 12px}.dm-popup-head h2{font-size:15px}
  .dm-conversation{padding:8px 7px;gap:9px}.dm-avatar{width:36px;height:36px;border-radius:11px;font-size:13px}.dm-conversation-top strong{font-size:12px}.dm-conversation-preview{font-size:10px}
  .dm-thread-head{padding:8px 10px}.dm-thread-person strong{font-size:13px}.dm-thread-person small{font-size:10px}.dm-thread-bubble{font-size:13px;padding:8px 10px}
  .ns-card{border-radius:17px}.ns-card h2{font-size:15px}.ns-body{padding:10px 12px 13px;gap:7px}.ns-row{padding:9px}.ns-row b{font-size:12px}.ns-row small,.ns-muted{font-size:10px}.ns-btn{padding:7px 11px;font-size:11px;border-radius:10px}
  .mp-card{border-radius:21px;max-height:86dvh}.mp-body{padding-inline:14px;gap:5px}.mp-avatar{width:70px;height:70px;margin-top:-35px;border-radius:22px;font-size:26px}.mp-name{font-size:18px}.mp-handle{font-size:11px}.mp-bio{font-size:12px}.mp-tag{font-size:10px;padding:3px 8px 3px 6px}.mp-acts{gap:6px;margin-top:9px}.mp-row{gap:6px}.mp-row .ns-btn{font-size:10px;padding:7px 8px}
  .mp-full .mp-body{padding-inline:14px}.mp-full .mp-avatar{width:82px;height:82px;margin-top:-41px;border-radius:25px;font-size:32px}.mp-full .mp-name{font-size:clamp(20px,5vw,26px)}.mp-stat{padding:8px 10px;border-radius:13px}.mp-stat b{font-size:14px}.mp-stat small{font-size:10px}.mp-sec{padding:11px 12px;border-radius:15px}.mp-sec h3{font-size:10px}
  .staff-drawer{width:calc(100vw - 20px);height:min(90dvh,850px);border-radius:18px}.staff-head{padding:8px 14px 12px}.staff-head h2{font-size:18px}.staff-content{padding:11px 12px 20px}.staff-nav{padding:8px 9px}.staff-nav button{font-size:9px;min-width:56px;padding:6px}.staff-nav button .ico{width:16px;height:16px}
  .staff-welcome{padding:13px;border-radius:15px}.staff-welcome h3{font-size:18px}.staff-stat{padding:10px 8px}.staff-stat b{font-size:18px}.staff-stat small{font-size:9px}.staff-action-card{padding:10px;grid-template-columns:27px 1fr 10px;font-size:10px}.staff-action-icon{width:27px;height:27px}.staff-list-row{padding:8px;gap:7px}.staff-list-name b{font-size:11px}.staff-list-name small,.staff-list-meta{font-size:9px}
  .staff-quick{bottom:calc(70px + var(--sab));padding:12px;border-radius:16px}.staff-quick>header strong{font-size:13px}
  .profile-hero{border-radius:18px;padding:0 15px 16px}.profile-cover-art{margin-inline:-15px}.profile-avatar-large{width:76px;height:76px;margin-top:-38px;border-radius:23px;font-size:29px}.profile-identity h2{font-size:20px}.profile-fact{font-size:11px;padding:6px 9px}.page-card{padding:13px;border-radius:16px}.page-card h3{font-size:15px}.page-card>p,.page-lead,.settings-note{font-size:11px}.settings-row{padding:10px 11px}.settings-row strong{font-size:12px}.settings-row small{font-size:10px}
  .auth-card{padding:20px;border-radius:18px}.auth-card h1{font-size:21px}.auth-card label{font-size:11px}.auth-card input{height:42px;font-size:13px}
}
@media(max-width:380px){
  .brand-name{font-size:14px}.header-actions{gap:3px}.icon-btn{width:32px;height:32px}.icon-btn .ico{width:17px;height:17px}
  .room-option{padding:11px;gap:8px}.option-icon{width:38px;height:38px}.option-copy strong{font-size:14px}.option-copy small{font-size:10px}
  .chat-messages{padding-inline:8px}.chat-bubble{font-size:11.5px;padding:7px 9px}
  .staff-stats{gap:5px}.staff-stat{padding:9px 6px}.staff-stat b{font-size:16px}.staff-stat small{font-size:8px}
}
.staff-chat-card{padding:13px;border:1px solid var(--line);border-radius:15px;background:#ffffff06;display:grid;gap:9px}
.staff-chat-status{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:750}
.staff-chat-status b{margin-left:auto;padding:3px 8px;border-radius:8px;background:#42b88320;color:#7de0ae;font-size:10px}
.staff-chat-status .staff-room-dot{width:8px;height:8px;border-radius:50%;background:#54c995;box-shadow:0 0 8px #54c99588}
.staff-chat-status .staff-room-dot.locked{background:#ff6578;box-shadow:0 0 8px #ff657888}
.staff-chat-card>.ns-btn{min-height:34px;padding:7px 11px;font-size:11px}
.staff-slow-label{font-size:10px;font-weight:750;color:var(--muted)}
.staff-chat-event{display:grid;gap:3px;padding:8px 0;border-top:1px solid var(--line)}
.staff-chat-event b{font-size:11px;text-transform:capitalize}
.staff-chat-event small{font-size:9px;color:var(--muted)}
.staff-chat-event p{margin:0;font-size:10px;color:var(--muted)}
@media(max-width:820px){
  .side-card{padding:14px;border-radius:14px}.side-card h3{font-size:12px;margin-bottom:10px}.trend{padding:8px 0}.trend strong{font-size:11px}.trend small,.online small{font-size:9px}.online{gap:8px;margin:9px 0}.online span{font-size:11px}
  .toast{padding:8px 12px;border-radius:10px;font-size:11px;max-width:calc(100% - 24px);bottom:calc(76px + var(--sab))}
  .page-head{gap:9px;margin-bottom:5px}.page-head h1{font-size:clamp(21px,4vw,27px)}.page-back,.page-action{height:35px;min-width:36px;padding-inline:10px;border-radius:11px;font-size:11px}
  .app-page{gap:14px;padding:16px 11px calc(30px + var(--sab))}.page-card{padding:12px;border-radius:15px;margin-top:10px}.page-card h3{font-size:14px}.page-card>p,.page-lead,.settings-note{font-size:11px}
  .edit-form{gap:10px}.edit-form>label{gap:5px;font-size:11px}.edit-form input:not([type=checkbox]):not([type=range]),.edit-form select,.edit-form textarea{font-size:13px;padding:9px 10px;border-radius:10px}
  .settings-row{min-height:54px;padding:9px 2px;gap:10px}.settings-row strong{font-size:11px}.settings-row small{font-size:9px}.settings-row>span:last-child{font-size:19px}.setting-control input{transform:scale(.92)}
  .danger-action{margin-top:10px;padding:10px 14px;border-radius:11px;font-size:11px}.primary-action{min-height:40px;padding-inline:14px;border-radius:11px;font-size:12px}
  .theme-grid{gap:8px;margin:10px 0}.theme-choice{gap:5px;padding:8px;border-radius:13px}.theme-choice strong{font-size:11px}.theme-choice small{font-size:9px}.theme-swatch{height:44px;border-radius:8px}.theme-preview-panel{padding:11px;border-radius:16px}.theme-preview-heading{font-size:11px;margin-bottom:9px}.theme-preview-chat-head{padding:8px 10px}.theme-preview-bubbles{gap:7px;padding:12px;min-height:100px}.theme-preview-bubbles span{padding:7px 10px;font-size:10px}.theme-preview-input{margin:0 8px 8px;padding:8px 10px;font-size:10px}
  .guest-box{gap:8px;margin-top:10px;padding-top:10px}.guest-box input{padding:9px 10px;border-radius:10px;font-size:12px}.guest-btn{padding:10px;border-radius:11px;font-size:11px}.guest-link{font-size:10px;padding:5px}.guest-panel{gap:10px}.guest-panel h2{font-size:19px}.guest-warn{padding:9px 11px;font-size:10px}
  .media-edit{border-radius:13px}.media-cover{height:auto;aspect-ratio:3/1}.media-avatar{width:62px;height:62px;margin:-31px 0 0 12px;border-radius:18px;font-size:23px}.media-btns{gap:6px;padding:9px 11px 11px}.media-btns .ns-btn{font-size:10px;padding:7px 9px}
  .ed-card{width:min(520px,100%);max-height:90dvh;border-radius:16px}.ed-body{gap:9px}.ed-canvas{max-height:36dvh;border-radius:11px}.ed-tabs,.ed-row{gap:6px}.ed-row label{gap:7px;min-width:120px;font-size:10px}.ed-foot{gap:7px}.ed-foot .ns-btn{font-size:10px;padding:7px 10px}
  .lightbox{padding:calc(54px + var(--sat)) 9px calc(12px + var(--sab))}.lightbox-bar{top:calc(9px + var(--sat));right:9px;gap:7px}.lightbox-btn{width:37px;height:37px;border-radius:11px}.lightbox-btn .ico{width:18px;height:18px}
}

/* Role-aware moderation actions inside both member profile surfaces. */
.staff-moderation-controls{border-color:#d5a24a44;background:#d5a24a08}.staff-moderation-controls h3{color:var(--teal2)}.staff-moderation-controls>.ns-btn{margin:4px 5px 0 0;min-height:31px;padding:6px 9px;font-size:10px}.staff-moderation-controls .owner-control-note{margin-bottom:7px}

/* Trusted Main Chat moderation notices (published by Arohi, never user-spoofable). */
.chat-line.moderation-notice-line{align-self:center;width:min(94%,780px);max-width:94%;margin:8px auto 12px;justify-content:center}
.chat-line.moderation-notice-line .chat-message-wrap{width:100%;max-width:100%;display:flex;flex-direction:column;align-items:center}
.chat-line.moderation-notice-line .chat-user{width:100%;text-align:center;color:#e8c9a4;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.chat-line.moderation-notice-line .chat-user small{margin-left:8px;color:#a9aab7;font-weight:500;letter-spacing:0}
.chat-bubble.moderation-notice-bubble{width:100%;box-sizing:border-box;padding:14px 18px;background:linear-gradient(135deg,#2a2028 0%,#211e29 58%,#1b2432 100%);border:1px solid #936b58;border-left:4px solid #d49a68;border-radius:8px 14px 14px 14px;color:#fff0e4;box-shadow:0 8px 24px #0005,inset 0 1px #ffffff12}
.moderation-notice-kicker{display:block;margin-bottom:7px;color:#e5b48c;font-size:9px;font-weight:900;letter-spacing:.16em}
.moderation-notice-text{margin:0;color:#fff0e4;font-size:13px;line-height:1.55;font-weight:650;overflow-wrap:anywhere}
@media(max-width:600px){.chat-line.moderation-notice-line{width:100%;max-width:100%;margin:6px 0 10px}.chat-bubble.moderation-notice-bubble{padding:12px 13px}.moderation-notice-text{font-size:12px}}


/* Owner-only hidden Storage Gallery */
.owner-gallery-overlay{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:calc(12px + var(--sat)) 12px calc(12px + var(--sab));background:#050a14ed;}
.owner-gallery-overlay[hidden]{display:none!important}
.owner-gallery-panel{width:min(100%,980px);height:min(92dvh,900px);display:flex;flex-direction:column;overflow:hidden;border:1px solid #7894c44a;border-radius:22px;background:#0d1729;box-shadow:0 24px 90px #0009;}
.owner-gallery-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:17px 18px;border-bottom:1px solid var(--line);}
.owner-gallery-header h2{margin:3px 0 0;font-size:20px;letter-spacing:-.02em;color:var(--text)}
.owner-gallery-eyebrow{font-size:10px;font-weight:800;letter-spacing:.16em;color:var(--teal)}
.owner-gallery-close{width:40px;height:40px;flex:0 0 40px;border:1px solid #7894c44a;border-radius:13px;background:#16243a;color:var(--text);display:grid;place-items:center}
.owner-gallery-body{padding:18px;overflow:auto;overscroll-behavior:contain;min-height:0;flex:1}
.owner-gallery-gate{width:min(100%,390px);margin:7vh auto 0;padding:24px;border:1px solid #7894c44a;border-radius:18px;background:#111f34}
.owner-gallery-gate h3{margin:0 0 8px;font-size:19px;color:var(--text)}
.owner-gallery-gate p{margin:0 0 17px;color:var(--muted);font-size:13px;line-height:1.55}
.owner-gallery-field{display:block;margin:12px 0;color:#dce7fb;font-size:12px;font-weight:700}
.owner-gallery-field input{display:block;width:100%;margin-top:7px;padding:13px 14px;border:1px solid #7894c455;border-radius:12px;background:#091323;color:#fff;font-family:inherit;font-size:18px;font-weight:600;line-height:1.2;letter-spacing:.28em;outline:none;}
.owner-gallery-field input:focus{border-color:var(--teal)}
.owner-gallery-submit,.owner-gallery-page-btn{border:0;border-radius:12px;background:linear-gradient(135deg,#62d4cd,#86e6dc);color:#08202a;font-weight:800;padding:13px 16px;cursor:pointer}
.owner-gallery-submit{width:100%;margin-top:7px}
.owner-gallery-submit:disabled,.owner-gallery-page-btn:disabled{opacity:.5;cursor:wait}
.owner-gallery-error{min-height:18px;margin-top:10px;color:#ff9c9c;font-size:12px}
.owner-gallery-note{font-size:11px!important;color:#9aacc9!important;margin-top:13px!important}
.owner-gallery-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;color:var(--muted);font-size:12px}
.owner-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px}
.owner-gallery-item{min-width:0;overflow:hidden;border:1px solid #7894c433;border-radius:13px;background:#111f34;padding:0;text-align:left;color:var(--text);cursor:pointer}
.owner-gallery-item img{display:block;width:100%;height:145px;object-fit:cover;background:#08111e}
.owner-gallery-item span{display:block;padding:8px 9px;font-size:10px;color:#b7c7e2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.owner-gallery-pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin:18px 0 4px;color:var(--muted);font-size:12px}
.owner-gallery-page-btn{padding:9px 13px}
.owner-gallery-empty{padding:35px 12px;text-align:center;color:var(--muted);font-size:13px}
.owner-gallery-preview{position:fixed;inset:0;z-index:130;display:grid;place-items:center;padding:calc(64px + var(--sat)) 12px calc(16px + var(--sab));background:#000f}
.owner-gallery-preview img{max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.owner-gallery-preview-close{position:absolute;top:calc(12px + var(--sat));right:12px;width:44px;height:44px;border:1px solid #ffffff3a;border-radius:14px;background:#101a2de6;color:white;display:grid;place-items:center}
@media(max-width:600px){.owner-gallery-panel{height:calc(100dvh - var(--sat) - var(--sab) - 16px);border-radius:18px}.owner-gallery-header{padding:14px}.owner-gallery-body{padding:12px}.owner-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.owner-gallery-item img{height:clamp(120px,36vw,175px)}.owner-gallery-gate{margin:5vh auto 0;padding:19px}}

/* Owner Gallery per-image attribution menu */
.owner-gallery-item{position:relative;display:block;min-width:0;overflow:hidden;border:1px solid #7894c433;border-radius:13px;background:#111f34;padding:0;text-align:left;color:var(--text)}
.owner-gallery-item-preview{display:block;width:100%;border:0;background:transparent;padding:0;cursor:pointer}
.owner-gallery-item-preview img{display:block;width:100%;height:145px;object-fit:cover;background:#08111e}
.owner-gallery-item-more{position:absolute;top:8px;right:8px;z-index:2;width:34px;height:34px;border:1px solid #ffffff55;border-radius:11px;background:#071222df;color:#fff;display:grid;place-items:center;box-shadow:0 3px 12px #0006;cursor:pointer}
.owner-gallery-item-more .ico{width:19px;height:19px}
.owner-gallery-item>span{display:block;padding:8px 9px;font-size:10px;color:#b7c7e2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.owner-gallery-details{position:fixed;inset:0;z-index:140;display:grid;place-items:center;padding:calc(16px + var(--sat)) 14px calc(16px + var(--sab));background:#020713d9}
.owner-gallery-details-panel{width:min(100%,430px);max-height:min(82dvh,680px);overflow:auto;border:1px solid #7894c455;border-radius:19px;background:#101d31;box-shadow:0 24px 80px #000b;padding:17px}
.owner-gallery-details-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.owner-gallery-details-header h3{margin:0;color:var(--text);font-size:17px}
.owner-gallery-details-close{width:36px;height:36px;flex:0 0 36px;border:1px solid #7894c455;border-radius:11px;background:#1a2a42;color:var(--text);display:grid;place-items:center}
.owner-gallery-details-content{display:grid;gap:0}
.owner-gallery-detail-row{display:grid;grid-template-columns:minmax(112px,.8fr) minmax(0,1.2fr);gap:12px;padding:12px 0;border-bottom:1px solid #7894c426}
.owner-gallery-detail-label{font-size:12px;color:#91a5c4}
.owner-gallery-detail-value{min-width:0;overflow-wrap:anywhere;text-align:right;font-size:12px;color:#edf4ff;font-weight:700}
.owner-gallery-details-note{margin:14px 0 0;color:#91a5c4;font-size:11px;line-height:1.5}
@media(max-width:600px){.owner-gallery-item-preview img{height:clamp(120px,36vw,175px)}}


/* Copy/selection deterrents: editable controls remain usable. */
html,body,body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,select,[contenteditable="true"],[data-copy-allowed]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
img,svg{-webkit-user-drag:none;user-drag:none}
.owner-gallery-clear-actions{display:flex;flex-wrap:wrap;gap:9px;margin:0 0 16px}
.owner-gallery-clear-btn{min-height:40px;padding:9px 13px;border:1px solid #ef777766;border-radius:11px;background:#4b1c2b;color:#ffe6ec;font-size:12px;font-weight:800;cursor:pointer}
.owner-gallery-clear-btn:active{transform:scale(.98)}
.owner-gallery-confirm-overlay{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:calc(16px + var(--sat)) 14px calc(16px + var(--sab));background:#020713e8}
.owner-gallery-confirm-panel{width:min(100%,430px);padding:20px;border:1px solid #ef777766;border-radius:18px;background:#101d31;box-shadow:0 24px 80px #000c}
.owner-gallery-confirm-panel h3{margin:0 0 10px;color:#fff;font-size:18px}
.owner-gallery-confirm-panel>p{margin:0 0 16px;color:#c1cde0;font-size:13px;line-height:1.55}
.owner-gallery-confirm-label{display:grid;gap:8px;color:#aabbd4;font-size:12px;font-weight:700}
.owner-gallery-confirm-label input{width:100%;min-height:44px;padding:10px 12px;border:1px solid #7894c455;border-radius:10px;background:#091426;color:#fff;font:inherit;user-select:text;-webkit-user-select:text}
.owner-gallery-confirm-buttons{display:flex;justify-content:flex-end;gap:9px;margin-top:17px}
.owner-gallery-confirm-buttons button{min-height:40px;padding:9px 13px;border-radius:10px;font-size:12px;font-weight:800}
.owner-gallery-confirm-cancel{border:1px solid #7894c455;background:#1a2a42;color:#dbe7f8}
.owner-gallery-confirm-delete{border:1px solid #ef777799;background:#76273b;color:#fff}
.owner-gallery-confirm-delete:disabled{opacity:.4;cursor:not-allowed}


/* Main Chat moderation, reply and mention affordances */
.staff-quick-danger[hidden]{display:none!important}
.staff-quick-danger{width:100%;display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid #ff647044;border-radius:13px;background:#ff647012;color:#ff9ba7;text-align:left;cursor:pointer}
.staff-quick-danger .ico{width:18px;height:18px;flex:none}
.staff-quick-danger span{display:grid;gap:3px;min-width:0}
.staff-quick-danger b{font-size:11px}.staff-quick-danger small{font-size:10px;color:#d59aa5}
.chat-message-more{align-self:flex-start;flex:none;width:27px;height:29px;margin-top:15px;border:1px solid #ffffff16;border-radius:9px;background:#ffffff08;color:#9db5d2;font-size:19px;line-height:1;opacity:.65;cursor:pointer}
.chat-line.own .chat-message-more{order:-1}
.chat-message-more:active,.chat-message-more:focus-visible{opacity:1;border-color:var(--teal);color:var(--teal2)}
.chat-message-menu{position:absolute;z-index:25;right:0;top:36px;min-width:154px;padding:5px;border:1px solid var(--line);border-radius:12px;background:#142139;box-shadow:0 12px 30px #0008;display:grid;gap:3px}
.chat-message-menu button{padding:9px 10px;border:0;border-radius:8px;background:transparent;color:var(--text);font:inherit;font-size:11px;text-align:left;cursor:pointer}
.chat-message-menu button:hover{background:#ffffff12}.chat-message-menu button.danger{color:#ff8997}
.chat-message-wrap{position:relative}.chat-line{position:relative}
.chat-mention{display:inline;color:#83e8e2;font-weight:850;text-shadow:0 0 7px #63e8dc99;background:#4bd8d31b;border-radius:4px;padding:0 2px}
.chat-mention-self{color:#fff2a8;background:#ffe27c22;text-shadow:0 0 9px #ffe27ccc;box-shadow:0 0 10px #ffe27c33}
.chat-mentioned-target .chat-bubble{outline:2px solid #ffe27c;box-shadow:0 0 22px #ffe27c66;transition:box-shadow .2s}
.chat-reply-quote{display:grid;gap:2px;margin:0 0 7px;padding:6px 9px;border-left:3px solid #74dcd2;border-radius:5px;background:#ffffff0a;max-width:100%}
.chat-reply-quote b{font-size:10px;color:#91e6de}.chat-reply-quote span{font-size:10px;color:#aebed3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.chat-replying{position:absolute;left:12px;right:12px;bottom:calc(100% + 7px);z-index:18;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 11px;border:1px solid #5bcac355;border-left:3px solid #69d8cf;border-radius:11px;background:#142139;box-shadow:0 8px 24px #0006}
.chat-replying[hidden],.chat-mention-suggestions[hidden]{display:none}
.chat-replying span{display:grid;gap:2px;min-width:0}.chat-replying small{font-size:9px;color:#78dcd4}.chat-replying b{font-size:10px;color:#e6f5ff}.chat-replying em{font-size:10px;color:#9eb1c9;font-style:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:min(70vw,520px)}
.chat-replying button{width:27px;height:27px;flex:none;border:0;border-radius:8px;background:#ffffff10;color:#c8d6e8;font-size:19px}
.chat-mention-suggestions{position:absolute;left:12px;right:12px;bottom:calc(100% + 7px);z-index:22;max-height:min(260px,40dvh);overflow:auto;padding:5px;border:1px solid var(--line);border-radius:14px;background:#142139;box-shadow:0 14px 35px #0009;display:grid;gap:3px}
.chat-composer.has-reply .chat-mention-suggestions{bottom:calc(100% + 53px)}
.chat-mention-option{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;border:0;border-radius:9px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.chat-mention-option:hover,.chat-mention-option:focus{background:#ffffff12}.chat-mention-option b{font-size:11px;color:#8ce7df}.chat-mention-option small{font-size:10px;color:var(--muted)}
@media(max-width:600px){.chat-message-more{width:24px;height:26px;margin-top:13px}.chat-message-menu{top:31px}.chat-mention-option{padding:11px}}

/* Device-local notification sound preferences */
.ns-sound-settings{display:grid;gap:9px;padding:13px;margin:0 0 12px;border:1px solid var(--line,rgba(120,148,196,.18));border-radius:14px;background:rgba(103,213,208,.045)}
.ns-sound-settings>strong{font-size:14px}.ns-sound-settings>small{font-size:11px;opacity:.7;margin-top:-6px}
.ns-sound-toggle,.ns-sound-volume{display:flex;align-items:center;gap:9px;font-size:13px;cursor:pointer}
.ns-sound-toggle input{accent-color:var(--teal,#67d5d0)}
.ns-sound-volume{justify-content:space-between}.ns-sound-volume input{width:55%;accent-color:var(--teal,#67d5d0)}
.ns-sound-tests{display:flex;gap:6px;flex-wrap:wrap}.ns-sound-tests .ns-btn{font-size:11px;padding:7px 9px}

/* Light and mixed palettes: keep room cards, headings and supporting copy readable. */
.room-option{color:var(--text)}
.option-copy strong{color:var(--text)}
.option-copy small{color:var(--muted)}
:root[data-theme] .room-option,
:root[data-theme] .room-option,
:root[data-theme] .room-option,
:root[data-theme] .room-option,
:root[data-theme] .room-option,
:root[data-theme] .room-option,
:root[data-theme] .room-option{
  background:linear-gradient(145deg,var(--panel),color-mix(in srgb,var(--bg) 72%,var(--panel)));
  border-color:var(--line);
  box-shadow:0 12px 28px #26364a18;
}
:root[data-theme] .room-option:before,
:root[data-theme] .room-option:before,
:root[data-theme] .room-option:before,
:root[data-theme] .room-option:before,
:root[data-theme] .room-option:before,
:root[data-theme] .room-option:before,
:root[data-theme] .room-option:before{background:radial-gradient(circle,color-mix(in srgb,var(--teal) 13%,transparent),transparent 70%)}
:root[data-theme] .option-icon,
:root[data-theme] .option-icon,
:root[data-theme] .option-icon,
:root[data-theme] .option-icon,
:root[data-theme] .option-icon,
:root[data-theme] .option-icon,
:root[data-theme] .option-icon{background:color-mix(in srgb,var(--teal) 16%,var(--panel));color:var(--teal2)}
:root[data-theme] .game-icon,
:root[data-theme] .game-icon,
:root[data-theme] .game-icon,
:root[data-theme] .game-icon,
:root[data-theme] .game-icon,
:root[data-theme] .game-icon,
:root[data-theme] .game-icon{background:color-mix(in srgb,#9474c8 15%,var(--panel));color:#7253a5}
:root[data-theme] .option-arrow,
:root[data-theme] .option-arrow,
:root[data-theme] .option-arrow,
:root[data-theme] .option-arrow,
:root[data-theme] .option-arrow,
:root[data-theme] .option-arrow,
:root[data-theme] .option-arrow{background:color-mix(in srgb,var(--teal) 12%,var(--panel));color:var(--teal2)}
.swatch-pearl{background:linear-gradient(135deg,#fffefa 0 55%,#987b55 55%)}
.swatch-sakura{background:linear-gradient(135deg,#fffafd 0 55%,#c05c83 55%)}
.swatch-mint{background:linear-gradient(135deg,#fbfffc 0 55%,#258765 55%)}
.swatch-sky{background:linear-gradient(135deg,#fbfdff 0 55%,#347eae 55%)}
.swatch-sand{background:linear-gradient(135deg,#fffdf7 0 55%,#9b7940 55%)}
.swatch-lilac{background:linear-gradient(135deg,#fdfbff 0 55%,#8067b5 55%)}

/* App-wide theme coverage: every shell, navigation surface, chat and dialog follows the active palette. */
:root[data-theme],:root[data-theme],:root[data-theme],:root[data-theme],:root[data-theme],:root[data-theme],:root[data-theme]{
  --surface-strong:color-mix(in srgb,var(--panel) 88%,var(--bg));
  --surface-soft:color-mix(in srgb,var(--panel) 94%,var(--bg));
  --surface-raised:color-mix(in srgb,var(--panel) 82%,var(--teal) 4%);
  --surface-own:color-mix(in srgb,var(--teal) 13%,var(--panel));
  --surface-border:color-mix(in srgb,var(--line) 78%,var(--text) 8%);
}
:root[data-theme] .topbar,:root[data-theme] .topbar,:root[data-theme] .topbar,:root[data-theme] .topbar,:root[data-theme] .topbar,:root[data-theme] .topbar,:root[data-theme] .topbar{background:color-mix(in srgb,var(--panel) 90%,transparent);border-color:var(--line)}
:root[data-theme] .icon-btn,:root[data-theme] .icon-btn,:root[data-theme] .icon-btn,:root[data-theme] .icon-btn,:root[data-theme] .icon-btn,:root[data-theme] .icon-btn,:root[data-theme] .icon-btn{background:var(--surface-strong);border:1px solid var(--line);color:var(--text);box-shadow:0 3px 12px #26384a12}
:root[data-theme] .dock,:root[data-theme] .dock,:root[data-theme] .dock,:root[data-theme] .dock,:root[data-theme] .dock,:root[data-theme] .dock,:root[data-theme] .dock{background:color-mix(in srgb,var(--panel) 94%,transparent);border-color:var(--line);box-shadow:0 10px 28px #26384a22}
:root[data-theme] .dock-pill,:root[data-theme] .dock-pill,:root[data-theme] .dock-pill,:root[data-theme] .dock-pill,:root[data-theme] .dock-pill,:root[data-theme] .dock-pill,:root[data-theme] .dock-pill{background:color-mix(in srgb,var(--teal) 16%,var(--panel));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--teal) 32%,transparent),0 2px 10px #26384a12}
:root[data-theme] .dock-btn,:root[data-theme] .dock-btn,:root[data-theme] .dock-btn,:root[data-theme] .dock-btn,:root[data-theme] .dock-btn,:root[data-theme] .dock-btn,:root[data-theme] .dock-btn{color:var(--muted)}
:root[data-theme] .dock-btn[aria-current],:root[data-theme] .dock-btn[aria-current],:root[data-theme] .dock-btn[aria-current],:root[data-theme] .dock-btn[aria-current],:root[data-theme] .dock-btn[aria-current],:root[data-theme] .dock-btn[aria-current],:root[data-theme] .dock-btn[aria-current]{color:var(--teal2)}
:root[data-theme] .chat-room,:root[data-theme] .chat-room,:root[data-theme] .chat-room,:root[data-theme] .chat-room,:root[data-theme] .chat-room,:root[data-theme] .chat-room,:root[data-theme] .chat-room{background:var(--bg)}
:root[data-theme] .chat-head,:root[data-theme] .chat-head,:root[data-theme] .chat-head,:root[data-theme] .chat-head,:root[data-theme] .chat-head,:root[data-theme] .chat-head,:root[data-theme] .chat-head{background:var(--panel);border-color:var(--line);color:var(--text)}
:root[data-theme] .hbtn,:root[data-theme] .hbtn,:root[data-theme] .hbtn,:root[data-theme] .hbtn,:root[data-theme] .hbtn,:root[data-theme] .hbtn,:root[data-theme] .hbtn{background:var(--surface-strong);border:1px solid var(--line);color:var(--text)}
:root[data-theme] .profile-btn,:root[data-theme] .profile-btn,:root[data-theme] .profile-btn,:root[data-theme] .profile-btn,:root[data-theme] .profile-btn,:root[data-theme] .profile-btn,:root[data-theme] .profile-btn{background:color-mix(in srgb,var(--teal) 18%,var(--panel));color:var(--teal2);border-color:var(--line)}
:root[data-theme] .room-meta small,:root[data-theme] .room-meta small,:root[data-theme] .room-meta small,:root[data-theme] .room-meta small,:root[data-theme] .room-meta small,:root[data-theme] .room-meta small,:root[data-theme] .room-meta small{color:var(--muted)}
:root[data-theme] .chat-user,:root[data-theme] .chat-user,:root[data-theme] .chat-user,:root[data-theme] .chat-user,:root[data-theme] .chat-user,:root[data-theme] .chat-user,:root[data-theme] .chat-user{color:var(--text)}
:root[data-theme] .chat-user small,:root[data-theme] .chat-user small,:root[data-theme] .chat-user small,:root[data-theme] .chat-user small,:root[data-theme] .chat-user small,:root[data-theme] .chat-user small,:root[data-theme] .chat-user small{color:var(--muted)}
:root[data-theme] .chat-bubble,:root[data-theme] .chat-bubble,:root[data-theme] .chat-bubble,:root[data-theme] .chat-bubble,:root[data-theme] .chat-bubble,:root[data-theme] .chat-bubble,:root[data-theme] .chat-bubble{background:var(--panel);border-color:var(--line);color:var(--text);box-shadow:0 2px 8px #26384a0a}
:root[data-theme] .chat-line.own .chat-bubble,:root[data-theme] .chat-line.own .chat-bubble,:root[data-theme] .chat-line.own .chat-bubble,:root[data-theme] .chat-line.own .chat-bubble,:root[data-theme] .chat-line.own .chat-bubble,:root[data-theme] .chat-line.own .chat-bubble,:root[data-theme] .chat-line.own .chat-bubble{background:var(--surface-own);border-color:color-mix(in srgb,var(--teal) 38%,var(--line));color:var(--text)}
:root[data-theme] .welcome-system-bubble,:root[data-theme] .welcome-system-bubble,:root[data-theme] .welcome-system-bubble,:root[data-theme] .welcome-system-bubble,:root[data-theme] .welcome-system-bubble,:root[data-theme] .welcome-system-bubble,:root[data-theme] .welcome-system-bubble{background:var(--surface-raised);border-color:var(--line);box-shadow:inset 4px 0 var(--teal)}
:root[data-theme] .welcome-system-bubble strong,:root[data-theme] .welcome-system-bubble strong,:root[data-theme] .welcome-system-bubble strong,:root[data-theme] .welcome-system-bubble strong,:root[data-theme] .welcome-system-bubble strong,:root[data-theme] .welcome-system-bubble strong,:root[data-theme] .welcome-system-bubble strong{color:var(--text)}
:root[data-theme] .welcome-system-bubble p,:root[data-theme] .welcome-system-bubble p,:root[data-theme] .welcome-system-bubble p,:root[data-theme] .welcome-system-bubble p,:root[data-theme] .welcome-system-bubble p,:root[data-theme] .welcome-system-bubble p,:root[data-theme] .welcome-system-bubble p{color:var(--muted)}
:root[data-theme] .chat-composer,:root[data-theme] .chat-composer,:root[data-theme] .chat-composer,:root[data-theme] .chat-composer,:root[data-theme] .chat-composer,:root[data-theme] .chat-composer,:root[data-theme] .chat-composer{background:var(--panel);border-color:var(--line)}
:root[data-theme] .chat-add,:root[data-theme] .chat-add,:root[data-theme] .chat-add,:root[data-theme] .chat-add,:root[data-theme] .chat-add,:root[data-theme] .chat-add,:root[data-theme] .chat-add{background:color-mix(in srgb,var(--teal) 16%,var(--panel));color:var(--teal2)}
:root[data-theme] .chat-input,:root[data-theme] .chat-input,:root[data-theme] .chat-input,:root[data-theme] .chat-input,:root[data-theme] .chat-input,:root[data-theme] .chat-input,:root[data-theme] .chat-input{background:var(--bg);border-color:var(--line);color:var(--text)}
:root[data-theme] .chat-input::placeholder,:root[data-theme] .chat-input::placeholder,:root[data-theme] .chat-input::placeholder,:root[data-theme] .chat-input::placeholder,:root[data-theme] .chat-input::placeholder,:root[data-theme] .chat-input::placeholder,:root[data-theme] .chat-input::placeholder{color:var(--muted)}
:root[data-theme] .dm-popup,:root[data-theme] .dm-popup,:root[data-theme] .dm-popup,:root[data-theme] .dm-popup,:root[data-theme] .dm-popup,:root[data-theme] .dm-popup,:root[data-theme] .dm-popup,:root[data-theme] .dm-thread,:root[data-theme] .dm-thread,:root[data-theme] .dm-thread,:root[data-theme] .dm-thread,:root[data-theme] .dm-thread,:root[data-theme] .dm-thread,:root[data-theme] .dm-thread{background:var(--panel);border-color:var(--line);color:var(--text)}
:root[data-theme] .dm-popup-head,:root[data-theme] .dm-popup-head,:root[data-theme] .dm-popup-head,:root[data-theme] .dm-popup-head,:root[data-theme] .dm-popup-head,:root[data-theme] .dm-popup-head,:root[data-theme] .dm-popup-head,:root[data-theme] .dm-thread-head,:root[data-theme] .dm-thread-head,:root[data-theme] .dm-thread-head,:root[data-theme] .dm-thread-head,:root[data-theme] .dm-thread-head,:root[data-theme] .dm-thread-head,:root[data-theme] .dm-thread-head{border-color:var(--line)}
:root[data-theme] .dm-close,:root[data-theme] .dm-close,:root[data-theme] .dm-close,:root[data-theme] .dm-close,:root[data-theme] .dm-close,:root[data-theme] .dm-close,:root[data-theme] .dm-close{background:var(--surface-strong);border-color:var(--line);color:var(--text)}
:root[data-theme] .dm-conversation:hover,:root[data-theme] .dm-conversation:hover,:root[data-theme] .dm-conversation:hover,:root[data-theme] .dm-conversation:hover,:root[data-theme] .dm-conversation:hover,:root[data-theme] .dm-conversation:hover,:root[data-theme] .dm-conversation:hover{background:var(--surface-strong)}
:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-top small,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-conversation-preview,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-person small,:root[data-theme] .dm-thread-time,:root[data-theme] .dm-thread-time,:root[data-theme] .dm-thread-time,:root[data-theme] .dm-thread-time,:root[data-theme] .dm-thread-time,:root[data-theme] .dm-thread-time,:root[data-theme] .dm-thread-time{color:var(--muted)}
:root[data-theme] .dm-thread-bubble,:root[data-theme] .dm-thread-bubble,:root[data-theme] .dm-thread-bubble,:root[data-theme] .dm-thread-bubble,:root[data-theme] .dm-thread-bubble,:root[data-theme] .dm-thread-bubble,:root[data-theme] .dm-thread-bubble{background:var(--surface-strong);border-color:var(--line);color:var(--text)}
:root[data-theme] .dm-thread-line.own .dm-thread-bubble,:root[data-theme] .dm-thread-line.own .dm-thread-bubble,:root[data-theme] .dm-thread-line.own .dm-thread-bubble,:root[data-theme] .dm-thread-line.own .dm-thread-bubble,:root[data-theme] .dm-thread-line.own .dm-thread-bubble,:root[data-theme] .dm-thread-line.own .dm-thread-bubble,:root[data-theme] .dm-thread-line.own .dm-thread-bubble{background:var(--surface-own);border-color:color-mix(in srgb,var(--teal) 38%,var(--line));color:var(--text)}
:root[data-theme] .dm-thread-composer,:root[data-theme] .dm-thread-composer,:root[data-theme] .dm-thread-composer,:root[data-theme] .dm-thread-composer,:root[data-theme] .dm-thread-composer,:root[data-theme] .dm-thread-composer,:root[data-theme] .dm-thread-composer{background:var(--panel);border-color:var(--line)}
:root[data-theme] .dm-thread-composer input,:root[data-theme] .dm-thread-composer input,:root[data-theme] .dm-thread-composer input,:root[data-theme] .dm-thread-composer input,:root[data-theme] .dm-thread-composer input,:root[data-theme] .dm-thread-composer input,:root[data-theme] .dm-thread-composer input{background:var(--bg);border-color:var(--line);color:var(--text)}
:root[data-theme] .people-tabs,:root[data-theme] .people-tabs,:root[data-theme] .people-tabs,:root[data-theme] .people-tabs,:root[data-theme] .people-tabs,:root[data-theme] .people-tabs,:root[data-theme] .people-tabs,:root[data-theme] .people-search input,:root[data-theme] .people-search input,:root[data-theme] .people-search input,:root[data-theme] .people-search input,:root[data-theme] .people-search input,:root[data-theme] .people-search input,:root[data-theme] .people-search input,:root[data-theme] .staff-search,:root[data-theme] .staff-search,:root[data-theme] .staff-search,:root[data-theme] .staff-search,:root[data-theme] .staff-search,:root[data-theme] .staff-search,:root[data-theme] .staff-search{background:var(--surface-strong);color:var(--text);border-color:var(--line)}
:root[data-theme] .people-tab,:root[data-theme] .people-tab,:root[data-theme] .people-tab,:root[data-theme] .people-tab,:root[data-theme] .people-tab,:root[data-theme] .people-tab,:root[data-theme] .people-tab{color:var(--muted)}
:root[data-theme] .people-tab[aria-selected=true],:root[data-theme] .people-tab[aria-selected=true],:root[data-theme] .people-tab[aria-selected=true],:root[data-theme] .people-tab[aria-selected=true],:root[data-theme] .people-tab[aria-selected=true],:root[data-theme] .people-tab[aria-selected=true]{background:var(--surface-own);color:var(--teal2);box-shadow:inset 0 0 0 1px var(--line)}
:root[data-theme] .staff-welcome,:root[data-theme] .staff-welcome,:root[data-theme] .staff-welcome,:root[data-theme] .staff-welcome,:root[data-theme] .staff-welcome,:root[data-theme] .staff-welcome,:root[data-theme] .staff-welcome{background:var(--surface-raised);border-color:var(--line)}
:root[data-theme] .staff-welcome p,:root[data-theme] .staff-welcome p,:root[data-theme] .staff-welcome p,:root[data-theme] .staff-welcome p,:root[data-theme] .staff-welcome p,:root[data-theme] .staff-welcome p,:root[data-theme] .staff-welcome p{color:var(--muted)}
:root[data-theme] .staff-stat,:root[data-theme] .staff-stat,:root[data-theme] .staff-stat,:root[data-theme] .staff-stat,:root[data-theme] .staff-stat,:root[data-theme] .staff-stat,:root[data-theme] .staff-stat,:root[data-theme] .staff-action-card,:root[data-theme] .staff-action-card,:root[data-theme] .staff-action-card,:root[data-theme] .staff-action-card,:root[data-theme] .staff-action-card,:root[data-theme] .staff-action-card,:root[data-theme] .staff-action-card,:root[data-theme] .staff-list-row,:root[data-theme] .staff-list-row,:root[data-theme] .staff-list-row,:root[data-theme] .staff-list-row,:root[data-theme] .staff-list-row,:root[data-theme] .staff-list-row,:root[data-theme] .staff-list-row,:root[data-theme] .staff-report-card,:root[data-theme] .staff-report-card,:root[data-theme] .staff-report-card,:root[data-theme] .staff-report-card,:root[data-theme] .staff-report-card,:root[data-theme] .staff-report-card,:root[data-theme] .staff-report-card{background:var(--surface-soft);border-color:var(--line)}
:root[data-theme] .staff-list-meta,:root[data-theme] .staff-list-meta,:root[data-theme] .staff-list-meta,:root[data-theme] .staff-list-meta,:root[data-theme] .staff-list-meta,:root[data-theme] .staff-list-meta,:root[data-theme] .staff-list-meta,:root[data-theme] .staff-status,:root[data-theme] .staff-status,:root[data-theme] .staff-status,:root[data-theme] .staff-status,:root[data-theme] .staff-status,:root[data-theme] .staff-status,:root[data-theme] .staff-status{background:var(--surface-strong)}
:root[data-theme] .side-card h3,:root[data-theme] .side-card h3,:root[data-theme] .side-card h3,:root[data-theme] .side-card h3,:root[data-theme] .side-card h3,:root[data-theme] .side-card h3,:root[data-theme] .side-card h3,:root[data-theme] .trend strong,:root[data-theme] .trend strong,:root[data-theme] .trend strong,:root[data-theme] .trend strong,:root[data-theme] .trend strong,:root[data-theme] .trend strong,:root[data-theme] .trend strong,:root[data-theme] .online span,:root[data-theme] .online span,:root[data-theme] .online span,:root[data-theme] .online span,:root[data-theme] .online span,:root[data-theme] .online span,:root[data-theme] .online span{color:var(--text)}
:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-panel,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-gate,:root[data-theme] .owner-gallery-item,:root[data-theme] .owner-gallery-item,:root[data-theme] .owner-gallery-item,:root[data-theme] .owner-gallery-item,:root[data-theme] .owner-gallery-item,:root[data-theme] .owner-gallery-item,:root[data-theme] .owner-gallery-item{background:var(--panel);border-color:var(--line);color:var(--text)}
