/* Sala de reunião (vídeo) — dentro do sistema e na página do convidado. Mesmo padrão visual do site. */
.rm-shell {
  --navy: #0b1a3a; --navy-2: #0b2a6b; --blue: #1e6ff0; --sky: #8db4ff; --on: #c8d3ea; --on-2: #9fb0d3; --green: #10b981; --red: #ef4444;
  --ease: cubic-bezier(.2, .7, .2, 1);
  position: fixed; inset: 0; z-index: 200; overflow: hidden; color: #fff;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: linear-gradient(150deg, #081430 0%, #0b1a3a 45%, #0c2050 100%);
}
body.rm-open { overflow: hidden; }
body.rm-guest { margin: 0; background: #081430; }
.rm-shell svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.rm-shell button { font-family: inherit; }
.rm-mark { position: absolute; left: -260px; top: 50%; width: 760px; transform: translateY(-50%); opacity: .06; pointer-events: none; user-select: none; }
.rm-top { position: relative; z-index: 1; display: flex; align-items: center; height: 68px; padding: 0 28px; }
.rm-logo { height: 26px; width: auto; }
@keyframes rmIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rmPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- pré-entrada ---------- */
.rm-pre-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 48px; align-items: center;
  max-width: 1120px; margin: 0 auto; padding: 24px 32px 40px; min-height: calc(100% - 68px); }
.rm-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #0e1f45; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8); animation: rmIn .5s var(--ease) both; }
.rm-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rm-preview-off { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--on-2); font-size: 14px; }
.rm-preview-off svg { width: 40px; height: 40px; }
.rm-pre.cam-off .rm-preview video { visibility: hidden; }
.rm-pre.cam-off .rm-preview-off { display: flex; }
.rm-preview-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; }
.rm-level { position: absolute; left: 20px; right: 20px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rm-level i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #6ee7b7); transform-origin: left; transform: scaleX(0); transition: transform .08s; }
.rm-pre-side { animation: rmIn .5s .08s var(--ease) both; }
.rm-kicker { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--sky); }
.rm-kicker::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.rm-pre-side h1, .rm-msg-in h1 { margin: 12px 0 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
.rm-sub { margin: 8px 0 0; color: var(--on-2); font-size: 15px; }
.rm-field { display: grid; gap: 8px; margin-top: 24px; font-size: 13.5px; font-weight: 600; color: var(--on); }
.rm-field input { height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(5, 12, 30, .45); color: #fff; font: 500 16px inherit; font-family: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
.rm-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(30, 111, 240, .25); }
.rm-hint { min-height: 20px; margin: 12px 0 0; font-size: 13.5px; color: #fcd581; }
.rm-hint:empty { min-height: 0; margin: 0; }
.rm-join { margin-top: 20px; width: 100%; height: 54px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(30, 111, 240, .95); transition: background .2s, transform .15s; }
.rm-join:hover { background: #1557d1; }
.rm-join:active { transform: translateY(1px); }
.rm-legal { margin: 16px 0 0; font-size: 12.5px; color: var(--on-2); line-height: 1.5; }
.rm-legal a { color: var(--on); }

/* ---------- telas de mensagem (aguardando, saiu…) ---------- */
.rm-msg-in { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; padding: 60px 24px; text-align: center; animation: rmIn .45s var(--ease) both; }
.rm-msg-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: var(--sky); background: rgba(30, 111, 240, .18); border: 1px solid rgba(141, 180, 255, .2); }
.rm-msg-ic svg { width: 30px; height: 30px; }
.rm-msg-in p { margin: 12px 0 0; color: var(--on); line-height: 1.6; }
.rm-msg-in b { color: #fff; }
.rm-dots { display: flex; justify-content: center; gap: 8px; margin: 26px 0 8px; }
.rm-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--sky); animation: rmDot 1.2s ease-in-out infinite; }
.rm-dots i:nth-child(2) { animation-delay: .15s; }
.rm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes rmDot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.rm-ghost { margin-top: 18px; padding: 10px 18px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: var(--on); font-weight: 600; cursor: pointer; }
.rm-ghost:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* ---------- sala ---------- */
.rm-room { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.rm-bar-top { display: flex; align-items: center; gap: 18px; padding: 14px 22px; }
.rm-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .12); }
.rm-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-title span { font-size: 12.5px; color: var(--on-2); font-variant-numeric: tabular-nums; }
.rm-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .2s; }
.rm-chip:hover { background: rgba(255, 255, 255, .12); }
.rm-chip svg { width: 18px; height: 18px; }
.rm-body { position: relative; display: flex; min-height: 0; gap: 12px; padding: 0 16px; }
.rm-stage { position: relative; flex: 1; min-width: 0; display: flex; }
.rm-grid { flex: 1; display: grid; gap: 10px; align-content: center; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); max-height: 100%; }
.rm-grid[data-n="1"] { --cols: 1; }
.rm-grid[data-n="2"] { --cols: 2; }
.rm-grid[data-n="3"], .rm-grid[data-n="4"] { --cols: 2; }
.rm-grid[data-n="5"], .rm-grid[data-n="6"] { --cols: 3; }
.rm-grid[data-n="7"], .rm-grid[data-n="8"], .rm-grid[data-n="9"] { --cols: 3; }
.rm-tile { position: relative; align-self: center; width: 100%; min-height: 0; aspect-ratio: 16 / 9; max-height: 100%; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #13285a, #0e1f45);
  border: 1px solid rgba(255, 255, 255, .08); animation: rmPop .35s var(--ease) both; transition: box-shadow .2s, border-color .2s; }
