:root {
  /* OnlineHR-ийн дизайн систем (landing, вэб апп — online-hr-front-v1.1/tailwind.config.js) */
  --bg: #F6F6F4;          /* shell */
  --card: #FFFFFF;
  --card-2: #F6F6F4;
  --text: #1B1B1B;        /* ink */
  --muted: #6B6B66;
  --border: #E2E2DD;
  --border-strong: #CFCFC9;
  --accent: #2B2B2B;      /* charcoal — үндсэн товч, сонголт */
  --accent-hover: #111111;
  --accent-2: #173D1F;    /* accent-ink — хаалттай өрөө */
  --accent-soft: #E8F7E8;
  --accent-ink: #173D1F;
  --green: #9BE39B;
  --danger: #A12A34;      /* HR: no */
  --ok: #1F6B2E;          /* HR: ok */
  --warn: #8A5A00;        /* HR: warn */
  --shadow: 0 1px 2px rgb(27 27 27 / .05), 0 4px 16px rgb(27 27 27 / .05);
  --shadow-lg: 0 12px 40px rgb(27 27 27 / .16);
  --av-l: 92%;
  --av-fg-l: 38%;
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 0; font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px max(16px, calc(50% - 604px));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; color: var(--green);
  background: var(--accent);
}
.logo svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.live i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.status.live { color: var(--ok); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--card);
  cursor: pointer; font-size: 14px; font-weight: 500;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--text); }
.me {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 4px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--card); cursor: pointer;
}
.me:hover { border-color: var(--text); }
.me-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.me-text strong { font-size: 14px; }
.me-text .muted { font-size: 11px; }
.pen { width: 14px; height: 14px; color: var(--muted); }
@media (max-width: 600px) {
  .hide-sm, .me-text .muted, .pen, .status span { display: none; }
  .icon-btn { padding: 0 10px; }
}
@media (max-width: 420px) { .me-text { display: none; } .me { padding: 0 4px; } }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start;
  max-width: 1240px; margin: 0 auto; padding: 0 16px;
}
main { min-width: 0; padding: 28px 0 48px; }
section { margin-bottom: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px; }
.link-btn:hover { color: var(--accent); }

/* ---------- Avatar ---------- */
.avatar {
  --h: 220;
  --s: 52px;
  position: relative;
  display: grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, hsl(var(--h) 90% calc(var(--av-l) + 4%)), transparent 70%),
    hsl(var(--h) 75% var(--av-l));
  box-shadow: inset 0 0 0 2px hsl(var(--h) 70% calc(var(--av-l) - 8%));
  color: hsl(var(--h) 65% var(--av-fg-l));
}
.avatar .emoji {
  font-size: calc(var(--s) * .56); line-height: 1;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / .12));
}
.avatar .face { display: grid; width: 55%; height: 55%; }
.avatar .face svg { width: 100%; height: 100%; }
/* Төхөөрөмжийн төрлийн жижиг тэмдэг */
.avatar .dev {
  position: absolute; right: -2px; bottom: -2px;
  display: grid; place-items: center;
  width: calc(var(--s) * .36); height: calc(var(--s) * .36); min-width: 16px; min-height: 16px;
  border-radius: 50%; background: var(--card); color: hsl(var(--h) 60% calc(var(--av-fg-l) - 6%));
  box-shadow: 0 0 0 2px var(--card), 0 1px 3px rgb(0 0 0 / .15);
}
.avatar .dev svg { width: 62%; height: 62%; }
.avatar:has(.face) .dev { display: none; }
.avatar.sm { --s: 32px; }
.avatar.sm .dev, .avatar.xs .dev { display: none; }
.avatar.xs { --s: 22px; box-shadow: none; }
.avatar.lg { --s: 72px; }

/* ---------- Peers ---------- */
.peers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .peers { grid-template-columns: 1fr 1fr; gap: 10px; } }
.peer {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 12px 18px; text-align: center; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  animation: pop .25s ease-out;
}
.peer .avatar { --s: 68px; margin-bottom: 10px; transition: transform .15s; }
.peer .name { font-weight: 600; word-break: break-word; }
.peer .device { font-size: 13px; color: var(--muted); }
.peer .send-hint {
  margin-top: 10px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink);
}
.peer:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.peer:hover .avatar { transform: scale(1.06); }
.peer:active { transform: translateY(0) scale(.98); }
.peer.over { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); transform: scale(1.03); }
body.dragging .peer { z-index: 30; border-color: var(--accent); }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 36px 20px 28px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty h3 { margin-top: 8px; }
.empty p { margin: 6px 0 20px; max-width: 420px; font-size: 14px; }
.radar { position: relative; display: grid; place-items: center; width: 180px; height: 180px; }
.radar > span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  animation: ripple 3s ease-out infinite; opacity: 0;
}
.radar > span:nth-child(2) { animation-delay: 1s; }
.radar > span:nth-child(3) { animation-delay: 2s; }
.radar .avatar { box-shadow: 0 0 0 6px var(--card); }
@keyframes ripple { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .radar > span { animation: none; opacity: .3; } }
.empty-connect {
  display: flex; align-items: center; gap: 18px; padding: 14px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; text-align: left;
}
@media (max-width: 480px) { .empty-connect { flex-direction: column; text-align: center; } }

