/* RH Activity Drawer */
:root {
	--rhad-primary: #5e17eb;
	--rhad-bg: #f6f2ff;
	--rhad-soft: #e6dcfd;
	--rhad-border: #d9cbfb;
	--rhad-text: #1f1640;
	--rhad-width: 420px;
	--rhad-fab-bottom: 20px; /* chỉnh độ cao nút tim nổi */
}

html.rhad-lock { overflow: hidden; }

.rhad-overlay {
	position: fixed; inset: 0; z-index: 999998;
	background: rgba(15, 10, 30, .45);
	opacity: 0; transition: opacity .25s ease;
}
.rhad-overlay.is-open { opacity: 1; }

.rhad-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 999999;
	width: var(--rhad-width); max-width: calc(100vw - 28px);
	background: var(--rhad-bg); color: var(--rhad-text);
	border-radius: 20px 0 0 20px;
	box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
	transform: translateX(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
	display: flex; flex-direction: column;
	font-family: inherit;
}
.rhad-drawer.is-open { transform: translateX(0); }

.rhad-collapse {
	position: absolute; left: -24px; top: 34px;
	width: 48px; height: 48px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: #fff; color: var(--rhad-text);
	border: 1px solid var(--rhad-border); cursor: pointer; padding: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}
.rhad-collapse:hover { color: var(--rhad-primary); }

.rhad-header {
	padding: 26px 20px 18px 34px;
	border-bottom: 1px solid var(--rhad-soft);
	text-align: center;
}
.rhad-title { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--rhad-text); }

.rhad-body { flex: 1; overflow-y: auto; padding: 20px 20px 28px; overscroll-behavior: contain; }

.rhad-tabs {
	display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
	padding: 6px; border-radius: 12px; background: var(--rhad-soft);
	margin-bottom: 20px;
}
.rhad-tab {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 8px; border-radius: 8px; border: 2px solid transparent;
	background: transparent; color: var(--rhad-text);
	font-size: 17px; font-weight: 600; cursor: pointer; line-height: 1;
}
.rhad-tab.is-active { background: #fff; border-color: var(--rhad-border); color: var(--rhad-primary); }
.rhad-tab svg { flex: none; }

.rhad-pane { display: none; }
.rhad-pane.is-active { display: block; }

.rhad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.rhad-card {
	position: relative; border-radius: 12px; overflow: hidden;
	background: #fff; border: 2px solid var(--rhad-soft);
	transition: border-color .15s, transform .15s;
}
.rhad-card:hover { border-color: var(--rhad-primary); transform: translateY(-2px); }
.rhad-card__link { display: flex; flex-direction: column; color: inherit !important; text-decoration: none !important; }
.rhad-card__media { aspect-ratio: 200 / 123; background: var(--rhad-soft); overflow: hidden; }
.rhad-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 !important; }
.rhad-card__name {
	margin: 0 !important; padding: 8px 12px 10px;
	font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--rhad-text);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rhad-card__remove {
	position: absolute; top: 8px; right: 8px;
	width: 32px; height: 32px; border-radius: 50%; padding: 0;
	display: flex; align-items: center; justify-content: center;
	background: #fff; color: var(--rhad-text); border: none; cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.rhad-card__remove:hover { background: var(--rhad-primary); color: #fff; }

.rhad-more { text-align: center; margin: 24px 0 0 !important; }
.rhad-more a {
	display: inline-flex; align-items: center; gap: 4px;
	color: var(--rhad-primary) !important; font-weight: 600; font-size: 16px; text-decoration: none !important;
}
.rhad-more a:hover { text-decoration: underline !important; }

.rhad-empty { text-align: center; color: #6b6290; padding: 30px 10px; margin: 0; }

.rhad-loading { display: flex; justify-content: center; padding: 40px 0; }
.rhad-loading span {
	width: 28px; height: 28px; border-radius: 50%;
	border: 3px solid var(--rhad-soft); border-top-color: var(--rhad-primary);
	animation: rhad-spin .8s linear infinite;
}
@keyframes rhad-spin { to { transform: rotate(360deg); } }

/* Nút mở */
.rhad-btn {
	position: relative; display: inline-flex; align-items: center; gap: 6px;
	background: transparent; border: none; cursor: pointer; color: inherit; padding: 6px;
}
.rhad-fab {
	position: fixed; right: 18px; bottom: var(--rhad-fab-bottom, 20px); z-index: 99990;
	width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
	background: var(--rhad-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 18px rgba(94, 23, 235, .4);
}
.rhad-fab:hover { filter: brightness(1.1); }
.rhad-count {
	position: absolute; top: -4px; right: -4px;
	min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: #ff3d57; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.rhad-count[hidden] { display: none; }

@media (max-width: 480px) {
	.rhad-header { padding-left: 40px; }
	.rhad-title { font-size: 20px; }
	.rhad-body { padding: 16px 14px 24px; }
	.rhad-grid { gap: 12px; }
	.rhad-tab { font-size: 15px; }
	.rhad-card__name { font-size: 14px; padding: 6px 10px 8px; }
}