.rm-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.rm-tile.has-video video { opacity: 1; }
.rm-tile.mirror video { transform: scaleX(-1); }
.rm-tile.rm-screen video { object-fit: contain; background: #050b1c; }
.rm-tile.rm-screen.mirror video { transform: none; }
.rm-avatar { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .3s; }
.rm-avatar span { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; background: linear-gradient(145deg, var(--blue), var(--navy-2)); box-shadow: 0 10px 30px -10px rgba(30, 111, 240, .7); }
.rm-tile.guest .rm-avatar span { background: linear-gradient(145deg, #7c5cff, #4c2fc9); }
.rm-tile.has-video .rm-avatar { opacity: 0; }
.rm-name { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px;
  background: rgba(5, 12, 30, .6); font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); }
.rm-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mic-ic { display: none; color: #fca5a5; }
.rm-mic-ic svg { width: 15px; height: 15px; }
.rm-tile.muted .rm-mic-ic { display: inline-flex; }
.rm-tile.speaking { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 30px -6px rgba(16, 185, 129, .6); }
/* alguém compartilhando a tela: ela fica grande e as câmeras viram uma faixa ao lado */
.rm-stage.presenting .rm-grid { grid-template-columns: minmax(0, 1fr) 220px; grid-auto-rows: auto; align-content: start; overflow-y: auto; }
.rm-stage.presenting .rm-tile { grid-column: 2; aspect-ratio: 16 / 9; }
.rm-stage.presenting .rm-tile.rm-screen { grid-column: 1; grid-row: 1 / span 20; aspect-ratio: auto; height: 100%; min-height: 300px; }
.rm-note { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3; padding: 9px 16px; border-radius: 12px; background: rgba(5, 12, 30, .85); border: 1px solid rgba(255, 255, 255, .1);
  font-size: 13.5px; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; animation: rmIn .3s var(--ease) both; transition: opacity .3s; }
.rm-note.out { opacity: 0; }

/* painel lateral (chat / participantes) */
.rm-panel { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; border-radius: 18px; overflow: hidden; color: #101828; background: #fff; animation: rmIn .3s var(--ease) both; }
.rm-panel[hidden] { display: none; }
.rm-panel header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #e4e8ef; }
.rm-panel header b { font-size: 15px; color: #0b1a3a; }
.rm-x { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: #667085; cursor: pointer; display: grid; place-items: center; }
.rm-x:hover { background: #f2f4f8; }
.rm-x svg { width: 20px; height: 20px; }
.rm-people { padding: 10px; overflow-y: auto; display: grid; gap: 4px; align-content: start; }
.rm-people[hidden], .rm-chat[hidden] { display: none !important; }
.rm-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.rm-person.speaking { background: #ecfdf5; }
.rm-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(145deg, #1e6ff0, #0b2a6b); }
.rm-pn { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rm-pn b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-pn small { font-size: 12px; color: #667085; }
.rm-person i { color: #10b981; }
.rm-person i.off { color: #ef4444; }
.rm-person i svg { width: 18px; height: 18px; }
.rm-invite-box { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin-bottom: 6px; border: 1px dashed #b9c8e6; border-radius: 14px; background: #f5f8ff; color: #1557d1; text-align: left; cursor: pointer; }
.rm-invite-box:hover { background: #eaf1fe; }
.rm-invite-box span { display: flex; flex-direction: column; }
.rm-invite-box b { font-size: 14px; }
.rm-invite-box small { color: #667085; font-size: 12.5px; }
.rm-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rm-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rm-empty { margin: auto 0; text-align: center; color: #667085; font-size: 13px; }
.rm-m { max-width: 85%; align-self: flex-start; animation: rmIn .25s var(--ease) both; }
.rm-m.mine { align-self: flex-end; text-align: right; }
.rm-mh { font-size: 11.5px; color: #667085; }
.rm-mh b { color: #344054; }
.rm-m p { margin: 3px 0 0; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: #f2f4f8; font-size: 14px; line-height: 1.45; text-align: left; word-break: break-word; }
.rm-m.mine p { border-radius: 14px 14px 4px 14px; background: #1e6ff0; color: #fff; }
.rm-m.mine p a { color: #fff; }
.rm-send { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e4e8ef; }
.rm-send input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #d0d7e2; border-radius: 12px; font: 15px inherit; font-family: inherit; outline: none; }
.rm-send input:focus { border-color: #1e6ff0; box-shadow: 0 0 0 3px rgba(30, 111, 240, .15); }
.rm-send button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #1e6ff0; color: #fff; cursor: pointer; display: grid; place-items: center; }

/* convidados batendo na porta */
.rm-lobby { position: absolute; right: 20px; top: 74px; z-index: 5; display: grid; gap: 10px; width: min(380px, calc(100% - 40px)); }
.rm-knock { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; color: #101828; background: #fff; box-shadow: 0 20px 44px -16px rgba(0, 0, 0, .6); animation: rmIn .35s var(--ease) both; transition: opacity .25s, transform .25s; }
.rm-knock.out { opacity: 0; transform: translateX(20px); }
.rm-kt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rm-kt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-kt small { font-size: 12.5px; color: #667085; }
.rm-admit, .rm-deny { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.rm-admit { border: 0; background: #10b981; color: #fff; }
.rm-deny { border: 1px solid #e4e8ef; background: #fff; color: #475467; }

/* barra de controles */
.rm-controls { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.rm-btn { position: relative; width: 54px; height: 54px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, transform .15s, border-color .2s; }
.rm-btn:hover { background: rgba(255, 255, 255, .16); }
.rm-btn:active { transform: scale(.94); }
.rm-btn.off { background: #fff; color: #b42318; border-color: #fff; }
.rm-btn.on { background: var(--blue); border-color: var(--blue); }
.rm-leave { width: auto; padding: 0 20px; display: inline-flex; gap: 8px; background: var(--red); border-color: var(--red); font-weight: 700; font-size: 14.5px; margin-left: 10px; }
.rm-leave:hover { background: #dc2626; }
.rm-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #0b1a3a; }
.rm-badge[hidden] { display: none; }
.rm-count { background: rgba(255, 255, 255, .2); }

@media (max-width: 860px) {
  .rm-pre-in { grid-template-columns: 1fr; gap: 24px; padding: 8px 18px 28px; }
  .rm-top { height: 58px; padding: 0 18px; }
  .rm-mark { width: 520px; left: -220px; }
  .rm-bar-top { padding: 10px 14px; gap: 12px; }
  .rm-bar-top .rm-logo { display: none; }
  .rm-title { padding-left: 0; border-left: 0; }
  .rm-chip span, .rm-chip { font-size: 0; padding: 0 10px; gap: 0; }
  .rm-chip svg { width: 20px; height: 20px; }
  .rm-body { padding: 0 8px; }
  .rm-grid { gap: 8px; align-content: stretch; }
  .rm-grid[data-n="2"] { --cols: 1; }
  .rm-grid[data-n="3"], .rm-grid[data-n="4"], .rm-grid[data-n="5"], .rm-grid[data-n="6"] { --cols: 2; }
  .rm-tile { aspect-ratio: auto; border-radius: 14px; align-self: stretch; }
  .rm-grid[data-n="1"] .rm-tile { aspect-ratio: auto; height: 100%; }
  .rm-panel { position: absolute; inset: 0 8px; width: auto; z-index: 4; }
  .rm-stage.presenting .rm-grid { grid-template-columns: 1fr; }
  .rm-stage.presenting .rm-tile { grid-column: 1; display: none; }
  .rm-stage.presenting .rm-tile.rm-screen { display: block; grid-row: auto; }
  .rm-controls { gap: 8px; padding: 10px 10px calc(12px + env(safe-area-inset-bottom)); }
  .rm-btn { width: 48px; height: 48px; border-radius: 16px; }
  .rm-leave { padding: 0 14px; margin-left: 4px; }
  .rm-leave span { display: none; }
  .rm-lobby { right: 10px; left: 10px; width: auto; top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .rm-shell *, .rm-shell { animation: none !important; transition: none !important; }
}

/* cartão "Sua reunião está pronta" */
.rm-ready { position: absolute; left: 24px; bottom: 96px; z-index: 6; width: min(400px, calc(100% - 48px)); padding: 18px; border-radius: 18px; color: #101828; background: #fff;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .6); animation: rmIn .4s var(--ease) both; }
.rm-ready[hidden] { display: none; }
.rm-ready header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rm-ready header b { font-size: 17px; color: #0b1a3a; }
.rm-ready > p { margin: 6px 0 0; font-size: 13.5px; color: #475467; line-height: 1.5; }
.rm-url { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 6px 6px 12px; border-radius: 12px; background: #f2f4f8; }
.rm-url span { flex: 1; min-width: 0; font-size: 13.5px; color: #1557d1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-url button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: #1e6ff0; color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.rm-url button svg { width: 17px; height: 17px; }
.rm-acc-label { margin: 14px 0 6px !important; font-size: 12px !important; font-weight: 700; color: #667085 !important; text-transform: uppercase; letter-spacing: .05em; }
.rm-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-acc button { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid #e4e8ef; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .2s, background .2s; }
.rm-acc button b { font-size: 13.5px; color: #101828; }
.rm-acc button small { font-size: 12px; color: #667085; }
.rm-acc button.on { border-color: #1e6ff0; background: #eaf1fe; }
@media (max-width: 860px) { .rm-ready { left: 10px; right: 10px; width: auto; bottom: 84px; } }

.rm-btn[hidden] { display: none; }
.rm-preview-bar .rm-btn.on { background: var(--blue); border-color: var(--blue); }

/* intensidade do desfoque */
.rm-blur-range { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 600; color: var(--on-2); }
.rm-blur-range[hidden] { display: none; }
.rm-blur-range input { flex: 1; min-width: 0; height: 22px; accent-color: var(--blue); cursor: pointer; }
.rm-blur-range.off { opacity: .45; }
.rm-pre-left { min-width: 0; }
.rm-preview + .rm-blur-range { margin-top: 14px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); animation: rmIn .3s var(--ease) both; }
.rm-blur-pop { position: absolute; left: 50%; bottom: 92px; translate: -50% 0; z-index: 7; width: min(340px, calc(100% - 24px)); padding: 14px 16px; border-radius: 16px;
  background: rgba(11, 26, 58, .96); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 20px 44px -16px rgba(0, 0, 0, .7); animation: rmIn .25s var(--ease) both; }
.rm-blur-pop[hidden] { display: none; }
.rm-bp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.rm-switch { position: relative; width: 44px; height: 26px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .2); cursor: pointer; transition: background .2s; }
.rm-switch i { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.rm-switch[aria-checked="true"] { background: var(--blue); }
.rm-switch[aria-checked="true"] i { transform: translateX(18px); }
@media (max-width: 860px) { .rm-blur-pop { bottom: 80px; } }

/* qualidade do recorte */
.rm-q { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--on-2); }
.rm-q[hidden] { display: none; }
.rm-q > span { margin-right: auto; }
.rm-q button { height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: var(--on); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s; }
.rm-q button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.rm-q.off { opacity: .6; }
.rm-pre-left > .rm-q { padding: 0 16px; }
.rm-q-hint { margin: 10px 0 0; font-size: 12px; color: var(--on-2); }
