/* Bridge Meet — styles follow the approved mockups. */
:root {
  --blue: #2F5FD0;
  --blue-dark: #1E3F99;
  --blue-soft: #E8EEFC;
  --host: #F5B83D;
  --cohost: #5B8DEF;
  --ink: #16191F;
  --ink-2: #3D4552;
  --muted: #5B6472;
  --line: #E3E6EB;
  --field: #C5CBD4;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  /* meeting (dark) */
  --m-bg: #111418;
  --m-panel: #1A1E24;
  --m-tile: #22262D;
  --m-line: #262B33;
  --m-btn: #262B33;
  --m-text: #F3F4F6;
  --m-muted: #A3ABB8;
  --danger: #C8372D;
  --muted-red: #FF9C94;
  --speak: #8FE3B6;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.icon { flex: none; }
:focus-visible { outline: 3px solid #9DB5EE; outline-offset: 2px; }

/* ---------- Site pages ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand--light, .brand--light:hover { color: var(--m-text); font-size: 16px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 10px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.site-nav a[aria-current="page"] { background: #EEF2FC; color: var(--blue-dark); font-weight: 600; }
.page { padding-top: 40px; padding-bottom: 24px; }
.page__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.page h1 { margin: 0; font-size: 28px; letter-spacing: -0.01em; }
.page__head p { margin: 0; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.meeting-card { display: flex; gap: 14px; }
.meeting-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.meeting-card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.meeting-card__foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.meeting-card__foot .btn { margin-left: auto; }
.date-box { flex: none; width: 56px; height: 60px; border-radius: 10px; background: #F1F3F6; display: flex; align-items: center; justify-content: center; }
.date-box--next { background: var(--blue); color: #fff; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge--open { background: var(--blue-soft); color: var(--blue-dark); }
.badge--closed { background: #F4EEE1; color: #6A4F12; }
.site-footer { margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: #2752B8; color: #fff; }
.btn--primary:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: #fff; color: var(--ink); border-color: #D5DAE1; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn--lg { height: 52px; font-size: 17px; border-radius: 12px; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- Before joining ---------- */
.prejoin { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.prejoin__card { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.prejoin__card--center { text-align: center; align-items: center; }
.prejoin h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.role-note { margin: -8px 0 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--host { background: var(--host); }
.preview { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--m-tile); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview__off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--m-text); font-size: 15px; background: var(--m-tile); }
.preview__controls { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 12px; }
.round-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,12,15,.65); color: #fff; cursor: pointer; }
.round-btn[aria-pressed="true"] { background: #fff; color: var(--ink); }
.meter { position: absolute; left: 14px; top: 14px; width: 6px; height: 48px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; display: flex; align-items: flex-end; }
.meter span { display: block; width: 100%; height: 0; background: var(--speak); transition: height .08s linear; }
.join-form { display: flex; flex-direction: column; gap: 8px; }
.join-form label { font-size: 14px; font-weight: 600; }
.join-form input { height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field); font-size: 16px; color: var(--ink); background: #fff; }
.join-form .btn { margin-top: 8px; }
.form-error { margin: 0; color: #B4322A; font-size: 14px; }
.fine { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- In the meeting ---------- */
body.room-page { background: var(--m-bg); }
body.room-page.is-prejoin, body.room-page.is-left { background: var(--bg); }
.meeting { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--m-bg); color: var(--m-text); }
.m-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 12px 20px; border-bottom: 1px solid var(--m-line); }
.m-top__left, .m-top__right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.m-divider { width: 1px; height: 24px; background: #2C323B; }
.m-title { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stat { display: inline-flex; align-items: center; gap: 6px; color: var(--m-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.m-banner { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; background: #3A2F17; color: #FBE6B8; font-size: 14px; }
.m-sound { align-self: center; margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; }
.m-stage { flex: 1; min-height: 0; padding: 16px; display: flex; align-items: center; justify-content: center; }

.tiles { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(var(--cols, 1), var(--tile-w, 320px)); gap: 12px; justify-content: center; align-content: center; overflow-y: auto; }
@media (max-width: 560px) {
  .m-stage { padding: 10px; }
  .tiles { gap: 8px; }
}

.tile { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; background: var(--m-tile); box-shadow: 0 0 0 1px #2C323B; overflow: hidden; transition: box-shadow .15s; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.is-self video { transform: scaleX(-1); }
.tile__avatar { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: var(--m-tile); }
.tile__avatar span { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; font-weight: 600; }
.tile.cam-off video, .tile.no-video video { visibility: hidden; }
.tile.cam-off .tile__avatar, .tile.no-video .tile__avatar { display: flex; }
.tile__role { position: absolute; top: 10px; left: 10px; display: none; padding: 4px 10px; border-radius: 999px; color: #14161A; font-size: 12px; font-weight: 700; }
.tile.role-host { box-shadow: 0 0 0 3px var(--host); }
.tile.role-host .tile__role { display: block; background: var(--host); }
.tile.role-cohost { box-shadow: 0 0 0 3px var(--cohost); }
.tile.role-cohost .tile__role { display: block; background: var(--cohost); }
.tile.speaking:not(.role-host):not(.role-cohost) { box-shadow: 0 0 0 3px #fff; }
.tile__label { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: rgba(10,12,15,.74); font-size: 13px; font-weight: 500; }
.tile__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .mic-off { color: var(--muted-red); display: none; }
.tile.mic-muted .mic-off { display: block; }
.tile.mic-muted .mic-on { display: none; }
.tile .speak { color: var(--speak); display: none; }
.tile.speaking .speak { display: block; }
.tile__status { position: absolute; top: 10px; right: 10px; display: none; padding: 4px 10px; border-radius: 999px; background: rgba(10,12,15,.74); font-size: 12px; color: var(--m-muted); }
.tile.connecting .tile__status { display: block; }

.m-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--m-line); }
.m-bar__center { display: flex; gap: 10px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--m-btn); color: var(--m-text); font-size: 12px; font-weight: 600; cursor: pointer; }
.ctl[aria-pressed="true"] { background: var(--m-text); color: #14161A; }
.bar-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.bar-btn--quiet { border: 1px solid #333A44; background: transparent; color: #C9CFD8; }
.bar-btn--leave { border: 0; background: var(--danger); color: #fff; padding: 0 18px; }
@media (max-width: 640px) {
  .m-top { padding: 10px 14px; }
  .m-top .brand--light span, .m-divider { display: none; }
  .m-bar { justify-content: center; padding-left: 12px; padding-right: 12px; }
  .m-bar__center { order: -1; width: 100%; justify-content: center; }
  .bar-btn--quiet span { display: none; }
  .ctl { min-width: 76px; }
}
