:root {
  --bg: #202124;
  --surface: #2d2e31;
  --surface-2: #3c4043;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --primary: #8ab4f8;
  --primary-strong: #1a73e8;
  --danger: #ea4335;
  --speaking: #8ab4f8;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.sprite { display: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.view { height: 100%; display: flex; flex-direction: column; overflow: auto; }

.topbar { display: flex; align-items: center; padding: 16px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--text); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 8px; border: 0; font-weight: 500; text-decoration: none; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--primary-strong); color: #fff; }
.btn.primary:hover { background: #1765cc; }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.text { background: none; color: var(--primary); }
.btn.text:hover { background: rgba(138, 180, 248, .08); }
.btn.outline { background: none; color: var(--primary); border: 1px solid #5f6368; }

.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.round:hover { filter: brightness(1.15); }
.round.off { background: var(--danger); }
.round.on { background: var(--primary); color: #202124; }
.round.danger { background: var(--danger); }
.round.wide { width: 64px; border-radius: 24px; }
.round:disabled { opacity: .4; cursor: default; }

.icon { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--text); }
.icon:hover { background: rgba(255, 255, 255, .08); }
.icon.active { color: var(--primary); background: rgba(138, 180, 248, .12); }

.error { color: #f28b82; }
.muted { color: var(--muted); }
.secure { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.secure svg { width: 16px; height: 16px; color: #81c995; }

/* Home */
.home { max-width: 640px; margin: auto; padding: 24px 16px 15vh; }
.home h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 400; line-height: 1.2; margin: 0 0 16px; }
.lede { color: var(--muted); font-size: 18px; line-height: 1.5; margin: 0 0 32px; }

/* Home: story on the left, sign-in on the right; one column on narrow screens. */
.home.split { max-width: 1120px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px 56px; align-items: start; padding-top: 6vh; }
.home-signin { position: sticky; top: 24px; }
.home-signin .card { margin-top: 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.home.split .steps { grid-template-columns: 1fr; }
.home.split .steps li { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.home.split .steps li > span:last-child { flex-basis: 100%; }
@media (max-width: 860px) {
  .home.split { grid-template-columns: 1fr; padding-top: 24px; }
  .home-signin { position: static; }
  .home-signin .card { margin-top: 0; }
}
/* The headline is set like the logo wordmark: lowercase, bold, tight, blue "pop" and a
   green "n" with the three pop rays (same geometry as logo.svg). */
.home h1.wordmark { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif; font-weight: 700; letter-spacing: -0.028em; font-size: clamp(40px, 7vw, 60px); line-height: 1.1; margin: 28px 0 10px; }
.wm-pop { color: #2b8cff; }
.wm-n { color: #34c759; position: relative; display: inline-block; }
.wm-n svg { position: absolute; left: 50%; top: -0.2em; width: .72em; height: .28em; transform: translateX(-50%); overflow: visible; }
.tagline { font-size: clamp(18px, 2.4vw, 24px); color: var(--text); opacity: .85; margin: 0 0 18px; line-height: 1.3; }
.home-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.join-form { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.join-form input, #prejoin-form input, .chat-form input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 8px; border: 1px solid #5f6368; background: transparent;
}
input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }

/* Pre-join */
.prejoin { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px; padding: 16px; }
.preview { width: min(720px, 100%); }
.preview .tile { aspect-ratio: 16 / 9; }
.preview-controls { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 16px; }
.preview-controls .round { border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .3); }
.preview-controls .round.off { background: var(--danger); border-color: var(--danger); }
.devices { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.devices label { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.devices select { height: 36px; border-radius: 8px; background: var(--surface); border: 1px solid #5f6368; padding: 0 8px; }
.prejoin-side { width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; }
.prejoin-side h2 { font-size: 28px; font-weight: 400; margin: 0; }
.prejoin-side p { margin: 0; }
#prejoin-form { display: flex; flex-direction: column; gap: 12px; }

/* Tiles */
.tile { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); min-height: 0; min-width: 0; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.mirror video { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: var(--surface); }
.tile.no-video .avatar { display: grid; }
.tile.no-video video { visibility: hidden; }
.avatar span { width: clamp(48px, 22%, 120px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(20px, 4vw, 48px); background: var(--avatar, #5f6368); color: #fff; text-transform: uppercase; }
.tile .label { position: absolute; left: 10px; bottom: 8px; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 20px); font-size: 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.tile .label .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .muted-icon { display: none; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: rgba(0, 0, 0, .5); }
.tile.mic-off .muted-icon { display: block; }
.tile .status { position: absolute; top: 10px; right: 10px; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .6); }
.tile .status:empty { display: none; }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; border: 3px solid transparent; transition: border-color .15s; }
.tile.speaking::after { border-color: var(--speaking); }

/* Meeting */
.meeting { overflow: hidden; }
.meeting-body { flex: 1; display: flex; min-height: 0; padding: 16px 16px 0; gap: 16px; }
.stage { flex: 1; display: flex; gap: 12px; min-width: 0; min-height: 0; }
.spotlight { display: none; flex: 1; min-width: 0; }
.spotlight .tile { width: 100%; height: 100%; }
.grid { flex: 1; display: grid; gap: 12px; min-width: 0; min-height: 0; align-content: center;
  justify-content: center; grid-template-columns: repeat(var(--cols, 1), var(--col-w, minmax(0, 1fr))); grid-auto-rows: var(--row-h, 1fr); }
.grid .tile { height: 100%; }
.stage.presenting .spotlight { display: block; }
.stage.presenting .grid { flex: 0 0 240px; grid-template-columns: 1fr; grid-auto-rows: 135px; align-content: start; overflow-y: auto; }

.panel { width: 360px; flex: none; background: #fff; color: #202124; border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0 24px; }
.panel h2 { font-size: 18px; font-weight: 400; margin: 0; }
.panel .icon { color: #5f6368; }
.panel .icon:hover { background: rgba(0, 0, 0, .06); }
.panel-chat, .panel-people { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px 24px 16px; }
.panel .hint { font-size: 12px; color: #5f6368; background: #f1f3f4; padding: 12px; border-radius: 8px; margin: 0 0 8px; }
.chat-log { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; }
.chat-log li { margin: 14px 0; }
.chat-log .meta { font-size: 13px; font-weight: 500; }
.chat-log .meta time { font-weight: 400; color: #5f6368; margin-left: 8px; }
.chat-log .text { font-size: 14px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; align-items: center; gap: 4px; background: #f1f3f4; border-radius: 24px; padding-left: 4px; margin-top: 8px; }
.chat-form input { border: 0; background: none; color: #202124; height: 44px; }
.chat-form input:focus { outline: none; }
.chat-form .icon { color: var(--primary-strong); }
.invite p { font-size: 14px; color: #5f6368; }
.invite .secure { font-size: 12px; align-items: flex-start; }
.invite-row { display: flex; align-items: center; gap: 4px; background: #f1f3f4; border-radius: 8px; padding: 4px 4px 4px 12px; }
.invite-row code { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #202124; }
.people-list { list-style: none; padding: 0; margin: 16px 0 0; overflow-y: auto; }
.people-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.people-list .avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--avatar, #5f6368); text-transform: uppercase; flex: none; }
.people-list .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list svg { width: 20px; height: 20px; color: #5f6368; }

.invite-card { position: absolute; left: 24px; bottom: 96px; width: min(360px, calc(100% - 48px)); background: #fff; color: #202124; border-radius: 8px; padding: 16px 16px 20px 24px; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); z-index: 5; }
.invite-card header { display: flex; justify-content: space-between; align-items: center; }
.invite-card h3 { margin: 0; font-weight: 400; font-size: 18px; }
.invite-card p { font-size: 14px; color: #5f6368; }
.invite-card .icon { color: #5f6368; }

.controls { height: 80px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; gap: 12px; }
.controls .left { display: flex; gap: 12px; color: var(--text); white-space: nowrap; overflow: hidden; }
.controls .left .sep { color: var(--muted); }
.controls .center { display: flex; gap: 12px; }
.controls .right { display: flex; justify-content: flex-end; gap: 4px; }
.badge-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--surface-2); font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

.left-view { margin: auto; text-align: center; padding: 16px; }
.left-view h1 { font-weight: 400; }
.left-view .home-actions { justify-content: center; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #e8eaed; color: #202124; padding: 12px 20px; border-radius: 6px; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); z-index: 10; max-width: calc(100% - 32px); }

@media (max-width: 760px) {
  .meeting-body { padding: 8px 8px 0; }
  .panel { position: fixed; inset: 0 0 80px 0; width: auto; border-radius: 0; z-index: 4; }
  /* Chat or people open on a phone: the video shrinks to a strip on top (the other side
     full width, yourself as a small thumbnail in its corner) and the panel fills the rest,
     instead of covering the video entirely. */
  .meeting-body.panel-open { flex-direction: column; gap: 8px; }
  .meeting-body.panel-open .stage { flex: 0 0 auto; height: 34vh; height: 34dvh; min-height: 150px; }
  .meeting-body.panel-open .stage.presenting .grid { display: none; }
  .meeting-body.panel-open .panel { position: static; inset: auto; flex: 1; min-height: 0; border-radius: var(--radius) var(--radius) 0 0; z-index: auto; }
  .meeting-body.panel-open .panel header { padding-top: 8px; }
  .meeting-body.panel-open .pager { display: none; }
  .stage.pip-self .grid .tile[data-self] { position: absolute; right: 8px; bottom: 8px; width: 30%; max-width: 150px; height: auto; aspect-ratio: 16 / 9; z-index: 3; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
  .stage.pip-self .grid .tile[data-self] .self-toggle, .stage.pip-self .grid .tile[data-self] .name { display: none; }
  /* One row that fits a 360px phone: lock badge | mic cam more leave | people chat. */
  .controls { grid-template-columns: auto 1fr auto; gap: 6px; padding: 0 8px; }
  .controls .left #quality, .controls .center #btn-share { display: none; }
  .controls .center { gap: 6px; }
  .controls .right { gap: 0; }
  .controls .right .icon { width: 40px; height: 40px; }
  /* Toasts sit above the chat box while a panel is open, not on top of it. */
  body:has(#view-meeting:not([hidden]) .meeting-body.panel-open) .toast { bottom: auto; top: 12px; }
  .controls .round { width: 44px; height: 44px; }
  .controls .round.wide { width: 56px; }
  .stage.presenting { flex-direction: column; }
  .stage.presenting .grid { flex: 0 0 110px; grid-auto-flow: column; grid-auto-columns: 160px; grid-template-columns: none; grid-auto-rows: 100%; overflow-x: auto; }
  .prejoin { gap: 24px; }
}

/* ---- Accounts, dashboard, invitations ---- */
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.small { font-size: 13px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 20px; font-weight: 400; margin: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.form label > span { color: var(--muted); }
.form input, .form textarea { font: inherit; color: var(--text); background: transparent; border: 1px solid #5f6368; border-radius: 8px; padding: 10px 12px; min-width: 0; }
.form input { height: 44px; }
.form textarea { resize: vertical; }
.form .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.join-security { border: 1px solid #3c4043; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; margin: 0; min-width: 0; }
.join-security legend { color: var(--muted); font-size: 14px; padding: 0 6px; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 14px; }
.form label.check input { height: auto; width: auto; flex: none; margin-top: 3px; }
.form label.check > span { color: var(--text); }
.form label.check small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.linkish { background: none; border: 0; color: var(--primary); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.dev { font-family: ui-monospace, monospace; font-size: 13px; color: #fdd663; }
.turnstile:empty { display: none; }
.home .card { text-align: left; }
.narrow { max-width: 720px; width: 100%; margin: 0 auto; padding: 8px 16px 48px; }
.narrow.center { margin: auto; padding-bottom: 15vh; }
.narrow h1 { font-size: 28px; font-weight: 400; margin: 8px 0 16px; }
.back { color: var(--primary); text-decoration: none; font-size: 14px; }
.dash { max-width: 860px; width: 100%; margin: 0 auto; padding: 8px 16px 48px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font-size: 28px; font-weight: 400; margin: 8px 0; }
.meeting-list, .invite-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.meeting-list li { display: flex; align-items: center; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 14px 20px; cursor: pointer; }
.meeting-list li:hover { background: var(--surface-2); }
.meeting-list .title { flex: 1; min-width: 0; }
.meeting-list .title strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-list .title span { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.pill.live { background: #1e8e3e; color: #fff; }
.pill.ended { color: var(--muted); }
.pill.warn { background: #f9ab00; color: #202124; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-head h1 { margin: 8px 0 4px; }
.detail-head p { margin: 0; }
.pw-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pw-line > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.pw-line svg { width: 18px; height: 18px; color: #81c995; }
.pw-line code { font-size: 16px; padding: 4px 10px; background: var(--bg); border-radius: 6px; }
.section-title { font-size: 18px; font-weight: 400; margin: 24px 0 0; }
.invite-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 12px 16px; }
.invite-list .who { min-width: 0; }
.invite-list .who strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-list .who span { color: var(--muted); font-size: 13px; }
.invite-list .actions { display: flex; gap: 4px; align-items: center; }
.invite-list .actions .btn { height: 36px; padding: 0 12px; font-size: 14px; }
.invite-list .linkbox { grid-column: 1 / -1; display: flex; gap: 4px; align-items: center; background: var(--bg); border-radius: 8px; padding: 4px 4px 4px 12px; }
.invite-list .linkbox code { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-list li.revoked .who { opacity: .5; text-decoration: line-through; }
.menu { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); background: #fff; color: #202124; border-radius: 8px; padding: 8px 0; box-shadow: 0 4px 16px rgba(0,0,0,.4); z-index: 6; min-width: 240px; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 20px; font-size: 14px; }
.menu-item:hover { background: #f1f3f4; }
.menu-item.danger { color: #c5221f; }
.people-list .host-actions { display: flex; gap: 2px; }
.people-list .host-actions .icon { width: 36px; height: 36px; color: #5f6368; }
.people-list .tag { font-size: 11px; color: #5f6368; background: #f1f3f4; border-radius: 8px; padding: 1px 6px; }
.panel .secure { color: #5f6368; margin: 0 0 8px; align-items: flex-start; }
.panel .secure svg { color: #1e8e3e; flex: none; margin-top: 2px; }
#join-title { font-size: 26px; margin: 4px 0; }

/* ---- Legal pages, footer ---- */
.legal h2 { font-size: 18px; font-weight: 500; margin: 28px 0 8px; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--primary); }
.footer { margin-top: auto; padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.footer a { color: var(--muted); margin: 0 8px; }
.capacity { font-size: 13px; color: var(--muted); }

/* ---- Encryption indicator ---- */
.e2ee-badge { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid rgba(129, 201, 149, .5); background: rgba(129, 201, 149, .12); color: #81c995; font-size: 13px; white-space: nowrap; }
.e2ee-badge svg { width: 16px; height: 16px; }
.e2ee-badge.warn { color: #fdd663; border-color: rgba(253, 214, 99, .5); background: rgba(253, 214, 99, .12); }
.tile .lock-icon { display: none; width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #81c995; }
.tile.verified .lock-icon { display: block; }
@media (max-width: 760px) { .controls .left { display: flex; } .controls .left .sep, .controls .left #clock, .controls .left #meeting-title-bar { display: none; } .e2ee-badge .text { display: none; } .e2ee-badge { padding: 0 8px; } }

/* ---- Sponsor credit ---- */
.sponsor { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 11px; }
.sponsor img { height: 18px; width: auto; opacity: .85; }
.sponsor:hover img { opacity: 1; }
.footer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-links { display: flex; align-items: center; gap: 4px; }
.prejoin-side .sponsor, .left-view .sponsor { margin-top: 20px; }
.left-view .sponsor { justify-content: center; display: flex; }

/* ---- Light theme (follows the OS) ---- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-2: #e8eaed;
    --text: #202124;
    --muted: #5f6368;
    --primary: #1a73e8;
    --primary-strong: #1a73e8;
    color-scheme: light;
  }
  .card, .meeting-list li, .invite-list li { border: 1px solid #dadce0; }
  .form input, .form textarea, .devices select, .join-form input, #prejoin-form input { border-color: #dadce0; background: #fff; }
  .round { background: #e8eaed; color: #202124; }
  .round.on { background: #1a73e8; color: #fff; }
  .icon:hover { background: rgba(0, 0, 0, .06); }
  .btn.text:hover { background: rgba(26, 115, 232, .08); }
  .btn.outline { border-color: #dadce0; }
  .panel { border: 1px solid #dadce0; }
  .tile { background: #e8eaed; }
  .tile .avatar { background: #e8eaed; }
  .meeting, .meeting .controls { background: #202124; color: #e8eaed; }   /* the room stays dark: video looks better on dark */
  .meeting .tile { background: var(--surface-2); }
  .meeting .round { background: #3c4043; color: #e8eaed; }
  .meeting .round.off, .meeting .round.danger { background: #ea4335; color: #fff; }
  .meeting .icon { color: #e8eaed; }
  .meeting .icon:hover { background: rgba(255, 255, 255, .08); }
  .meeting .badge-count { background: #3c4043; color: #e8eaed; }
  .meeting .controls .left { color: #e8eaed; }
  .toast { background: #202124; color: #e8eaed; }
  .pw-line code { background: #f1f3f4; }
  .invite-list .linkbox { background: #f1f3f4; }
  .dev { color: #b06000; }
  .e2ee-badge { background: rgba(30, 142, 62, .12); border-color: rgba(30, 142, 62, .5); color: #1e8e3e; }
  .meeting .e2ee-badge { color: #81c995; border-color: rgba(129, 201, 149, .5); background: rgba(129, 201, 149, .12); }
}

/* ---- Home steps, banners, presence, reactions, PiP, self view ---- */
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.steps li strong { color: var(--text); font-weight: 500; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-strong); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.sponsor-line { margin-top: 24px; }
.banner { padding: 10px 16px; text-align: center; font-size: 14px; }
.banner.warn { background: #fdd663; color: #202124; }
.meeting .banner { flex: none; }
.presence { color: var(--muted); font-size: 14px; margin: 0; min-height: 1.4em; }
.invitee-line { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin: 0; }
.invitee-line svg { width: 16px; height: 16px; color: #81c995; }
.react-menu { display: flex; gap: 4px; padding: 6px; min-width: 0; }
.react-menu .react { background: none; border: 0; font-size: 26px; width: 44px; height: 44px; border-radius: 8px; }
.react-menu .react:hover { background: #f1f3f4; }
.reactions { position: absolute; left: 0; right: 0; bottom: 90px; pointer-events: none; height: 0; }
.reaction { position: absolute; bottom: 0; font-size: 40px; animation: float 2.4s ease-out forwards; }
.reaction small { display: block; font-size: 12px; color: var(--text); text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
@keyframes float { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-260px); opacity: 0; } }
.tile .hand { position: absolute; top: 8px; left: 10px; font-size: 20px; background: rgba(0,0,0,.5); border-radius: 10px; padding: 2px 6px; }
.tile .label .hand { position: static; margin-left: 4px; font-size: 16px; padding: 0 4px; }
.round.on[aria-pressed="true"] { background: #fdd663; color: #202124; }
.tile .self-toggle { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: rgba(0,0,0,.5); color: #fff; opacity: 0; transition: opacity .15s; }
.tile[data-self]:hover .self-toggle, .tile[data-self]:focus-within .self-toggle { opacity: 1; }
.tile[data-self] .self-toggle { display: grid; }
.stage.self-min .grid .tile[data-self] { position: absolute; right: 24px; bottom: 96px; width: 160px; height: 90px; z-index: 3; }
.stage.self-min .grid .tile[data-self] .self-toggle { opacity: 1; }
.stage { position: relative; }
.recap { font-size: 14px; }
.recap strong { font-weight: 500; }
.people-list .hand-pill { font-size: 16px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .controls .center .round#btn-react, .controls .center .round#btn-hand { display: none; }
  .controls .right #btn-pip { display: none; }
}
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 8px 0; }
.meter div { height: 100%; background: var(--primary-strong); }
.stats { border-collapse: collapse; width: 100%; font-size: 14px; }
.stats td, .stats th { padding: 6px 8px; border-bottom: 1px solid var(--surface-2); text-align: left; }
.stats td:last-child, .stats th:last-child, .stats td:nth-child(2), .stats th:nth-child(2) { text-align: right; }
.dash-foot { order: 99; margin-top: 32px; }
.dash { display: flex; flex-direction: column; }

/* ---- Lobby, lock, pager, quality, recording, pins, files ---- */
.lobby-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.lobby-overlay .card { max-width: 420px; text-align: center; }
.lobby-overlay h2 { font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.lobby-card { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 8; background: #fff; color: #202124; border-radius: 12px; min-width: 320px; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.4); padding: 8px 16px 12px; }
.lobby-card header { display: flex; align-items: center; justify-content: space-between; }
.lobby-card h3 { margin: 0; font-weight: 500; font-size: 15px; }
.lobby-card ul { list-style: none; margin: 4px 0 0; padding: 0; }
.lobby-card li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.lobby-card li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-card .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.host-tools { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #202124; background: #f1f3f4; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.host-tools label { display: flex; align-items: center; gap: 8px; }
.pager { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.5); border-radius: 20px; padding: 2px 6px; font-size: 13px; z-index: 4; }
.pager .icon { width: 32px; height: 32px; font-size: 20px; color: #fff; }
.tile.offpage { display: none !important; }
.quality { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.quality svg { width: 16px; height: 16px; }
.quality.good { color: #81c995; } .quality.fair { color: #fdd663; } .quality.poor { color: #f28b82; }
.rec, .tile .rec-badge { color: #f28b82; font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.tile .rec-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6); border-radius: 10px; padding: 2px 8px; }
.tile .pin { position: absolute; top: 6px; right: 44px; width: 32px; height: 32px; background: rgba(0,0,0,.5); color: #fff; opacity: 0; transition: opacity .15s; display: grid; }
.tile[data-self] .pin { right: 44px; } .tile:not([data-self]) .pin { right: 6px; }
.tile:hover .pin, .tile:focus-within .pin, .tile.pinned .pin { opacity: 1; }
.tile.pinned .pin { color: #8ab4f8; }
.stage.audio-only .tile:not(.screen) video { visibility: hidden; }
.stage.audio-only .tile:not(.screen) .avatar { display: grid; }
.chat-form label.icon { color: #5f6368; cursor: pointer; }
.chat-log .file { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: #f1f3f4; font-size: 13px; color: #1a73e8; text-decoration: none; }
.chat-log .file.pending { color: #5f6368; }
.people-list .role-btn { font-size: 12px; }
@media (max-width: 760px) { .controls .center .round#btn-more { display: inline-grid; } .quality .text { display: none; } }

.form .row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.form .row.two label { min-width: 0; }
.form select { height: 44px; border-radius: 8px; background: var(--surface); border: 1px solid #5f6368; padding: 0 8px; color: var(--text); }
@media (max-width: 760px) { .form .row.two { grid-template-columns: 1fr; } }

/* ---- Popnin brand ---- */
.brand .logo { height: 30px; width: auto; display: block; }
.brand { color: var(--text); }

.chat-log .warn-box { background: #fef7e0; color: #7a4b00; border: 1px solid #fdd663; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-top: 4px; }
.chat-log .row { display: flex; gap: 6px; margin-top: 6px; }
.chat-log .small-btn { height: 34px; padding: 0 12px; font-size: 13px; color: #202124; border-color: #dadce0; }
.chat-log .small-btn.text { color: #5f6368; }
.chat-log li.notice { font-size: 13px; color: #5f6368; font-style: italic; }

/* ---- Recording status ---- */
.rec-banner { background: #d93025; color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; }
.rec-banner .rec-dot { animation: blink 1.2s infinite; }
.rec { display: inline-flex; align-items: center; gap: 6px; color: #f28b82; font-size: 12px; font-weight: 600; letter-spacing: .5px; padding: 2px 8px; border: 1px solid rgba(242,139,130,.6); border-radius: 12px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ea4335; display: inline-block; animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.record-menu { min-width: 360px; max-width: calc(100% - 32px); padding: 12px 0 8px; }
.record-menu h3 { margin: 0 20px 4px; font-size: 16px; font-weight: 500; }
.record-menu p { margin: 0 20px 8px; }
.record-menu .rec-mode { display: flex; flex-direction: column; gap: 2px; }
.record-menu .rec-mode span { font-size: 12px; color: #5f6368; }
.tile .rec-badge { display: inline-flex; align-items: center; gap: 5px; }

/* ---- Trust & safety ---- */
.identity { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.identity .pill.verified { background: #1e8e3e; color: #fff; }
.identity .pill.personal { background: var(--surface-2); color: var(--text); }
.identity .pill.new { background: #fdd663; color: #202124; }
.scam-warning { background: #fef7e0; color: #5c3b00; border: 1px solid #fdd663; border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.scam-warning strong { display: block; margin-bottom: 4px; }
.scam-warning a { color: #5c3b00; }
.safety-links { margin: 4px 0 0; }
.plain { padding-left: 18px; text-align: left; font-size: 14px; line-height: 1.5; }
.center-row { justify-content: center; }
#report-form textarea { width: 100%; box-sizing: border-box; font: inherit; color: var(--text); background: transparent; border: 1px solid #5f6368; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.dns-record { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; overflow-x: auto; }
.domain-card h2 { font-size: 18px; font-weight: 500; margin: 0 0 6px; }
.menu-item.danger { color: #c5221f; }
.banner.warn a { color: #202124; }
.global-dialog { position: fixed; z-index: 30; }

.rec-quality { display: flex; flex-direction: column; gap: 4px; margin: 0 20px 8px; font-size: 13px; color: #5f6368; }
.rec-quality select { height: 36px; border-radius: 8px; border: 1px solid #dadce0; background: #fff; color: #202124; padding: 0 8px; font: inherit; }
.rec-stream { display: flex; gap: 8px; align-items: center; margin: 0 20px 6px; font-size: 13px; color: #202124; }

/* Operations page */
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: none; color: #c5221f; border: 1px solid #c5221f; }
.admin .stats td, .admin .stats th { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid var(--surface-2); text-align: left; }
.admin .stats td:last-child { white-space: nowrap; }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.admin pre { white-space: pre-wrap; }

/* Background effects */
.bg-button { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-start; padding: 6px 8px; }
.bg-button svg { width: 18px; height: 18px; fill: currentColor; }
.bg-menu { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 16px 20px; }
.bg-menu h3 { margin: 0 0 4px; font-size: 16px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 12px 0; }
.bg-option { border: 2px solid transparent; border-radius: 8px; padding: 0; background: #e8eaed; color: #202124; aspect-ratio: 16 / 9; overflow: hidden; position: relative; font-size: 12px; display: grid; place-items: center; }
.bg-option img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-option span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; background: rgba(0,0,0,.55); color: #fff; }
.bg-option[aria-checked="true"] { border-color: var(--primary-strong); }
.bg-option.blur { background: linear-gradient(135deg, #9aa0a6, #dadce0); filter: none; }
.bg-upload { display: inline-block; margin-bottom: 4px; }

/* Live captions */
.captions { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: min(900px, 90%); display: grid; gap: 4px; z-index: 4; pointer-events: none; }
.captions .cap { background: rgba(0,0,0,.72); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 18px; line-height: 1.35; text-wrap: balance; }
.captions .cap b { color: #ffd54a; font-weight: 500; margin-right: 6px; }
.captions .cap.interim { opacity: .8; }

/* Accessibility */
.skip-link { position: absolute; left: 8px; top: -40px; background: var(--primary-strong); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip-link:focus { top: 8px; }
.shortcuts td { padding: 6px 10px; }
kbd { font: 12px/1 ui-monospace, monospace; border: 1px solid #9aa0a6; border-bottom-width: 2px; border-radius: 4px; padding: 2px 6px; }
.tile:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  .reaction { animation-duration: .01ms; animation-iteration-count: 1; }
  * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.retention td, .retention th { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid var(--surface-2); text-align: left; font-size: 14px; }

/* Headings take focus on view change for screen readers; no visible ring needed. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, .view[tabindex="-1"]:focus { outline: none; }
