:root {
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	--page-bg: #0f172a;
	--surface: #ffffff;
	--surface-muted: #f8fafc;
	--surface-strong: #e2e8f0;
	--text: #0f172a;
	--text-muted: #475569;
	--primary: #4338ca;
	--primary-strong: #312e81;
	--secondary: #0f172a;
	--danger: #dc2626;
	--success: #15803d;
	--warning: #a16207;
	--hint: #0369a1;
	--accent: #9333ea;
	--radius-lg: 1rem;
	--radius-full: 999px;
	--shadow-soft: 0 10px 35px rgba(15, 23, 42, 0.12);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background: radial-gradient(120% 120% at 50% 0%, rgba(79, 70, 229, 0.08), transparent 60%) var(--surface-muted);
	color: var(--text);
	display: flex;
	flex-direction: column;
	font-family: inherit;
	line-height: 1.5;
}

body > * {
	font-family: inherit;
}

.no-copy,
.no-copy * {
	user-select: none;
}

.no-share * {
	touch-action: manipulation;
}

#topbar {
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(16px);
	border-bottom: 1px solid rgba(148, 163, 184, 0.4);
	padding: 0.75rem 1.5rem;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	position: sticky;
	top: 0;
	z-index: 10;
}

#topbar header {
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--primary);
	text-transform: none;
}

#topbar header a {
	color: inherit;
	text-decoration: none;
}

#topbar .filler {
	flex: 1;
}

.admin-note {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #b45309;
	background: #fffbeb;
	padding: 0.25rem 0.75rem;
	border-radius: var(--radius-full);
}

#mwrap {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 2rem clamp(1rem, 4vw, 3rem);
}

#mwrap > .filler {
	display: none;
}

.flashbox {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

main {
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
}

footer {
	background: #e2e8f0;
	padding: 2rem 1rem;
	font-size: 0.9rem;
	color: #1e293b;
}

footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 1.5rem;
}

