/* Touch / coarse pointer: no sticky :hover — use :active for tap feedback instead */

@media (hover: none), (pointer: coarse) {
	/* —— Hover resets (match default / selected state) —— */

	.fm-rail-btn:hover:not(.is-active) {
		background: transparent;
		color: var(--fm-color-muted);
		border-radius: 10px;
	}

	.fm-rail-btn-logout:hover:not(.is-active) {
		background: transparent;
		color: var(--fm-color-muted);
	}

	.fm-panel-collapse-btn:hover,
	.fm-panel-close-btn:hover {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
	}

	.fm-room-item:hover:not(.is-active) {
		background: transparent;
	}

	.fm-mention-item:hover {
		background: var(--fm-surface-subtle);
		box-shadow: inset 0 0 0 1px var(--fm-border-subtle);
	}

	.fm-mention-item.is-unread:hover {
		box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fm-color-accent) 45%, transparent);
		background: color-mix(in srgb, var(--fm-color-accent) 8%, var(--fm-surface-subtle));
	}

	.fm-theme-option:hover:not(.is-active) {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
		box-shadow: inset 0 0 0 1px var(--fm-border-subtle);
	}

	.fm-theme-option:hover:not(.is-active) i {
		color: var(--fm-color-muted);
	}

	.fm-theme-option.is-active:hover i {
		color: var(--fm-color-accent);
	}

	.fm-filter-panel .fm-filter-row:hover,
	.fm-app-panel .fm-filter-row:hover {
		background: transparent;
	}

	.fm-filter-panel .fm-filter-row--zone:hover .fm-zone-stats-bar,
	.fm-app-panel .fm-filter-row--zone:hover .fm-zone-stats-bar {
		opacity: 0.75;
	}

	.fm-filter-panel .fm-filter-action-link:hover,
	.fm-app-panel .fm-filter-action-link:hover {
		color: var(--fm-link-color);
	}

	.fm-filter-panel .form-check.form-switch:not(.fm-layer-row__switch):hover,
	.fm-app-panel .fm-filter-display-section .form-check.form-switch:not(.fm-layer-row__switch):hover,
	.fm-app-panel .form-check.form-switch:not(.fm-layer-row__switch):hover {
		background: transparent;
	}

	.fm-panel-section[data-panel="settings"] .form-check.form-switch:hover {
		background: var(--fm-surface-subtle);
	}

	.fm-filter-panel .fm-filter-row--option:hover,
	.fm-app-panel .fm-filter-row--option:hover {
		background: transparent;
	}

	.fm-input-info-btn:hover,
	.fm-input-info-btn:focus-visible {
		color: var(--fm-color-subtle, #6c757d);
		background: transparent;
	}

	.fm-panel-section[data-panel="users"] #usersList .fm-users-item.has-location:hover,
	#usersList .fm-users-item.has-location:hover {
		background-color: transparent;
	}

	.fm-app-shell .btn-check:not(:checked) + .btn-outline-primary:hover,
	#searchModal .btn-check:not(:checked) + .btn-outline-primary:hover {
		background: transparent;
		border-color: rgba(88, 101, 242, 0.55);
		color: #aeb6ff;
	}

	.fm-app-shell button.fm-search-result:hover,
	button.fm-search-result:hover {
		background: transparent;
		background-color: transparent;
		box-shadow: none;
	}

	.fm-app-shell button.fm-search-result:hover .fm-search-result-meta,
	button.fm-search-result:hover .fm-search-result-meta {
		color: var(--fm-color-muted, #6c757d);
	}

	.fm-app-shell .fm-search-result:hover .fm-search-result-chevron,
	button.fm-search-result:hover .fm-search-result-chevron {
		color: var(--fm-color-subtle, #949ba4);
	}

	.fm-search-panel .search-container > .input-group .btn:hover {
		background: transparent;
		color: inherit;
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .fm-panel-subline-actions .edge-edit-fit-map-btn:hover,
	.fm-panel-section[data-panel="edit"]:is([data-edit-mode="assets"],[data-edit-mode^="topic:"]) .fm-panel-subline-actions .edge-asset-fit-map-btn:hover {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
	}

	.fm-panel-section[data-panel="edit"] .fm-object-tabs__btn:hover {
		background: transparent;
	}

	.fm-panel-section[data-panel="edit"] .fm-object-tabs__btn:hover:not(.is-active):not([aria-selected="true"]) {
		color: var(--fm-color-subtle);
		background: transparent;
	}

	.fm-panel-section[data-panel="edit"] .fm-object-tabs__btn.is-active:hover,
	.fm-panel-section[data-panel="edit"] .fm-object-tabs__btn[aria-selected="true"]:hover {
		color: var(--fm-link-color, var(--fm-color-accent));
		background: transparent;
	}

	.fm-app-shell .edge-edit-status-option:hover:not(.is-current),
	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .edge-edit-status-option:hover:not(.is-current) {
		background: transparent;
		box-shadow: inset 0 0 0 1px var(--fm-border-subtle);
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-mention-picker button:hover:not(.is-active),
	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-channel-picker button:hover:not(.is-active) {
		background: transparent;
	}

	.fm-app-shell .chat-window--shell .chat-header-btn:hover:not(.active) {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn:hover,
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn:hover,
	.chat-composer-btn:hover:not(.active):not(.chat-composer-btn--send) {
		background: transparent !important;
		color: var(--fm-color-muted);
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn.active:hover,
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn.active:hover,
	.chat-composer-btn.active:hover {
		background: color-mix(in srgb, var(--fm-color-accent, #5865f2) 14%, transparent);
		color: var(--fm-color-accent, #5865f2);
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn--reference.active:hover,
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn--reference.active:hover,
	.chat-composer-btn--reference.active:hover {
		background: var(--fm-color-accent-strong, #4752c4) !important;
		color: #fff;
	}

	.fm-app-shell .chat-window--shell .fm-message-edge-chip:hover {
		background: var(--fm-message-edge-chip-bg);
	}

	.fm-app-shell .chat-window--shell .chat-mention-picker button:hover:not(.is-active),
	.fm-app-shell .chat-window--shell .chat-channel-picker button:hover:not(.is-active),
	.fm-app-shell .chat-mention-picker button:hover:not(.is-active),
	.fm-app-shell .chat-channel-picker button:hover:not(.is-active) {
		background: transparent;
	}

	.chat-mention-picker button:hover:not(.is-active),
	.chat-channel-picker button:hover:not(.is-active) {
		background: transparent;
	}

	.fm-app-shell .chat-window--shell .fm-message-menu-btn:hover {
		color: var(--fm-color-subtle);
		background: transparent;
	}

	.fm-app-shell .chat-window--shell .fm-message-dropdown__item:hover,
	.fm-message-dropdown__item:hover {
		background: transparent;
	}

	.fm-app-shell .chat-window--shell .chat-channel-ref:hover,
	.chat-channel-ref:hover {
		color: #1f6fb8;
		background: rgba(34, 139, 230, 0.14);
		box-shadow: inset 0 0 0 1px rgba(34, 139, 230, 0.28);
	}

	.chat-header-btn:hover:not(.active) {
		background: rgba(255, 255, 255, 0.2);
	}

	.fm-message-edge-chip:hover {
		background: var(--fm-message-edge-chip-bg, #eef0f2);
	}

	.chat-composer-btn--send.is-ready:hover,
	.fm-app-shell .chat-window--shell .chat-composer-btn--send.is-ready:hover,
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn--send.is-ready:hover {
		background: var(--fm-color-accent, #5865f2);
		color: #fff;
	}

	.chat-composer-btn--cancel:hover {
		background: transparent;
		color: inherit;
	}

	.chat-composer-btn--send:disabled:hover,
	.fm-app-shell .chat-window--shell .chat-composer-btn--send:disabled:not(.is-ready):hover,
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn--send:disabled:not(.is-ready):hover {
		background: color-mix(in srgb, var(--fm-color-muted) 10%, transparent);
		color: var(--fm-color-muted);
	}

	.maplibregl-ctrl-attrib-button:hover {
		background-color: transparent !important;
	}

	.maplibregl-ctrl-attrib-button:hover::before {
		background-color: var(--fm-map-ctrl-attrib-icon);
	}

	.chat-composer-ref-remove:hover,
	.chat-referenced-edge-remove:hover {
		background: transparent;
		opacity: inherit;
	}

	.maplibregl-ctrl-group button:hover {
		background-color: transparent;
	}

	.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon {
		opacity: 1;
	}

	#toastContainer .toast .btn-close:hover,
	#toastContainer .toast .btn-close:focus {
		opacity: 0.45;
		background: transparent;
	}

	html.fm-theme-light #toastContainer .toast .btn-close:hover,
	html.fm-theme-light #toastContainer .toast .btn-close:focus {
		opacity: 0.38;
		background: transparent;
	}

	/* —— Hover-gated controls: keep reachable without sticky :hover —— */

	.fm-sync-panel-item-remove {
		opacity: 0.6;
	}

	.fm-sync-panel-item-remove:active {
		opacity: 1;
	}

	.fm-rail-group--primary > .fm-rail-btn.fm-rail-btn--edit-hub.fm-rail-btn--mobile-primary:not(.is-active):hover {
		background: transparent;
		color: var(--fm-color-muted);
		box-shadow: none;
	}

	.fm-room-icon-addon.btn:hover {
		background: transparent;
	}

	.fm-icon-pick:hover:not(.is-selected) {
		background: rgba(255, 255, 255, 0.05);
	}

	.fm-asset-topic-admin-item:hover {
		background: transparent;
	}

	.fm-chip:hover:not(.is-selected):not(.is-write) {
		background: rgba(255, 255, 255, 0.06);
	}

	.fm-user-pick-opt:hover {
		background: transparent;
	}

	.fm-seg-btn:hover:not(.is-active) {
		color: var(--fm-color-subtle);
	}

	.fm-user-exc-remove:hover {
		color: var(--fm-color-subtle);
		background: transparent;
	}

	.fm-panel-header .fm-panel-back-btn:hover {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
	}

	.fm-mobile-more-nav__item:hover {
		background: var(--fm-surface-raised, rgba(255, 255, 255, 0.04));
		border-color: var(--fm-border-subtle, rgba(0, 0, 0, 0.07));
	}

	.fm-panel-section[data-panel="settings"] .fm-map-offline-cancel:hover {
		color: var(--fm-color-muted);
	}

	.fm-settings-nav__item:hover {
		background: transparent;
	}

	.fm-settings-nav__item:hover .fm-settings-nav__chevron {
		color: var(--fm-color-subtle);
	}

	.fm-settings-nav__item--danger:hover {
		background: transparent;
	}

	.fm-settings-nav > .form-check.form-switch:hover {
		background: transparent;
	}

	.fm-panel-subline-btn:hover,
	.fm-panel-subline-btn--icon:hover {
		background: transparent;
		color: var(--fm-color-muted);
	}

	.fm-panel-subline-btn--icon:hover {
		background: var(--fm-surface-subtle);
	}

	.fm-panel-section[data-panel="edit"]:is([data-edit-mode="assets"],[data-edit-mode^="topic:"]) .fm-panel-header-controls .edge-asset-place-toggle-btn:hover {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
	}

	.fm-edit-mode-title-btn:hover {
		color: var(--fm-heading-color);
	}

	.fm-edit-mode-menu__item:hover:not(.is-active) {
		background: transparent;
		color: inherit;
	}

	.fm-panel-section:is([data-edit-mode="assets"],[data-edit-mode^="topic:"]) .edge-asset-edit-status-option:hover:not(:disabled):not(.is-current) {
		background: transparent;
	}

	.fm-panel-section[data-panel="edit"] .edge-edit-status-history-btn:hover {
		background: transparent;
		color: var(--fm-color-muted);
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .edge-edit-comment-archive-foot .edge-edit-archive-btn:hover {
		background: transparent;
		color: var(--fm-color-muted);
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .edge-edit-archive-banner .edge-edit-archive-show-btn:hover {
		background: var(--fm-surface-subtle);
		color: var(--fm-color-muted);
		box-shadow: inset 0 0 0 1px var(--fm-border-subtle);
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .edge-edit-status-option.is-current:hover {
		background: color-mix(in srgb, var(--edge-status-color) 14%, transparent);
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .edge-edit-status-option.is-action-pending:hover {
		background: transparent;
	}

	.chat-mention:hover {
		background: rgba(88, 101, 242, 0.14);
		color: var(--fm-color-accent-strong, #4752c4);
		box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.22);
	}

	.chat-mention-self:hover {
		color: #fff;
		background: var(--fm-color-accent, #5865f2);
		box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.55);
	}

	.fm-message-asset:hover,
	.fm-message-geo:hover {
		filter: none;
	}

	.fm-message__reply-preview:hover {
		background: var(--fm-message-reply-bg);
	}

	.chat-composer-reply__cancel:hover,
	.chat-composer-forward__cancel:hover {
		background: transparent;
		color: var(--fm-color-subtle, #949ba4);
	}

	.chat-composer-forward__cancel:hover {
		color: var(--fm-message-reply-snippet);
	}

	.chat-composer-reply__body--clickable:hover .chat-composer-reply__snippet {
		color: var(--fm-message-reply-snippet);
	}

	.fm-attachments__image:hover img {
		transform: none;
	}

	.fm-attachments__doc:hover {
		background: var(--fm-surface-subtle, rgba(0, 0, 0, 0.04));
	}

	.fm-poll__option:hover:not(.is-selected) {
		box-shadow: inset 0 0 0 1px var(--fm-surface-hover, rgba(0, 0, 0, 0.08));
	}

	.fm-poll__submit:hover {
		background: var(--fm-color-accent, #5865f2);
	}

	.fm-composer-poll-option-remove:hover {
		background: var(--fm-surface-subtle, rgba(0, 0, 0, 0.04));
		color: var(--fm-color-muted, #5c6370);
	}

	.fm-message__pending-action:hover {
		background: var(--fm-surface-subtle, rgba(0, 0, 0, 0.06));
		color: var(--fm-color-text, #2e3338);
	}

	.fm-message__pending-action[data-action="retry"]:hover {
		background: var(--fm-color-accent, #4752c4);
		color: #fff;
	}

	.fm-chat-room-members-popover__item:hover {
		background: transparent;
	}

	.fm-chat-room-members-link:hover {
		color: inherit;
		text-decoration: underline;
	}

	.chat-pending-chip__remove:hover,
	.chat-pending-chip--image .chat-pending-chip__remove:hover {
		background: transparent;
		opacity: inherit;
		color: inherit;
	}

	.chat-composer-addons > .chat-pending-chip .chat-pending-chip__remove:hover {
		background: var(--fm-surface-hover, rgba(0, 0, 0, 0.08));
		color: var(--fm-color-danger-soft, #ed4245);
	}

	.chat-composer-addons > .chat-pending-chip--event:hover,
	.chat-composer-addons > .chat-pending-chip--poll:hover,
	.chat-composer-addons > .chat-pending-chip--link:hover,
	.chat-composer-addons > .chat-pending-chip--checklist:hover,
	.chat-composer-addons > .chat-pending-chip--note:hover {
		background: var(--fm-surface-hover, rgba(0, 0, 0, 0.06));
	}

	.chat-attach-menu__item:hover {
		background: transparent;
	}

	.fm-message .fm-message-link:hover,
	.fm-message-feed .fm-message-link:hover,
	.fm-message-text .fm-message-link:hover {
		background: var(--fm-composer-link-bg, rgba(88, 101, 242, 0.14));
		box-shadow: inset 0 0 0 1px var(--fm-composer-link-border, rgba(88, 101, 242, 0.22));
		color: var(--fm-composer-link-text, var(--fm-color-accent-strong, #4752c4));
	}

	.fm-lexical-composer .fm-lexical-input .fm-composer-mention:hover,
	.fm-lexical-composer .fm-lexical-input .spike-lexical-mention:hover,
	.fm-inline-editor .fm-composer-mention:hover {
		background: var(--fm-composer-mention-bg, rgba(88, 101, 242, 0.14));
		box-shadow: inset 0 0 0 1px var(--fm-composer-mention-border, rgba(88, 101, 242, 0.22));
	}

	.fm-lexical-composer .fm-lexical-input .fm-composer-channel-ref:hover,
	.fm-lexical-composer .fm-lexical-input .spike-lexical-hashtag:hover,
	.fm-inline-editor .fm-composer-channel-ref:hover {
		background: var(--fm-composer-chip-bg, var(--fm-composer-channel-bg, rgba(88, 101, 242, 0.14)));
		box-shadow: inset 0 0 0 1px var(--fm-composer-chip-border, var(--fm-composer-channel-border, rgba(88, 101, 242, 0.22)));
	}

	.fm-lexical-composer .fm-lexical-input .fm-composer-link:hover,
	.fm-lexical-composer .fm-lexical-input .spike-lexical-link:hover {
		background: var(--fm-composer-link-bg, var(--fm-composer-chip-bg, rgba(88, 101, 242, 0.14)));
		box-shadow: inset 0 0 0 1px var(--fm-composer-link-border, var(--fm-composer-chip-border, rgba(88, 101, 242, 0.22)));
	}

	.fm-lexical-composer .fm-lexical-input .fm-composer-link__edit:hover,
	.fm-lexical-composer .fm-lexical-input .spike-lexical-link .fm-composer-link__edit:hover {
		opacity: inherit;
		background: transparent;
	}

	.fm-lexical-composer .fm-lexical-input .fm-inline-ref-chip:not(.fm-ref-chip-graphic):hover,
	.fm-lexical-composer .fm-lexical-input .spike-lexical-ref:not(.fm-ref-chip-graphic):hover,
	.fm-app-shell .edge-edit-comment-composer .edge-comment-feed .fm-inline-ref-chip:not(.fm-ref-chip-graphic):hover,
	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) .fm-message-feed-list .fm-message__text .fm-inline-ref-chip--readonly:not(.fm-ref-chip-graphic):hover,
	.fm-app-shell .chat-composer .fm-lexical-composer .fm-lexical-input .fm-inline-ref-chip:not(.fm-ref-chip-graphic):hover {
		background: var(--fm-composer-chip-bg, var(--fm-composer-ref-bg, rgba(88, 101, 242, 0.14)));
		box-shadow: inset 0 0 0 1px var(--fm-composer-chip-border, var(--fm-composer-ref-border, rgba(88, 101, 242, 0.22)));
		color: var(--fm-composer-chip-text, var(--fm-composer-ref-text, var(--fm-color-accent-strong, #4752c4)));
	}

	.fm-ref-chip-graphic:hover .chip-graphic__node-dot,
	.fm-ref-chip-graphic:hover .chip-graphic__region-append,
	.fm-ref-chip-graphic:hover .chip-graphic__freepoint-marker--inline,
	.fm-app-shell .chat-window--shell .fm-ref-chip-graphic:hover .chip-graphic__node-dot,
	.fm-app-shell .chat-window--shell .fm-ref-chip-graphic:hover .chip-graphic__region-append,
	.fm-app-shell .chat-window--shell .fm-ref-chip-graphic:hover .chip-graphic__freepoint-marker--inline {
		background: var(--fm-graphic-chip-bg);
		box-shadow: inset 0 0 0 1px var(--fm-graphic-chip-border);
	}

	.fm-ref-chip-graphic .chip-graphic__edge-bar--reversible:hover .chip-graphic__edge-bar-line {
		opacity: 0.65;
	}

	.fm-ref-chip-graphic .chip-graphic__edge-bar--reversible:hover .chip-graphic__edge-hover-icon {
		opacity: 0;
	}

	.fm-freepoint-icon-picker__tab:hover:not(.is-active) {
		background: transparent;
		color: inherit;
	}

	.fm-freepoint-icon-picker__option:hover:not(.is-selected) .chip-graphic__freepoint-marker--picker {
		background: var(--fm-surface-subtle, rgba(255, 255, 255, 0.04));
		border-color: var(--fm-chat-picker-border, rgba(255, 255, 255, 0.1));
		color: var(--fm-chat-picker-text, var(--fm-color-text, #dbdee1));
		opacity: 0.72;
		box-shadow: none;
	}

	.fm-lexical-composer .fm-lexical-input .fm-inline-ref-chip.fm-ref-chip-graphic:hover,
	.fm-app-shell .chat-composer .fm-lexical-composer .fm-lexical-input .chat-composer-ref-chip.fm-ref-chip-graphic:hover {
		background: transparent;
		box-shadow: none;
	}

	#toastContainer .fm-toast-action-btn:hover {
		color: var(--fm-toast-info);
	}

	.fm-progress-action__cancel:hover {
		color: var(--fm-color-muted, #6c757d);
	}

	.modal .btn-close:hover,
	.modal .btn-close:focus {
		opacity: 0.72;
		background-color: transparent;
	}

	html.fm-theme-light .modal .btn-close:hover,
	html.fm-theme-light .modal .btn-close:focus {
		background-color: transparent;
		opacity: 0.72;
	}

	.modal .fm-legal-content a:hover {
		color: var(--fm-link-color, #7eb8ff);
	}

	html.fm-theme-light .modal .fm-legal-content a:hover {
		color: #0d6efd;
	}

	.fm-auth-link:hover {
		color: var(--fm-link-color);
		text-decoration: none;
	}

	.fm-chat-forward-room-item:hover:not(.is-selected) {
		background: transparent;
		border-color: var(--fm-border-subtle, rgba(0, 0, 0, 0.08));
	}

	/* First message in a group: menu button stays visible on touch.
	   Continued messages (2+) have no actions menu (see chat.js). */
	.fm-message:not(.fm-message--continued) .fm-message-menu-btn,
	.fm-app-shell .chat-window--shell .fm-message:not(.fm-message--continued) .fm-message-menu-btn {
		opacity: 1;
		pointer-events: auto;
	}

	/* Object comment feeds: hide menu chrome; long-press opens (message-longpress.js). */
	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"],[data-edit-mode="assets"],[data-edit-mode^="topic:"]) .fm-message-feed-list .fm-message .fm-message-menu-btn {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"],[data-edit-mode="assets"],[data-edit-mode^="topic:"]) .fm-message-feed-list .fm-message .fm-message-menu-btn.fm-message-menu-btn--longpress-anchor,
	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"],[data-edit-mode="assets"],[data-edit-mode^="topic:"]) .fm-message-feed-list .fm-message.fm-message--action-focus .fm-message-menu-btn,
	.fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"],[data-edit-mode="assets"],[data-edit-mode^="topic:"]) .fm-message-feed-list .fm-message-menu-btn[aria-expanded="true"] {
		visibility: visible;
		opacity: 1;
		pointer-events: auto;
	}

	/* Continued messages (2+ in stack): menu button visually hidden on touch.
	   Long-press opens menu; toggle must stay in layout for Bootstrap/Popper. */
	.fm-message--continued .fm-message__actions--floated,
	.fm-app-shell .chat-window--shell .fm-message--continued .fm-message__actions--floated {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	.fm-message--continued .fm-message-menu-btn,
	.fm-app-shell .chat-window--shell .fm-message--continued .fm-message-menu-btn {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	.fm-message--continued .fm-message-menu-btn.fm-message-menu-btn--longpress-anchor,
	.fm-app-shell .chat-window--shell .fm-message--continued .fm-message-menu-btn.fm-message-menu-btn--longpress-anchor {
		visibility: visible;
		opacity: 0;
		pointer-events: none;
	}

	.fm-message--continued.fm-message--action-focus,
	.fm-message--continued.fm-msg-lp-armed {
		background: var(--fm-message-hover);
	}

	.fm-message--continued.fm-message--action-focus .fm-message__timestamp--inline,
	.fm-message--continued.fm-msg-lp-armed .fm-message__timestamp--inline {
		opacity: 1;
		pointer-events: auto;
	}

	/* Sync item remove: no hover on touch — keep it reachable (see hover-gated block) */

	/* —— :active tap feedback —— */

	.fm-panel-collapse-btn:active {
		transform: scale(0.96);
		background: var(--fm-surface-hover);
		color: var(--fm-heading-color);
	}

	.fm-room-item:active:not(.is-active) {
		background: var(--fm-surface-hover);
	}

	.fm-app-panel .fm-filter-row:active {
		background: var(--fm-surface-hover);
	}

	.fm-app-panel .form-check.form-switch:active,
	.fm-filter-panel .form-check.form-switch:active {
		background: var(--fm-surface-subtle);
	}

	.fm-panel-section[data-panel="users"] #usersList .fm-users-item.has-location:active,
	#usersList .fm-users-item.has-location:active {
		background: var(--fm-surface-hover);
	}

	#usersList .fm-users-item.has-location:active {
		background-color: rgba(0, 0, 0, 0.06);
	}

	/* No full-row :active on messages — flashes while scrolling. Long-press uses
	   .fm-message--action-focus / .fm-msg-lp-armed instead. */

	.fm-message-menu-btn:active,
	.fm-app-shell .chat-window--shell .fm-message-menu-btn:active {
		opacity: 1;
		transform: scale(0.96);
		background: var(--fm-message-hover);
		color: var(--fm-message-name);
	}

	.fm-message-dropdown__item:active,
	.fm-app-shell .chat-window--shell .fm-message-dropdown__item:active {
		background: var(--fm-surface-hover, rgba(0, 0, 0, 0.06));
	}

	.fm-app-shell .chat-window--shell .chat-channel-ref:active,
	.chat-channel-ref:active {
		transform: scale(0.98);
	}

	.fm-filter-panel .fm-filter-action-link:active,
	.fm-app-panel .fm-filter-action-link:active {
		color: var(--fm-link-hover-color);
	}

	.fm-input-info-btn:active {
		color: var(--fm-color-text, #212529);
		background: var(--fm-surface-hover, rgba(255, 255, 255, 0.06));
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn:active:not(:disabled):not(.chat-composer-btn--send),
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn:active:not(:disabled):not(.chat-composer-btn--send),
	.chat-composer-btn:active:not(:disabled):not(.chat-composer-btn--send) {
		transform: scale(0.96);
		background: var(--fm-surface-hover, rgba(255, 255, 255, 0.08));
		color: var(--fm-color-text, #374151);
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn.active:active:not(:disabled),
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn.active:active:not(:disabled),
	.chat-composer-btn.active:active:not(:disabled) {
		background: color-mix(in srgb, var(--fm-color-accent, #5865f2) 22%, transparent);
		color: var(--fm-color-accent, #5865f2);
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn--reference.active:active:not(:disabled),
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn--reference.active:active:not(:disabled),
	.chat-composer-btn--reference.active:active:not(:disabled) {
		background: var(--fm-color-accent-strong, #4752c4);
		color: #fff;
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn--send.is-ready:active:not(:disabled),
	.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn--send.is-ready:active:not(:disabled),
	.chat-composer-btn--send.is-ready:active:not(:disabled) {
		transform: scale(0.96);
		background: color-mix(in srgb, var(--fm-color-accent, #5865f2) 82%, #000);
		color: #fff;
	}

	.fm-app-shell .chat-window--shell .chat-composer-btn--cancel:active:not(:disabled),
	.chat-composer-btn--cancel:active:not(:disabled) {
		transform: scale(0.96);
		background: rgba(220, 53, 69, 0.14);
		color: var(--fm-color-danger, #dc3545);
	}

	.fm-app-shell .chat-window--shell .chat-header-btn:active:not(.active) {
		transform: scale(0.96);
		background: var(--fm-surface-hover);
		color: var(--fm-heading-color);
	}

	.fm-app-shell .chat-window--shell .chat-mention-picker button:active:not(.is-active),
	.fm-app-shell .chat-window--shell .chat-channel-picker button:active:not(.is-active),
	.chat-mention-picker button:active:not(.is-active),
	.chat-channel-picker button:active:not(.is-active) {
		background: var(--fm-chat-picker-hover, rgba(255, 255, 255, 0.08));
	}

	.fm-rail-btn:active:not(.is-active) {
		background: var(--fm-surface-hover);
		color: var(--fm-color-text);
	}

	.fm-mobile-more-nav__item:active {
		background: var(--fm-surface-hover);
		border-color: var(--fm-border-medium);
	}

	.fm-settings-nav__item:active {
		background: rgba(99, 102, 241, 0.14);
	}

	.fm-settings-nav__item--static:active {
		background: transparent;
	}

	.fm-settings-nav__item--danger:active {
		background: color-mix(in srgb, var(--fm-color-danger, #ed4245) 18%, transparent);
	}

	.fm-settings-nav > .form-check.form-switch:active {
		background: rgba(99, 102, 241, 0.08);
	}

	.fm-panel-header .fm-panel-back-btn:active {
		background: var(--fm-surface-hover);
		color: var(--fm-heading-color);
	}

	.fm-room-icon-addon.btn:active {
		background: var(--fm-surface-hover);
	}

	.fm-icon-pick:active:not(.is-selected) {
		background: rgba(255, 255, 255, 0.1);
	}

	.fm-asset-topic-admin-item:active {
		background: rgba(99, 102, 241, 0.08);
	}

	.fm-user-pick-opt:active {
		background: var(--fm-surface-hover);
	}

	.fm-chip:active:not(.is-locked) {
		background: rgba(255, 255, 255, 0.1);
	}

	.chat-mention:active,
	.chat-mention-self:active {
		transform: scale(0.98);
	}

	.chat-attach-menu__item:active {
		background: var(--fm-surface-hover, rgba(0, 0, 0, 0.06));
	}

	.fm-chat-room-members-popover__item:active {
		background: var(--fm-chat-picker-hover, #f0f1ff);
	}

	.fm-message__reply-preview:active:not(.fm-message__reply-preview--deleted) {
		background: var(--fm-message-reply-hover);
	}

	.fm-poll__option:active:not(.is-selected) {
		box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fm-color-accent, #5865f2) 45%, transparent);
	}

	.fm-edit-mode-menu__item:active:not(.is-active) {
		background: var(--fm-surface-hover);
	}

	.fm-panel-section[data-panel="edit"] .fm-object-tabs__btn:active:not(.is-active):not([aria-selected="true"]) {
		color: var(--fm-color-muted);
	}

	.fm-panel-section:is([data-edit-mode="assets"],[data-edit-mode^="topic:"]) .edge-asset-edit-status-option:active:not(:disabled):not(.is-current) {
		background: var(--fm-surface-hover);
	}

	.fm-freepoint-icon-picker__tab:active:not(.is-active) {
		background: var(--fm-chat-picker-hover, rgba(255, 255, 255, 0.06));
	}

	.fm-auth-submit:hover {
		background: #2563eb;
	}

	.fm-auth-submit:active {
		transform: scale(0.96);
		background: #1d4ed8;
	}

	.chat-composer-ref-remove:active,
	.chat-pending-chip__remove:active,
	.chat-referenced-edge-remove:active {
		transform: scale(0.96);
		background: rgba(0, 0, 0, 0.08);
		color: var(--fm-color-danger-soft, #ed4245);
	}

	.maplibregl-ctrl-group button:active {
		background-color: var(--fm-map-ctrl-bg-hover, rgba(255, 255, 255, 0.08)) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	@media (hover: none), (pointer: coarse) {
		.fm-panel-collapse-btn:active,
		.fm-app-shell .chat-window--shell .chat-header-btn:active,
		.fm-app-shell .chat-window--shell .fm-message-menu-btn:active,
		.fm-message-menu-btn:active,
		.fm-app-shell .chat-window--shell .chat-composer-btn:active:not(:disabled),
		.fm-app-shell .fm-panel-section:is([data-edit-mode="edges"],[data-edit-mode="nodes"]) :is([data-edge-edit-root],[data-node-edit-root]) .chat-composer-btn:active:not(:disabled),
		.chat-composer-btn:active:not(:disabled),
		.fm-app-shell .chat-window--shell .chat-channel-ref:active,
		.chat-channel-ref:active,
		.fm-auth-submit:active {
			transform: none;
		}
	}
}
