*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --bg: #080d12;
  --surface: #0c1117;
  --surface2: #151a22;
  --surface3: #1c222c;
  --border: #222933;
  --border-strong: #313a46;
  --fg: #e6edf3;
  --muted: #98a2ae;
  --accent: #58a6ff;
  --primary: #1f6feb;
  --primary-hover: #388bfd;
  --cta: #238636;
  --cta-hover: #2ea043;
  --online: #3fb950;
  --attention: #d29922;
  --danger: #f85149;
  --focus: #58a6ff;
  --radius: 10px;
  --control: 36px;
  --overlay: rgba(8, 13, 18, 0.72);
  --overlay-fg: #f0f6fc;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --voice-scope-mic: rgba(152, 162, 174, 0.75);
  --voice-scope-out: #58a6ff;
  --voice-scope-grid: rgba(152, 162, 174, 0.25);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface2: #f6f8fa;
  --surface3: #eaeef2;
  --border: #d0d7de;
  --border-strong: #afb8c1;
  --fg: #1f2328;
  --muted: #59636e;
  --accent: #0969da;
  --primary: #0969da;
  --primary-hover: #0550ae;
  --cta: #1f883d;
  --cta-hover: #1a7f37;
  --online: #1a7f37;
  --attention: #9a6700;
  --danger: #cf222e;
  --focus: #0969da;
  --shadow: 0 12px 28px rgba(31, 35, 40, 0.16);
  --voice-scope-mic: rgba(89, 99, 110, 0.55);
  --voice-scope-out: #0969da;
  --voice-scope-grid: rgba(89, 99, 110, 0.2);
}
html, body { height: 100%; }
body.mr-body { display: flex; flex-direction: column; min-height: 100%; background: var(--bg); color: var(--fg); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.mr-muted { color: var(--muted); font-size: 12px; }

.mr-top { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mr-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; text-decoration: none; }
.mr-top-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.mr-lock { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--online) 45%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--online) 12%, transparent); color: var(--online); font-size: 12px; font-weight: 600; }
.mr-lock svg { width: 14px; height: 14px; }
.mr-quality { position: relative; display: flex; align-items: center; }
.mr-theme { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); color: var(--muted); }
.mr-theme:hover { color: var(--fg); border-color: var(--border-strong); }
.mr-theme svg { width: 16px; height: 16px; }
:root[data-theme="light"] .mr-theme-sun, :root:not([data-theme="light"]) .mr-theme-moon { display: none; }
.mr-quality .fm-q { display: contents; --fm-q-you: var(--accent); --fm-q-them: var(--muted); --fm-q-line: var(--fg); --fm-q-grid: var(--border-strong); --fm-q-good: var(--online); --fm-q-fair: var(--attention); --fm-q-poor: var(--danger); }

.mr-trust { position: absolute; z-index: 20; top: 58px; right: 16px; width: min(440px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface2); box-shadow: var(--shadow); }
.mr-trust h2 { font-size: 15px; margin-bottom: 8px; }
.mr-trust ul { display: grid; gap: 8px; padding-left: 18px; margin-bottom: 12px; color: var(--muted); }
.mr-trust strong { color: var(--fg); }
.mr-code-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.mr-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 700; letter-spacing: 0.06em; }
.mr-code-words { color: var(--muted); }