.qr { width: 120px; height: 120px; padding: 6px; background: #fff; border-radius: 10px; flex: none; }
.qr.big { width: 220px; height: 220px; padding: 10px; }
.qr svg { display: block; width: 100%; height: 100%; }
.url-slot .primary {
  display: block; font-size: 17px; font-weight: 700; color: var(--accent);
  text-decoration: none; word-break: break-all;
}
.url-slot .others { margin-top: 6px; font-size: 12px; color: var(--muted); }
.url-slot .others a { color: inherit; }
.copy { margin-top: 8px; }

/* ---------- Transfers ---------- */
.transfers { display: flex; flex-direction: column; gap: 10px; }
.transfer {
  display: flex; gap: 14px; padding: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: pop .2s ease-out;
}
.thumb {
  position: relative; display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-ink);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 26px; height: 26px; }
.thumb .ext {
  position: absolute; bottom: 5px; left: 0; right: 0; text-align: center;
  font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.thumb.has-ext svg { transform: translateY(-5px); }
.t-body { flex: 1; min-width: 0; }
.t-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.t-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.chip {
  flex: none; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.transfer.done .chip { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: transparent; }
.transfer.error .chip { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: transparent; }
.mode { font-size: 11px; padding: 0 6px; border-radius: 5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.mode.relay { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.bar { height: 6px; margin-top: 10px; background: var(--card-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; width: 0; border-radius: 99px; background: var(--ok); transition: width .2s; }
.transfer.done .bar > div { background: var(--ok); }
.transfer.error .bar > div { background: var(--danger); }
.transfer.done .bar, .transfer.error .bar { opacity: .55; }
.t-meta { margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.saved { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.saved a {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.saved a:hover { text-decoration: underline; }

.note {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  font-size: 13px; color: var(--muted);
}
.note svg { width: 16px; height: 16px; flex: none; }

/* ---------- Drag overlay ---------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center; padding: 32px;
}
.drop-hint {
  padding: 12px 20px; border-radius: 99px; font-weight: 600; color: #fff;
  background: var(--accent); box-shadow: var(--shadow-lg);
}

/* ---------- Dialogs ---------- */
.btn {
  padding: 11px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #fff;
  background: var(--accent);
}
.btn:hover { background: var(--accent-hover); }
.btn.ghost:hover { background: var(--card); border-color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
dialog.sheet {
  width: min(440px, calc(100vw - 24px)); padding: 22px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--card); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.sheet[open] { animation: rise .2s ease-out; }
dialog::backdrop { background: rgb(8 12 20 / .5); backdrop-filter: blur(3px); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sheet-head > div:not(.avatar) { flex: 1; min-width: 0; }
.sheet-head .close { width: 36px; height: 36px; justify-content: center; padding: 0; }
.incoming-files { list-style: none; margin: 0 0 18px; padding: 0; max-height: 40vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.incoming-files li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 14px; }
.incoming-files li:first-child { border-top: 0; }
.incoming-files .thumb { width: 32px; height: 32px; border-radius: 8px; }
.incoming-files .thumb svg { width: 16px; height: 16px; transform: none; }
.incoming-files .thumb .ext { display: none; }
.incoming-files .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incoming-files .fsize { color: var(--muted); flex: none; font-size: 13px; }
.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; }
.connect-body { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible { outline-offset: 3px; }

/* ---------- Chat ---------- */
.chat {
  position: sticky; top: 82px; margin-top: 28px;
  display: flex; flex-direction: column; height: calc(100vh - 110px); min-height: 420px;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.chat-head .close { display: none; width: 36px; height: 36px; justify-content: center; padding: 0; }
.chat-log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 14px 12px 6px;
}
.chat-empty {
  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px;
}
.chat-empty-icon { font-size: 34px; margin-bottom: 6px; }

.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.msg.first { margin-top: 12px; }
.msg .avatar { --s: 30px; }
.msg .avatar .dev { display: none; }
.msg .spacer { width: 30px; flex: none; }
.msg-body { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; min-width: 0; }
.msg-name { font-size: 12px; font-weight: 600; margin: 0 0 3px 10px; color: hsl(var(--h) 55% var(--av-fg-l)); }
.bubble {
  padding: 7px 12px 6px; border-radius: 18px; border-bottom-left-radius: 6px;
  background: var(--card-2); border: 1px solid var(--border);
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.4;
}
.bubble a { color: var(--accent); }
.bubble time { float: right; margin: 6px 0 -2px 10px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .bubble {
  background: var(--accent); color: #fff; border-color: transparent;
  border-bottom-left-radius: 18px; border-bottom-right-radius: 6px;
}
.msg.mine .bubble a { color: #fff; }
.msg.mine .bubble time { color: rgb(255 255 255 / .75); }
.msg.new { animation: msg-in .18s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sys {
  align-self: center; margin: 12px 0 2px; padding: 3px 12px; border-radius: 99px;
  font-size: 12px; color: var(--muted); background: var(--card-2);
}
.sys.err { color: var(--danger); }
.chat-typing { min-height: 22px; padding: 0 18px; font-size: 12px; color: var(--muted); font-style: italic; }

.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 12px; }
.chat-form textarea {
  flex: 1; resize: none; max-height: 120px; height: 42px; padding: 10px 14px; overflow-y: hidden; scrollbar-width: thin;
  border: 1px solid var(--border); border-radius: 20px; outline: none;
  background: var(--card-2); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.4;
}
.chat-form textarea:focus { border-color: var(--accent); }
.chat-form .send {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; cursor: pointer;
}
.chat-form .send svg { width: 20px; height: 20px; }
.chat-form .send:disabled { opacity: .45; cursor: default; }

.chat-fab {
  display: none; position: fixed; right: 18px; bottom: 18px; z-index: 15;
  width: 58px; height: 58px; border: 0; border-radius: 50%; place-items: center; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-lg);
}
.chat-fab svg { width: 26px; height: 26px; }
.chat-badge {
  position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}

@media (max-width: 999px) {
  .layout { grid-template-columns: minmax(0, 1fr); max-width: 880px; }
  .topbar { padding-left: max(16px, calc(50% - 424px)); padding-right: max(16px, calc(50% - 424px)); }
  main { padding-bottom: 96px; }
  .chat-fab { display: grid; }
  .chat { display: none; }
  .chat.open {
    display: flex; position: fixed; inset: 0; z-index: 40; margin: 0;
    height: 100dvh; min-height: 0; border: 0; border-radius: 0;
  }
  .chat.open .chat-head .close { display: inline-flex; }
}

/* Түгжээний icon текстийн мөрөнд хамт урсана (утсан дээр тусдаа хөвөхгүй) */
.note { display: block; }
.note svg { display: inline; vertical-align: -3px; margin-right: 4px; }
/* Өөрийн мессеж dark mode-д ч тод харагдана */
.msg.mine .bubble { background: var(--accent); }

/* ---------- "бичиж байна" ---------- */
.chat-typing {
  display: flex; align-items: center; gap: 8px; min-height: 0; height: 0; padding: 0 12px;
  overflow: hidden; font-style: normal; opacity: 0;
  transition: height .18s ease, opacity .18s ease;
}
.chat-typing.on { height: 44px; opacity: 1; }
.typing-avatars { display: flex; flex: none; }
.typing-avatars .avatar { --s: 30px; box-shadow: 0 0 0 2px var(--card); }
.typing-avatars .avatar + .avatar { margin-left: -10px; }
.typing-avatars .avatar .dev { display: none; }
.typing-bubble {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 11px 14px; border-radius: 18px; border-bottom-left-radius: 6px;
  background: var(--card-2); border: 1px solid var(--border);
}
.typing-bubble i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typing-dot 1.2s infinite ease-in-out;
}
.typing-bubble i:nth-child(2) { animation-delay: .15s; }
.typing-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.typing-label { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Утсан дээр чат хаалттай үед хэн нэгэн бичиж байвал товч "амьсгална" */
.chat-fab.typing::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent); animation: fab-pulse 1.4s ease-out infinite;
}
@keyframes fab-pulse { from { transform: scale(.95); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .typing-bubble i, .chat-fab.typing::after { animation: none; opacity: .8; }
}

/* ---------- Өрөө ---------- */
.room-btn { font-weight: 600; }
.room-btn #room-icon { font-size: 15px; }
.room-btn.private { border-color: color-mix(in srgb, var(--accent-2) 55%, var(--border)); color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 8%, var(--card)); }
#room-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .room-btn:not(.private) #room-label { display: none; } }
@media (max-width: 420px) { #room-label { display: none; } }

.room-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 22px; padding: 10px 14px; border-radius: 14px; font-size: 14px;
  background: color-mix(in srgb, var(--accent-2) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, var(--border));
}
.room-banner-text { flex: 1; min-width: 200px; }
.room-banner-actions { display: flex; gap: 4px; }
.room-banner .link-btn { font-weight: 600; color: var(--accent-2); }
.room-note { font-size: 13px; color: var(--accent-2); font-weight: 600; }
.room-current { margin: -4px 0 14px; font-size: 14px; color: var(--muted); }
.room-form { display: flex; gap: 8px; }
.room-form input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-2); color: var(--text); font: inherit; font-size: 16px; letter-spacing: .04em;
}
.room-form input:focus { outline: none; border-color: var(--accent); }
.room-error { min-height: 20px; margin-top: 4px; font-size: 13px; color: var(--danger); }
.room-or { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; color: var(--muted); font-size: 12px; }
.room-or::before, .room-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Тохиргоо ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer;
}
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; }
.toggle-row + .actions { margin-top: 12px; }
.switch {
  appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0;
  border-radius: 99px; background: var(--border); cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Дамжуулалт: цуцлах / үргэлжлүүлэх ---------- */
.t-actions { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.t-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; height: 26px; padding: 0 8px;
}
.t-btn.cancel { width: 26px; padding: 0; }
.t-btn.cancel:hover { color: var(--danger); border-color: var(--danger); }
.t-btn.resume { color: #fff; border-color: transparent; background: var(--accent); }
.transfer.paused .chip { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-color: transparent; }
.transfer.paused .bar > div { background: var(--warn); }

/* Нарийн дэлгэц дээр header-ийн товчнууд багтахын тулд нэрийг нууж, logo + төлөвийн цэгийг үлдээнэ */
@media (max-width: 440px) {
  .brand-name { display: none; }
  .top-actions { gap: 6px; }
}

/* Өрөөний чат нийтийн чатаас ялгарч харагдана */
.chat.private .chat-head { background: color-mix(in srgb, var(--accent-2) 9%, var(--card)); }
.chat.private #chat-title { color: var(--accent-2); }

/* ---------- Өрөөний жагсаалт, PIN ---------- */
.room-current {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: -4px 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  background: color-mix(in srgb, var(--accent-2) 10%, var(--card));
}
.room-current .link-btn { font-weight: 600; }
.room-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow: auto; }
.room-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card-2); cursor: pointer;
}
.room-item:hover, .room-item.selected { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 8%, var(--card)); }
.room-item.here { cursor: default; border-style: dashed; }
.room-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { font-size: 12px; color: var(--muted); flex: none; }
.room-item.here .room-meta { color: var(--accent-2); font-weight: 600; }
.room-empty { padding: 14px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }
.room-join { margin-bottom: 4px; }
.room-join-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.room-create { display: flex; flex-direction: column; gap: 8px; }
.room-create > input, #room-pin, #new-room-pin {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-2); color: var(--text); font: inherit; font-size: 16px;
}
#room-pin, #new-room-pin { letter-spacing: .25em; }
.room-create > input:focus { outline: none; border-color: var(--accent); }
.pin-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; letter-spacing: .15em; background: color-mix(in srgb, var(--accent-2) 14%, transparent); }

/* nginx-ийн ард HOME_URL тохируулсан үед: OnlineHR лого → хэрэгслүүд */
.home-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--border); }
.home-link img { width: 26px; height: 26px; object-fit: contain; }
.home-link:hover { color: var(--muted); }
@media (max-width: 600px) { .home-link .hl-text { display: none; } .home-link { padding-right: 8px; } }

/* Нэг өнгийн SVG icon (emoji-гийн оронд) */
.i { width: 1em; height: 1em; flex: none; vertical-align: -0.14em; }
#chat-title, #room-join-title, .room-leave, #room-leave, #test-sound { display: inline-flex; align-items: center; gap: 6px; }
#room-icon { display: inline-flex; }
#room-icon .i { width: 17px; height: 17px; }
.room-banner-icon { display: inline-flex; }
.room-banner-icon .i { width: 18px; height: 18px; }
.chat-empty-icon .i { width: 36px; height: 36px; color: var(--muted); stroke-width: 1.5; }
.room-lock { display: inline-flex; color: var(--accent-2); }
