/* EasyMaster Engagement — uses the theme's tokens, so light and dark mode follow. */
.eme-ico { width: 20px; height: 20px; flex: none; }
.eme-ico .eme-on { display: none; }
[aria-pressed="true"] .eme-ico .eme-on { display: inline; }
[aria-pressed="true"] .eme-ico .eme-off { display: none; }

/* Bar under the post */
.eme-bar { margin: 2rem 0 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--em-border); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eme-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--em-border); background: var(--em-bg-card); color: var(--em-text); font: 600 15px/1 inherit; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, transform .1s; }
.eme-btn:hover { border-color: var(--em-primary); color: var(--em-text); }
.eme-btn:active { transform: scale(.97); }
.eme-btn:focus-visible { outline: 3px solid var(--em-primary); outline-offset: 2px; }
.eme-btn .eme-n { font-variant-numeric: tabular-nums; color: var(--em-muted); font-weight: 700; }
.eme-btn .eme-n:empty { display: none; }
.eme-btn[aria-pressed="true"] { border-color: var(--em-primary); background: var(--em-bg-2); color: var(--em-primary); }
.eme-btn[aria-pressed="true"] .eme-n { color: var(--em-primary); }
.eme-helpful[aria-pressed="true"] .eme-ico { animation: eme-pop .3s ease; }
.is-busy { opacity: .65; }
@keyframes eme-pop { 50% { transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .eme-helpful[aria-pressed="true"] .eme-ico { animation: none; } }
.eme-status { width: 100%; margin: 2px 0 0; font-size: 14px; color: var(--em-muted); min-height: 1.3em; }

/* Desktop rail: placed by the script beside the post, only where there is room */
.eme-rail { position: fixed; top: 160px; z-index: 40; display: none; flex-direction: column; gap: 6px; align-items: center; }
.eme-rail.on { display: flex; }
.eme-r { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--em-text); cursor: pointer; font: 600 13px/1 inherit; text-decoration: none; }
.eme-r .eme-c { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid transparent; transition: background-color .15s, border-color .15s; }
.eme-r:hover .eme-c { background: var(--em-bg-2); }
.eme-r:focus-visible { outline: none; }
.eme-r:focus-visible .eme-c { outline: 3px solid var(--em-primary); outline-offset: 2px; }
.eme-r[aria-pressed="true"] { color: var(--em-primary); }
.eme-r[aria-pressed="true"] .eme-c { background: var(--em-bg-2); border-color: var(--em-primary); }
.eme-r .eme-n { color: var(--em-muted); font-variant-numeric: tabular-nums; }
/* No count yet (under 10): no empty line under the icon, so the gaps stay even. */
.eme-r .eme-n:empty { display: none; }
.eme-r[aria-pressed="true"] .eme-n { color: var(--em-primary); }
.eme-tip { position: absolute; left: 60px; top: 14px; white-space: nowrap; background: var(--em-text); color: var(--em-bg-card); font: 600 12px/1 inherit; padding: 6px 8px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.eme-r:hover .eme-tip, .eme-r:focus-visible .eme-tip { opacity: 1; }
.eme-rail--right .eme-tip { left: auto; right: 60px; }
.eme-mbar .eme-tip { display: none; }

/* Phone bar */
.eme-mbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 45; display: none; justify-content: space-around; background: var(--em-bg-card); border: 1px solid var(--em-border); border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 4px; transition: transform .2s, opacity .2s; }
.eme-mbar.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }
/* Desktop without room for the rail: the same bar as a small centred pill. */
@media (min-width: 900px) {
	.eme-mbar.eme-desk { display: flex; left: 50%; right: auto; bottom: 1.25rem; transform: translateX(-50%); gap: 4px; padding: 4px 8px; }
	.eme-mbar.eme-desk.is-hidden { transform: translate(-50%, 140%); }
	.eme-mbar.eme-desk .eme-tip { display: block; left: 50%; right: auto; top: auto; bottom: 58px; transform: translateX(-50%); }
}
.eme-mbar .eme-r { flex-direction: row; gap: 6px; padding: 4px 10px; min-height: 48px; min-width: 48px; justify-content: center; font-size: 14px; }
.eme-mbar .eme-r .eme-c { width: auto; height: auto; border: 0; background: none !important; }
@media (max-width: 899px) {
	.eme-mbar { display: flex; }
	.eme-rail { display: none !important; }
	html.eme-has-mbar body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Menus and toast */
.eme-menu { position: fixed; z-index: 60; min-width: 210px; padding: 6px; background: var(--em-bg-card); color: var(--em-text); border: 1px solid var(--em-border); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .3); }
.eme-menu[hidden] { display: none; }
.eme-menu a, .eme-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: inherit; font: 500 15px/1.2 inherit; text-align: left; text-decoration: none; cursor: pointer; }
.eme-menu a:hover, .eme-menu button:hover, .eme-menu a:focus-visible, .eme-menu button:focus-visible { background: var(--em-bg-2); outline: none; }
.eme-toast { position: fixed; left: 50%; bottom: 100px; z-index: 70; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: var(--em-text); color: var(--em-bg-card); font: 600 14px/1.3 inherit; opacity: 0; pointer-events: none; transition: opacity .2s; }
.eme-toast.on { opacity: 1; }

/* Saved posts page */
.eme-saved-list { list-style: none; margin: 0; padding: 0 !important; display: grid; gap: 10px; }
.eme-saved-list li { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--em-border); border-radius: 12px; background: var(--em-bg-card); }
.eme-saved-list img, .eme-saved-ph { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--em-bg-2); }
.eme-saved-list div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eme-saved-list a { font-weight: 700; color: var(--em-text); text-decoration: none; }
.eme-saved-list a:hover { text-decoration: underline; }
.eme-saved-type { font-size: 13px; color: var(--em-muted); }
.eme-saved-list .eme-btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