footer a {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

footer a:hover,
footer a:focus-visible {
	border-color: rgba(15, 23, 42, 0.5);
}

.filler {
	display: none;
}

.weak {
	color: var(--text-muted);
}

.nowrap {
	white-space: nowrap;
}

.a11y-only {
	position: absolute;
	clip: rect(1px, 1px, 1px, 1px);
	padding: 0;
	margin: -1px;
	border: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.box {
	background: var(--surface);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 1rem;
	padding: 1.25rem 1.5rem;
	box-shadow: var(--shadow-soft);
}

.box header {
	margin-top: 0;
	margin-bottom: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
}

.box p {
	margin: 0.25rem 0 0;
}

.box.slim {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
}

.box.success {
	border-color: rgba(5, 122, 85, 0.3);
	background: #f0fdf4;
	color: #166534;
}

.box.alert {
	border-color: rgba(220, 38, 38, 0.3);
	background: #fef2f2;
	color: #991b1b;
}

.box.warning {
	border-color: rgba(161, 98, 7, 0.25);
	background: #fffbeb;
	color: #92400e;
}

.box.hint {
	border-color: rgba(3, 105, 161, 0.25);
	background: #ecfeff;
	color: #0c4a6e;
}

.box.primary {
	border-color: rgba(67, 56, 202, 0.3);
	background: #eef2ff;
	color: #312e81;
}

.elevated {
	background: var(--surface);
	border-radius: 1.25rem;
	box-shadow: var(--shadow-soft);
	padding: 1.5rem;
}

.el-1 {
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.el-2 {
	box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12);
}

.el-3 {
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.el-4 {
	box-shadow: 0 25px 55px rgba(15, 23, 42, 0.2);
}

.el-5 {
	box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
}

.button,
button,
input[type="submit"],
.copy-to-clipboard,
.share-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	border-radius: var(--radius-full);
	font-weight: 600;
	font-size: 0.95rem;
	padding: 0.55rem 1.2rem;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
	background: rgba(15, 23, 42, 0.04);
	color: var(--secondary);
}

.button:hover,
button:hover,
input[type="submit"]:hover,
.copy-to-clipboard:hover,
.share-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
.copy-to-clipboard:focus-visible,
.share-button:focus-visible {
	outline: 3px solid rgba(67, 56, 202, 0.3);
	outline-offset: 2px;
}

.button.primary,
button.primary,
input.primary[type="submit"] {
	background: linear-gradient(135deg, var(--primary), var(--accent));
	color: white;
	border-color: transparent;
}

.button.secondary,
button.secondary,
input.secondary[type="submit"] {
	background: rgba(67, 56, 202, 0.08);
	color: var(--primary);
	border-color: rgba(67, 56, 202, 0.15);
}

.button.tertiary,
button.tertiary,
input.tertiary[type="submit"] {
	background: transparent;
	color: var(--text);
	border-color: rgba(15, 23, 42, 0.12);
}

.button.danger,
button.danger,
input.danger[type="submit"] {
	background: rgba(220, 38, 38, 0.08);
	color: var(--danger);
	border-color: rgba(220, 38, 38, 0.35);
}

.button.accent,
button.accent,
input.accent[type="submit"] {
	box-shadow: 0 20px 35px rgba(147, 51, 234, 0.2);
}

.button.slimmify,
button.slimmify {
	padding: 0.35rem 0.9rem;
	font-size: 0.85rem;
}

.button > span,
button > span {
	display: inline-flex;
	align-items: center;
}

.button svg,
button svg {
	width: 1rem;
	height: 1rem;
}

table {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

table th {
	text-align: left;
	background: rgba(15, 23, 42, 0.04);
	padding: 0.85rem 1rem;
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--text-muted);
}

table td {
	padding: 1rem;
	border-top: 1px solid rgba(148, 163, 184, 0.25);
}

table tr:hover td {
	background: rgba(67, 56, 202, 0.04);
}

.collapsible {
	width: 10rem;
}

.form {
	background: var(--surface);
	border-radius: var(--radius-lg);
	padding: 2rem;
	box-shadow: var(--shadow-soft);
	margin: 1.5rem 0;
}

.form-title {
	margin: 0 0 0.75rem;
	font-size: 1.35rem;
	font-weight: 600;
}

.form-desc,
.form-descr {
	margin: 0 0 1.5rem;
	color: var(--text-muted);
}

.layout-expanded label,
.layout-expanded legend {
	display: block;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 0.5rem;
}

.layout-expanded fieldset {
	border: none;
	padding: 0;
	margin: 0;
}

.f-ebox {
	margin: 1.25rem 0;
}

.f-bbox {
	margin-top: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-end;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
textarea {
	width: 100%;
	border: 1px solid rgba(15, 23, 42, 0.15);
	border-radius: 0.75rem;
	padding: 0.85rem 1rem;
	font-size: 1rem;
	background: rgba(248, 250, 252, 0.75);
}

input:focus,
textarea:focus,
select:focus {
	outline: 3px solid rgba(67, 56, 202, 0.3);
	outline-offset: 2px;
	border-color: transparent;
	background: #fff;
}

textarea {
	min-height: 6rem;
	resize: vertical;
}

.select-wrap {
	position: relative;
	border: 1px solid rgba(15, 23, 42, 0.15);
	border-radius: 0.75rem;
	background: rgba(248, 250, 252, 0.75);
}

.select-wrap select {
	width: 100%;
	border: none;
	background: transparent;
	padding: 0.85rem 1rem;
	appearance: none;
	font-size: 1rem;
}

.select-wrap::after {
	content: "";
	position: absolute;
	right: 1rem;
	top: 50%;
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid var(--text-muted);
	border-bottom: 2px solid var(--text-muted);
	transform: translateY(-60%) rotate(45deg);
}

input[type="checkbox"],
input[type="radio"] {
	width: 1.05rem;
	height: 1.05rem;
	margin-right: 0.5rem;
	accent-color: var(--primary);
}

.radio-button-ext {
	margin-bottom: 0.75rem;
}

.radio-button-ext label {
	font-weight: 500;
	color: var(--text);
}

.radio-button-ext p {
	margin: 0.35rem 0 0;
	color: var(--text-muted);
}

.field-desc {
	margin-top: 0.25rem;
	font-size: 0.9rem;
	color: var(--text-muted);
}

label.required::after {
	content: "*";
	color: var(--danger);
	margin-left: 0.25rem;
}

.flashbox .box[role="alert"] {
	margin: 0;
}

.avatar {
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	background-color: rgba(15, 23, 42, 0.1);
	position: relative;
}

.avatar.shim span {
	position: absolute;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: white;
	text-transform: uppercase;
}

.username-with-avatar {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 18rem;
}

.avatar-container {
	position: relative;
}

.user-badge-icon {
	position: absolute;
	bottom: -0.25rem;
	right: -0.25rem;
	background: white;
	border-radius: var(--radius-full);
	padding: 0.15rem;
	box-shadow: 0 5px 15px rgba(15, 23, 42, 0.15);
}

.user-info-container {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.user-display-name {
	font-weight: 600;
}

.user-jid {
	font-size: 0.9rem;
	color: var(--text-muted);
}

.user-jid-at {
	padding: 0 0.15rem;
}

.welcome ul {
	list-style: none;
	padding: 0;
	margin: 2rem 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
	gap: 1.5rem;
}

.welcome li {
	background: var(--surface);
	border-radius: 1.25rem;
	padding: 1.5rem;
	box-shadow: var(--shadow-soft);
}

.profile-card {
	display: flex;
	gap: 1rem;
	align-items: center;
	margin: 1rem 0;
	background: rgba(67, 56, 202, 0.05);
	padding: 1rem;
	border-radius: 1rem;
}

.profile-card input {
	border-radius: 2rem;
	padding: 0.5rem 0.75rem;
	background: white;
	border: 1px dashed rgba(15, 23, 42, 0.2);
	font-weight: 600;
}

.picture {
	flex-shrink: 0;
}

.install-buttons ul {
	list-style: none;
	padding: 0;
	margin: 0 0 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.install-buttons img {
	max-height: 3.5rem;
	height: auto;
}

.powered-by {
	font-size: 0.9rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.powered-by img {
	height: 1rem;
}

.modal {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.65);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

.modal[aria-modal="true"] {
	display: flex !important;
}

.modal[aria-hidden="false"],
.modal:target {
	display: flex !important;
}

.modal > div[role="document"] {
	background: var(--surface);
	border-radius: 1.25rem;
	width: min(32rem, 100%);
	max-height: 90vh;
	overflow-y: auto;
	padding: 1.5rem;
	box-shadow: 0 30px 70px rgba(15, 23, 42, 0.35);
}

.modal-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 1rem;
	font-weight: 600;
}

.qr {
	width: 16rem;
	height: 16rem;
	margin: 1rem auto;
}

.with-tooltip {
	position: relative;
	cursor: help;
}

.with-tooltip::after {
	content: attr(data-tooltip);
	position: absolute;
	left: 50%;
	bottom: 100%;
	transform: translate(-50%, -0.5rem);
	background: #0f172a;
	color: white;
	font-size: 0.75rem;
	padding: 0.3rem 0.5rem;
	border-radius: 0.35rem;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 120ms ease;
}

.with-tooltip:focus::after,
.with-tooltip:hover::after {
	opacity: 1;
}

.with-tooltip.above::after {
	transform: translate(-50%, -0.4rem);
}

.install-buttons .popover {
	position: relative;
}

.copy-to-clipboard,
.share-button {
	background: rgba(67, 56, 202, 0.08);
	color: var(--primary);
}

.powered-by + p,
.install-buttons + p {
	margin-top: 0;
}

.lwrap {
	display: grid;
	gap: 1rem;
}

.localpart-magic,
.localpart-fixed {
	font-family: "JetBrains Mono", "Fira Mono", monospace;
	font-size: 0.85rem;
	background: rgba(15, 23, 42, 0.06);
	padding: 0.5rem 0.75rem;
	border-radius: 0.75rem;
}

.inline {
	display: inline-flex;
	gap: 0.75rem;
	align-items: center;
}

.float-right {
	float: right;
	margin-left: 1.25rem;
	margin-bottom: 1rem;
	max-width: 12rem;
}

.fullwidth {
	width: 100%;
}

.guru-meditation {
	font-family: "JetBrains Mono", "Fira Mono", monospace;
	background: #0f172a;
	color: #f87171;
	padding: 1rem;
	border-radius: 1rem;
	box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.3);
}

.modal ol {
	padding-left: 1.25rem;
}

.modal li {
	margin-bottom: 0.75rem;
}

.demo-columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
	gap: 1.5rem;
}

.demo-column {
	background: var(--surface);
	border-radius: 1rem;
	padding: 1rem;
	box-shadow: var(--shadow-soft);
}

.samplerow {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.samplehead {
	width: 6rem;
	font-weight: 600;
}

.samplebox {
	flex: 1;
	height: 2rem;
	border-radius: 0.5rem;
}

.dark {
	background: #0f172a;
	color: white;
	padding: 0.5rem;
	border-radius: 0.75rem;
}

.dark .samplebox {
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.gray-100 { background: #f8fafc; }
.gray-200 { background: #e2e8f0; }
.gray-300 { background: #cbd5f5; }
.gray-400 { background: #94a3b8; }
.gray-500 { background: #64748b; }
.gray-600 { background: #475569; }
.gray-700 { background: #334155; }
.gray-800 { background: #1e293b; }
.gray-900 { background: #0f172a; }

.success-100 { background: #f0fdf4; }
.success-200 { background: #dcfce7; }
.success-300 { background: #bbf7d0; }
.success-400 { background: #86efac; }
.success-500 { background: #4ade80; }
.success-600 { background: #22c55e; }
.success-700 { background: #16a34a; }
.success-800 { background: #15803d; }
.success-900 { background: #166534; }

.alert-100 { background: #fef2f2; }
.alert-200 { background: #fee2e2; }
.alert-300 { background: #fecaca; }
.alert-400 { background: #fca5a5; }
.alert-500 { background: #f87171; }
.alert-600 { background: #ef4444; }
.alert-700 { background: #dc2626; }
.alert-800 { background: #b91c1c; }
.alert-900 { background: #991b1b; }

.accent-100 { background: #f3e8ff; }
.accent-200 { background: #e9d5ff; }
.accent-300 { background: #d8b4fe; }
.accent-400 { background: #c084fc; }
.accent-500 { background: #a855f7; }
.accent-600 { background: #9333ea; }
.accent-700 { background: #7e22ce; }
.accent-800 { background: #6b21a8; }
.accent-900 { background: #581c87; }

.primary-100 { background: #eef2ff; }
.primary-200 { background: #e0e7ff; }
.primary-300 { background: #c7d2fe; }
.primary-400 { background: #a5b4fc; }
.primary-500 { background: #818cf8; }
.primary-600 { background: #6366f1; }
.primary-700 { background: #4f46e5; }
.primary-800 { background: #4338ca; }
.primary-900 { background: #312e81; }

@media (min-width: 960px) {
	#topbar {
		padding: 1rem 3rem;
	}

	#mwrap {
		padding: 3rem 4rem 4rem;
	}
}

@media (max-width: 640px) {
	.button,
	button,
	input[type="submit"] {
		width: 100%;
		justify-content: center;
	}

	#topbar {
		flex-direction: column;
		align-items: flex-start;
	}
}