.mr-main { flex: 1; display: flex; min-height: 0; }
.mr-blocked { display: flex; gap: 12px; align-items: flex-start; margin: 12px auto 0; width: calc(100% - 32px); max-width: 1048px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--attention) 55%, var(--border)); border-radius: var(--radius); background: color-mix(in srgb, var(--attention) 10%, var(--surface)); }
.mr-blocked-icon { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--attention); color: var(--bg); font-size: 13px; font-weight: 800; }
.mr-blocked-body { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.mr-blocked-title { font-weight: 600; }
.mr-blocked-text, .mr-blocked-steps { color: var(--muted); }
.mr-blocked-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.mr-blocked-address { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.mr-blocked-copy { height: 30px; }
.mr-blocked-help { color: var(--accent); font-size: 13px; }
.mr-blocked-help:hover { text-decoration: underline; }
.mr-message { margin: auto; max-width: 460px; padding: 32px 20px; text-align: center; }
.mr-message h1 { font-size: 20px; margin-bottom: 8px; }
.mr-message p { color: var(--muted); }
.mr-message-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }

.mr-lobby { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; width: 100%; max-width: 1080px; margin: auto; padding: 24px 16px; align-items: start; }
.mr-preview { display: grid; gap: 14px; min-width: 0; }
.mr-preview-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface2); border: 1px solid var(--border); }
.mr-preview-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.mr-preview-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; color: var(--muted); text-align: center; }
.mr-preview-tools { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 10px; }
.mr-round { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2); background: var(--overlay); color: var(--overlay-fg); }
.mr-round span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mr-round[aria-pressed="false"] { background: var(--danger); border-color: transparent; color: #fff; }
.mr-effects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; min-width: 0; }
.mr-field { display: grid; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.mr-field select, .mr-field input { width: 100%; min-width: 0; height: var(--control); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); color: var(--fg); font-size: 13px; text-overflow: ellipsis; }
.mr-field input:focus, .mr-field select:focus { border-color: var(--accent); outline: none; }
.mr-voice { grid-column: 1 / -1; min-width: 0; }
.mr-voice:empty { display: none; }
.mr-voice .chat-call-voice-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mr-voice .chat-call-face { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; min-width: 0; font-size: 12px; color: var(--muted); }
.mr-voice .chat-call-face > span:first-child { grid-column: 1 / -1; }
.mr-voice .chat-call-face > span[aria-live] { align-self: center; white-space: nowrap; }
.mr-voice select { width: 100%; min-width: 0; height: var(--control); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); color: var(--fg); font-size: 13px; }
.mr-voice button { height: var(--control); padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); font-size: 13px; white-space: nowrap; }
.mr-voice button:not(:disabled):hover { border-color: var(--accent); }
.mr-voice button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface2)); }
.mr-voice .chat-call-voice-scope { grid-column: 1 / -1; display: grid; gap: 6px; }
.mr-voice .chat-call-voice-scope canvas { display: block; width: 100%; height: 72px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.chat-call-voice-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-call-voice-key { display: inline-flex; align-items: center; gap: 5px; }
.chat-call-voice-key::before { content: ""; width: 12px; height: 2px; border-radius: 1px; background: var(--voice-scope-mic); }
.chat-call-voice-key.is-out::before { height: 3px; background: var(--voice-scope-out); }
.chat-call-voice-readout { margin-left: auto; color: var(--fg); }
.mr-voice .chat-call-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.mr-effects-note { grid-column: 1 / -1; }

.mr-join { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mr-eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.mr-join h1 { font-size: 22px; line-height: 1.25; }
.mr-host { font-weight: 600; }
.mr-when, .mr-status { color: var(--muted); }
.mr-name input { height: 40px; }
.mr-cta { height: 42px; border: 0; border-radius: 8px; background: var(--cta); color: #fff; font-weight: 600; }
.mr-cta:not(:disabled):hover { background: var(--cta-hover); }
.mr-error { color: var(--danger); font-size: 13px; }
.mr-assurance { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.mr-assurance svg { color: var(--online); width: 22px; height: 22px; }
.mr-assurance strong { color: var(--fg); }
.mr-link { border: 0; background: none; color: var(--accent); padding: 0; font-size: 13px; }
.mr-link:hover { text-decoration: underline; }
.mr-button { height: var(--control); padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); font-size: 13px; }
.mr-button:not(:disabled):hover { border-color: var(--accent); }

.mr-button-link { display: inline-flex; align-items: center; justify-content: center; color: var(--fg); text-decoration: none; }
.mr-primary { display: inline-flex; align-items: center; justify-content: center; height: var(--control); padding: 0 16px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.mr-primary:hover { background: var(--primary-hover); }
.mr-primary-small { height: 30px; padding: 0 12px; }
.mr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.mr-share { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.mr-share p:empty { display: none; }
.mr-invite { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
[data-mr="share-link-room"][hidden], [data-mr="invite-share"][hidden], [data-mr="share-link"][hidden] { display: none; }
.mr-devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mr-devices[hidden], [data-mr="dev-speaker-field"][hidden], [data-mr="check-speaker-field"][hidden] { display: none; }

.mr-home { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; }
.mr-home-head { margin-bottom: 16px; }
.mr-home-head h1 { font-size: 22px; line-height: 1.25; margin-bottom: 4px; }
.mr-home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mr-card { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.mr-card-wide { grid-column: 1 / -1; }
.mr-card h2 { font-size: 16px; }
.mr-card h3 { font-size: 18px; line-height: 1.3; }
.mr-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mr-signed-out { display: grid; gap: 10px; justify-items: start; color: var(--muted); }
.mr-start { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; }
.mr-start[hidden], .mr-created[hidden], .mr-signed-out[hidden] { display: none; }
.mr-wide { grid-column: 1 / -1; }
.mr-start input { height: 40px; }
.mr-created { display: grid; gap: 10px; }
.mr-link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mr-link-row input { flex: 1 1 220px; min-width: 0; height: var(--control); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); color: var(--fg); font-size: 13px; }
.mr-link-row input:focus { border-color: var(--accent); outline: none; }
.mr-link-row input[readonly] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.mr-meetings { list-style: none; display: grid; gap: 8px; }
.mr-meetings:empty { display: none; }
.mr-meeting { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: var(--surface2); }
.mr-meeting-body { display: grid; gap: 2px; min-width: 0; }
.mr-meeting-body strong { font-size: 14px; overflow-wrap: anywhere; }
.mr-pill { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--online) 45%, var(--border)); color: var(--online); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.mr-check { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.mr-check-side { display: grid; gap: 10px; min-width: 0; }
.mr-check-effects { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.mr-check-effects[hidden] { display: none; }
.mr-check .mr-preview-empty > div { display: grid; gap: 12px; justify-items: center; max-width: 360px; }
.mr-preview-frame video[hidden], .mr-preview-empty[hidden], [data-mr="check-start"][hidden] { display: none; }
.mr-preview-frame video.mr-playback { transform: none; object-fit: contain; background: #000; }
.mr-meter { height: 6px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.mr-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--online); transition: width 80ms linear; }
.mr-diag { list-style: none; display: grid; gap: 6px; }
.mr-diag:empty { display: none; }
.mr-diag-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface2); }
.mr-diag-item p { color: var(--muted); font-size: 13px; }
.mr-diag-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--surface3); color: var(--muted); font-size: 12px; font-weight: 700; }
.mr-diag-item[data-status="ok"] .mr-diag-mark { background: color-mix(in srgb, var(--online) 20%, transparent); color: var(--online); }
.mr-diag-item[data-status="warn"] .mr-diag-mark { background: color-mix(in srgb, var(--attention) 20%, transparent); color: var(--attention); }
.mr-diag-item[data-status="bad"] .mr-diag-mark { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }

.mr-call { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.mr-stage { position: relative; grid-column: 1; grid-row: 1; padding: 12px; min-height: 0; overflow: auto; }
.mr-grid { display: grid; gap: 10px; height: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); grid-auto-rows: minmax(180px, 1fr); }
.mr-grid[data-count="1"], .mr-grid[data-count="2"] { grid-auto-rows: minmax(220px, 1fr); }
.mr-tile { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); background: var(--surface2); border: 1px solid var(--border); }
.mr-tile video { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.mr-tile video.mr-tile-backdrop { position: absolute; inset: 0; z-index: -1; object-fit: cover; filter: blur(28px) brightness(0.6); transform: scale(1.2); pointer-events: none; }
.mr-tile.is-self video { transform: scaleX(-1); }
.mr-tile.is-self video.mr-tile-backdrop { transform: scale(-1.2, 1.2); }
.mr-tile.is-novideo video { visibility: hidden; }
.mr-tile.is-novideo::before { content: attr(data-initial); position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 999px; background: var(--surface3); font-size: 28px; font-weight: 600; }
.mr-tile figcaption { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px; border-radius: 6px; background: var(--overlay); color: var(--overlay-fg); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mr-tile.is-muted figcaption::after { content: " · muted"; opacity: 0.7; }
.mr-tile-note:empty { display: none; }
.mr-tile-note { position: absolute; left: 50%; top: calc(50% + 48px); transform: translateX(-50%); width: calc(100% - 24px); max-width: 360px; margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.mr-badge:empty { display: none; }
.mr-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--overlay); border: 1px solid #d29922; color: #e3b341; font-size: 11px; font-weight: 600; }
.mr-toasts { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; pointer-events: none; }
.mr-toast { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px; box-shadow: var(--shadow); }

.mr-side { grid-column: 2; grid-row: 1 / span 2; width: min(360px, 100vw); display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface); min-height: 0; }
.mr-tabs { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.mr-tabs [role="tab"] { height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; }
.mr-tabs [role="tab"][aria-selected="true"] { background: var(--surface2); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.mr-side-close { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 20px; }
.mr-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 0; flex: 1; overflow: auto; }
.mr-panel .mr-effects { grid-template-columns: 1fr; }
.mr-chat { gap: 8px; }
.mr-chat-list { list-style: none; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 120px; overflow: auto; }
.mr-chat-list:empty { display: none; }
.mr-chat-item { display: grid; gap: 2px; padding: 2px 0; }
.mr-chat-head { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 12px; }
.mr-chat-head time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mr-chat-item.is-mine .mr-chat-head strong { color: var(--accent); }
.mr-chat-text { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mr-chat-text a { color: var(--accent); }
.mr-chat-empty { margin-bottom: auto; }
.mr-chat-form { display: flex; align-items: flex-end; gap: 8px; }
.mr-chat-form textarea { flex: 1; min-width: 0; min-height: var(--control); max-height: 140px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface2); color: var(--fg); font: inherit; font-size: 13px; line-height: 1.4; resize: none; }
.mr-chat-form textarea:focus { border-color: var(--accent); outline: none; }
.mr-chat-form .mr-primary:disabled { opacity: 0.5; cursor: default; }
.mr-chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; }
.mr-control { position: relative; }
.mr-unread { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.mr-people { list-style: none; display: grid; gap: 6px; }
.mr-people li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface2); }
.mr-tr-head { display: flex; align-items: end; gap: 8px; }
.mr-tr-head .mr-field { flex: 1; }
.mr-transcript { list-style: none; display: grid; gap: 8px; flex: 1; min-height: 120px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); align-content: start; }
.mr-transcript li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; font-size: 13px; }
.mr-transcript time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mr-transcript strong { font-size: 12px; }
.mr-transcript span { grid-column: 1 / -1; }
.mr-transcript li.is-interim span { color: var(--muted); font-style: italic; }
.mr-tr-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mr-controls { grid-column: 1; grid-row: 2; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.mr-control { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface2); font-size: 13px; }
.mr-control:not(:disabled):hover { border-color: var(--accent); }
.mr-control[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.mr-control[data-mr="mute"][aria-pressed="true"], .mr-control[data-mr="camera"][aria-pressed="true"] { background: var(--danger); border-color: transparent; color: #fff; }
.mr-leave { background: var(--danger); border-color: transparent; color: #fff; }
.mr-leave:not(:disabled):hover { border-color: transparent; filter: brightness(1.1); }

.mr-check-effects .chat-call-voice-preview, .mr-panel .chat-call-voice-preview { padding: 0; border: 0; background: none; }

.mr-react-layer { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.mr-react-pop { position: absolute; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -50%); animation: mr-react-rise 3s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; will-change: transform, opacity; }
.mr-react-emoji { font-size: 44px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35)); }
.mr-react-pop.is-sound .mr-react-emoji { font-size: 56px; }
.mr-react-name { max-width: 180px; padding: 2px 8px; border-radius: 999px; background: var(--overlay); color: var(--overlay-fg); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-react-pop.is-mine .mr-react-name { background: var(--primary); color: #fff; }
.mr-react-pop[data-motion="float"] { animation-name: mr-react-float; animation-duration: 3.2s; }
.mr-react-pop[data-motion="wobble"] .mr-react-emoji { animation: mr-react-wobble 0.35s ease-in-out 6 alternate; }
.mr-react-pop[data-motion="pop"] .mr-react-emoji { animation: mr-react-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.mr-react-pop[data-motion="shake"] .mr-react-emoji { animation: mr-react-shake 0.12s linear 10; }
.mr-react-pop[data-motion="swing"] .mr-react-emoji { transform-origin: 50% 0; animation: mr-react-swing 0.5s ease-in-out 4 alternate; }
.mr-react-pop[data-motion="bounce"] { animation-name: mr-react-bounce; animation-timing-function: linear; }
.mr-react-pop[data-motion="droop"] { animation-name: mr-react-droop; }
.mr-react-pop[data-motion="rocket"] { animation-name: mr-react-rocket; animation-duration: 2.2s; animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
.mr-react-pop[data-motion="fade"] { animation: mr-react-fade 2.6s ease forwards; }
.mr-react-confetti, .mr-react-sparkle { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: mr-react-burst 1.6s cubic-bezier(0.15, 0.6, 0.35, 1) var(--delay, 0ms) forwards; }
.mr-react-sparkle { width: 6px; height: 6px; border-radius: 999px; animation-duration: 1s; }
@keyframes mr-react-rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 22% { transform: translate(-50%, -60%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -320%) scale(0.9); } }
@keyframes mr-react-float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 40% { transform: translate(calc(-50% + var(--drift, 0px)), -140%) scale(1); } 70% { opacity: 1; transform: translate(calc(-50% - var(--drift, 0px)), -230%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -320%) scale(0.85); } }
@keyframes mr-react-bounce { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 8% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 20% { transform: translate(-50%, -190%); } 32% { transform: translate(-50%, -50%) scaleY(0.8); } 44% { transform: translate(-50%, -140%); } 56% { transform: translate(-50%, -50%) scaleY(0.88); } 66% { transform: translate(-50%, -95%); } 76% { transform: translate(-50%, -50%); } 90% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%); } }
@keyframes mr-react-droop { 0% { opacity: 0; transform: translate(-50%, -80%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -100%) scale(1.05) rotate(0deg); } 70% { opacity: 1; transform: translate(-50%, -30%) scale(1) rotate(-14deg); } 100% { opacity: 0; transform: translate(-50%, 10%) scale(0.9) rotate(-22deg); } }
@keyframes mr-react-rocket { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 12% { opacity: 1; transform: translate(-50%, -40%) scale(1); } 30% { transform: translate(-50%, -45%) rotate(-4deg); } 100% { opacity: 0; transform: translate(calc(-50% + 120px), -900%) rotate(10deg) scale(0.8); } }
@keyframes mr-react-fade { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mr-react-wobble { from { transform: rotate(-12deg); } to { transform: rotate(12deg) scale(1.08); } }
@keyframes mr-react-pop { 0% { transform: scale(0.2); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes mr-react-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px) rotate(-6deg); } 75% { transform: translateX(5px) rotate(6deg); } }
@keyframes mr-react-swing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes mr-react-burst { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 90px)) rotate(var(--spin)); } }

