:root {
	--bg-color: #050505;
	--surface: #121212;
	--surface-glass: rgba(255, 255, 255, 0.05);
	--border-glass: rgba(255, 255, 255, 0.1);
	--primary: #6366f1;
	--primary-hover: #4f46e5;
	--danger: #ef4444;
	--danger-hover: #dc2626;
	--text: #f8fafc;
	--text-muted: #94a3b8;
	--success: #10b981;
	--radius-lg: 24px;
	--radius-md: 16px;
	--radius-sm: 8px;
	--shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}
* {
	box-sizing: border-box;
	margin: 0px;
	padding: 0px;
}
body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
	background-color: var(--bg-color);
	color: var(--text);
	height: 100vh;
	height: 100dvh; /* follows the browser's collapsing toolbars on mobile */
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
}
h1 {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
}
h2 {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}
.subtitle {
	color: var(--text-muted);
	margin-bottom: 2rem;
}
.app-container {
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	max-width: 1200px;
	margin: 0px auto;
	position: relative;
}
.app-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 2rem;
	z-index: 10;
}
.logo {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 700;
	font-size: 1.25rem;
	letter-spacing: -0.025em;
}
a.logo {
	color: inherit;
	text-decoration: none;
}
.logo i {
	color: var(--primary);
}
.status-badge {
	padding: 0.4rem 1rem;
	border-radius: 99px;
	font-size: 0.875rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--surface-glass);
	border: 1px solid var(--border-glass);
	transition: 0.3s;
}
.status-badge::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--text-muted);
}
.status-badge.connected {
	color: var(--success);
	border-color: rgba(16, 185, 129, 0.2);
	background: rgba(16, 185, 129, 0.1);
}
.status-badge.connected::before {
	background-color: var(--success);
	box-shadow: 0 0 8px var(--success);
}
.main-content {
	flex: 1 1 0%;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1rem;
}
.view {
	display: none;
	width: 100%;
	height: 100%;
	animation: 0.4s ease 0s 1 normal none running fadeIn;
}
.view.active {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
@keyframes fadeIn {
	0% {
		opacity: 0;
		transform: translateY(10px);
	}
	100% {
		opacity: 1;
		transform: translateY(0px);
	}
}
.glass-card {
	background: var(--surface-glass);
	backdrop-filter: blur(12px);
	border: 1px solid var(--border-glass);
	border-radius: var(--radius-lg);
	padding: 3rem;
	width: 100%;
	max-width: 500px;
	text-align: center;
}
.glass-panel {
	background: var(--surface-glass);
	backdrop-filter: blur(12px);
	border: 1px solid var(--border-glass);
	box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 32px;
}
.mode-buttons {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
button {
	cursor: pointer;
	font-family: inherit;
	transition: 0.2s;
}
.primary-btn,
.secondary-btn {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 1.5rem;
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	width: 100%;
	text-align: left;
}
.primary-btn {
	background: linear-gradient(135deg, var(--primary), var(--primary-hover));
	color: white;
	box-shadow: var(--shadow-glow);
}
.primary-btn:hover {
	transform: translateY(-2px);
	box-shadow: rgba(99, 102, 241, 0.5) 0px 0px 25px;
}
.secondary-btn {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border-glass);
	color: var(--text);
}
.secondary-btn:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.2);
}
.btn-text {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}
.btn-text strong {
	font-size: 1.125rem;
}
.btn-text span {
	font-size: 0.875rem;
	color: rgba(255, 255, 255, 0.7);
}
.video-container {
	position: relative;
	width: 100%;
	height: 100%;
	max-height: 70vh;
	max-height: 70dvh;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: rgb(0, 0, 0);
	box-shadow: rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;
}
video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.video-overlay {
	position: absolute;
	top: 1rem;
	left: 1rem;
	right: 1rem;
	display: flex;
	justify-content: center;
	z-index: 5;
	transition: opacity 0.3s ease;
}
.video-overlay.hidden {
	opacity: 0;
	pointer-events: none;
}
.video-overlay > * {
	pointer-events: auto;
}
.pairing-info {
	padding: 1rem 1.5rem;
	border-radius: 99px;
	display: flex;
	align-items: center;
	gap: 1rem;
}
.code-display {
	font-family: monospace;
	font-size: 1.5rem;
	letter-spacing: 2px;
	color: var(--primary);
	background: rgba(0, 0, 0, 0.3);
	padding: 0.25rem 0.75rem;
	border-radius: var(--radius-sm);
}
.icon-btn {
	background: transparent;
	border: none;
	color: var(--text-muted);
	padding: 0.5rem;
	border-radius: 50%;
}
.icon-btn:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.1);
}
.controls-bar {
	position: absolute;
	bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 1rem;
	padding: 1rem;
	border-radius: 99px;
	z-index: 10;
}
.control-btn {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: white;
	display: flex;
	justify-content: center;
	align-items: center;
}
.control-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(1.05);
}
.control-btn.active {
	background: var(--text);
	color: var(--bg-color);
}
.talk-btn {
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}
.talk-btn.talking {
	background: var(--success);
	box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.25), 0 0 24px var(--success);
	transform: scale(1.1);
}
.control-btn.danger {
	background: var(--danger);
}
.control-btn.danger:hover {
	background: var(--danger-hover);
}
.input-group {
	display: flex;
	margin-top: 2rem;
	gap: 0.5rem;
}
input[type="text"] {
	flex: 1 1 0%;
	padding: 1rem 1.5rem;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-glass);
	background: rgba(0, 0, 0, 0.5);
	color: white;
	font-size: 1.125rem;
	font-family: monospace;
	outline: none;
	transition: border-color 0.2s;
}
input[type="text"]:focus {
	border-color: var(--primary);
}
.input-group .primary-btn {
	width: auto;
	padding: 1rem 2rem;
}
.hidden {
	display: none !important;
}
#toast-container {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	z-index: 100;
}
.toast {
	background: var(--surface);
	border: 1px solid var(--border-glass);
	color: white;
	padding: 1rem 1.5rem;
	border-radius: var(--radius-md);
	box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px;
	animation: 0.3s ease 0s 1 normal none running slideIn;
}
@keyframes slideIn {
	0% {
		transform: translateX(100%);
		opacity: 0;
	}
	100% {
		transform: translateX(0px);
		opacity: 1;
	}
}
@media (max-width: 768px) {
	.glass-card {
		padding: 2rem 1.5rem;
	}
	.pairing-info {
		flex-direction: column;
		text-align: center;
		border-radius: var(--radius-md);
	}
	.video-container {
		border-radius: 0px;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		position: fixed;
		top: 0px;
		left: 0px;
		z-index: 1;
	}
	.controls-bar {
		bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
		gap: 0.5rem;
		padding: 0.6rem;
		max-width: calc(100vw - 16px);
	}
	.control-btn {
		width: 48px;
		height: 48px;
		flex-shrink: 0;
	}
	.app-header {
		padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 1rem;
	}
	#toast-container {
		left: 1rem;
		right: 1rem;
		bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
	}
	.video-overlay,
	.controls-bar {
		z-index: 2;
	}
	.app-header {
		z-index: 3;
		position: relative;
	}
	.app-container {
		max-width: 100%;
		margin: 0px;
	}
}

