.root {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 4px 12px 8px;
	gap: 12px;
}

/* ── Segmented tab selector ───────────────────────────────────────────
   Matches the Fluxer ExpressionPicker header tab list — rounded pill
   container, inset padding, animated active tab background. Uses a
   CSS-transform transition on the .tabBackground element instead of
   framer-motion's layoutId so it stays lightweight. */

.tabBar {
	position: relative;
	display: flex;
	border-radius: 10px;
	background: var(--background-tertiary);
	padding: 3px;
	flex-shrink: 0;
}

.tabBackground {
	position: absolute;
	top: 3px;
	bottom: 3px;
	height: calc(100% - 6px);
	border-radius: 8px;
	background: var(--background-secondary);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}

.tab {
	position: relative;
	z-index: 10;
	flex: 1;
	border: none;
	border-radius: 8px;
	padding: 8px 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	background: transparent;
	color: var(--text-secondary);
	transition: color 0.15s ease;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

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

.tabDisabled {
	opacity: 0.55;
	cursor: default;
}

/* ── Search bar ──────────────────────────────────────────────────────
   Mirrors Fluxer's PickerSearchInput — 36px min height, rounded,
   magnifying-glass leading icon, clear-X trailing button. */

.searchBar {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 2.25rem 0 2.25rem;
	border-radius: 8px;
	border: 1px solid var(--background-modifier-accent);
	background-color: var(--background-tertiary);
	flex-shrink: 0;
}

.searchIcon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-tertiary);
	pointer-events: none;
}

.searchInput {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	padding: 8px 0;
	font: inherit;
	font-size: 15px;
	color: var(--text-primary);
}

/* Kill every browser focus/active/autofill ring so the only visual
   is the rounded `.searchBar` surface. Firefox and Chromium ship
   different default blue rings on text inputs. */
.searchInput:focus,
.searchInput:focus-visible,
.searchInput:active {
	outline: none;
	box-shadow: none;
	border: none;
}

.searchInput::placeholder {
	color: var(--text-tertiary-muted, var(--text-tertiary));
}

.searchClear {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	background: var(--background-modifier-hover, rgba(255, 255, 255, 0.1));
	color: var(--text-primary);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* ── Body / scrolling area ───────────────────────────────────────────*/

.body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.comingSoon {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--text-tertiary);
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	padding: 24px 16px;
}

/* ── Media tab filter chips ─────────────────────────────────────
   Same shape as the desktop EmojiPicker chips so the mobile and
   desktop Media surfaces read identically. */
.filterChips {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	padding: 4px 0 0;
	flex-shrink: 0;
}

.filterChip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: transparent;
	border: none;
	border-radius: var(--radius-md, 0.375rem);
	color: var(--text-primary-muted, #a0a3a8);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.25rem;
	cursor: pointer;
	transition: background-color 0.12s, color 0.12s;
}

.filterChip:active {
	background-color: var(--background-modifier-hover);
	color: var(--text-primary);
}

.filterChipActive {
	background-color: var(--background-modifier-selected);
	color: var(--text-primary);
}

/* ── Saved-media grid (mobile) ──────────────────────────────────
   Square thumbnails with the filename ellipsised at the bottom.
   Same data shape the desktop picker uses but the cards are a bit
   bigger because fingers are less precise than cursors. */
.mediaGrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 8px;
	padding: 8px 0;
}

.mediaCard {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 0;
	border: 1px solid var(--background-modifier-accent);
	border-radius: 8px;
	background: var(--background-tertiary);
	color: var(--text-tertiary);
	cursor: pointer;
	overflow: hidden;
	transition: background-color 0.12s, border-color 0.12s;
}

.mediaCard:active {
	background: var(--background-modifier-hover);
	border-color: var(--background-modifier-selected, var(--background-modifier-accent));
}

.mediaCardIcon {
	color: var(--text-tertiary);
}

.mediaCardName {
	position: absolute;
	bottom: 4px;
	left: 4px;
	right: 4px;
	font-size: 10px;
	color: var(--text-secondary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: center;
}

/* ── Collapsible category sections ───────────────────────────────────
   The header is a clickable row with a caret that rotates; the emoji
   grid slides in/out below when toggled. Headers are intentionally
   NOT position: sticky — the user wants them to scroll naturally with
   the content, matching the Fluxer drawer layout in the reference. */

.categorySection {
	display: flex;
	flex-direction: column;
	margin-bottom: 4px;
}

.categoryHeader {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 4px;
	border: none;
	background: none;
	color: var(--text-primary);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.categoryCaret {
	flex-shrink: 0;
	color: var(--text-primary-muted, var(--text-tertiary));
	transition: transform 0.15s ease;
}

.categoryCaretOpen {
	transform: rotate(90deg);
}

.categoryGrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
	gap: 2px;
	padding: 4px 0 12px;
}

.emojiButton {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border: none;
	border-radius: 6px;
	background: none;
	padding: 4px;
	cursor: pointer;
	transition: background-color 0.1s;
	-webkit-tap-highlight-color: transparent;
}

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

.emojiImg {
	width: 28px;
	height: 28px;
	display: block;
	pointer-events: none;
}

/* ── Search results layout ──────────────────────────────────────────*/

.searchResults {
	display: flex;
	flex-direction: column;
	padding-top: 4px;
}

.searchResultsLabel {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-tertiary);
	padding: 4px 4px 6px;
}

.noResults {
	text-align: center;
	color: var(--text-tertiary);
	font-size: 14px;
	padding: 32px 0;
}

/* ── Bottom category nav bar ────────────────────────────────────────
   Horizontal row of icon buttons below the body, for jumping directly
   to a category. Mirrors Fluxer's `categoryListBottom` — pinned to
   the sheet's bottom, subtle top divider, safe-area padding so it
   clears the home indicator on notched phones. */

.bottomCategoryBar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
	padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--background-header-secondary);
	flex-shrink: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.bottomCategoryBar::-webkit-scrollbar {
	display: none;
}

.bottomCategoryButton {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--text-primary-muted, var(--text-tertiary));
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
	-webkit-tap-highlight-color: transparent;
}

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

.bottomCategoryButtonActive {
	color: var(--text-primary);
	background-color: var(--background-modifier-hover);
}
