:root {
  /* theme — overridden by the server from Admin → Appearance */
  --primary: #b8862f;
  --primary-2: #8a611d;
  --bg: #f4ede2;
  --card: #fffdf9;
  --text: #1f1a14;
  --muted: #6b6358;
  /* derived */
  --pink: var(--primary);
  --pink-2: var(--primary-2);
  --primary-soft: color-mix(in srgb, var(--primary) 12%, var(--card));
  --field: color-mix(in srgb, var(--text) 4.5%, var(--card));
  --female: #ec4899;
  --female-bg: #fde4ec;
  --male: #42a5f5;
  --male-bg: #e3f2fd;
  --room: #7e57c2;
  --badge: #f01d1d;
  --ok: #1f8a3d;
  --line: color-mix(in srgb, var(--text) 9%, var(--card));
  --panel: #ffffff;
  --bubble-them: #ffffff;
  --bubble-me: var(--primary);
  --row-h: 80px;
  --side-w: 380px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
/* flex + auto margins: centered when there's room, scrollable from the very top when the card is taller than the screen */
.login { position: relative; height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 10px; isolation: isolate;
  background:
    radial-gradient(900px 520px at 85% -10%, color-mix(in srgb, var(--primary) 22%, transparent) 0, transparent 60%),
    radial-gradient(1100px 500px at -10% 110%, color-mix(in srgb, var(--primary) 14%, transparent) 0, transparent 60%),
    var(--bg); }
/* dotted grid (same as the chat background), strongest around the card */
.login.pattern::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(color-mix(in srgb, var(--text) 13%, transparent) 1px, transparent 1.4px) 0 0/18px 18px;
  -webkit-mask: radial-gradient(ellipse 70% 65% at 50% 45%, #000 0, transparent 75%); mask: radial-gradient(ellipse 70% 65% at 50% 45%, #000 0, transparent 75%); }

.login > .card { margin: auto 0; flex: none; }
.card { position: relative; width: 100%; max-width: 420px; background: var(--card); border-radius: 24px; padding: 26px 24px 20px;
  overflow: hidden; display: grid; gap: 12px; border: 1px solid color-mix(in srgb, var(--text) 7%, var(--card));
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 30px 70px -34px color-mix(in srgb, var(--primary-2) 50%, transparent); }
.card > * { position: relative; }

/* hero image in the top-right corner, cut by a curve with a thin theme-colored edge */
.card > .hero { position: absolute; top: 0; right: 0; width: 42%; height: 190px; background: center 30%/cover no-repeat; z-index: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M18 0C34 4 36 30 52 48S80 66 100 76V0z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M18 0C34 4 36 30 52 48S80 66 100 76V0z'/%3E%3C/svg%3E") 0 0/100% 100% no-repeat; }
.card > .hero-edge { position: absolute; top: 0; right: 0; width: 42%; height: 190px; z-index: 1; pointer-events: none; overflow: visible; }
.hero-edge path, .card-swoosh path { fill: none; stroke: var(--primary); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.card > .card-swoosh { display: none; }
.card > .hero.default { background-size: 140% auto; background-position: 30% 88%; } /* frame the built-in skyline */
.card > .off { display: none; }

.brand-block { display: flex; align-items: center; gap: 10px; max-width: 66%; z-index: 2; }
.logo { width: 46px; height: 46px; flex: none; }
.logo svg, .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-weight: 700; font-size: 28px; line-height: 1.05; letter-spacing: -.035em; color: var(--text); white-space: nowrap; }
.brand-name .accent { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 70%, #fff) 0%, var(--primary) 45%, var(--primary-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin-top: 5px; font-size: 9px; font-weight: 600; letter-spacing: .26em; color: var(--muted); white-space: nowrap; }
.tagline:empty { display: none; }
.tag { margin: 0; max-width: 72%; color: var(--muted); font-size: 13.5px; line-height: 1.5; font-weight: 500; z-index: 2; }
.tag:empty { display: none; }
/* no corner picture: the name and description can use the full card width */
.card:has(> .hero.off) .brand-block, .card:has(> .hero.off) .tag { max-width: 100%; }

.field { display: grid; gap: 6px; }
.lbl { font-size: 13.5px; font-weight: 600; color: color-mix(in srgb, var(--text) 80%, var(--card)); }
.frow { display: flex; align-items: center; gap: 10px; }
.ibadge { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--card)); }
.ibadge svg, .seg svg, .btn .bi, .geo-hint svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibadge .dots, .btn .dots { stroke-width: 2.6; }
.ctl { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; background: var(--field); border: 1.5px solid color-mix(in srgb, var(--text) 5%, transparent);
  border-radius: 14px; transition: border-color .15s, background .15s; }
.ctl:focus-within { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.ctl input, .ctl select { width: 100%; border: 0; background: transparent; outline: none; padding: 12px 14px; font-size: 15px; font-weight: 600; color: var(--text); appearance: none; -webkit-appearance: none; }
.ctl input::placeholder { color: color-mix(in srgb, var(--muted) 65%, var(--card)); font-weight: 500; }
.ctl.float { display: grid; padding: 7px 0 0; }
.ctl.float > span { padding: 0 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ctl.float input { padding: 1px 14px 8px; }
.ctl.select::after { content: ''; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px; margin-top: -6px; pointer-events: none;
  border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: rotate(45deg); opacity: .8; }
.ctl.select select { padding-right: 38px; cursor: pointer; }
.ctl select:disabled { cursor: not-allowed; color: var(--muted); }
.ctl.country .flag { position: absolute; left: 14px; width: 30px; height: 20px; object-fit: cover; border-radius: 3px; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.ctl.country select { padding-left: 54px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: block; position: relative; }
.seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 8px; border-radius: 14px; font-size: 15px; font-weight: 600;
  color: var(--text); background: var(--field); border: 1.5px solid color-mix(in srgb, var(--text) 5%, transparent); cursor: pointer; transition: all .15s; }
.seg span svg { width: 20px; height: 20px; }
.seg input:checked + span { border-color: var(--primary); color: var(--primary-2);
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
  box-shadow: 0 8px 18px -12px var(--primary); }
.seg input:checked + span svg { color: var(--primary); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; padding: 15px 18px; margin-top: 2px;
  font-size: 16.5px; font-weight: 600; color: #fff; letter-spacing: 0;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--primary-2)));
  box-shadow: 0 14px 28px -14px var(--primary), inset 0 1px 0 rgba(255,255,255,.18); transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn .bi { width: 22px; height: 22px; stroke-width: 2; }
.btn:disabled { opacity: .65; }

.err { color: #c62828; font-size: 14px; font-weight: 600; }
.err:empty { display: none; }
.notice { background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--primary-2); padding: 11px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cap-box { min-height: 65px; }
.cap-status { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: -3px; }
.cap-status[data-state=ok] { color: var(--ok); }
.cap-status[data-state=error] { color: #c62828; font-size: 14px; }
.geo-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: -2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.geo-hint img { width: 24px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.geo-hint svg { width: 17px; height: 17px; color: var(--ok); }
.geo-hint b { color: var(--ok); font-weight: 600; }
.geo-hint .short { display: none; }
.geo-hint .muted { color: color-mix(in srgb, var(--muted) 70%, var(--card)); }
.fine { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.credit { font-size: 10.5px; color: color-mix(in srgb, var(--muted) 45%, var(--bg)); text-decoration: none; margin-top: 18px; }
.credit:hover { color: var(--muted); }
/* short "about" text under the login card: what search engines read */
.seo-about { width: min(440px, 100%); margin: 26px 0 8px; padding: 0 6px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; flex: none; }
.seo-about h1 { margin: 0 0 8px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.seo-about p { margin: 0 0 8px; }

.duo { display: grid; grid-template-columns: 1fr 160px; gap: 12px; align-items: end; } /* gender + age side by side */

/* login modes: guest (default) · log in to a profile · create a profile */
.card[data-mode=login] .not-login { display: none !important; }
.card:not([data-mode=login]):not([data-mode=register]) .acct-only { display: none; }
.card:not([data-mode=register]) .reg-only { display: none; }
.mode-links { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.mode-links [data-show] { display: none; }
.card[data-mode=guest] .mode-links [data-show=guest], .card[data-mode=login] .mode-links [data-show=login],
.card[data-mode=register] .mode-links [data-show=register] { display: inline; }
.mode-links a { color: var(--primary-2); font-weight: 600; text-decoration: none; }
.mode-links a:hover { text-decoration: underline; }
.reg-extra { display: flex; align-items: center; gap: 10px; }
.reg-extra .ctl { flex: 1; }
.ctl small { font-weight: 500; opacity: .8; }
.photo-pick { flex: none; cursor: pointer; }
.photo-pick .pp-img { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; overflow: hidden;
  background: var(--field); border: 1.5px dashed color-mix(in srgb, var(--primary) 55%, transparent); }
.photo-pick .pp-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick.big .pp-img { width: 96px; height: 96px; font-size: 30px; }


/* Phones (and phones held sideways): compact layout so the whole login form fits on one screen */
@media (max-width: 480px), (max-height: 520px) {
  .login { padding: 10px 10px 6px; }
  .card { padding: 18px 16px 16px; border-radius: 24px; gap: 10px; }
  .card > .hero, .card > .hero-edge { width: 40%; height: 128px; }
  .card > .card-swoosh { height: 36px; }
  .brand-block { gap: 8px; max-width: 64%; }
  .logo { width: 34px; height: 38px; }
  .brand-name { font-size: 24px; }
  .tagline { margin-top: 4px; font-size: 8.5px; letter-spacing: .2em; }
  .tag { margin: 0; max-width: 74%; font-size: 12.5px; line-height: 1.45; }
  .ibadge { display: none; }
  .frow { gap: 0; }
  .field { gap: 5px; }
  .lbl { font-size: 13px; }
  .ctl { border-radius: 13px; }
  .ctl input, .ctl select { padding: 11px 12px; font-size: 16px; } /* 16px stops iPhones zooming in on tap */
  .ctl.float { padding-top: 6px; }
  .ctl.float > span { padding: 0 12px; font-size: 11px; }
  .ctl.float input { padding: 1px 12px 8px; }
  .ctl.select select { padding-right: 34px; }
  .ctl.select::after { right: 13px; width: 7px; height: 7px; margin-top: -5px; }
  .ctl.country .flag { left: 12px; width: 30px; height: 20px; }
  .ctl.country select { padding-left: 52px; }
  .duo { grid-template-columns: 1fr 92px; gap: 10px; }
  .seg { gap: 8px; }
  .seg span { gap: 6px; padding: 10px 6px; border-radius: 13px; font-size: 15px; }
  .seg span svg { width: 20px; height: 20px; }
  .geo-hint { gap: 6px; font-size: 12px; }
  .geo-hint .long { display: none; }
  .geo-hint .short { display: inline; }
  .geo-hint img { width: 22px; height: 15px; }
  .geo-hint svg { width: 16px; height: 16px; }
  .cap-status { margin-top: -3px; font-size: 13px; }
  .btn { gap: 10px; margin-top: 2px; padding: 13px; font-size: 16px; }
  .btn .bi { width: 21px; height: 21px; }
  .fine { font-size: 11.5px; }
  .credit { margin-top: 8px; }
}
/* very small phones (320–360px): keep the name clear of the skyline corner */
@media (max-width: 360px) {
  .card { padding: 16px 13px 14px; }
  .card > .hero, .card > .hero-edge { width: 34%; height: 112px; }
  .brand-block { max-width: 72%; gap: 7px; }
  .logo { width: 30px; height: 34px; }
  .brand-name { font-size: 21px; }
  .tagline { font-size: 7.5px; letter-spacing: .16em; }
  .tag { max-width: 80%; font-size: 12px; }
  .duo { grid-template-columns: 1fr 82px; gap: 8px; }
  .seg { gap: 6px; }
  .seg span { gap: 4px; font-size: 14px; }
  .seg span svg { width: 18px; height: 18px; }
  .geo-hint { font-size: 11px; gap: 5px; }
}

/* ---------- App shell ---------- */
.app { height: 100%; height: 100dvh; display: grid; grid-template-columns: var(--side-w) 1fr;
  overflow: hidden; } /* clips the off-screen chat panel on phones, so mobile browsers don't zoom out to fit it */
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me .av { width: 40px; height: 40px; }
.me .nm { font-weight: 700; font-size: 15px; }
.me .sub { font-size: 12px; }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; font-size: 20px;
  display: grid; place-items: center; color: var(--muted); flex: none; }
.leave-btn { border: 1.5px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 10px; flex: none; }
.leave-btn:hover { border-color: var(--pink); color: var(--pink); }
.icon-btn:hover { background: #f3f4f6; }
.side-tools { padding: 10px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.side-tools input { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fafbfc; outline: none; font-weight: 600; }
.side-tools input:focus { border-color: var(--pink); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tabs button { border: 0; padding: 8px 4px; border-radius: 10px; background: #f3f4f6; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs button b { font-weight: 700; color: var(--text); margin-left: 2px; }
.tabs button.on { background: var(--pink); color: #fff; }
.tabs button.on b { color: #fff; }

/* ---------- User rows (matches the reference design) ---------- */
.list { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.spacer { width: 1px; }
.row, .room-row { height: var(--row-h); display: flex; align-items: center; gap: 14px; padding: 0 18px 0 14px; cursor: pointer;
  border-bottom: 3px solid #fff; }
.row { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.row.f { background: var(--female-bg); }
.row.m { background: var(--male-bg); }
/* sidebar sections: People · Rooms · Inbox · History */
.side-nav { flex: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; padding: 9px 6px 8px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--text) 3%, var(--panel))); }
/* each tab: a colorful raised 3D tile with a white icon */
.side-nav button { position: relative; border: 0; background: none; padding: 2px 0 0; display: grid; justify-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.side-nav [data-pane=people]  { --c1: #60a5fa; --c2: #1d4ed8; }
.side-nav [data-pane=rooms]   { --c1: #c084fc; --c2: #7e22ce; }
.side-nav [data-pane=inbox]   { --c1: #2dd4bf; --c2: #0f766e; }
.side-nav [data-pane=history] { --c1: #fbbf24; --c2: #c2410c; }
.side-nav [data-pane=search]  { --c1: #f472b6; --c2: #be185d; }
.side-nav [data-pane=friends] { --c1: #fb7185; --c2: #be123c; }
.side-nav .ic { position: relative; width: 38px; height: 34px; border-radius: 11px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--c2) 75%, #000),            /* the "key" edge */
              0 7px 12px -5px color-mix(in srgb, var(--c2) 75%, transparent), /* soft drop shadow */
              inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 4px rgba(0,0,0,.12);
  filter: saturate(.8) brightness(.98); transition: transform .12s, box-shadow .12s, filter .12s; }
.side-nav .ic::after { content: ''; position: absolute; inset: 0 0 52% 0; border-radius: 11px 11px 40% 40%;   /* glossy highlight */
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0)); pointer-events: none; }
.side-nav button svg { position: relative; z-index: 1; width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.side-nav button:hover .ic { filter: none; transform: translateY(-1px); }
.side-nav button.on { color: var(--c2); }
.side-nav button.on .ic { filter: saturate(1.1); transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c2) 75%, #000), 0 10px 16px -6px color-mix(in srgb, var(--c2) 85%, transparent),
              inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 4px rgba(0,0,0,.12), 0 0 0 3px color-mix(in srgb, var(--c1) 30%, transparent); }
.side-nav button:active .ic { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c2) 75%, #000), inset 0 1px 0 rgba(255,255,255,.45); }
.side-nav button:focus { outline: none; }
.side-nav button:focus-visible .ic { outline: 2px solid var(--c2); outline-offset: 3px; }
.side-nav .nb { position: absolute; top: -3px; left: calc(50% + 9px); z-index: 2; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--badge); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--panel); }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane[hidden] { display: none !important; }
.pane-note { margin: 0; padding: 10px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); flex: none; }
.pane .room-list { max-height: none; flex: 1; }
.gender-filter button { display: flex; align-items: center; justify-content: center; gap: 4px; }
.clist { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.crow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.crow:hover, .crow.sel { background: var(--primary-soft); }
.crow .av { width: 46px; height: 46px; }
.crow .info { flex: 1; min-width: 0; }
.crow .nm { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.crow .pv { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.crow.unread .pv { color: var(--text); font-weight: 600; }
.crow .side-meta { display: grid; justify-items: end; gap: 4px; flex: none; font-size: 11.5px; color: var(--muted); }
.crow.gone { opacity: .7; }
.tag-left { font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: var(--field); color: var(--muted); }
.empty-pane { padding: 34px 20px; text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; }
/* registered profiles: photo avatars + ✓ badge */
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* away (idle) badge on the avatar: 🌙 + how long */
.av-wrap { position: relative; flex: none; display: inline-grid; }
.av-wrap.idle > .av { filter: saturate(.55) opacity(.8); }
/* chosen status (busy / away / do not disturb) */
.st-dot { position: absolute; right: -2px; top: -2px; width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel); }
.st-dot.st-busy, .st-ic.st-busy { background: #ef4444; }
.st-dot.st-away, .st-ic.st-away { background: #f59e0b; }
.st-dot.st-dnd, .st-ic.st-dnd { background: #dc2626 linear-gradient(#fff, #fff) center / 60% 2.5px no-repeat; }
.st-dot.st-invisible { background: #fff; box-shadow: 0 0 0 2px var(--panel), inset 0 0 0 3px #9ca3af; }
.st-ic { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.st-ic.st-online { background: #22c55e; }
.st-ic.st-invisible { background: transparent; box-shadow: inset 0 0 0 2px #9ca3af; }
.st-ic.st-dnd { background-size: 60% 2px; }
.st-label { font-weight: 600; }
.st-label.st-busy, .st-label.st-dnd { color: #dc2626; }
.st-label.st-away { color: #d97706; }
.side-head { position: relative; }
.st-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 2px 4px 2px 0; margin: 1px 0 0;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 6px; }
.st-btn:hover { color: var(--text, #111); }
.st-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.st-menu { position: absolute; left: 12px; top: calc(100% - 6px); z-index: 60; width: 240px; max-width: calc(100% - 24px); padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.st-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 10px; font: inherit; color: inherit; cursor: pointer; }
.st-menu button:hover, .st-menu button.on { background: rgba(127,127,127,.12); }
.st-menu .st-ic { width: 12px; height: 12px; }
.st-menu b { display: block; font-size: 14px; }
.st-menu small { display: block; font-size: 11.5px; color: var(--muted); }
.idle-badge { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px 1px 4px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1.4;
  white-space: nowrap; box-shadow: 0 0 0 2px var(--panel), 0 2px 4px rgba(0,0,0,.18); pointer-events: auto; }
.idle-badge svg { width: 11px; height: 11px; fill: #fff; stroke: none; }
.vbadge { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 900; margin-left: 4px; vertical-align: 1px; flex: none; }
.me { cursor: pointer; border-radius: 12px; padding: 2px 6px 2px 2px; }
.me:hover { background: var(--field); }
/* profile card shown at the top of a chat with a registered user */
.prof-card { align-self: center; display: grid; justify-items: center; gap: 6px; text-align: center; background: var(--panel); border-radius: 18px;
  padding: 16px 22px; margin: 4px 0 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); max-width: 320px; }
.prof-card .av { width: 72px; height: 72px; }
.prof-card .nm { font-size: 17px; font-weight: 700; }
.prof-card .sub { font-size: 12.5px; color: var(--muted); }
.prof-card .bio { font-size: 14px; color: var(--text); font-style: italic; }
/* profile dialog */
.prof-dlg { width: min(400px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; position: relative; }
.prof-dlg[data-kind=claim] .edit-only, .prof-dlg[data-kind=edit] .claim-only { display: none; }
.prof-dlg .dlg-x { position: absolute; top: 12px; right: 12px; border: 0; background: var(--field); border-radius: 50%; width: 30px; height: 30px; color: var(--muted); }
.prof-photo { display: grid; justify-items: center; gap: 6px; }
.prof-intro { margin: 0; font-size: 13.5px; color: var(--muted); }
.prof-fields { display: grid; gap: 10px; text-align: left; }
.pf { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pf input, .pf select { padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--field); font-size: 15px; font-weight: 600; color: var(--text); outline: none; width: 100%; }
.pf input:focus, .pf select:focus { border-color: var(--primary); }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-btn { border: 0; background: none; color: #c62828; font-weight: 600; font-size: 12.5px; padding: 2px; }
.pw-change { text-align: left; font-size: 13.5px; }
.pw-change summary { cursor: pointer; font-weight: 600; color: var(--primary-2); padding: 4px 0; }
.pw-change[open] { display: grid; gap: 10px; }

/* Search tab */
.search-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); flex: none; min-width: 0; }
.sg span { min-width: 0; white-space: nowrap; }
/* the sidebar never grows wider than its column; its content adapts to the space available */
.side { min-width: 0; overflow: hidden; container-type: inline-size; container-name: side; }
/* narrow columns: keep the colored icons, move them in front of the text and let the colored box show the choice */
@container side (max-width: 350px) {
  .search-form .sg span { justify-content: center; gap: 5px; padding: 9px 4px; font-size: 13.5px; }
  .search-form .sg span::before { display: none; }
  .search-form .sg .gi, .search-form .sg .sg-av { order: -1; width: 19px; height: 19px; }
}
.search-form input, .search-form select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
  font-size: 16px; font-weight: 600; color: var(--text); outline: none; }
.search-form input:focus, .search-form select:focus { border-color: var(--primary); }
.s-age { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.s-age-l, .s-age-to { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.sg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } /* equal columns that may shrink */
.sg label { display: block; position: relative; min-width: 0; } /* keeps the hidden radio inside its button */
.sg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sg span { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px 9px 32px; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; position: relative; background: var(--card); }
.sg span::before { content: ''; position: absolute; left: 9px; top: 50%; width: 16px; height: 16px; margin-top: -9px; border-radius: 50%; border: 1.5px solid #c5c9d2; }
/* each option has its own color: All = purple (pink + blue), Female = pink, Male = blue */
.sg .o-all { --c: #8e44ad; } .sg .o-f { --c: #e0457b; } .sg .o-m { --c: #2d8ae0; }
.sg span:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.sg input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--card)); box-shadow: 0 6px 14px -10px var(--c); }
.sg input:checked + span::before { border-color: var(--c); background: radial-gradient(circle, var(--c) 0 4.5px, transparent 5.5px); }
.sg input:focus-visible + span { outline: 2px solid var(--c); outline-offset: 2px; }
.sg .gi { width: 24px; height: 24px; fill: none; stroke-width: 2; stroke-linecap: round; }
.sg .gi .f { stroke: #e0457b; } .sg .gi .m { stroke: #2d8ae0; }
.sg-av { width: 22px; height: 22px; border-radius: 50%; flex: none; background: center/72% no-repeat; }
.sg-av.f { background-color: var(--female); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23fff' d='M32 13c-7.6 0-12.6 5.8-12.6 13.6 0 5.6 1 9.4-2.4 13.4 3.3 1.3 6.6 1.1 9-.4 1.8 1.2 3.8 1.8 6 1.8s4.2-.6 6-1.8c2.4 1.5 5.7 1.7 9 .4-3.4-4-2.4-7.8-2.4-13.4C44.6 18.8 39.6 13 32 13z'/%3E%3Cpath fill='%23fff' d='M10 64c0-11.5 9.8-18.5 22-18.5S54 52.5 54 64z'/%3E%3C/svg%3E"); }
.sg-av.m { background-color: var(--male); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle fill='%23fff' cx='32' cy='26' r='11.5'/%3E%3Cpath fill='%23fff' d='M10 64c0-11.5 9.8-18.5 22-18.5S54 52.5 54 64z'/%3E%3C/svg%3E"); }
.s-sel { position: relative; }
.s-sel::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text); transform: rotate(45deg); pointer-events: none; opacity: .7; }
.s-sel select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.search-btn { border: 0; border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 600; letter-spacing: 0; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 80%, #fff), var(--primary-2)); box-shadow: 0 10px 20px -12px var(--primary-2); }
.search-btn:active { transform: translateY(1px); }
.s-head { padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); flex: none; }
.crow .flag { width: 32px; height: 24px; }

/* friends */
.fsec { padding: 10px 16px 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.crow .fr-actions { display: flex; gap: 6px; flex: none; }
.fr-actions button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.fr-actions .ok { border: 0; color: #fff; background: linear-gradient(180deg, var(--primary), var(--primary-2)); }
.fr-actions .x { width: 30px; height: 30px; padding: 0; color: var(--muted); }
.on-dot { width: 9px; height: 9px; border-radius: 50%; background: #22a55a; box-shadow: 0 0 0 2px var(--card); display: inline-block; flex: none; }
.crow.offline { opacity: .65; }
/* quick add-friend button on People / Search rows */
.qf { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: 8px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); color: var(--primary); cursor: pointer; font-weight: 700; font-size: 15px; padding: 0; }
.qf svg, .fr-add svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.qf:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--card)); }
.qf.go { border: 0; color: #fff; background: linear-gradient(180deg, var(--primary), var(--primary-2)); }
.qf.sent { width: auto; height: auto; padding: 4px 9px; border-radius: 999px; font-size: 11px; color: var(--muted); cursor: default; }
.fr-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.fr-add input { width: 100%; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; font-size: 14px; color: var(--text); outline: none; }
.fr-add input:focus { border-color: var(--primary); }
.fr-add button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 0 14px; font: inherit; font-weight: 700; font-size: 13.5px;
  color: #fff; background: linear-gradient(180deg, var(--primary), var(--primary-2)); cursor: pointer; }
.test-badge { display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 4px; background: #64748b; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; vertical-align: 2px; }
.heart { color: #e0457b; font-size: 12px; margin-left: 4px; }
.friend-btn { border: 1.5px solid var(--primary); background: var(--card); color: var(--primary-2); border-radius: 999px; padding: 7px 12px;
  font-size: 13px; font-weight: 700; margin-right: 4px; white-space: nowrap; }
.friend-btn.done { border-color: var(--line); color: var(--muted); }
.friend-btn.go { border: 0; color: #fff; background: linear-gradient(180deg, var(--primary), var(--primary-2)); }
@container side (max-width: 360px) { .side-nav button { font-size: 10.5px; } .side-nav .ic { width: 32px; height: 30px; border-radius: 10px; } .side-nav button svg { width: 17px; height: 17px; } }

/* rooms list (sidebar) */
.rooms { flex: none; border-bottom: 1px solid var(--line); }
.rooms-head, .people-head { padding: 10px 16px 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rooms-head b { font-weight: 700; color: var(--primary); margin-left: 4px; }
.people-head { flex: none; border-bottom: 1px solid var(--line); }
.room-list { max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.room-list .room-row { height: 60px; gap: 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.room-list .room-row .av.room { width: 40px; height: 40px; font-size: 18px; border-width: 2px; }
.room-list .room-row .nm { font-size: 15px; }
.room-list .room-row .sub { font-size: 12.5px; margin-top: 1px; }
.room-list .room-row:not(.joined) .nm { color: var(--muted); }
.room-list .room-row:not(.joined) .av.room { opacity: .55; }
.room-list .room-row:hover { background: var(--primary-soft); }
.room-list .room-row.sel { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.av.room { background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 70%, #fff), var(--primary-2)); }
.lock { font-size: .8em; }
.pw-dlg { border: 0; border-radius: 22px; padding: 26px; width: min(360px, calc(100% - 32px)); background: var(--card); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.pw-dlg::backdrop { background: rgba(20, 14, 5, .45); }
.pw-dlg form { display: grid; gap: 10px; text-align: center; }
.pw-ic { font-size: 32px; }
.pw-dlg h3 { margin: 0; font-size: 20px; }
.pw-dlg p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.pw-dlg input { padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--field); font-size: 16px; outline: none; text-align: center; }
.pw-dlg input:focus { border-color: var(--primary); }
.pw-actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.pw-join { border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 700; color: #fff; background: linear-gradient(180deg, var(--primary), var(--primary-2)); }
#leaveRoomBtn { margin-right: 4px; }
.row:hover, .row.sel { background: #fff; box-shadow: inset 4px 0 0 var(--pink); }
.row.m:hover, .row.m.sel { box-shadow: inset 4px 0 0 var(--male); }
.av { width: 58px; height: 58px; border-radius: 50%; flex: none; border: 3px solid #e5e7eb; overflow: hidden; display: grid; place-items: center; }
.av svg { width: 100%; height: 100%; display: block; }
.av.f { background: var(--female); }
.av.m { background: var(--male); }
.av.room { color: #fff; font-size: 26px; font-weight: 700; } /* background: theme gradient, set above */
.info { flex: 1; min-width: 0; }
.nm { font-weight: 700; font-size: 17px; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 14.5px; color: var(--muted); font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--badge); color: #fff;
  font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.flag { flex: none; width: 40px; height: 30px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); background: #eee; }
.empty { padding: 30px 20px; text-align: center; color: #9ca3af; font-weight: 600; }

/* ---------- Chat panel ---------- */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f7f7fb;
  background-image: radial-gradient(#e9e9f2 1px, transparent 1px); background-size: 18px 18px; position: relative; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 72px; }
.peer { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.peer .av { width: 46px; height: 46px; }
.peer .nm { font-size: 16px; }
.peer .sub { font-size: 13px; }
.head-actions { display: flex; }
.back { display: none; font-size: 32px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.msg { display: flex; flex-direction: column; max-width: min(78%, 560px); align-self: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 12.5px; font-weight: 700; margin: 8px 0 3px 12px; cursor: pointer; }
.msg .who.f { color: #d81b60; }
.msg .who.m { color: #1e88e5; }
.bubble { background: var(--bubble-them); padding: 9px 14px; border-radius: 18px 18px 18px 6px; font-size: 15px; line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; font-weight: 500; }
.msg.me .bubble { background: var(--bubble-me); color: #fff; border-radius: 18px 18px 6px 18px; }
.bubble.pic { padding: 4px; background: #fff !important; }
.bubble.pic img { display: block; max-width: min(280px, 60vw); max-height: 320px; border-radius: 14px; cursor: zoom-in; }
.meta { font-size: 11px; color: #9ca3af; margin: 2px 8px 4px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.ticks { display: inline-flex; }
.ticks svg { width: 18px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ticks.sending svg { width: 11px; height: 11px; stroke-width: 1.6; }
.ticks.sending, .ticks.sent { color: #a3a9b5; }
.ticks.read { color: #34a8f0; }
.msg.fail .meta { color: #d32f2f; }
.sys { align-self: center; background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  margin: 10px 0; box-shadow: 0 1px 2px rgba(0,0,0,.05); text-align: center; }
.typing { position: absolute; bottom: 74px; left: 18px; background: #fff; border-radius: 14px; padding: 9px 12px; display: flex; gap: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #bbb; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3 } 40% { opacity: 1 } }

/* live typing preview (the other person's unsent text) */
.msg.draft .bubble { background: transparent; border: 1.5px dashed #d5d8e0; color: #6b7280; box-shadow: none; }
.msg.draft .bubble::after { content: ''; display: inline-block; width: 2px; height: 1.05em; background: var(--pink); margin-left: 2px; vertical-align: -2px; animation: caret 1s steps(1) infinite; }
.msg.draft .meta { font-style: italic; }
@keyframes caret { 50% { opacity: 0; } }
.live-note { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }
.live-note button { border: 0; background: none; color: var(--pink); font-weight: 600; font-size: 12.5px; padding: 0; }
.side-head > .icon-btn { margin-left: auto; margin-right: 4px; }
.composer { display: flex; align-items: center; gap: 6px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line); position: relative; }
.composer #text { flex: 1; min-width: 0; border: 1.5px solid var(--line); background: #f5f6fa; border-radius: 22px; padding: 11px 16px; outline: none; font-size: 16px; font-weight: 500; }
.composer #text:focus { border-color: var(--pink); background: #fff; }
.send { border: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 18px; flex: none; }
.composer.disabled { opacity: .5; pointer-events: none; }
/* emoji panel: full chat width, categories, Noto Emoji images */
.emoji-panel { position: absolute; left: 0; right: 0; bottom: 100%; height: 300px; display: flex; flex-direction: column; z-index: 6;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -12px 28px -14px rgba(0,0,0,.22); }
.ep-tabs { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.ep-tabs button { flex: none; width: 36px; height: 32px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; }
.ep-tabs button:hover { background: var(--field); }
.ep-tabs img { width: 22px; height: 22px; }
.ep-tabs svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.ep-grid { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; }
.ep-h { position: sticky; top: 0; z-index: 1; background: var(--card); padding: 8px 4px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ep-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.ep-items button { border: 0; background: none; height: 42px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; transition: transform .08s; }
.ep-items button:hover { background: var(--field); transform: scale(1.15); }
.ep-items img { width: 30px; height: 30px; pointer-events: none; }
.emoji-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.emoji-btn .dots { stroke-width: 2.6; }
/* emojis inside messages */
.bubble .emj { width: 1.3em; height: 1.3em; vertical-align: -.28em; margin: 0 .03em; }
.bubble.big-emoji { background: transparent !important; box-shadow: none; padding: 2px 0; }
.bubble.big-emoji .emj { width: 46px; height: 46px; margin: 0 2px; vertical-align: middle; }
@media (max-width: 720px) { .emoji-panel { height: 44vh; } }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 50; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px;
  border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) { :root { --side-w: 320px; } .nm { font-size: 16px; } .sub { font-size: 13.5px; } }
@media (max-width: 720px) {
  :root { --row-h: 76px; }
  .app { grid-template-columns: 1fr; }
  .side { grid-area: 1 / 1; }
  .chat { grid-area: 1 / 1; transform: translateX(100%); transition: transform .22s ease; z-index: 2; }
  body.chat-open .chat { transform: none; }
  .back { display: grid; }
  .av { width: 52px; height: 52px; }
  .row, .room-row { gap: 12px; padding: 0 14px 0 12px; }
  .flag { width: 36px; height: 27px; }
  .msg { max-width: 86%; }
}