/* ---------- Broadcaster pairing card ---------- */
.pairing-card {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 5;
	width: 280px;
	max-height: calc(100% - 2rem);
	overflow-y: auto;
	padding: 1.1rem;
	border-radius: var(--radius-md);
	background: rgba(10, 10, 14, 0.72);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	display: flex;
	flex-direction: column;
	gap: 1rem;
	animation: fadeIn 0.25s ease;
}
.pc-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.5rem;
}
.pc-title {
	font-weight: 700;
	font-size: 1.05rem;
}
.pc-sub {
	font-size: 0.8rem;
	color: var(--text-muted);
}
.pc-share {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
}
.pc-qr {
	background: #fff;
	padding: 10px;
	border-radius: 14px;
	line-height: 0;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.4);
}
.pc-qr:empty {
	display: none;
}
.pc-qr img,
.pc-qr canvas {
	width: 148px !important;
	height: 148px !important;
	display: block;
}
.pc-code-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	width: 100%;
}
.pc-label {
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-muted);
}
.pc-code {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 1.15rem;
	letter-spacing: 0.04em;
	color: #a5b4fc;
	user-select: all;
	word-break: break-all;
	text-align: center;
}
.pc-copy,
.pc-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.5rem 0.9rem;
	border-radius: 10px;
	border: 1px solid var(--border-glass);
	background: rgba(255, 255, 255, 0.06);
	color: var(--text);
	font-size: 0.85rem;
	font-weight: 600;
}
.pc-copy:hover,
.pc-reset:hover {
	background: rgba(255, 255, 255, 0.12);
}
.pc-copy svg,
.pc-settings summary svg {
	width: 16px;
	height: 16px;
}
.pc-settings {
	border-top: 1px solid var(--border-glass);
	padding-top: 0.85rem;
}
.pc-settings summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text-muted);
}
.pc-settings summary::-webkit-details-marker {
	display: none;
}
.pc-settings summary::after {
	content: "+";
	margin-left: auto;
	font-family: ui-monospace, monospace;
	font-size: 1.1rem;
}
.pc-settings[open] summary {
	color: var(--text);
	margin-bottom: 0.85rem;
}
.pc-settings[open] summary::after {
	content: "−";
}
.pc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.35rem;
}
.pc-grid label {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 0.4rem;
}
.pc-grid output {
	font-family: ui-monospace, monospace;
	color: var(--text);
}
.pc-grid select {
	width: 100%;
	padding: 0.5rem 0.6rem;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.4);
	color: var(--text);
	border: 1px solid var(--border-glass);
	font: inherit;
	font-size: 0.9rem;
}
.pc-grid input[type="range"] {
	width: 100%;
	accent-color: var(--primary);
	height: 28px; /* comfortable touch target */
}
.pc-reset {
	margin-top: 0.85rem;
	width: 100%;
}
.pairing-pill {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.9rem;
	border-radius: 99px;
	color: var(--text);
	font-family: ui-monospace, "SF Mono", Menlo, monospace;
	font-size: 0.85rem;
	background: rgba(10, 10, 14, 0.72);
}
.pairing-pill svg {
	width: 16px;
	height: 16px;
}
@media (max-width: 768px) {
	.pairing-card,
	.pairing-pill {
		top: calc(4.5rem + env(safe-area-inset-top, 0px));
		left: 0.75rem;
	}
	.pairing-card {
		right: 0.75rem;
		width: auto;
		max-height: calc(100dvh - 4.5rem - 7rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	}
	.pc-share {
		flex-direction: row;
		align-items: center;
	}
	.pc-qr img,
	.pc-qr canvas {
		width: 132px !important;
		height: 132px !important;
	}
	.pc-code-wrap {
		align-items: flex-start;
	}
	.pc-code {
		text-align: left;
		font-size: 0.9rem;
		white-space: nowrap;
		word-break: normal;
	}
}

/* ---------- 1-to-1 call ---------- */
.call-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
.call-buttons .secondary-btn {
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1.25rem;
}
.call-stage #call-remote {
	object-fit: contain;
	background: #000;
}
.call-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	color: var(--text-muted);
	background: radial-gradient(circle at 50% 40%, #16162a, #050505 70%);
	z-index: 2;
	text-align: center;
	padding: 1rem;
}
.call-avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: rgba(99, 102, 241, 0.15);
	color: #a5b4fc;
	box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}
