/* Amperis Meet — estilos. Distribución inspirada en las herramientas de reuniones de escritorio
   (barra lateral, calendario, controles de reunión arriba) con la identidad visual de amperis.com:
   rojo Amperis #ae1d1d, papel cálido #f6f4f0, tinta #1f2024, Archivo + IBM Plex Sans. */
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/plex-sans-var.woff2) format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --red: #ae1d1d; --red-2: #931a1a; --red-3: #7e1414; --red-soft: #f6e6e4;
  --ink: #1f2024; --ink-2: #4a4b50; --muted: #6d6a66; --steel: #2c5068; --steel-soft: #e4edf2;
  --paper: #f6f4f0; --card: #ffffff; --line: #e4dfd7; --line-2: #d6d0c6; --hover: #efebe5;
  --ok: #2f8a52; --warn: #b7791f; --danger: #c42b1c; --away: #c9a227;
  --rail: #f0ece6; --rail-active: #ffffff;
  --radius: 8px; --radius-lg: 12px; --shadow: 0 1px 2px rgba(31,32,36,.06), 0 4px 16px rgba(31,32,36,.06);
  --font: "IBM Plex Sans", "Segoe UI", Arial, sans-serif; --font-head: "Archivo", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --red: #e0453c; --red-2: #c93a32; --red-3: #ee4b43; --red-soft: #3a1f1d;
  --ink: #ecebe8; --ink-2: #c3c1bc; --muted: #9b9893; --steel: #7fa9c4; --steel-soft: #1f2a33;
  --paper: #18191c; --card: #1f2024; --line: #2e2f34; --line-2: #3a3b41; --hover: #2a2b30;
  --rail: #141518; --rail-active: #24252a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #e0453c; --red-2: #c93a32; --red-3: #ee4b43; --red-soft: #3a1f1d;
    --ink: #ecebe8; --ink-2: #c3c1bc; --muted: #9b9893; --steel: #7fa9c4; --steel-soft: #1f2a33;
    --paper: #18191c; --card: #1f2024; --line: #2e2f34; --line-2: #3a3b41; --hover: #2a2b30;
    --rail: #141518; --rail-active: #24252a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 15px; font-weight: 650; }
a { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-size: 12.5px; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow { font: 500 11.5px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--red); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: var(--red); }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; padding: 7px 14px; min-height: 34px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }

/* Formularios */
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-width: 0; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--card); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--steel) 20%, transparent); }
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--red); }
.toggle { position: relative; width: 38px; height: 20px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .15s; cursor: pointer; }
.toggle i::after { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .15s; }
.toggle input:checked + i { background: var(--red); }
.toggle input:checked + i::after { left: 21px; }
.error { color: var(--danger); font-size: 13px; }

/* Avatares y presencia */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; font-family: var(--font); }
.presence { position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%; min-width: 9px; min-height: 9px; border-radius: 50%; border: 2px solid var(--card); }
.presence.available { background: var(--ok); } .presence.meeting { background: var(--danger); } .presence.offline { background: var(--line-2); }

/* ===================================================================== Inicio de sesión */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--red) 8%, transparent), transparent), var(--paper); }
.auth-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.auth-card .logo { height: 36px; justify-self: start; }
.auth-foot { font-size: 12px; color: var(--muted); text-align: center; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; } :root[data-theme="dark"] .logo-dark { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: inline; } }

/* ===================================================================== Estructura principal */
.app { display: grid; grid-template-rows: 48px 1fr; grid-template-columns: 68px 1fr; height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .logo { height: 24px; }
.topbar .app-name { font: 700 15px var(--font-head); color: var(--ink); border-left: 1px solid var(--line-2); padding-left: 12px; }
.topbar .search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.topbar .search input { padding-left: 34px; background: var(--paper); border-color: var(--line); height: 32px; }
.topbar .search .ic { position: absolute; left: 10px; top: 7px; color: var(--muted); }
.me-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 4px; background: var(--rail); border-right: 1px solid var(--line); }
.rail a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 500; }
.rail a:hover { background: var(--hover); color: var(--ink); }
.rail a.active { color: var(--red); background: var(--rail-active); font-weight: 650; }
.rail a.active::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.rail .badge { position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; }
.main { overflow: hidden; display: flex; min-width: 0; }
.page { flex: 1; overflow: auto; padding: 20px 24px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 48px 1fr 58px; }
  .rail { grid-row: 3; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); }
  .rail a.active::before { display: none; }
  .topbar .app-name, .topbar .search { display: none; }
  .page { padding: 16px; }
}

