/* Reunião — sistema visual
   Entrada clara e editorial; chamada escura e imersiva, com controles em vidro. */

:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --bg: #fbfbfd;
    --surface: #ffffff;
    --surface-2: #f5f5f7;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #86868b;
    --line: rgba(0, 0, 0, 0.1);
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --link: #0066cc;
    --red: #ff3b30;
    --green: #30d158;
    --orange: #ff9f0a;

    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 28px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    --ease: cubic-bezier(0.28, 0.11, 0.32, 1);

    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --surface: #1d1d1f;
        --surface-2: #161617;
        --text: #f5f5f7;
        --text-2: #a1a1a6;
        --text-3: #86868b;
        --line: rgba(255, 255, 255, 0.14);
        --blue: #0a84ff;
        --blue-hover: #2b95ff;
        --link: #2997ff;
        --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }
body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    letter-spacing: -0.022em;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}
body[data-view="call"] { background: #000; overflow: hidden; }

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.45; }
a { color: var(--link); text-decoration: none; }
.icon { flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media not (pointer: coarse) { .touch-only { display: none !important; } }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 2px; }

/* ---------------------------------------------------------------- Botões */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 22px;
    border-radius: 980px;
    font-size: 17px; font-weight: 400;
    transition: background 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-quiet { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.btn-quiet.danger { color: var(--red); }
.btn-lg { min-height: 52px; padding: 0 30px; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.link { color: var(--link); font-size: 17px; }
.link:hover { text-decoration: underline; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 32px; padding: 0 13px;
    border-radius: 980px;
    font-size: 13px; font-weight: 500; white-space: nowrap;
    color: #fff; background: rgba(255, 255, 255, 0.16);
    transition: background 0.2s;
}
.chip:hover:not(:disabled) { background: rgba(255, 255, 255, 0.26); }
.chip[aria-pressed="true"] { background: #fff; color: #000; }
.chip-primary { background: var(--blue); }
.chip-primary:hover:not(:disabled) { background: var(--blue-hover); }
.chip-danger { background: var(--red); }
.chip-danger:hover:not(:disabled) { background: #ff5147; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text-2);
}

.avatar {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 15px; font-weight: 600; letter-spacing: 0;
    color: #fff; background: linear-gradient(145deg, #8e8e93, #636366);
}
.avatar-lg { width: clamp(64px, 22%, 112px); height: auto; aspect-ratio: 1; font-size: clamp(22px, 5vmin, 40px); }

.spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid color-mix(in srgb, currentColor 18%, transparent);
    border-top-color: currentColor;
    animation: spin 0.9s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Entrada */

.view { min-height: 100dvh; }
.lobby { display: flex; flex-direction: column; padding: var(--safe-t) max(22px, var(--safe-r)) calc(24px + var(--safe-b)) max(22px, var(--safe-l)); }

.nav {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; max-width: 1080px; margin: 0 auto; height: 52px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.nav-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }

.lobby-grid {
    flex: 1; width: 100%; max-width: 1080px; margin: 0 auto;
    display: grid; align-items: center; gap: clamp(28px, 6vw, 72px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    padding: 24px 0 40px;
}

.eyebrow { font-size: 17px; font-weight: 600; color: var(--orange); letter-spacing: -0.01em; }
.headline {
    margin-top: 6px;
    font-size: clamp(40px, 5.6vw, 64px); line-height: 1.06; font-weight: 600; letter-spacing: -0.035em;
    text-wrap: balance;
}
.lead { margin-top: 16px; font-size: clamp(19px, 2vw, 24px); line-height: 1.3; color: var(--text-2); letter-spacing: -0.015em; }

.waiting-row { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; font-size: 17px; color: var(--text-2); }
.join-form { margin-top: 32px; display: grid; gap: 12px; max-width: 400px; justify-items: start; }
.field { width: 100%; }
.field input {
    width: 100%; height: 56px; padding: 0 18px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); font-size: 17px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
.join-form .btn-primary { width: 100%; }
.form-error { font-size: 14px; color: var(--red); }
.form-note { font-size: 14px; color: var(--text-2); }

.preview {
    position: relative; overflow: hidden;
    aspect-ratio: 4 / 3; width: 100%;
    border-radius: var(--r-lg);
    background: #1d1d1f; color: #f5f5f7;
    box-shadow: var(--shadow);
}
.preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
video.mirror, .tile.mirror video { transform: scaleX(-1); }
.preview-off {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 24px; text-align: center;
    background: radial-gradient(120% 120% at 50% 0%, #2c2c2e 0%, #161617 70%);
    font-size: 15px; color: #a1a1a6;
}
.preview-bar { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 14px; }
.meter { position: absolute; left: 20px; top: 20px; width: 56px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform 0.08s linear; }

@media (max-width: 820px) {
    .lobby-grid { grid-template-columns: 1fr; align-content: start; gap: 24px; padding-top: 8px; }
    .preview { order: -1; aspect-ratio: 5 / 4; max-height: 42dvh; border-radius: 22px; }
    .lobby-copy { text-align: center; }
    .headline { font-size: clamp(32px, 9vw, 44px); }
    .lead { margin-top: 10px; }
    .join-form { margin: 22px auto 0; justify-items: center; }
    .nav-note { display: none; }
}

/* ---------------------------------------------------------------- Telas centrais */

.center { display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.center-card { display: grid; justify-items: center; gap: 14px; max-width: 420px; }
.center-card h2 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.center-card p { color: var(--text-2); font-size: 19px; line-height: 1.35; }
.center-card .btn { margin-top: 14px; }
.center-card .spinner { color: var(--text-3); margin-bottom: 6px; }

/* ---------------------------------------------------------------- Chamada */

.call {
    position: fixed; inset: 0; min-height: 0;
    display: flex; flex-direction: column;
    color: #f5f5f7; background: #000;
    --glass: rgba(44, 44, 46, 0.72);
    --pad: clamp(8px, 1.4vw, 16px);
    --controls-h: 84px;
}

.call-top {
    position: absolute; z-index: 20; left: 0; right: 0; top: 0;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 14px) 0 calc(var(--safe-l) + 14px);
    pointer-events: none;
}
.call-top > * { pointer-events: auto; }
.call-top-right { display: flex; gap: 8px; align-items: center; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 36px; padding: 0 14px; border-radius: 980px;
    font-size: 14px; color: #f5f5f7;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.pill strong { font-weight: 600; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill #call-timer { color: #a1a1a6; font-variant-numeric: tabular-nums; }
.pill-warn { color: #1d1d1f; background: var(--orange); font-weight: 500; }
.pill-btn { position: relative; font-variant-numeric: tabular-nums; }
.badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: #fff; background: var(--red);
}

.stage {
    flex: 1; min-height: 0; position: relative;
    display: flex; gap: var(--pad);
    padding: calc(var(--safe-t) + 60px) calc(var(--safe-r) + var(--pad)) calc(var(--safe-b) + var(--controls-h) + var(--pad)) calc(var(--safe-l) + var(--pad));
}
.focus { display: none; flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; border-radius: var(--r-md); touch-action: none; }
.grid { flex: 1; min-width: 0; min-height: 0; display: grid; gap: var(--pad); grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); }

.tile {
    position: relative; overflow: hidden; min-width: 0; min-height: 0;
    border-radius: var(--r-md);
    background: #1c1c1e;
    isolation: isolate;
}
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #1c1c1e; }
.tile-screen video { object-fit: contain; background: #000; transform-origin: center; }
.tile::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: inset 0 0 0 3px var(--green); opacity: 0; transition: opacity 0.18s;
}
.tile.speaking::after { opacity: 1; }
.tile-avatar {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    background: radial-gradient(120% 120% at 50% 0%, #2c2c2e 0%, #161617 70%);
}
.tile.no-video .tile-avatar { display: flex; }
.tile.no-video video { opacity: 0; }
.tile-label {
    position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px);
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 980px;
    font-size: 13px; font-weight: 500; color: #fff;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-muted { display: none; color: #ff6961; }
.tile.muted .tile-muted { display: inline-flex; }
.tile-away {
    position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    font-size: 14px; color: #f5f5f7; background: rgba(0, 0, 0, 0.62);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tile.away .tile-away { display: flex; }
.tile-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; z-index: 2; }
.tile-actions .chip { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tile-actions .chip-primary { background: var(--blue); }
.tile-cam { cursor: pointer; }
.tile.control-live { cursor: crosshair; outline: 2px solid var(--blue); outline-offset: -2px; }

/* Sozinho ou a dois: um vídeo ocupa tudo; o seu fica em miniatura. */
.stage[data-mode="solo"] .grid, .stage[data-mode="duo"] .grid { --cols: 1; --rows: 1; }
.tile.pip {
    position: absolute; z-index: 5;
    right: calc(var(--safe-r) + var(--pad) + 10px); bottom: calc(var(--safe-b) + var(--controls-h) + var(--pad) + 10px);
    width: clamp(92px, 22vmin, 220px); aspect-ratio: 3 / 4;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.14);
}
@media (orientation: landscape) { .tile.pip { aspect-ratio: 4 / 3; } }
.tile.pip .tile-label { display: none; }

/* Destaque: tela compartilhada ou vídeo fixado, com os demais em faixa. */
.stage[data-mode="focus"] .focus { display: block; }
.stage[data-mode="focus"] .focus .tile { width: 100%; height: 100%; }
.stage[data-mode="focus"] .grid {
    flex: none; width: clamp(150px, 17vw, 240px);
    display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none;
}
.stage[data-mode="focus"] .grid .tile { flex: none; aspect-ratio: 4 / 3; }
@media (orientation: portrait), (max-width: 700px) {
    .stage[data-mode="focus"] { flex-direction: column; }
    .stage[data-mode="focus"] .grid { width: auto; height: clamp(84px, 15dvh, 130px); flex-direction: row; overflow-x: auto; overflow-y: hidden; }
    .stage[data-mode="focus"] .grid .tile { height: 100%; aspect-ratio: 3 / 4; }
    .stage[data-mode="focus"] .grid .tile-label { left: 6px; bottom: 6px; padding: 3px 8px; font-size: 11px; }
}

/* Controles em vidro */
.controls {
    position: absolute; z-index: 30; left: 50%; bottom: calc(var(--safe-b) + 14px);
    transform: translateX(-50%);
    display: flex; align-items: center; gap: clamp(8px, 2.6vw, 14px);
    padding: 10px; border-radius: 980px;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.ctl {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 50%;
    color: #fff; background: rgba(255, 255, 255, 0.14);
    transition: background 0.2s var(--ease), color 0.2s, transform 0.15s var(--ease);
}
.ctl:hover { background: rgba(255, 255, 255, 0.24); }
.ctl:active { transform: scale(0.92); }
.ctl[aria-pressed="false"]:not(#btn-screen) { background: #fff; color: #1d1d1f; }
#btn-screen[aria-pressed="true"] { background: var(--green); color: #00390f; }
.ctl-danger { width: 68px; background: var(--red); }
.ctl-danger:hover { background: #ff5147; }
.preview-bar .ctl { background: rgba(60, 60, 67, 0.6); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
@media (max-width: 380px) { .ctl { width: 46px; height: 46px; } .ctl-danger { width: 58px; } }

/* Avisos no topo: compartilhamento e controle remoto */
.banners {
    position: absolute; z-index: 25; left: 0; right: 0; top: calc(var(--safe-t) + 58px);
    display: grid; justify-items: center; gap: 8px; padding: 0 12px; pointer-events: none;
}
.banner {
    pointer-events: auto;
    display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 10px;
    max-width: 100%; padding: 8px 10px 8px 16px; border-radius: 22px;
    font-size: 14px; color: #f5f5f7;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: drop 0.35s var(--ease);
}
.banner-alert { background: rgba(255, 59, 48, 0.9); }
.banner-alert .chip-danger { background: #fff; color: var(--red); }
.banner-ask { background: rgba(28, 28, 30, 0.92); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.16); }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

/* Pedidos de entrada */
.knocks {
    position: absolute; z-index: 26; right: calc(var(--safe-r) + 14px); top: calc(var(--safe-t) + 58px);
    display: grid; gap: 8px; width: min(360px, calc(100vw - 28px));
}
.knock {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md);
    background: rgba(28, 28, 30, 0.92); color: #f5f5f7;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
    animation: drop 0.35s var(--ease);
}
.knock-text { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.knock-text strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knock-text span { font-size: 13px; color: #a1a1a6; }
.knock .btn-quiet { background: rgba(255, 255, 255, 0.14); color: #fff; }
@media (max-width: 700px) { .knocks { left: 14px; right: 14px; width: auto; } }

/* Barra do controle remoto */
.rc-bar {
    position: absolute; z-index: 31; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--safe-b) + 84px);
    display: flex; align-items: center; gap: 10px;
    max-width: calc(100vw - 20px); padding: 8px 8px 8px 16px; border-radius: 22px;
    background: rgba(0, 113, 227, 0.92); color: #fff;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.rc-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.rc-actions { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.rc-actions::-webkit-scrollbar, .grid::-webkit-scrollbar { display: none; }
.rc-typing { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; font-size: 16px; }
/* A barra não pode cobrir a parte de baixo da tela controlada (é onde fica o prompt do terminal). */
body.controlling .call { --controls-h: 142px; }
body.controlling .controls { opacity: 0.35; transition: opacity 0.2s; }
body.controlling .controls:hover, body.controlling .controls:focus-within { opacity: 1; }
@media (max-width: 700px) {
    .rc-bar { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 10px; left: 10px; right: 10px; transform: none; }
    .rc-label { text-align: center; }
    body.controlling .call { --controls-h: 178px; }
}

/* Legendas */
.captions {
    position: absolute; z-index: 22; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--safe-b) + var(--controls-h) + 22px);
    width: min(820px, calc(100vw - 32px)); max-height: 30dvh; overflow: hidden;
    display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none;
}
.caption {
    padding: 8px 16px; border-radius: 14px; text-align: center;
    font-size: clamp(17px, 2.2vw, 24px); line-height: 1.3; color: #fff;
    background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: opacity 0.8s;
}
.caption strong { font-weight: 600; color: #a1a1a6; font-size: 0.7em; }
.caption.fade { opacity: 0; }

.unmute-hint {
    position: absolute; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 980px;
    font-size: 16px; font-weight: 500; color: #1d1d1f; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.overlay {
    position: absolute; z-index: 50; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    font-size: 19px; color: #f5f5f7; background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}

/* ---------------------------------------------------------------- Painéis */

.scrim { position: fixed; z-index: 90; inset: 0; background: rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.3s var(--ease); }
.scrim.open { opacity: 1; }
.sheet {
    position: fixed; z-index: 100; top: 12px; right: 12px; bottom: 12px;
    width: min(400px, calc(100vw - 24px));
    display: flex; flex-direction: column;
    color: var(--text); background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
    border-radius: var(--r-lg); box-shadow: var(--shadow);
    transform: translateX(calc(100% + 24px)); transition: transform 0.38s var(--ease);
}
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 10px 24px; }
.sheet-head h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 6px 24px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
.sheet-body > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.sheet-body > .group { gap: 0; }
.sheet-foot { padding: 12px 24px calc(20px + var(--safe-b)); }
.sheet-lead { font-size: 15px; line-height: 1.45; color: var(--text-2); }
.sheet-lead strong { color: var(--text); }
@media (max-width: 700px) {
    .sheet {
        top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86dvh;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        transform: translateY(105%);
    }
    .sheet-head::before {
        content: ""; position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
        width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 22%, transparent);
    }
    .sheet-body { padding-bottom: calc(24px + var(--safe-b)); }
}

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.list-title { margin: 8px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.02em; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.person-name { flex: 1; min-width: 0; display: grid; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.person-name em { font-style: normal; color: var(--text-3); display: contents; }
.person-name small { font-size: 13px; color: var(--text-3); }
.person-mic { color: var(--text-3); }
.person-mic.off { color: var(--red); }

.group { background: var(--surface-2); border-radius: var(--r-md); padding: 4px 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; font-size: 16px; }
.row + .row { border-top: 1px solid var(--line); }
.row select {
    max-width: 58%; height: 34px; padding: 0 10px; border-radius: 9px; border: 0;
    background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 15px; text-overflow: ellipsis;
}
.row-link { color: var(--text); }
.group-note { padding: 10px 0 12px; font-size: 13px; line-height: 1.4; color: var(--text-3); border-top: 1px solid var(--line); }
.sheet-body > .group-note { border: 0; padding: 0; }

.switch {
    appearance: none; -webkit-appearance: none; flex: none; position: relative;
    width: 51px; height: 31px; border-radius: 16px; margin: 0; cursor: pointer;
    background: color-mix(in srgb, var(--text) 16%, transparent); transition: background 0.25s var(--ease);
}
.switch::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease);
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }

.steps { margin: 0; padding: 0 0 0 22px; display: grid; gap: 18px; font-size: 15px; }
.steps li p { margin-bottom: 8px; }
.code {
    display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: var(--r-sm);
    background: var(--surface-2); border: 1px solid var(--line);
}
.code code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.code-form { display: flex; gap: 10px; }
.code-form input {
    flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: var(--surface); font-family: var(--mono); font-size: 20px; letter-spacing: 0.3em; text-align: center;
}
.code-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }

.toast {
    position: fixed; z-index: 200; left: 50%; bottom: calc(var(--safe-b) + 112px);
    transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
    max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 980px;
    font-size: 15px; text-align: center; color: #fff; background: rgba(44, 44, 46, 0.94);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .link { color: #64b5ff; font-size: inherit; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