.call-avatar svg {
	width: 40px;
	height: 40px;
}
.call-avatar.pulse {
	animation: callPulse 1.8s ease-out infinite;
}
@keyframes callPulse {
	0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
	100% { box-shadow: 0 0 0 28px rgba(99, 102, 241, 0); }
}
.call-self {
	position: absolute;
	right: 1rem;
	bottom: 7rem;
	width: 200px;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 14px;
	border: 2px solid rgba(255, 255, 255, 0.15);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	z-index: 4;
	background: #111;
}
.call-self.mirror {
	transform: scaleX(-1);
}
.call-muted-badge {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.8rem;
	border-radius: 99px;
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.35);
	color: #fca5a5;
	font-size: 0.85rem;
}
.call-muted-badge svg {
	width: 16px;
	height: 16px;
}
.call-sound-btn {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 6;
	width: auto;
	padding: 1rem 1.5rem;
}
.call-lobby {
	position: absolute;
	inset: 0;
	z-index: 8;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(5, 5, 5, 0.85);
}
.call-lobby code {
	font-family: ui-monospace, "SF Mono", Menlo, monospace;
	color: #a5b4fc;
}
@media (max-width: 768px) {
	.call-buttons {
		grid-template-columns: 1fr;
	}
	.call-buttons .secondary-btn {
		flex-direction: row;
		align-items: center;
		gap: 1.5rem;
		padding: 1.5rem;
	}
	.call-self {
		width: 104px;
		aspect-ratio: 3 / 4;
		right: 0.75rem;
		bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
	}
	.call-muted-badge {
		top: calc(4.5rem + env(safe-area-inset-top, 0px));
	}
	.call-stage #call-remote {
		object-fit: cover;
	}
}

