/* v13.7 adaptive room layout: fills the window, scales evenly, no clipping/horizontal scroll */
html,body{min-width:600px!important}
@media (min-width:601px){
 html:has(#chat[style*="flex"]),html:has(#chat[style*="flex"]) body{height:100%;overflow:hidden}
 html:has(#chat[style*="flex"]) #yfoot,html:has(#chat[style*="flex"]) #foot{display:none!important}
 #chat[style*="flex"]{position:fixed!important;inset:0!important;width:auto!important;max-width:none!important;height:auto!important;margin:0!important;transform:none!important;flex-direction:column;min-width:0}
 #chat #main{flex:1 1 auto;min-height:0;height:auto!important}
 #chat #lpane{min-height:0}
 #chat #log{flex:1 1 auto;height:auto!important;min-height:60px}
 #chat #mpane{width:clamp(150px,22vw,280px)!important;min-width:0!important;min-height:0;overflow:hidden}
 #chat #mem{flex:1;min-height:0;overflow:auto}
 #chat #rhead{padding:clamp(6px,1.4vh,12px) clamp(8px,1.6vw,16px)!important;gap:clamp(6px,1.2vw,14px)!important}
 #chat #rtile{transform:scale(clamp(.7,calc(100vh/900px),1))}
 #chat #rhead .rn{font-size:clamp(15px,2vw,20px)!important}
 #chat #vrow{padding:clamp(4px,1vh,10px) clamp(8px,1.4vw,16px)!important;gap:clamp(4px,1vw,14px)!important;min-width:0;overflow:hidden}
 #chat #form{padding:clamp(4px,1vh,8px) clamp(6px,1.4vw,12px)!important}
 #chat #msg{min-height:clamp(36px,6vh,52px)!important;height:clamp(36px,6vh,52px)!important;padding:clamp(6px,1.2vh,12px) 12px!important}
 #chat .adph{flex:none;max-height:clamp(30px,8vh,90px);overflow:hidden}
}
@media (min-width:601px) and (max-height:640px){#chat #vrow{padding-top:3px!important;padding-bottom:3px!important}#chat .adph{max-height:40px}}
/* People list collapses into a toggle on narrow windows */
#bPpl{display:none}
@media (max-width:700px) and (min-width:601px){
 #bPpl{display:inline-flex}
 #chat #mpane{position:absolute;right:0;top:0;bottom:0;width:min(240px,60vw)!important;z-index:30;background:var(--card,#fff);box-shadow:-4px 0 14px rgba(0,0,0,.18);display:none!important}
 #chat #main{position:relative}
 #chat.pplon #mpane{display:flex!important}
 #rhead .hb span{display:none}
}
/* pop-overs always stay inside the window */
#smp.open,#sty.open,.ygifpop{max-width:calc(100vw - 8px);max-height:calc(100vh - 8px);overflow:auto;box-sizing:border-box}
@media (min-width:601px){#chat #vright{flex:0 1 auto!important;min-width:0;display:flex;align-items:center}
 #chat #phead{font-size:clamp(12px,1.3vw,15px)!important;gap:4px;overflow:hidden}#chat #phead #bPs{flex:none}
 #chat #mbtns{display:flex;gap:4px}#chat #mbtns button{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:clamp(11px,1.2vw,13px)!important;padding-left:4px!important;padding-right:4px!important}}
@media (min-width:601px) and (max-width:960px){#chat #fsz{display:none!important}}
@media (min-width:601px) and (max-width:720px){#chat #vol{width:48px!important;min-width:48px}#chat #micn{display:none}}
html.ydpop,html.ydpop body{min-width:0!important}
/* v13.8: never hide voice-bar essentials; compact instead */
@media (min-width:601px){
 #chat #vrow .meter{display:block!important;flex:0 1 110px!important;min-width:34px!important}
 #chat #mlv{display:inline-flex!important;align-items:center;flex:none;white-space:nowrap}
 #chat #vright{flex:none!important}
 #chat #vol{width:clamp(44px,6vw,90px)!important;min-width:44px;flex:none}
 #chat #volI,#chat #bMute,#chat #talk,#chat #hand,#chat #avb{flex:none}
 #chat #vstat{min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media (min-width:601px) and (max-width:1100px){#chat #avb span,#chat #mlv .mlb{display:none}#chat #talk{padding-left:12px!important;padding-right:12px!important}}
@media (min-width:601px) and (max-width:860px){#chat #vrow label{font-size:0}#chat #vrow label input{margin:0}#chat #hf{transform:scale(1.1)}#chat #vrow .meter{flex-basis:60px!important}#chat #vstat{display:none}#chat #talk{padding:6px 10px!important}}
@media (min-width:601px) and (max-width:720px){#chat #vrow{gap:4px!important;padding-left:6px!important;padding-right:6px!important}#chat #vol{width:44px!important}#chat #volv{min-width:26px;font-size:10px}#chat #vrow .meter{flex-basis:40px!important}#chat #hand{padding:4px 8px!important;font-size:11px}}

/* Razzle Chat browser surfaces */
#brand {
  padding: clamp(18px, 4vh, 36px) 16px 6px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.room-brand-heading { display: flex; align-items: center; gap: 10px; }
.room-brand-heading h1 { margin: 0; color: #12345a; font: 750 clamp(26px, 5vw, 40px)/1.1 var(--sys); }
#brand .tag { margin-top: 8px; font-size: 14px; line-height: 1.5; }
#login.win { width: min(640px, calc(100% - 28px)); max-width: none; }
#chat > .tbar {
  background: linear-gradient(115deg, #004990, #002b65) !important;
  padding: 8px 12px;
  color: #fff !important;
}
#chat > .tbar .lgs {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: #fff;
  border-radius: 8px;
}
#chat > .tbar .lgs img { display: block; width: 26px; height: 26px; }
#chat > .tbar #hdr {
  min-width: 0;
  overflow: hidden;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  text-shadow: none;
  white-space: nowrap;
}
#chat > .tbar .wb { color: #fff !important; flex-shrink: 0; }
#login .in { padding: clamp(14px, 4vw, 24px) !important; }
#login #who { margin-bottom: 10px; line-height: 1.5; }
.room-chooser-title { margin: 18px 0 8px; font-size: 16px; line-height: 1.4; }
#login #rlist { border-top: 1px solid var(--line); padding-top: 8px; }
#login #rlist .room { display: inline-block; padding: 0 7px; border-radius: 5px; }
#login #rlist .room.sel { box-shadow: inset 3px 0 #ff9900; }
#chat #log > div { padding-block: 5px; }
#foot { padding: 8px 12px 54px; font-size: 12px; }

#login.win {
  background: var(--card, #fff);
  border: 1px solid #c6d8e9;
  border-radius: 14px;
  box-shadow: 0 10px 28px #173b601c;
}
#room-entry-title { margin: 0 0 6px; color: var(--ink); font: 700 21px/1.3 var(--sys); }
#login #who p { margin: 0; }
.room-entry-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
#login #nmw {
  display: grid;
  flex: 0 1 210px;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  font-weight: 650;
}
#login #nm {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
}
#login #go, #login #mk {
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 40px;
  margin: 0;
  border-radius: 7px;
}
#login :is(input, button, a):focus-visible {
  outline: 2px solid #397cba;
  outline-offset: 2px;
}
#login #go { background: #004990 !important; color: #fff !important; }
#login #mk { background: #edf4fb !important; color: #12345a !important; }
#login #incl { align-self: center; }
#foot a { color: inherit; text-decoration: underline; }

#login #mk:disabled { background: #edf0f3 !important; color: #667584 !important; border-color: #d4dde5 !important; cursor: not-allowed; }
#bFol[hidden] { display: none !important; }
.room-directory-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.room-directory-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
#login .room-directory-tabs button { padding: 6px 10px; border-radius: 6px; }
#login .room-directory-tabs button[aria-pressed="true"] { background: #004990 !important; color: #fff !important; }
.room-directory-toolbar .yonline { color: var(--muted); font-size: 12px; }
.room-list-note { margin: 10px 0 4px; }

#login #rlist > details { margin-block: 6px; }
#login #rlist summary {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
}
#login #rlist details[open] > summary { margin-bottom: 6px; }
@media (max-width: 480px) {
  #login #nmw { flex-basis: min(100%, 210px); }
  #login .room-entry-actions { gap: 8px; }
}

/* Shared Social and Chat sidebar. */
.site-sidebar {
  align-self: stretch;
  padding: 20px 14px;
  background: radial-gradient(ellipse at 50% 48%, #004990 0%, #003b7c 48%, #002658 100%);
  color: #e7f2ff;
  border-radius: 0;
  font: 13px 'Segoe UI', sans-serif;
}
.site-sidebar .menu { display: grid; gap: 6px; }
.site-sidebar .menu > :is(a, button) {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  color: #e0effd;
  font-size: 18px;
  line-height: normal;
  border-radius: 1px;
  text-align: left;
  text-decoration: none;
}
.site-sidebar .menu > :is(a, button) > span:last-of-type { flex: 1; font-size: 14px; }
.site-sidebar .menu i { font-size: 10px; font-style: normal; }
.site-sidebar .topic-list { margin-top: 29px; padding-top: 23px; border-top: 1px solid #2465a1; }
.site-sidebar .topic-list .label { margin: 11px 0 20px; color: #a4c9ec; font-size: 11px; font-weight: 650; letter-spacing: 1.7px; }
.site-sidebar .featured-room {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 3px;
  color: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}
.site-sidebar .featured-room small { display: block; margin-top: 5px; color: #b1d1ed; font-size: 11px; }
.site-sidebar .featured-room .topic {
  display: grid;
  place-items: center;
  flex: 0 0 29px;
  height: 30px;
  border-radius: 1px;
  font-size: 11px;
  font-weight: 650;
}
.site-sidebar .topic-list .t1 { background: #4d90cd; color: #fff; }
.site-sidebar .topic-list .t2 { background: #0a64b0; color: #fff; }
.site-sidebar .topic-list .t3 { background: #ff9900; color: #003876; }
.site-sidebar .featured-room:hover { background: #ffffff14; }
.site-sidebar :is(.menu .selected, .menu [aria-current="page"], .featured-room[aria-current="page"]) {
  background: #07599a;
  color: #fff;
  box-shadow: inset 3px 0 #ff9900;
  font-weight: 650;
}
.site-sidebar footer { margin: 35px 5px; color: #a3afbe; font-size: 8px; line-height: 2; }
.site-sidebar footer a { color: inherit; }
/* Razzle Social shell for the room entry screen */
#social-chat-header, #social-chat-layout { box-sizing: border-box; }
#social-chat-header[hidden], #social-chat-layout[hidden] { display: none !important; }
#social-chat-header {
 display: flex; align-items: center; gap: 20px; height: 80px; padding: 0 3%;
 background: #fff; border-bottom: 1px solid #dce6ef; font: 650 14px 'Segoe UI', sans-serif;
}
#social-chat-header a { color: #003876; text-decoration: none; }
.social-chat-brand { display: flex; align-items: center; gap: 8px; font-size: 32px; font-weight: 800; letter-spacing: -1px; white-space: nowrap; }
.social-chat-brand span { color: #ff9900; margin-left: -8px; }
.social-chat-search {
 display: flex; align-items: center; gap: 8px; width: min(100%, 435px); margin-left: auto;
 padding: 4px 10px; border: 1px solid #dce6ef; border-radius: 6px; background: #f4f8fc;
}
.social-chat-search input { width: 100%; min-width: 0; background: transparent; border: 0; color: #173b60; font: inherit; padding: 6px 0; }
.social-chat-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 18px 18px 0 0; min-height: calc(100dvh - 80px); background: #fff; }
.social-chat-main { min-width: 0; }
.social-chat-main #brand { align-items: flex-start; padding: 10px 0; text-align: left; }
.social-chat-main #brand .tag { margin: 0; }
.social-chat-main #login.win { box-sizing: border-box; width: 100%; margin: 8px 0 20px !important; }
@media (max-width: 799px) {
 #social-chat-header { height: auto; min-height: 66px; flex-wrap: wrap; gap: 8px 14px; padding: 8px 14px; }
 .social-chat-brand { font-size: 24px; }
 .social-chat-brand img { width: 46px; height: 42px; }
 .social-chat-search { order: 3; width: 100%; margin: 0; }
 #social-chat-header > a:last-child { margin-left: auto; }
 .social-chat-layout { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 0; gap: 12px; }
 .social-chat-layout .topic-list { display: none; }
}

.room-brand-heading h1 { font-family: 'Segoe UI', system-ui, sans-serif; font-weight: 800; letter-spacing: -.045em; }
#login .live-room-card { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
#login #rlist .live-room-card .room {
 display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px;
 flex: 1; min-width: 0; padding: 8px 10px !important; margin: 0 !important;
 border: 1px solid var(--line) !important; border-radius: 8px;
 background: var(--card) !important; color: var(--ink) !important; text-align: left; line-height: 1.4;
}
#login #rlist .live-room-card .room.sel { background: var(--soft) !important; color: var(--ink) !important; }
.live-room-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--soft); }
.live-room-copy { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.live-room-copy strong { font-size: 14px; }
.live-room-topic, .live-room-count { font-size: 12px; color: var(--muted); }
.live-room-count { text-align: right; }
@media (max-width: 480px) {
 #login #rlist .live-room-card .room { grid-template-columns: 36px minmax(0, 1fr); gap: 3px 9px; }
 .live-room-count { grid-column: 2; text-align: left; }
}

/* Keep the directory shell in place when a desktop browser enters a room. */
body.chat-room-active #social-chat-header,
body.chat-room-active #social-chat-layout { display: none; }
@media (min-width: 1100px) {
 html:not(.ydpop) body.chat-room-active #social-chat-header { display: flex; }
 html:not(.ydpop) body.chat-room-active #social-chat-layout { display: grid; }
 html:not(.ydpop) body.chat-room-active .social-chat-search { visibility: hidden; }
 html:not(.ydpop) body.chat-room-active #chat[style*="flex"] {
  inset: 98px 18px 12px 260px !important;
 }
}

#login [hidden] { display: none !important; }
#guest-room-selection { margin: 8px 0 0; color: var(--ink); font-weight: 650; line-height: 1.5; }
#login #rlist .guest-room-join {
 flex: 0 0 auto;
 min-height: 36px;
 padding: 6px 10px;
 border-radius: 7px;
 background: #004990 !important;
 color: #fff !important;
 white-space: nowrap;
}
@media (max-width: 580px) {
 #login .live-room-card:has(.guest-room-join:not([hidden])) { flex-wrap: wrap; }
 #login #rlist .live-room-card:has(.guest-room-join:not([hidden])) .room { flex-basis: 100%; }
}

#login #nm {
 min-height: 44px;
 border: 2px solid #5d8fbc !important;
 background: var(--card, #fff) !important;
}
#login #nm::placeholder { color: var(--muted, #476986); opacity: 1; }
#login #nm:focus { border-color: #004990 !important; box-shadow: 0 0 0 3px #4d90cd40; }
#login #rlist .guest-room-join {
 min-height: 40px; padding: 7px 12px;
 background: #ffbc76 !important; color: #12345a !important; font-weight: 750 !important;
}
#login #rlist .guest-room-join span { margin-left: 4px; }
#chat > .tbar .room-title-action {
 flex: 0 0 auto; padding: 5px 8px !important; border-radius: 5px;
 background: transparent !important; color: #fff !important; border: 1px solid #ffffff65 !important;
 font-size: 12px; white-space: nowrap;
}
#chat > .tbar .room-title-action:hover { background: #ffffff24 !important; }
#chat > .tbar .room-title-action:focus-visible { outline: 2px solid #ffbc76; outline-offset: 2px; }
.room-popout #room-popout, .room-popout body.chat-room-active #social-chat-header,
.room-popout body.chat-room-active #social-chat-layout { display: none !important; }
html.room-popout body.chat-room-active #chat[style*="flex"] { inset: 0 !important; }
/* Desktop app room window: no Social sidebar/header, so the room fills the whole window (was offset 260px/98px and clipped when maximized) */
html.yd body.chat-room-active #chat[style*="flex"], html.yd #chat[style*="flex"] { inset: 0 !important; width: auto !important; height: auto !important; }

#login #rlist .guest-room-join:not(.selected-entry) { background: #edf5fc !important; color: #003876 !important; }
#room-popout-status { margin: 22px; color: var(--ink); font-weight: 650; }
html.room-popout-pending #social-chat-header, html.room-popout-pending #social-chat-layout { display: none !important; }

/* Keep the transcript readable when the room window is narrow. */
#chat #log {
  min-inline-size: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#chat :is(#log, #mem) {
  scrollbar-width: thin;
  scrollbar-color: #a9bed1 transparent;
}
#chat :is(#log, #mem):is(:hover, :focus-within) {
  scrollbar-color: #7897b2 transparent;
}
#chat #log > div > .tx {
  flex: 1 1 0%;
  min-inline-size: 0;
}
#chat #log :is(.room-chat-body, .room-msg-text, .rlink, .sys) {
  min-inline-size: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#chat #log .room-chat-heading {
  flex-wrap: wrap;
}
#chat #log .room-chat-heading .n {
  white-space: normal;
  overflow-wrap: anywhere;
}
