/* ── Mobile user settings — full-screen overlay ──────────────────────
   Mirrors `MobileServerSettings.module.css` so the two settings
   surfaces feel consistent on mobile. Top bar with X / back arrow,
   user-avatar hero on the category list, then a stack of grouped
   rounded cards (Your Account / App Settings / Log Out). Tapping a
   row pushes the tab content full-screen with a back arrow. */

.overlay {
	position: fixed;
	inset: 0;
	z-index: var(--z-index-modal, 10000);
	display: flex;
	flex-direction: column;
	background-color: var(--background-secondary);
	overflow: hidden;
}

/* ── Top bar ────────────────────────────────────────────────────────*/

.topBar {
	flex-shrink: 0;
	display: grid;
	grid-template-columns: 48px 1fr 48px;
	align-items: center;
	height: 56px;
	padding: 0 8px;
	border-bottom: 1px solid var(--background-header-secondary);
}

.topBarButton {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: var(--text-primary);
	cursor: pointer;
	transition: background-color 0.15s;
	-webkit-tap-highlight-color: transparent;
	margin: 0 auto;
}

.topBarButton:active {
	background-color: var(--background-modifier-hover);
}

.topBarTitleBlock {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.topBarTitle {
	font-size: 17px;
	font-weight: 700;
	color: var(--text-primary);
	text-align: center;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

/* ── Body ───────────────────────────────────────────────────────────*/

.body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 16px 32px;
}

.bodyList {
	padding-top: 24px;
}

.bodyPanel {
	padding: 16px;
}

/* ── User hero ─────────────────────────────────────────────────────*/

.hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
}

.heroName {
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
	text-align: center;
}

.heroHandle {
	font-size: 13px;
	color: var(--text-primary-muted);
	margin: 0;
	text-align: center;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 0 16px;
}

/* ── Section / cards ───────────────────────────────────────────────*/

.section + .section {
	margin-top: 18px;
}

.sectionLabel {
	font-size: 13px;
	font-weight: 500;
	color: var(--text-primary-muted);
	padding: 0 4px 8px;
}

.tabList {
	background-color: var(--background-secondary-alt);
	border-radius: 0.75rem;
	overflow: hidden;
}

.tabItem {
	position: relative;
	display: grid;
	grid-template-columns: 32px 1fr auto;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 16px;
	background: transparent;
	border: none;
	color: var(--text-primary);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.1s;
	-webkit-tap-highlight-color: transparent;
}

.tabItem:active {
	background-color: var(--background-modifier-hover);
}

.tabItemIcon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background-color: var(--background-secondary);
	color: var(--text-primary);
}

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

.tabItem:not(:last-child)::after {
	content: '';
	position: absolute;
	left: calc(16px + 32px + 12px);
	right: 16px;
	bottom: 0;
	height: 1px;
	background-color: var(--background-header-secondary);
	pointer-events: none;
}

/* ── Log Out button (danger card) ───────────────────────────────────*/

.dangerCard {
	background-color: var(--background-secondary-alt);
	border-radius: 0.75rem;
	overflow: hidden;
}

.dangerItem {
	display: grid;
	grid-template-columns: 32px 1fr;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 16px;
	background: transparent;
	border: none;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	color: hsl(350, calc(90% * var(--saturation-factor)), 65%);
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.1s;
}

.dangerItem:active {
	background-color: var(--background-modifier-hover);
}

.dangerItemIcon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background-color: var(--background-secondary);
	color: hsl(350, calc(90% * var(--saturation-factor)), 65%);
}

/* ── Tab panel stub fallback ────────────────────────────────────────*/

.stubTitle {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
}

.stubBody {
	margin: 0;
	font-size: 14px;
	color: var(--text-primary-muted);
}