/* ---------- Video source menu (camera / screen / off) ---------- */
.source-menu {
	position: fixed;
	z-index: 200;
	min-width: 230px;
	padding: 6px;
	border-radius: 14px;
	background: rgba(14, 14, 20, 0.92);
	display: flex;
	flex-direction: column;
	gap: 2px;
	animation: fadeIn 0.15s ease;
}
.source-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	padding: 0.7rem 0.8rem;
	border: none;
	border-radius: 10px;
	background: transparent;
	color: var(--text);
	font-size: 0.95rem;
	text-align: left;
}
.source-item:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.08);
}
.source-item.current {
	background: rgba(99, 102, 241, 0.16);
}
.source-item:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.source-item svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}
.source-item span {
	display: flex;
	flex-direction: column;
}
.source-item small {
	font-size: 0.75rem;
	color: var(--text-muted);
}
.source-item .source-check {
	margin-left: auto;
	color: #a5b4fc;
}

/* A shared screen is shown whole: cropping a demo hides its edges */
#remote-video,
#local-video.screen,
.call-stage #call-remote.screen {
	object-fit: contain !important;
	background: #000;
}
.call-self.screen {
	aspect-ratio: 16 / 9;
	object-fit: contain;
}

/* Fullscreen call: the whole view, controls included */
#call-view:fullscreen {
	background: #000;
	padding: 0;
}
#call-view:fullscreen .video-container {
	max-height: none;
	height: 100%;
	border-radius: 0;
}
#call-view:-webkit-full-screen {
	background: #000;
	width: 100%;
	height: 100%;
}
#call-view:-webkit-full-screen .video-container {
	max-height: none;
	height: 100%;
	border-radius: 0;
}

/* ==========================================================================
   LiveCall.pm: the .pm landings' charter (pm.studio, card/assets/landing.css)
   Outfit 500, paper and ink, hairlines rather than boxes, pill buttons, the
   logo in two inks. Light by default, dark with the system. The video stage
   stays dark whatever the theme: its tokens are redefined locally below.
   ========================================================================== */