.mr-react { position: absolute; z-index: 16; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 10px; width: min(640px, calc(100vw - 24px)); max-height: calc(100% - 96px); overflow: auto; padding: 14px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.mr-react-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.mr-react-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mr-react-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.mr-react-toggle input { accent-color: var(--primary); }
.mr-react-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.mr-react-emoji-button { display: grid; place-items: center; height: 42px; border: 1px solid transparent; border-radius: 10px; background: var(--surface2); font-size: 24px; line-height: 1; transition: transform 120ms ease, border-color 120ms ease; }
.mr-react-emoji-button:hover { transform: translateY(-2px) scale(1.12); border-color: var(--border-strong); }
.mr-react-emoji-button:active { transform: scale(0.94); }
.mr-react-sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.mr-react-sound { display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); font-size: 13px; text-align: left; transition: border-color 120ms ease, transform 120ms ease; }
.mr-react-sound span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mr-react-sound .mr-react-glyph { font-size: 18px; line-height: 1; }
.mr-react-sound:hover { border-color: var(--accent); }
.mr-react-sound:active { transform: scale(0.97); }
.mr-control[data-mr="open-react"][aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .mr-react-pop .mr-react-emoji { animation: none !important; }
  .mr-react-confetti, .mr-react-sparkle { display: none; }
}