/* Menús emergentes */
.menu { position: fixed; z-index: 50; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; color: var(--ink); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-head { padding: 8px 10px; display: flex; gap: 10px; align-items: center; }

/* ===================================================================== Calendario */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal { display: grid; grid-template-columns: 56px repeat(var(--days, 5), minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); overflow: auto; max-height: calc(100vh - 170px); position: relative; }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 10px; font-size: 12px; color: var(--muted); }
.cal-head b { display: block; font: 600 20px var(--font-head); color: var(--ink); }
.cal-head.today b { color: var(--red); }
.cal-hour { height: 48px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col .slot { height: 48px; border-top: 1px solid var(--line); }
.cal-col .slot:hover { background: color-mix(in srgb, var(--red) 5%, transparent); cursor: pointer; }
.cal-event { position: absolute; left: 4px; right: 4px; border-radius: 6px; background: var(--red-soft); border-left: 3px solid var(--red); padding: 4px 6px; font-size: 12px; overflow: hidden; cursor: pointer; color: var(--ink); }
.cal-event b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover { filter: brightness(.97); box-shadow: var(--shadow); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ===================================================================== Chat */
.chat { display: grid; grid-template-columns: 320px 1fr; height: 100%; width: 100%; min-width: 0; }
.chat-list { border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 14px 14px 8px; display: flex; align-items: center; gap: 8px; }
.chat-items { overflow: auto; flex: 1; padding: 4px 6px 10px; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--red-soft); }
.chat-item .t { flex: 1; min-width: 0; }
.chat-item .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .t span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .when { font-size: 11.5px; color: var(--muted); align-self: flex-start; }
.chat-item.unread b, .chat-item.unread span { color: var(--ink); font-weight: 700; }
.chat-item .meet-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--steel-soft); color: var(--steel); }
.conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.conv-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--card); min-height: 56px; }
.msgs { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; gap: 10px; max-width: min(720px, 85%); }
.msg .bubble { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 8px; white-space: pre-wrap; word-break: break-word; }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg .meta b { color: var(--ink-2); font-weight: 600; margin-right: 6px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--red-soft); border-color: transparent; }
.msg.cont { margin-top: -2px; } .msg.cont .avatar { visibility: hidden; } .msg.cont .meta { display: none; }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.composer { padding: 10px 18px 16px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 6px 6px 12px; }
.composer form:focus-within { border-color: var(--steel); border-bottom: 2px solid var(--red); }
.composer textarea { border: 0; padding: 6px 0; min-height: 22px; max-height: 160px; resize: none; background: transparent; box-shadow: none !important; }
.empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px 20px; gap: 10px; }
@media (max-width: 720px) { .chat { grid-template-columns: 1fr; } .chat.open .chat-list { display: none; } .chat:not(.open) .conv { display: none; } }

/* ===================================================================== Listas y tablas */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.item.click { cursor: pointer; } .item.click:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.item .t { flex: 1; min-width: 0; } .item .t b { display: block; font-weight: 650; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--steel-soft); color: var(--steel); }
.tag.red { background: var(--red-soft); color: var(--red); }
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--paper); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--red); }
.pre { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; max-height: 60vh; overflow: auto; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; } .md ul { padding-left: 20px; } .md p { margin: 6px 0; }