@font-face { font-family: Outfit; font-weight: 500; font-display: swap; src: url(./assets/fonts/outfit-500.ttf) format("truetype"); }
@font-face { font-family: Outfit; font-weight: 800; font-display: swap; src: url(./assets/fonts/outfit-800.ttf) format("truetype"); }

:root {
	--paper: #f5f6f7; --sheet: #ffffff; --ink: #17191d; --soft: #6b717c; --faint: #9aa0aa; --rule: #e2e5e9;
	--bg-color: var(--paper);
	--surface: var(--sheet);
	--surface-glass: var(--sheet);
	--border-glass: var(--rule);
	--primary: var(--ink);
	--primary-hover: var(--ink);
	--text: var(--ink);
	--text-muted: var(--soft);
	--success: #059669;
	--danger: #e5484d;
	--danger-hover: #d13438;
	--radius-lg: 20px;
	--radius-md: 14px;
	--shadow-glow: none;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root { --paper: #0f121a; --sheet: #1a1d22; --ink: #eceef1; --soft: #a3a9b3; --faint: #6f7680; --rule: #2a2e35; --success: #34d399; color-scheme: dark; }
}
/* the video stage and what floats on it: always dark */
.video-container, .controls-bar, .source-menu {
	--bg-color: #0f121a; --surface-glass: rgba(15, 18, 26, 0.62); --border-glass: rgba(255, 255, 255, 0.12);
	--text: #eceef1; --text-muted: #a3a9b3; --primary: #eceef1; --ink: #eceef1; --rule: rgba(255, 255, 255, 0.12);
	color: var(--text);
}

body {
	font: 500 16px/1.6 Outfit, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
	letter-spacing: -0.005em;
}
h1, h2 { font-weight: 500; letter-spacing: -0.02em; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid #00a0e3; outline-offset: 4px; border-radius: 4px; }

/* header: the logo in two inks, a quiet status */
.app-header { padding: 1.5rem 2rem; }
.logo img { height: 17px; width: auto; display: block; }
.logo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
	.logo .logo-light { display: none; }
	.logo .logo-dark { display: block; }
}
.status-badge { background: none; border: 0; padding: 0; font-size: 13px; color: var(--soft); }
.status-badge::before { width: 7px; height: 7px; }
.status-badge.connected { background: none; color: var(--ink); }
.status-badge.connected::before { box-shadow: none; }

/* home: a kicker, a title, a lead, then the calls as hairline rows */
.home { width: 100%; max-width: 640px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--soft); margin-bottom: 22px; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.home h1 { font-size: clamp(36px, 3vw + 20px, 64px); line-height: 1.06; letter-spacing: -0.028em; margin: 0 0 24px; text-wrap: balance; }
.home h1 em { font-style: normal; color: var(--faint); }
.lead { font-size: clamp(17px, 0.4vw + 12.5px, 20px); color: var(--soft); max-width: 40ch; margin-bottom: 48px; }
.home .mode-buttons { gap: 0; border-bottom: 1px solid var(--rule); }
.home .call-buttons { display: flex; flex-direction: column; gap: 0; }
.row-btn {
	display: flex; align-items: center; gap: 20px; width: 100%; min-height: 84px; padding: 16px 0;
	background: none; border: 0; border-top: 1px solid var(--rule); border-radius: 0;
	color: var(--ink); text-align: left; font: inherit;
}
.row-btn > svg:first-child { width: 22px; height: 22px; color: var(--soft); flex-shrink: 0; transition: color 0.2s; }
.row-btn .btn-text { flex: 1; }
.row-btn .btn-text strong { font-weight: 500; font-size: clamp(22px, 1vw + 16px, 28px); letter-spacing: -0.02em; line-height: 1.15; }
.row-btn .btn-text span { color: var(--soft); font-size: 14px; }
.row-btn .row-arrow { width: 20px; height: 20px; color: var(--faint); transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), color 0.2s; }
.row-btn:hover > svg:first-child, .row-btn:hover .row-arrow { color: var(--ink); }
.row-btn:hover .row-arrow { transform: translateX(4px); }
.row-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* cards (join prompt, lobby): a sheet with a hairline, no glass */
.glass-card { background: var(--sheet); border: 1px solid var(--rule); backdrop-filter: none; box-shadow: none; text-align: left; }
.glass-card p { color: var(--soft); }
.video-container .glass-card { background: rgba(15, 18, 26, 0.86); }