@media (max-width: 820px) {
  .mr-lobby { grid-template-columns: 1fr; }
  .mr-home-grid, .mr-check { grid-template-columns: 1fr; }
  .mr-start { grid-template-columns: 1fr; }
  .mr-call { grid-template-columns: 1fr; }
  .mr-side { position: fixed; z-index: 15; inset: 52px 0 0 auto; width: min(380px, 100vw); }
  .mr-control span { display: none; }
  .mr-control { padding: 0 12px; }
  .mr-top-title { display: none; }
  .mr-react { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .mr-effects { grid-template-columns: 1fr; }
  .mr-lobby { padding: 12px; gap: 16px; }
  .mr-voice .chat-call-voice-preview { grid-template-columns: 1fr; }
  .mr-react-sounds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fm-q-bar { order: 3; margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 4px; }
.fm-q-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface2); color: var(--muted); font: inherit; font-size: 11px; font-variant-numeric: tabular-nums; cursor: pointer; }
.fm-q-pill:hover { color: var(--fg); border-color: var(--border-strong); }
.fm-q-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fm-q-bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 10px; }
.fm-q-bars[hidden], .fm-q-text[hidden] { display: none; }
.fm-q-bars i { width: 2px; border-radius: 1px; background: var(--border-strong); }
.fm-q-bars i:nth-child(1) { height: 3px; }
.fm-q-bars i:nth-child(2) { height: 5px; }
.fm-q-bars i:nth-child(3) { height: 7px; }
.fm-q-bars i:nth-child(4) { height: 10px; }
.fm-q[data-grade="good"] .fm-q-bars i.is-on { background: var(--online); }
.fm-q[data-grade="fair"] .fm-q-bars i.is-on { background: var(--attention); }
.fm-q[data-grade="poor"] .fm-q-bars i.is-on { background: var(--danger); }
.fm-q-chart { display: block; }
.fm-q-panel { flex-basis: 100%; order: 10; display: grid; gap: 4px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.fm-q-panel[hidden] { display: none; }
.fm-q-heading { color: var(--fg); font-weight: 600; }
.fm-q-row { display: grid; grid-template-columns: 64px 120px minmax(0, 1fr); align-items: center; gap: 8px; }
.fm-q-row[hidden] { display: none; }
.fm-q-value { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.fm-q-diag { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface2); color: var(--fg); font: inherit; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.fm-q-diag[hidden] { display: none; }
.fm-q-diag:hover { background: var(--surface3); }
.fm-q-diag:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fm-q-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.fm-q-diag[data-state="ok"] .fm-q-dot { background: var(--online); }
.fm-q-diag[data-state="warn"], .fm-q-diag[data-state="bad"] { border-color: var(--danger); color: var(--danger); }
.fm-q-diag[data-state="warn"] .fm-q-dot, .fm-q-diag[data-state="bad"] .fm-q-dot { background: var(--danger); }
.fm-q-diag[data-state="bad"] { background: color-mix(in srgb, var(--danger) 16%, var(--surface2)); }
.fm-q-diag-panel { order: 11; gap: 6px; }
.fm-q-issues, .fm-q-fixes { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.fm-q-issue p { margin: 2px 0; }
.fm-q-issue strong { color: var(--fg); font-size: 12px; }
.fm-q-issue[data-severity="bad"] strong { color: var(--danger); }
.fm-q-issue[data-severity="ok"] { list-style: none; margin-left: -18px; }
.fm-q-prompt { width: 100%; box-sizing: border-box; resize: vertical; min-height: 96px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--fg); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.fm-q-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fm-q-action { height: 24px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--fg); font: inherit; font-size: 11px; cursor: pointer; }
.fm-q-action:hover { border-color: var(--border-strong); }
.fm-q-action:focus-visible, .fm-q-note-input:focus-visible, .fm-q-prompt:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fm-q-note-input { flex: 1 1 160px; min-width: 0; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--fg); font: inherit; font-size: 11px; }
.fm-q-status { color: var(--muted); }
@media (max-width: 480px) {
  .fm-q-row { grid-template-columns: 64px minmax(0, 1fr); row-gap: 2px; }
  .fm-q-value { grid-column: 2; }
}
.mr-agent-tile { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--agent-color) 22%, var(--surface2)), var(--surface2) 70%); }
.mr-agent-tile.is-novideo::before { content: none; }
.mr-agent-face { width: min(46%, 168px); aspect-ratio: 1; margin-bottom: 34px; transform-origin: 50% 90%; }
.mr-agent-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mr-agent-tile .mr-badge { border-color: var(--border-strong); color: var(--overlay-fg); font-weight: 500; }
.mr-agent-bubble { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 6px 10px; border-radius: 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13px; line-height: 1.35; text-align: center; z-index: 2; }
.mr-agent-ptt { position: absolute; right: 8px; bottom: 8px; height: var(--control); padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--overlay); color: var(--overlay-fg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mr-agent-ptt:hover { border-color: var(--accent); }
.mr-agent-ptt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mr-agent-ptt.is-held { background: var(--primary); border-color: var(--primary); color: #fff; }
.mr-agent-remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--overlay); color: var(--overlay-fg); font-size: 16px; line-height: 1; cursor: pointer; }
.mr-agent-remove:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mr-agent-tile.is-speaking .mr-agent-face { animation: mr-agent-talk 0.32s ease-in-out infinite alternate; }
.mr-agent-light { animation: mr-agent-blink 2.4s ease-in-out infinite; }
.mr-agent-tile.is-speaking .mr-agent-light { animation-duration: 0.4s; }
.mr-agent-face[data-motion="bob"] { animation: mr-agent-bob 0.6s ease-in-out 3; }
.mr-agent-face[data-motion="bounce"] { animation: mr-agent-bounce 0.45s ease-out 4; }
.mr-agent-face[data-motion="nod"] { animation: mr-agent-nod 0.5s ease-in-out 3; }
.mr-agent-face[data-motion="shake"] { animation: mr-agent-shake 0.35s ease-in-out 4; }
.mr-agent-face[data-motion="tilt"] { animation: mr-agent-tilt 1.2s ease-in-out infinite alternate; }
.mr-agent-face[data-motion="wave"] { animation: mr-agent-tilt 0.4s ease-in-out 6 alternate; }
.mr-agent-face[data-motion="droop"] { animation: mr-agent-droop 1.6s ease-in-out forwards; }
.mr-agent-face[data-motion="pop"] { animation: mr-agent-pop 0.5s cubic-bezier(.3, 1.6, .5, 1) 1; }
.mr-agent-face[data-motion="spin"] { animation: mr-agent-spin 0.9s ease-in-out 1; }
.mr-agent-face[data-motion="rocket"] { animation: mr-agent-rocket 1.1s ease-in-out 1; }
@keyframes mr-agent-talk { from { transform: translateY(0) scale(1); } to { transform: translateY(-3px) scale(1.02); } }
@keyframes mr-agent-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes mr-agent-bob { 50% { transform: translateY(-8px); } }
@keyframes mr-agent-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16px) scale(0.96, 1.04); } 60% { transform: translateY(0) scale(1.05, 0.95); } }
@keyframes mr-agent-nod { 50% { transform: rotateX(25deg) translateY(4px); } }
@keyframes mr-agent-shake { 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes mr-agent-tilt { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes mr-agent-droop { to { transform: translateY(8px) rotate(-4deg) scale(0.96); } }
@keyframes mr-agent-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes mr-agent-spin { to { transform: rotate(360deg); } }
@keyframes mr-agent-rocket { 40% { transform: translateY(-26px) rotate(-6deg); } 70% { transform: translateY(-30px) rotate(6deg); } 100% { transform: translateY(0); } }
.mr-agents { display: grid; gap: 10px; align-content: start; }
.mr-agent-add { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.mr-agent-add .mr-field { flex: 1 1 140px; max-width: 280px; }
.mr-agent-warn { color: var(--attention); }
.mr-agent-list { list-style: none; display: grid; gap: 6px; }
.mr-agent-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface2); flex-wrap: wrap; }
.mr-agent-list .mr-muted { flex: 1; font-size: 12px; }
.mr-agent-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.mr-agent-ask { display: flex; gap: 8px; flex-wrap: wrap; }
.mr-agent-ask select { flex: 0 0 auto; }
.mr-agent-ask input { flex: 1 1 160px; min-width: 0; }
.mr-agent-ask select, .mr-agent-ask input { height: var(--control); padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; }
.mr-agent-ask select:focus-visible, .mr-agent-ask input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.mr-agent-notes { display: grid; gap: 6px; }
.mr-agent-notes h3 { font-size: 13px; }
.mr-agent-notes ol { padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.mr-solo-crew { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.mr-agent-card { min-height: 220px; }
.mr-solo-lines { max-height: 340px; }
.mr-inline { display: inline-grid; }
@media (prefers-reduced-motion: reduce) {
  .mr-agent-face, .mr-agent-face[data-motion], .mr-agent-tile.is-speaking .mr-agent-face, .mr-agent-light { animation: none !important; }
}
