/* IDMBX Meet: full-screen meeting overlay, lobby, whiteboard */
.meet-root, .meet-launcher { font-family: inherit; color: #e5e7eb; }
.meet-root .hidden, .meet-launcher.hidden, .meet-root.hidden { display: none !important; }
body.meet-standalone #app { display: none !important; }

.meet-root { position: fixed; inset: 0; z-index: 200; background: #0b1220; display: flex; flex-direction: column; }
.meet-root.meet-min { inset: auto 16px 16px auto; background: transparent; }
.meet-root.meet-min .meet-screen { display: none !important; }
.meet-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.meet-pill { display: none; background: #2563eb; color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.meet-root.meet-min .meet-pill { display: block; }

.meet-primary, .meet-ghost, .meet-ghost-solid { border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; color: #fff; font-family: inherit; }
.meet-primary { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.meet-primary:hover { filter: brightness(1.08); }
.meet-primary:disabled { opacity: .55; cursor: default; }
.meet-ghost { background: rgba(255,255,255,.08); }
.meet-ghost:hover { background: rgba(255,255,255,.16); }
.meet-ghost-solid { background: #1f2937; }
.meet-icon-text { display: inline-flex; gap: 6px; align-items: center; }
.meet-icon-only { display: inline-flex; align-items: center; justify-content: center; width: 38px; padding: 8px 0; }
.meet-sub { font-size: 13px; opacity: .65; margin: 0; }
.meet-msg { font-size: 13px; color: #fbbf24; min-height: 18px; margin: 0; }
.meet-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; opacity: .95; }
.meet-field input, .meet-l-join input, .meet-chat-form input {
  background: #0f172a; border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; min-width: 0;
}
.meet-field input:focus, .meet-l-join input:focus, .meet-chat-form input:focus { outline: 2px solid #3b82f6; outline-offset: 0; }

/* Lobby */
.meet-lobby, .meet-ended { align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.meet-lobby-card { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 960px; width: 100%; }
.meet-preview { position: relative; width: min(560px, 100%); aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; flex: 1 1 380px; }
.meet-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.meet-preview-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #111827; font-size: 15px; opacity: .9; }
.meet-preview-ctrls { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.meet-lobby-side { display: flex; flex-direction: column; gap: 14px; width: 300px; max-width: 100%; }
.meet-lobby-side h2 { margin: 0; font-size: 24px; font-weight: 600; }
.meet-lobby-actions { display: flex; gap: 10px; }
.meet-lobby-actions .meet-primary { flex: 1; }
.meet-center { text-align: center; align-items: stretch; }

.meet-round, .meet-ctrl {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; position: relative; transition: background .15s;
}
.meet-round:hover, .meet-ctrl:hover { background: rgba(255,255,255,.22); }
.meet-round.off, .meet-ctrl.off { background: #dc2626; }
.meet-ctrl.active { background: #3b82f6; }
.meet-ctrl.meet-danger { background: #dc2626; width: 56px; border-radius: 24px; }
.meet-ctrl.meet-danger:hover { background: #ef4444; }
.meet-dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; border: 2px solid #0b1220; }

/* Room */
.meet-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.meet-top-info { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.meet-top-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meet-top-actions { display: flex; gap: 8px; align-items: center; }
.meet-conn { font-size: 12px; color: #fbbf24; }
.meet-body { flex: 1; min-height: 0; display: flex; }
.meet-main { flex: 1; min-width: 0; display: flex; padding: 12px; gap: 12px; position: relative; }
.meet-main.presenting { flex-direction: row; }
.meet-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 10px; align-content: center; min-height: 0; }
.meet-main.presenting .meet-grid { flex: 0 0 200px; grid-template-columns: 1fr; align-content: start; overflow-y: auto; }

.meet-tile { position: relative; background: #1f2937; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; min-height: 0; }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.meet-tile.self video { transform: scaleX(-1); }
.meet-tile.no-video video { visibility: hidden; }
.meet-tile-avatar { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; color: #fff; }
.meet-tile.no-video .meet-tile-avatar { display: flex; }
.meet-tile-name { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); background: rgba(0,0,0,.6); border-radius: 6px; padding: 2px 8px; font-size: 12px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.meet-tile-name span { overflow: hidden; text-overflow: ellipsis; }
.meet-tile-muted { color: #f87171; display: inline-flex; }
.meet-tile-hand { position: absolute; top: 8px; right: 8px; background: #f59e0b; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }

.meet-stage { flex: 1; min-width: 0; position: relative; background: #000; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.meet-stage > video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.meet-stage-label { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.65); padding: 4px 10px; border-radius: 6px; font-size: 13px; }
.meet-stage-self { display: flex; flex-direction: column; gap: 14px; align-items: center; font-size: 18px; }

.meet-knocks { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.meet-knock { display: flex; gap: 10px; align-items: center; background: #111827; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; }

.meet-controls { display: flex; justify-content: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.meet-leave-wrap { position: relative; }
.meet-leave-menu { position: absolute; bottom: 64px; right: 0; background: #111827; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.meet-leave-menu button { background: none; border: 0; color: #fff; text-align: left; padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; font-family: inherit; }
.meet-leave-menu button:hover { background: rgba(255,255,255,.1); }
#meet-leave-all { color: #f87171; }

/* Side panel */
.meet-side { width: 320px; max-width: 100vw; border-left: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; background: #0f172a; }
.meet-side-tabs { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.meet-tab { background: none; border: 0; color: inherit; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; opacity: .7; }
.meet-tab.active { background: rgba(255,255,255,.1); opacity: 1; }
.meet-side-close { margin-left: auto; }
.meet-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.meet-chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.meet-msg-row { display: flex; flex-direction: column; align-items: flex-start; max-width: 90%; align-self: flex-start; }
.meet-msg-row.me { align-self: flex-end; align-items: flex-end; }
.meet-msg-who { font-size: 11px; font-weight: 600; opacity: .7; margin: 0 4px 2px; }
.meet-msg-body { background: #1f2937; padding: 7px 11px; border-radius: 14px 14px 14px 4px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.meet-msg-row.me .meet-msg-body { background: #2563eb; border-radius: 14px 14px 4px 14px; }
.meet-msg-time { font-size: 10px; opacity: .5; margin: 2px 4px 0; }
.meet-chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.meet-chat-form input { flex: 1; }
.meet-people { overflow-y: auto; padding: 8px; }
.meet-person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.meet-person-av { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0; }
.meet-person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.meet-person-flags { display: flex; gap: 6px; align-items: center; font-size: 12px; opacity: .8; color: #f87171; }

/* Whiteboard */
.meet-wb { position: absolute; inset: 0; display: flex; flex-direction: column; background: #e5e7eb; }
.meet-wb-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 8px 12px; background: #111827; border-bottom: 1px solid rgba(255,255,255,.1); }
.meet-wb-group { display: flex; gap: 6px; align-items: center; }
.meet-wb-btn { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; font-family: inherit; }
.meet-wb-btn.active { background: #3b82f6; }
.meet-wb-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.meet-wb-color.active { border-color: #fff; box-shadow: 0 0 0 2px #3b82f6; }
.meet-wb-canvas-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px; }
#meet-wb-canvas { max-width: 100%; max-height: 100%; aspect-ratio: 16 / 9; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.3); touch-action: none; cursor: crosshair; }

/* Launcher modal */
.meet-launcher { position: fixed; inset: 0; z-index: 190; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.meet-launcher-card { background: #111827; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 18px; width: 380px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.meet-launcher-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.meet-or { text-align: center; font-size: 12px; opacity: .6; }
.meet-l-join { display: flex; gap: 8px; }
.meet-l-join input { flex: 1; }

@media (max-width: 800px) {
  .meet-main { flex-direction: column; padding: 8px; }
  .meet-main.presenting .meet-grid { flex: 0 0 110px; grid-template-columns: repeat(auto-fill, 150px); grid-auto-flow: column; overflow-x: auto; overflow-y: hidden; }
  .meet-side { position: absolute; right: 0; top: 0; bottom: 0; z-index: 10; width: min(340px, 100vw); }
  .meet-body { position: relative; }
  .meet-top-info .meet-sub { display: none; }
  .meet-icon-text span { display: none; }
}