/* buttons: ink pills */
.primary-btn, .secondary-btn { border-radius: var(--radius-md); gap: 1rem; padding: 1.1rem 1.25rem; }
.primary-btn { background: var(--ink); color: var(--paper); box-shadow: none; }
.video-container .primary-btn { color: #0f121a; }
.primary-btn:hover { transform: none; box-shadow: none; opacity: 0.86; }
.secondary-btn { background: none; border: 1px solid var(--rule); color: var(--ink); }
.secondary-btn:hover { background: none; border-color: var(--ink); }
.btn-text strong { font-weight: 500; }
.btn-text span { color: inherit; opacity: 0.7; }
.input-group .primary-btn { border-radius: 999px; padding: 0 1.75rem; min-height: 52px; }
input[type="text"] { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; font-size: 1rem; }
input[type="text"]:focus { border-color: var(--ink); }

/* video stage: dark, quiet, no indigo */
.video-container { background: #0f121a; box-shadow: none; }
.call-placeholder { background: #0f121a; }
.call-avatar { background: rgba(255, 255, 255, 0.06); color: #eceef1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.call-avatar.pulse { animation: lcPulse 2s ease-out infinite; }
@keyframes lcPulse { 0% { box-shadow: 0 0 0 0 rgba(236, 238, 241, 0.35); } 100% { box-shadow: 0 0 0 28px rgba(236, 238, 241, 0); } }
.call-lobby code, .source-item .source-check, .pc-code { color: #eceef1; }
.source-menu { background: rgba(15, 18, 26, 0.94); border: 1px solid rgba(255, 255, 255, 0.12); }
.source-item.current { background: rgba(255, 255, 255, 0.1); }
.glass-panel { box-shadow: none; }
.control-btn.danger { color: #fff; }

/* toasts: a sheet, the ink */
.toast { background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: 0.8rem 1.4rem; font-size: 14px; }

@media (max-width: 768px) {
	.app-header { padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 1rem; }
	.main-content { align-items: flex-start; padding: 1.5rem 1.25rem; }
	.row-btn { min-height: 72px; gap: 16px; }
	#selection-view.active { justify-content: flex-start; padding-top: 2rem; }
}

/* ---------- No zoom: no double-tap zoom, no pinch (script.js stops the rest) ---------- */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-size: 16px; } /* below 16px iOS zooms on focus */

/* ---------- Header: status + language ---------- */
.header-right { display: flex; align-items: center; gap: 16px; }
.lang-btn {
	min-width: 38px; height: 30px; padding: 0 10px; border-radius: 999px;
	background: none; border: 1px solid var(--rule); color: var(--soft);
	font: inherit; font-size: 12px; letter-spacing: 0.04em;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Immersive stage: a call fills the screen, whatever the device ---------- */
.video-container {
	position: fixed; inset: 0; z-index: 1;
	width: 100%; height: 100vh; height: 100dvh; max-height: none;
	border-radius: 0;
}
.controls-bar { position: fixed; z-index: 10; transition: opacity 0.35s ease, transform 0.35s ease; }
/* no transform on the stage views: it would pin the fixed stage to the view, not the screen */
.view:not(#selection-view) { animation-name: stageIn; }
@keyframes stageIn { from { opacity: 0; } to { opacity: 1; } }
.pairing-card, .pairing-pill { top: calc(4.75rem + env(safe-area-inset-top, 0px)); }
.call-muted-badge { top: calc(4.75rem + env(safe-area-inset-top, 0px)); }
.call-self { transition: bottom 0.35s ease; }
.call-stage #call-remote { object-fit: contain; }
.call-stage #call-remote.fill { object-fit: cover; } /* a shared screen stays whole (.screen, !important) */
body:has(#call-view.active, #broadcaster-view.active, #local-view.active, #remote-video-container:not(.hidden)) .app-header {
	position: fixed; inset: 0 0 auto; z-index: 12;
	padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
	background: linear-gradient(rgba(5, 6, 9, 0.55), rgba(5, 6, 9, 0));
	transition: opacity 0.35s ease;
}
body:has(#call-view.active, #broadcaster-view.active, #local-view.active, #remote-video-container:not(.hidden)) :is(.logo .logo-light, .lang-btn) { display: none; }
body:has(#call-view.active, #broadcaster-view.active, #local-view.active, #remote-video-container:not(.hidden)) .logo .logo-dark { display: block; }
body:has(#call-view.active, #broadcaster-view.active, #local-view.active, #remote-video-container:not(.hidden)) .status-badge { color: #a3a9b3; }
body:has(#call-view.active, #broadcaster-view.active, #local-view.active, #remote-video-container:not(.hidden)) .status-badge.connected { color: #eceef1; }
/* idle: header and controls fade out, can't be hit, the self view slides down */
body.idle .app-header, body.idle .controls-bar { opacity: 0; pointer-events: none; }
body.idle .controls-bar { transform: translateX(-50%) translateY(12px); }
body.idle .call-self { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
body.idle #call-view { cursor: none; }

/* ---------- Join a call: scan first, type as a fallback ---------- */
.connect-prompt h2 { font-size: clamp(28px, 1.5vw + 18px, 40px); line-height: 1.12; margin-bottom: 0.75rem; }
.scan-btn { margin-top: 1.75rem; }
.scan-btn > svg:first-child { width: 26px; height: 26px; flex-shrink: 0; }
.or { display: flex; align-items: center; gap: 14px; margin: 1.5rem 0 0; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.connect-prompt .input-group { margin-top: 1.25rem; }
.connect-prompt input[type="text"] { min-width: 0; }
.connect-prompt .input-group .primary-btn { flex-shrink: 0; padding: 0 1.5rem; }
.back-btn {
	display: inline-flex; align-items: center; gap: 8px; margin-top: 1.5rem; padding: 0;
	background: none; border: 0; color: var(--soft); font: inherit; font-size: 14px;
}
.back-btn svg { width: 16px; height: 16px; }
.back-btn:hover { color: var(--ink); }

/* the scanner: the camera full screen, a frame with crop marks (the charter's) */
.scanner { position: fixed; inset: 0; z-index: 70; background: #000; display: grid; place-items: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame {
	position: relative; width: min(68vmin, 320px); aspect-ratio: 1; border-radius: 28px;
	box-shadow: 0 0 0 100vmax rgba(5, 6, 9, 0.5);
}
.scanner-frame i { position: absolute; width: 34px; height: 34px; border: 0 solid #fff; }
.scanner-frame i:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 28px; }
.scanner-frame i:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 28px; }
.scanner-frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 28px; }
.scanner-frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 28px; }
.scanner-frame::after {
	content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; border-radius: 2px;
	background: rgba(255, 255, 255, 0.85); animation: scanLine 2.2s ease-in-out infinite;
}
@keyframes scanLine { 0%, 100% { transform: translateY(-110px); opacity: 0.2; } 50% { transform: translateY(110px); opacity: 1; } }
.scanner-hint {
	position: absolute; left: 0; right: 0; bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
	text-align: center; color: #eceef1; font-size: 15px;
}
#btn-scan-close { position: absolute; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; }

/* ---------- Installed app: the system draws no bars, the safe areas matter ---------- */
@media (display-mode: standalone) {
	.app-header { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