/* Modales y avisos */
.modal-back { position: fixed; inset: 0; background: rgba(20,21,24,.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-body { padding: 8px 18px 14px; overflow: auto; display: grid; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.toasts { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; width: min(440px, calc(100% - 32px)); justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; transition: opacity .4s; pointer-events: auto; }
.toast.warn { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; }

/* ===================================================================== Antesala */
.prejoin { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.prejoin-box { width: min(1040px, 100%); display: grid; gap: 18px; }
.prejoin-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .prejoin-grid { grid-template-columns: 1fr; } }
.preview { background: #111214; border-radius: var(--radius-lg); overflow: hidden; }
.preview .vid { position: relative; aspect-ratio: 16/9; display: grid; place-items: center; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .bar { display: flex; gap: 14px; align-items: center; padding: 10px 14px; background: #1b1c1f; color: #e8e6e3; flex-wrap: wrap; }
.preview .bar label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.meter { width: 60px; height: 4px; background: #333; border-radius: 4px; overflow: hidden; } .meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s; }
.join-card { padding: 20px; display: grid; gap: 14px; }

/* ===================================================================== Reunión (siempre oscura) */
.call { --c-bg: #141518; --c-panel: #1f2024; --c-tile: #2a2b30; --c-line: #34353b; --c-text: #ecebe8; --c-muted: #9b9893;
  position: fixed; inset: 0; display: grid; grid-template-rows: 56px 1fr; background: var(--c-bg); color: var(--c-text); z-index: 40; }
.call .icon-btn:hover, .call .btn.ghost:hover { background: #2e2f35; }
.call-top { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 14px; background: var(--c-panel); border-bottom: 1px solid var(--c-line); overflow-x: auto; }
.call-top .title { display: flex; flex-direction: column; min-width: 0; margin-right: 8px; }
.call-top .title b { font: 650 14px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.call-top .title span { font-size: 12px; color: var(--c-muted); }
.cbtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 54px; height: 46px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--c-text); font-size: 11px; cursor: pointer; position: relative; flex: none; }
.cbtn:hover { background: #2e2f35; }
.cbtn.on { color: #fff; }
.cbtn.active { background: #34353b; color: #ff8a80; }
.cbtn.off .ic { color: #ff8a80; }
.cbtn .dot { position: absolute; top: 5px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-3, #ee4b43); }
.cbtn .count { position: absolute; top: 3px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #ee4b43; color: #fff; font-size: 10px; display: grid; place-items: center; }
.vsep { width: 1px; height: 28px; background: var(--c-line); margin: 0 4px; flex: none; }
.leave { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 6px; border: 0; background: #c42b1c; color: #fff; font-weight: 650; cursor: pointer; flex: none; margin-left: 4px; }
.leave:hover { background: #a82315; }
.rec-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 99px; background: #c42b1c; color: #fff; font-size: 11.5px; font-weight: 600; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .6; } }
.call-main { display: flex; min-height: 0; position: relative; }
.stage-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 10px; gap: 10px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: #3a1f1d; color: #ffd9d4; font-size: 13px; flex-wrap: wrap; }
.banner.ctl { background: #1f2a33; color: #cfe4f2; }
.banner .btn { min-height: 28px; padding: 4px 10px; background: transparent; color: inherit; border-color: currentColor; }
.stage { flex: 1; display: flex; gap: 10px; min-height: 0; }
.share-area { flex: 3; position: relative; background: #000; border-radius: 10px; overflow: hidden; display: none; }
.share-area.on { display: block; }
.share-area video { width: 100%; height: 100%; object-fit: contain; display: block; }
.share-area .who { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.6); padding: 3px 10px; border-radius: 6px; font-size: 12.5px; }
.share-area .share-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.share-area .share-tools .btn { background: rgba(31,32,36,.85); color: #fff; border-color: #444; min-height: 30px; }
.share-area.controlling { cursor: none; outline: 3px solid #4aa3df; }
.rcursor { position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 3; color: #4aa3df; transform: translate(-3px, -2px); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.gallery { flex: 1; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); grid-auto-rows: minmax(150px, 1fr); align-content: center; min-width: 0; overflow: auto; }
.stage.sharing .gallery { flex: 0 0 240px; grid-template-columns: 1fr; grid-auto-rows: 135px; align-content: start; }
.stage.speaker .gallery { grid-template-columns: 1fr; }
@media (max-width: 760px) { .stage.sharing { flex-direction: column; } .stage.sharing .gallery { flex: 0 0 110px; grid-auto-flow: column; grid-auto-columns: 150px; grid-template-columns: none; grid-auto-rows: 100%; } }
.tile { position: relative; background: var(--c-tile); border-radius: 10px; overflow: hidden; border: 2px solid transparent; transition: border-color .15s; min-height: 0; }
.tile.speaking { border-color: #ee4b43; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.self video { transform: scaleX(-1); }
.tile .av { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .name { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; align-items: center; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.55); font-size: 12.5px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .hand { position: absolute; top: 8px; left: 8px; background: #c9a227; color: #1f2024; border-radius: 6px; padding: 2px 6px; display: flex; }
.tile .pin { position: absolute; top: 6px; right: 6px; opacity: 0; }
.tile:hover .pin { opacity: 1; }
.side { width: 340px; flex: none; background: var(--c-panel); border-left: 1px solid var(--c-line); display: flex; flex-direction: column; min-height: 0; }
@media (max-width: 760px) { .side { position: absolute; inset: 0; width: auto; z-index: 5; } }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.side-body { flex: 1; overflow: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.call input, .call select, .call textarea { background: #2a2b30; border-color: #3a3b41; color: var(--c-text); }
.pp { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; }
.pp:hover { background: #2a2b30; }
.pp .t { flex: 1; min-width: 0; } .pp .t b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pp .t span { font-size: 11.5px; color: var(--c-muted); }
.sec { font-size: 12px; color: var(--c-muted); font-weight: 600; margin: 10px 4px 2px; display: flex; justify-content: space-between; align-items: center; }
.cmsg { padding: 4px 2px; } .cmsg .meta { font-size: 11.5px; color: var(--c-muted); } .cmsg .meta b { color: #d9d7d3; margin-right: 6px; }
.cmsg .txt { white-space: pre-wrap; word-break: break-word; background: #2a2b30; border-radius: 6px; padding: 6px 9px; display: inline-block; max-width: 100%; }
.cmsg.me .txt { background: #3a1f1d; }
.call .menu { background: #2a2b30; border-color: #3a3b41; color: var(--c-text); }
.call .menu button { color: var(--c-text); } .call .menu button:hover { background: #34353b; } .call .menu hr { border-color: #3a3b41; }
.menu .sel::after { content: "✓"; margin-left: auto; color: var(--red); }
.call .menu .sel::after { color: #ff8a80; }
.captions { position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px; width: min(900px, calc(100% - 32px)); display: grid; gap: 6px; pointer-events: none; z-index: 4; }
.cap { background: rgba(0,0,0,.78); padding: 7px 14px; border-radius: 8px; font-size: clamp(15px, 1.8vw, 19px); }
.cap b { color: #ff9d94; font-weight: 600; margin-right: 8px; }
.cap i { color: #b9c3cd; font-style: normal; }
.reactions { position: absolute; left: 24px; bottom: 30px; pointer-events: none; z-index: 4; }
.reactions span { position: absolute; font-size: 34px; animation: float 3s ease-out forwards; }
@keyframes float { to { transform: translateY(-280px); opacity: 0; } }
.react-bar { display: flex; gap: 4px; padding: 6px; }
.react-bar button { font-size: 24px; border: 0; background: none; cursor: pointer; border-radius: 8px; width: 42px; height: 42px; }
.react-bar button:hover { background: #34353b; transform: scale(1.1); }
.lobby-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 45; padding: 16px; }
.lobby-screen .card { padding: 32px; max-width: 460px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.call .modal { background: #1f2024; color: #ecebe8; }
.call .modal-foot { border-color: #34353b; }
