:root {
  --teams: #5b5fc7;
  --teams-hover: #4f52b2;
  --teams-soft: #e9eaf6;
  --canvas: #f5f5f5;
  --surface: #ffffff;
  --text: #242424;
  --muted: #616161;
  --border: #d1d1d1;
  --dark: #292929;
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { min-width: 320px; background: var(--canvas); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--teams); outline-offset: 2px; }

.teams-mark { position: relative; display: block; width: 45px; height: 39px; flex: 0 0 auto; }
.teams-mark i { position: absolute; z-index: 3; left: 0; top: 9px; display: grid; place-items: center; width: 29px; height: 27px; border-radius: 3px; color: white; background: #4f52b2; font-size: 18px; font-style: normal; font-weight: 700; box-shadow: 0 2px 4px #32337c38; }
.teams-mark b { position: absolute; z-index: 2; right: 3px; top: 9px; width: 22px; height: 28px; border-radius: 4px 8px 8px 4px; background: #7b83eb; }
.teams-mark em { position: absolute; right: 7px; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: #7b83eb; box-shadow: 13px 5px 0 -1px #5b5fc7; }

.prejoin-shell { min-height: calc(100vh - 86px); display: grid; place-items: center; padding: 42px 38px 24px; }
.prejoin { width: min(1030px, 100%); }
.meeting-heading { display: grid; justify-items: center; margin-bottom: 24px; }
.meeting-heading h1 { margin: 10px 0 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.2px; }
.meeting-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.join-grid { display: grid; grid-template-columns: minmax(430px, 1.13fr) minmax(360px, .87fr); gap: 18px; align-items: start; }

.video-column { overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); box-shadow: 0 1px 2px #0000000d; }
.video-preview { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(circle at 50% 40%, #373737, #242424 66%); }
.camera-preview { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scaleX(-1); transition: opacity .18s ease; }
.video-preview.camera-on .camera-preview { opacity: 1; }
.preview-avatar { position: relative; z-index: 1; display: grid; place-items: center; width: 100px; height: 100px; border-radius: 50%; color: #fff; background: #6264a7; font-size: 42px; font-weight: 400; }
.preview-avatar svg { width: 54px; height: 54px; fill: none; stroke: white; stroke-width: 2.7; stroke-linecap: round; }
.camera-off-label { position: absolute; z-index: 1; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 5px 10px; border-radius: 4px; color: #e8e8e8; background: #161616c9; font-size: 12px; }
.preview-controls { min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.round-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #e8e8e8; cursor: pointer; }
.round-toggle svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round-toggle.is-off { color: white; background: var(--teams); }
.round-toggle.is-off svg, .round-toggle.is-off svg path, .round-toggle.is-off svg rect { fill: none; stroke: white; }
.round-toggle:not(.is-off) .slash { display: none; }
.control-label { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border: 0; border-radius: 4px; background: transparent; font-size: 14px; cursor: pointer; }
.control-label:hover, .settings-button:hover { background: #f0f0f0; }
.control-label svg, .settings-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.settings-button { width: 34px; height: 34px; display: grid; place-items: center; margin-left: auto; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }

.setup-column { padding: 0 2px 0 0; }
.field-label { display: block; margin: 0 0 7px; font-size: 14px; font-weight: 600; }
.name-input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #929292; border-bottom-color: #616161; border-radius: 4px; color: var(--text); background: white; }
.name-input:focus { border-color: var(--teams); outline: 2px solid var(--teams); outline-offset: -2px; }
.setup-column h2 { margin: 24px 0 10px; font-size: 16px; font-weight: 600; }
.audio-card { width: 100%; min-height: 68px; display: grid; grid-template-columns: 35px 1fr 20px; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 5px 5px 0 0; text-align: left; background: white; cursor: pointer; }
.audio-card.is-selected { border: 2px solid var(--teams); padding: 10px 13px; background: #f9f9ff; }
.audio-card--muted { margin-top: 8px; border-radius: 5px; }
.audio-icon { display: grid; place-items: center; color: var(--teams); }
.audio-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.audio-card strong, .audio-card small { display: block; }
.audio-card strong { margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.audio-card small { color: var(--muted); font-size: 12px; }
.radio-dot, .radio-empty { width: 18px; height: 18px; border: 1px solid #888; border-radius: 50%; }
.radio-dot { border: 5px solid var(--teams); background: white; }
.device-box { min-height: 66px; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px 14px 10px 61px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 5px 5px; background: white; }
.device-box span, .device-box strong { display: block; font-size: 12px; }
.device-box span { margin-bottom: 4px; color: var(--muted); }
.device-box strong { font-weight: 400; }
.device-control { display: flex; align-items: center; gap: 9px; }
.device-control-icon { width: 19px; height: 19px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.device-mic { position: relative; width: 38px; height: 22px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--teams); cursor: pointer; transition: background .16s ease; }
.device-mic span { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px #0003; transition: transform .16s ease; }
.device-mic.is-off { background: #b3b3b3; }
.device-mic.is-off span { transform: translateX(-16px); }
.join-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; }
.join-status { min-height: 18px; margin: 8px 0 0; color: #c4314b; text-align: right; font-size: 12px; }
.primary-button, .secondary-button { min-width: 96px; height: 40px; padding: 0 18px; border-radius: 4px; font-weight: 600; font-size: 14px; cursor: pointer; }
.primary-button { border: 1px solid var(--teams); color: white; background: var(--teams); box-shadow: 0 1px 2px #0002; }
.primary-button:hover { border-color: var(--teams-hover); background: var(--teams-hover); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.secondary-button { border: 1px solid #8a8a8a; background: white; }
.secondary-button:hover { background: #f0f0f0; }
.page-footer { height: 38px; display: flex; justify-content: center; gap: 22px; font-size: 12px; }
.page-footer a, .update-help a { color: #4f52b2; }

.error-page { overflow: hidden; }
.error-stage { min-height: calc(100vh - 48px); display: grid; place-items: center; padding: 24px 16px; }
.update-frame { width: min(470px, 100%); padding: 30px 32px 22px; border-radius: 8px; background: white; box-shadow: 0 14px 42px #00000038; animation: frame-in .23s ease-out both; }
.update-illustration { position: relative; width: 90px; height: 74px; margin: 0 auto 15px; }
.teams-mark--update { position: absolute; left: 23px; top: 19px; transform: scale(.83); }
.update-ring { position: absolute; inset: 0; display: grid; place-items: center; color: #a9ace0; }
.update-ring svg { width: 74px; height: 74px; fill: none; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.update-frame h2 { margin: 0; text-align: center; font-size: 21px; line-height: 1.35; font-weight: 600; }
.update-frame > p { margin: 12px auto 0; max-width: 380px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.update-note { display: flex; align-items: center; gap: 10px; margin: 20px 0 22px; padding: 12px 13px; border-radius: 5px; color: #424242; background: #f3f3f3; font-size: 13px; }
.update-note svg { width: 20px; height: 20px; flex: none; fill: none; stroke: #616161; stroke-width: 1.6; stroke-linecap: round; }
.update-actions { display: flex; justify-content: flex-end; gap: 8px; }
.update-actions .primary-button { flex: 1; }
.update-frame .update-help { margin-top: 18px; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 5; padding: 10px 15px; border-radius: 5px; color: white; background: #292929; font-size: 13px; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.app-banner { position: fixed; top: 16px; left: 50%; z-index: 30; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--teams); border-radius: 6px; background: var(--teams-soft); color: #252423; font-size: 13px; line-height: 1.45; box-shadow: 0 4px 14px #00000024; opacity: 0; transform: translate(-50%, -24px) scale(.92); transition: opacity .28s ease, transform .32s cubic-bezier(.4, 0, .2, 1); }
.app-banner.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); animation: banner-in .48s cubic-bezier(.22, 1.28, .36, 1) both; }
@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, -24px) scale(.92); }
  70% { opacity: 1; transform: translate(-50%, 3px) scale(1.015); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.app-banner.is-leaving { animation: banner-out .32s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes banner-out {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to { opacity: 0; transform: translate(-50%, -16px) scale(.95); }
}
.app-banner-icon { display: inline-flex; width: 30px; height: 30px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--teams); }
.app-banner-icon svg { width: 16px; height: 16px; fill: none; stroke: white; stroke-width: 1.9; stroke-linecap: round; }
.app-banner-link { color: var(--teams); font-weight: 700; }
.app-banner-link:hover { color: var(--teams-hover); text-decoration: underline; }
.app-banner-close { flex: none; width: 24px; height: 24px; border: none; border-radius: 4px; background: transparent; color: #616161; font-size: 16px; line-height: 1; cursor: pointer; }
.app-banner-close:hover { background: #00000014; color: #252423; }

.panel-scrim { position: fixed; z-index: 20; inset: 48px 0 0; background: #00000026; }
.side-panel { position: fixed; z-index: 21; top: 48px; right: 0; bottom: 0; width: min(360px, 100vw); overflow: auto; border-left: 1px solid #d8d8d8; background: white; box-shadow: -8px 0 24px #00000018; animation: panel-in .18s ease-out both; }
.side-panel__header { position: sticky; z-index: 1; top: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px 0 22px; border-bottom: 1px solid #e5e5e5; background: white; }
.side-panel__header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.panel-close { width: 34px; height: 34px; border: 0; border-radius: 4px; background: transparent; color: #555; font-size: 23px; cursor: pointer; }
.panel-close:hover { background: #f0f0f0; }
.panel-content { padding: 21px 22px 28px; }
.panel-content h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.effect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.effect-tile { min-width: 0; padding: 3px; border: 2px solid transparent; border-radius: 6px; text-align: left; background: transparent; cursor: pointer; }
.effect-tile:hover { background: #f5f5f5; }
.effect-tile.is-selected { border-color: var(--teams); background: #f5f5ff; }
.effect-tile > span:last-child { display: block; overflow: hidden; padding: 6px 3px 3px; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.effect-thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: #ddd; }
.effect-none { background: #f2f2f2; }
.effect-none svg { width: 25px; height: 25px; fill: none; stroke: #777; stroke-width: 1.5; }
.effect-blur { background: radial-gradient(circle at 68% 28%, #f7e5cf 0 9%, transparent 10%), linear-gradient(125deg, #8090a3, #dad0c2 53%, #7d6b62); filter: blur(.3px); }
.effect-blur i { width: 28px; height: 34px; border-radius: 50% 50% 42% 42%; background: #866f63aa; filter: blur(3px); }
.effect-office { background: linear-gradient(90deg, #9ab0bd 0 24%, #dce1dc 24% 68%, #7d8b75 68%); }
.effect-office::before { content: ""; position: absolute; left: 7px; top: 7px; width: 20px; height: 30px; border: 3px solid #edf4f5; border-bottom: 0; }
.effect-office i { position: absolute; right: 8px; bottom: 7px; width: 29px; height: 12px; background: #5e6c54; }
.effect-office b { position: absolute; left: 33px; bottom: 5px; width: 20px; height: 18px; background: #b18a6a; }
.effect-light { background: linear-gradient(135deg, #f2eee7, #cdd9e1); }
.effect-light i { width: 42px; height: 31px; border: 5px solid white; box-shadow: 17px 12px 0 -8px #8796a5; }
.effect-gradient { background: linear-gradient(135deg, #b9b8ef, #dad8f4 52%, #8ea4c7); }
.effect-studio { background: #353642; }
.effect-studio::before, .effect-studio::after { content: ""; position: absolute; top: 7px; width: 16px; height: 34px; background: linear-gradient(#766f98, #b7a8cf); filter: blur(2px); }
.effect-studio::before { left: 8px; }.effect-studio::after { right: 8px; }
.effect-studio i { width: 27px; height: 33px; border-radius: 50%; background: #bca797; }
.panel-divider { height: 1px; margin: 22px 0; background: #e5e5e5; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 14px; font-weight: 600; }.setting-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.visual-switch { position: relative; width: 40px; height: 22px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--teams); cursor: pointer; }
.visual-switch span { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px #0003; transition: transform .16s ease; }
.visual-switch.is-off { background: #aaa; }.visual-switch.is-off span { transform: translateX(-18px); }
.visual-note, .device-permission-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.device-section { display: grid; gap: 18px; }
.device-section label { display: grid; gap: 7px; color: #424242; font-size: 13px; font-weight: 600; }
.device-section select, .compact-select { width: 100%; height: 38px; padding: 0 34px 0 10px; border: 1px solid #929292; border-radius: 4px; color: var(--text); background: white; font-size: 13px; }
.setting-row--stacked { align-items: end; }.setting-row--stacked .compact-select { width: 108px; flex: none; }

@keyframes frame-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .prejoin-shell { place-items: start center; padding: 24px 18px 40px; }
  .join-grid { grid-template-columns: 1fr; }
  .setup-column { padding: 0; }
  .meeting-heading { margin-bottom: 18px; }
  .page-footer { padding-bottom: 20px; }
}

@media (max-width: 520px) {
  .prejoin-shell { padding: 20px 12px 32px; }
  .meeting-heading .teams-mark { transform: scale(.8); }
  .meeting-heading h1 { font-size: 19px; }
  .preview-controls { gap: 8px; }
  .control-label { font-size: 12px; }
  .join-actions, .update-actions { flex-direction: column-reverse; }
  .join-actions button, .update-actions > * { width: 100%; }
  .update-frame { padding: 28px 20px 20px; }
}

/* Meeting room */
.room { position: relative; display: flex; flex-direction: column; height: calc(100vh - 48px); overflow: hidden; color: #fff; background: #1f1f1f; animation: room-in .2s ease-out both; }
@keyframes room-in { from { opacity: 0; } to { opacity: 1; } }
.room-topbar { position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; pointer-events: none; }
.room-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.room-title h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 14px; font-weight: 600; }
.room-timer { flex: none; padding: 3px 10px; border-radius: 4px; color: #d4d4d4; background: #ffffff1f; font-size: 13px; font-weight: 600; }
.room-people { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid #ffffff2e; border-radius: 4px; color: #fff; background: #ffffff14; font-size: 13px; cursor: pointer; }
.room-people:hover { background: #ffffff26; }
.room-people svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.room-people-count { min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--teams); font-size: 11px; text-align: center; }
.room-stage { flex: 1; display: grid; place-items: center; padding: 58px 16px 90px; }
.room-solo { display: grid; justify-items: center; gap: 18px; width: 100%; max-width: 640px; }
.room-tile { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; margin: 0; border-radius: 5px; background: #2d2c2c; box-shadow: 0 8px 28px #0006; }
.room-tile .camera-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s ease; }
.room-tile.is-camera-on .camera-preview { opacity: 1; }
.tile-avatar { position: absolute; inset: 0; display: grid; place-items: center; }
.tile-avatar span { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #fff; background: #6264a7; font-size: 34px; }
.room-tile.is-camera-on .tile-avatar { display: none; }
.tile-name { position: absolute; bottom: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: #00000073; font-size: 12px; font-weight: 600; }
.room-alone { display: flex; align-items: center; gap: 9px; margin: 0; color: #adadad; font-size: 14px; }
.room-alone-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teams); animation: alone-pulse 2.2s ease-in-out infinite; }
@keyframes alone-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.room-controls { position: absolute; z-index: 2; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 7px 10px; border-radius: 10px; background: #292929f2; box-shadow: 0 6px 20px #0005; }
.stage-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: #3b3a3a; cursor: pointer; }
.stage-toggle:hover { background: #4c4b4b; }
.stage-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stage-toggle.is-off { background: var(--teams); }
.stage-toggle:not(.is-off) .slash { display: none; }
.leave-button { height: 44px; margin-left: 10px; padding: 0 20px; border: 0; border-radius: 4px; color: white; background: #c4314b; font-weight: 600; font-size: 14px; cursor: pointer; }
.leave-button:hover { background: #a8293f; }

.roster-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.roster-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 5px; font-size: 14px; }
.roster-list li:hover { background: #f5f5f5; }
.roster-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: white; background: var(--teams); font-size: 13px; }
.roster-you { margin-left: auto; color: var(--muted); font-size: 12px; }

.room:not([hidden]) ~ .toast { bottom: 84px; }

@media (max-width: 820px) {
  .room-people .people-label { display: none; }
  .room-stage { padding: 52px 12px 84px; }
}

@media (max-width: 520px) {
  .room-controls { gap: 5px; padding: 6px 8px; }
  .stage-toggle { width: 39px; height: 39px; }
  .stage-toggle svg { width: 19px; height: 19px; }
  .stage-toggle--extra { display: none; }
  .leave-button { height: 39px; margin-left: 5px; padding: 0 14px; }
  .room-stage { padding: 48px 10px 78px; }
  .room:not([hidden]) ~ .toast { bottom: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
