/* meliora.art — community UI. Token lay tu design/homepage.html */
:root {
  --ml-bg: #F4F5F7;
  --ml-surface: #FFFFFF;
  --ml-surface-2: #F4F5F7;
  --ml-border: #E7E8EC;
  --ml-border-input: #D4D7DE;
  --ml-text: #14151A;
  --ml-text-2: #343844;
  --ml-muted: #5D6270;
  --ml-primary: #4B3BE8;
  --ml-primary-ink: #3A2FC0;
  --ml-primary-soft: #ECEAFD;
  --ml-green: #1E7A4E;
  --ml-green-soft: #E3F5EC;
  --ml-red: #E5484D;
  --ml-red-ink: #C2353D;
  --ml-radius-card: 20px;
  --ml-radius: 12px;
  --ml-shadow-pop: 0 12px 32px rgba(20, 21, 26, .14);
  --ml-header-h: 53px;
  --ml-header-bg: rgba(255, 255, 255, .72);
  --ml-col-left: 264px;
  --ml-col-right: 298px;
  --ml-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 860px) {
  html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
body.ml-page { margin: 0; background: var(--ml-bg); color: var(--ml-text); font: 400 15px/1.55 var(--ml-font); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ml-primary); outline-offset: 2px; }
.ml-icon { flex: none; }

/* ---------- Buttons & chips ---------- */
.ml-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border: 0; border-radius: 22px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.ml-btn--primary { background: var(--ml-primary); color: #fff; }
.ml-btn--primary:hover { background: var(--ml-primary-ink); }
.ml-btn--soft { background: var(--ml-primary-soft); color: var(--ml-primary-ink); }
.ml-btn--soft:hover { background: #E0DCFB; }
.ml-btn--ghost { background: transparent; color: var(--ml-muted); }
.ml-btn--ghost:hover { background: var(--ml-surface-2); }
.ml-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.ml-btn[disabled] { opacity: .6; cursor: progress; }

.ml-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--ml-border); border-radius: 50%; background: var(--ml-surface); color: var(--ml-text); position: relative; }
.ml-icon-btn:hover { background: var(--ml-surface-2); }
.ml-icon-btn--ghost { border-color: transparent; width: 36px; height: 36px; color: var(--ml-muted); background: transparent; }
.ml-icon-btn.is-active { color: var(--ml-primary); border-color: var(--ml-primary); background: var(--ml-primary-soft); }

.ml-link { border: 0; background: none; padding: 0; color: var(--ml-primary-ink); font-weight: 600; }


.ml-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 8px; border: 1px solid var(--ml-border); border-radius: 20px; background: var(--ml-surface); font-weight: 500; font-size: 14px; white-space: nowrap; flex: none; }
.ml-chip:not(:has(.ml-game-icon)) { padding-left: 18px; padding-right: 18px; }
.ml-chip:hover { border-color: #CFD2DA; }
.ml-chip.is-active { border-color: var(--ml-primary); background: var(--ml-primary-soft); color: var(--ml-primary-ink); font-weight: 600; }
.ml-chip--game { height: 32px; padding: 0 12px 0 5px; background: var(--ml-surface-2); border-color: transparent; font-size: 13px; font-weight: 600; }
.ml-chip--game .ml-game-icon { border-radius: 6px; font-size: 0; }
.ml-chip--removable { height: 30px; padding: 0 10px 0 12px !important; gap: 4px; background: var(--ml-primary-soft); border-color: transparent; color: var(--ml-primary-ink); font-weight: 600; font-size: 13px; }

.ml-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--ml-primary); color: #fff; font-size: 12px; font-weight: 600; }
.ml-count { min-width: 24px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--ml-primary-soft); color: var(--ml-primary-ink); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.ml-score { display: inline-grid; place-items: center; min-width: 38px; height: 32px; padding: 0 8px; border-radius: 10px; background: var(--ml-green-soft); color: var(--ml-green); font-weight: 700; font-size: 15px; }

.ml-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.ml-avatar--guest { background: var(--ml-surface-2); color: var(--ml-muted); }
.ml-game-icon { display: inline-grid; place-items: center; flex: none; border-radius: 8px; color: #fff; font-weight: 700; font-size: 11px; object-fit: cover; letter-spacing: .02em; }

/* ---------- Header ---------- */
.ml-header { position: sticky; top: 0; z-index: 40; height: var(--ml-header-h); background: var(--ml-surface); border-bottom: 1px solid var(--ml-border); }
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .ml-header { background: var(--ml-header-bg); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
}
/* Cung luoi 3 cot voi .ml-shell: logo tren sidebar trai, search giua tren feed, actions tren cot phai */
.ml-header__inner { height: 100%; padding: 0 24px; display: grid; grid-template-columns: var(--ml-col-left) minmax(0, 1fr) var(--ml-col-right); align-items: center; gap: 24px; }
.ml-header__menu { display: none; }
.ml-logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.ml-logo__mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ml-primary); color: #fff; font-weight: 700; font-size: 20px; }
.ml-logo__mark--lg { width: 56px; height: 56px; border-radius: 16px; font-size: 30px; }
.ml-logo__text { font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.ml-logo__text span { color: var(--ml-muted); font-weight: 500; }
.ml-search { position: relative; width: 100%; max-width: 560px; justify-self: center; display: flex; align-items: center; }
.ml-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ml-search .ml-icon { position: absolute; left: 12px; color: var(--ml-muted); pointer-events: none; }
.ml-search input { width: 100%; height: 36px; padding: 0 14px 0 38px; border: 1px solid var(--ml-border); border-radius: 18px; background: var(--ml-surface-2); font-size: 14px; }
.ml-search input:focus { outline: none; border-color: var(--ml-primary); background: var(--ml-surface); }
.ml-header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ml-header .ml-icon-btn { width: 36px; height: 36px; }
.ml-header .ml-icon-btn > svg { width: 18px; height: 18px; }
.ml-header__actions > .ml-btn { height: 34px; padding: 0 14px; font-size: 13px; }
.ml-account { position: relative; }
.ml-account__btn { padding: 0; border: 0; background: none; border-radius: 50%; display: block; }
.ml-account__info { padding: 8px 12px 10px; border-bottom: 1px solid var(--ml-border); margin-bottom: 4px; display: grid; }
.ml-account__info span { color: var(--ml-muted); font-size: 13px; }

.ml-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px; padding: 6px; background: var(--ml-surface); border: 1px solid var(--ml-border); border-radius: var(--ml-radius); box-shadow: var(--ml-shadow-pop); }
.ml-menu__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font-size: 14px; text-align: left; }
.ml-menu__item:hover { background: var(--ml-surface-2); }
.ml-account__communities { margin: 6px 0; padding: 8px 0 6px; border-block: 1px solid var(--ml-border); }
.ml-account__section-title { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ml-muted); }
.ml-account__communities .ml-menu__item { padding: 8px 12px; color: var(--ml-text-2); }
.ml-account__communities .ml-menu__item .ml-icon { flex: none; color: var(--ml-muted); }
.ml-account__communities .ml-menu__item:hover { color: var(--ml-text); }
.ml-account__communities .ml-menu__item:hover .ml-icon { color: var(--ml-primary-ink); }
.ml-account__community-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-account__communities { max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.ml-menu__item--danger { color: var(--ml-red-ink); }

/* ---------- Shell (3 cot) ---------- */
/* Sidebar trai/phai sat 2 mep man hinh, feed o giua (toi da 704px) */
.ml-shell { padding: 24px 24px 48px; display: grid; grid-template-columns: var(--ml-col-left) minmax(0, 1fr) var(--ml-col-right); gap: 24px; align-items: start; }
.ml-left { position: sticky; top: calc(var(--ml-header-h) + 24px); }
.ml-right { display: grid; gap: 16px; }
.ml-main { width: 100%; max-width: 704px; justify-self: center; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.ml-card { background: var(--ml-surface); border: 1px solid var(--ml-border); border-radius: var(--ml-radius-card); }

/* Left nav */
.ml-nav { display: grid; gap: 4px; }
.ml-nav__item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: var(--ml-radius); font-weight: 500; color: var(--ml-text); }
.ml-nav__item:hover { background: rgba(75, 59, 232, .06); }
.ml-nav__item.is-active { background: var(--ml-primary-soft); color: var(--ml-primary-ink); font-weight: 600; }
.ml-nav__item > span:not(.ml-nav__soon) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-nav__soon { margin-left: auto; flex: none; font-size: 10px; line-height: 16px; font-weight: 600; color: var(--ml-muted); background: var(--ml-surface); border: 1px solid var(--ml-border); padding: 1px 6px; border-radius: 6px; }
.ml-left__section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--ml-border); }
.ml-left__title { padding: 0 14px 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ml-muted); }
.ml-left__hint { padding: 0 14px; font-size: 13px; color: var(--ml-muted); }
.ml-left__hint a { color: var(--ml-primary-ink); font-weight: 600; }
.ml-follow-list { display: grid; gap: 2px; }
.ml-follow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--ml-radius); font-size: 14px; font-weight: 500; }
.ml-follow:hover { background: rgba(20, 21, 26, .04); }
.ml-follow__name { flex: 1; min-width: 0; white-space: nowrap; }
.ml-follow .ml-game-icon, .ml-follow .ml-count { flex-shrink: 0; }

/* Composer */
.ml-composer { padding: 16px 20px; }
.ml-composer__row { display: flex; align-items: center; gap: 12px; }
.ml-composer__input { flex: 1; height: 46px; padding: 0 18px; border: 1px solid var(--ml-border); border-radius: 23px; background: var(--ml-surface-2); color: var(--ml-muted); text-align: left; font-size: 15px; }
.ml-composer__input:hover { border-color: #CFD2DA; }

/* Filter bar */
.ml-filter { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ml-filter__label { font-size: 13px; font-weight: 500; color: var(--ml-muted); flex: none; }
.ml-filter__chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; min-width: 0; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.ml-filter__chips::-webkit-scrollbar { display: none; }
.ml-active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ml-muted); }

/* ---------- Post card ---------- */
.ml-feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ml-post { padding: 22px 20px 6px; scroll-margin-top: calc(var(--ml-header-h) + 16px); }
.ml-post:target { border-color: var(--ml-primary); box-shadow: 0 0 0 3px var(--ml-primary-soft); }
.ml-post__head { display: flex; align-items: center; gap: 12px; }
.ml-post__author { flex: 1; min-width: 0; }
.ml-post__name { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ml-post__sub { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--ml-muted); }
.ml-post__type { color: var(--ml-primary-ink); font-weight: 500; }
.ml-post__more { position: relative; }
.ml-post__title { margin-top: 16px; font-size: 19px; font-weight: 700; line-height: 1.4; letter-spacing: -.01em; }
.ml-post__content { margin-top: 10px; color: var(--ml-text-2); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ml-post__content.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.ml-post__expand { display: inline-block; margin-top: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ml-primary-ink); cursor: pointer; }
.ml-post__expand:hover { text-decoration: underline; }
.ml-inline-tag { color: var(--ml-primary-ink); font-weight: 500; }

/* Media bai viet (kieu Threads): 1 cai giu ti le goc, nhieu cai xep hang ngang cuon, khong crop */
.ml-post__media { margin-top: 14px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.ml-post__media::-webkit-scrollbar { display: none; }
@media (hover: hover) { .ml-post__media, .ml-cmt__media { cursor: grab; } }
.ml-post__media.is-dragging, .ml-cmt__media.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.ml-post__media.is-dragging *, .ml-cmt__media.is-dragging * { pointer-events: none; }
.ml-media { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: #2A2633; }
.ml-media img, .ml-media video { width: 100%; height: 100%; object-fit: cover; }
.ml-post__media .ml-media { flex: none; height: 320px; min-width: 120px; max-width: 80%; scroll-snap-align: start; }
.ml-post__media .ml-media img, .ml-post__media .ml-media video { display: block; width: auto; max-width: 100%; height: 100%; }
.ml-post__media--1 .ml-media { height: auto; max-width: 100%; }
.ml-post__media--1 .ml-media img, .ml-post__media--1 .ml-media video { width: auto; height: auto; max-height: 520px; }
@media (max-width: 640px) {
  .ml-post__media .ml-media { height: 240px; }
  .ml-post__media--1 .ml-media { height: auto; }
  .ml-post__media--1 .ml-media img, .ml-post__media--1 .ml-media video { max-height: 420px; }
}
.ml-post[data-post-href], .ml-media { cursor: pointer; }
body.is-media-open { overflow: hidden; }
.ml-media-modal { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0 80px; border: 0; background: rgba(8, 9, 13, .97); color: #fff; }
.ml-media-modal::backdrop { background: #08090d; }
.ml-media-modal[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ml-media-modal__stage { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; flex: 1; container-type: size; }
.ml-media-modal__stage img, .ml-media-modal__stage video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
/* Khung video: cao het man hinh, rong theo ti le that (doc/ngang) khi da biet metadata */
.ml-media-modal__frame { position: relative; width: 100%; height: 100%; }
.ml-media-modal__frame[style*="--ml-ar"] { width: min(100cqw, 100cqh * var(--ml-ar)); height: auto; aspect-ratio: var(--ml-ar); }
.ml-media-modal__frame video { display: block; cursor: pointer; }
.ml-media-modal__frame.is-paused::after { content: ""; position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; pointer-events: none;
  background: rgba(0, 0, 0, .5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpolygon points='8 5 19 12 8 19'/%3E%3C/svg%3E") center / 32px no-repeat; }
.ml-media-modal > .ml-media__mute { display: none; }
.ml-media-modal__frame .ml-media__mute { right: 14px; bottom: 14px; width: 32px; height: 32px; }
.ml-media-modal .ml-icon-btn { position: absolute; z-index: 1; color: #fff; background: rgba(255, 255, 255, .12); }
.ml-media-modal .ml-icon-btn:hover { background: rgba(255, 255, 255, .24); }
.ml-media-modal__close { top: 16px; left: 16px; }
.ml-media-modal__prev { left: 12px; top: calc(50% - 20px); }
.ml-media-modal__next { right: 12px; top: calc(50% - 20px); }
.ml-media-modal__caption { max-width: 720px; padding: 12px 16px; text-align: center; font-size: 14px; overflow-wrap: anywhere; max-height: 20vh; overflow-y: auto; }
.ml-media-modal__caption:empty { display: none; }
.ml-media-modal__count { position: absolute; bottom: 18px; font-size: 13px; color: #c4c7d0; }
@media (max-width: 768px) {
  .ml-media-modal { padding: 64px 0 60px; }
  .ml-media-modal__prev, .ml-media-modal__next { top: auto; bottom: 12px; }
}
.ml-media figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); color: #fff; font-size: 13px; font-weight: 600; }

.ml-deal { margin-top: 14px; display: flex; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid var(--ml-border); border-radius: 14px; }
.ml-deal:hover { border-color: #CFD2DA; }
.ml-deal__thumb { flex: none; width: 120px; height: 68px; border-radius: 10px; background-size: cover; background-position: center; }
.ml-deal__info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ml-deal__info strong { font-size: 15px; }
.ml-deal__info span { font-size: 13px; color: var(--ml-muted); }
.ml-deal__price { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 14px; justify-items: end; }
.ml-deal__off { grid-row: span 2; align-self: start; padding: 3px 8px; border-radius: 6px; background: var(--ml-green); color: #fff; font-weight: 700; font-size: 13px; }
.ml-deal__now { font-size: 18px; font-weight: 700; }
.ml-deal__old { grid-column: 2; font-size: 13px; color: var(--ml-muted); }

.ml-poll { margin-top: 14px; display: grid; gap: 8px; }
.ml-poll__opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--ml-border); border-radius: 12px; overflow: hidden; cursor: pointer; }
.ml-poll__opt:hover { border-color: var(--ml-primary); }
.ml-poll__opt input { accent-color: var(--ml-primary); margin: 0; }
.ml-poll__text { flex: 1; position: relative; font-weight: 500; }
.ml-poll__pct { position: relative; font-weight: 600; color: var(--ml-muted); display: none; }
.ml-poll.is-result .ml-poll__opt { cursor: default; border-color: var(--ml-border); }
.ml-poll.is-result .ml-poll__opt::before { content: ""; position: absolute; inset: 0; width: var(--pct); background: var(--ml-surface-2); }
.ml-poll.is-result .ml-poll__opt.is-voted::before { background: var(--ml-primary-soft); }
.ml-poll.is-result .ml-poll__opt input { display: none; }
.ml-poll.is-result .ml-poll__pct { display: block; }
.ml-poll.is-result .is-voted .ml-poll__pct { color: var(--ml-primary-ink); }
.ml-poll__add { display: flex; gap: 8px; }
.ml-poll__add input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--ml-border); border-radius: 10px; background: var(--ml-surface); color: var(--ml-text); }
.ml-poll__foot { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ml-muted); }
.ml-poll__foot .ml-btn { margin-left: auto; }
.ml-poll:not([data-multiple]) .ml-poll__foot [data-action="vote"] { display: none; }
.ml-poll[data-busy] .ml-poll__opt { opacity: .6; pointer-events: none; }

.ml-lfg { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.ml-lfg li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--ml-surface-2); font-size: 13px; color: var(--ml-text-2); }
.ml-lfg .ml-icon { color: var(--ml-muted); }

.ml-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.ml-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--ml-primary-soft); color: var(--ml-primary-ink); font-size: 13px; font-weight: 600; }
.ml-tag:hover { background: #E0DCFB; }
.ml-tag--mode { background: var(--ml-surface-2); color: var(--ml-text-2); }

.ml-post__actions { margin-top: 16px; padding: 8px 0; border-top: 1px solid var(--ml-border); display: flex; align-items: center; gap: 4px; }
.ml-action { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 0; border-radius: 20px; background: none; color: var(--ml-muted); font-weight: 500; font-size: 14px; }
button.ml-action:hover { background: var(--ml-surface-2); color: var(--ml-text); }
.ml-action__count { color: var(--ml-text-2); font-weight: 600; }
.ml-action.is-active { color: var(--ml-primary); }
.ml-action[data-action="like"].is-active { color: var(--ml-red); }
.ml-action.is-active svg { fill: currentColor; }
.ml-action.is-pop svg { animation: ml-pop .3s ease; }
@keyframes ml-pop { 50% { transform: scale(1.25); } }

.ml-feed__more { display: flex; justify-content: center; padding: 8px 0; }
.ml-empty { padding: 48px 24px; display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--ml-muted); }

/* ---------- Right widgets ---------- */
.ml-widget { padding: 22px 20px; }
.ml-widget__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; white-space: nowrap; }
.ml-widget__title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; padding-bottom: 14px; }
.ml-widget__flame { color: var(--ml-red); display: inline-flex; }
.ml-widget__more { font-size: 13px; font-weight: 600; color: var(--ml-primary-ink); }
.ml-trend-list li + li { border-top: 1px solid var(--ml-border); }
.ml-trend { display: flex; gap: 16px; padding: 12px 0; }
.ml-trend__rank { width: 14px; font-weight: 700; color: var(--ml-muted); }
.ml-trend__rank.is-top { color: var(--ml-red-ink); }
.ml-trend__body { display: grid; }
.ml-trend__body strong { font-size: 15px; }
.ml-trend__body span { font-size: 13px; color: var(--ml-muted); }
.ml-trend:hover strong { color: var(--ml-primary-ink); }
.ml-hotgame-list { display: grid; gap: 4px; }
.ml-hotgame { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.ml-hotgame__cover { flex: none; width: 56px; height: 56px; border-radius: 8px; background-size: cover; background-position: center; }
.ml-hotgame__body { flex: 1; min-width: 0; display: grid; }
.ml-hotgame__body strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.ml-hotgame__body span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ml-muted); }
.ml-hotgame > .ml-score { flex-shrink: 0; }
.ml-hotgame:hover strong { color: var(--ml-primary-ink); }
.ml-upcoming-list li + li { border-top: 1px solid var(--ml-border); }
.ml-upcoming { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.ml-upcoming__date { flex: none; width: 52px; height: 52px; border-radius: 10px; background: var(--ml-surface-2); display: grid; place-content: center; text-align: center; line-height: 1.15; }
.ml-upcoming__date span { font-size: 11px; font-weight: 600; color: var(--ml-muted); }
.ml-upcoming__date strong { font-size: 18px; }
.ml-upcoming__body { flex: 1; min-width: 0; display: grid; }
.ml-upcoming__body strong { font-size: 15px; font-weight: 600; }
.ml-upcoming__body span { font-size: 13px; color: var(--ml-muted); }
.ml-footer { padding: 8px 6px; font-size: 12px; color: var(--ml-muted); line-height: 1.7; }
.ml-footer__links { display: flex; flex-wrap: wrap; gap: 4px; }
.ml-footer a:hover { color: var(--ml-text); }

/* ---------- Game page / library ---------- */
.ml-page-head { padding: 4px 4px 0; display: grid; gap: 4px; }
.ml-page-head h1 { font-size: 24px; font-weight: 700; }
.ml-page-head p { color: var(--ml-muted); }
.ml-game-hero { overflow: hidden; }
.ml-game-hero__cover { height: 160px; background-size: cover; background-position: center; }
.ml-game-hero__body { display: flex; align-items: flex-start; gap: 16px; padding: 0 20px; margin-top: -36px; }
.ml-game-hero__body > .ml-btn { margin-top: 48px; }
.ml-game-hero__body > .ml-game-icon { border: 4px solid var(--ml-surface); border-radius: 18px; font-size: 22px; }
.ml-game-hero__info { flex: 1; min-width: 0; padding-top: 44px; }
.ml-game-hero__info h1 { font-size: 24px; font-weight: 700; line-height: 1.3; }
.ml-game-hero__meta, .ml-game-hero__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--ml-muted); }
.ml-game-hero__stats { margin-top: 4px; }
.ml-game-hero__stats strong { color: var(--ml-text); }
.ml-game-hero__stats .ml-score { height: 26px; min-width: 32px; font-size: 13px; }
.ml-game-hero__desc { padding: 14px 20px 20px; color: var(--ml-text-2); }
.ml-game-hero__body + .ml-game-hero__desc { margin-top: 0; }
.ml-game-hero:not(:has(.ml-game-hero__desc)) .ml-game-hero__body { padding-bottom: 20px; }
[data-action="follow-game"] .ml-when-on, [data-action="follow-game"][aria-pressed="true"] .ml-when-off { display: none; }
[data-action="follow-game"][aria-pressed="true"] .ml-when-on { display: inline-flex; align-items: center; gap: 6px; }

.ml-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ml-game-tile { display: grid; overflow: hidden; height: 100%; }
.ml-game-tile:hover { border-color: #CFD2DA; }
.ml-game-tile__cover { position: relative; aspect-ratio: 16 / 9; background-size: cover; background-position: center; }
.ml-game-tile__flag { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(20, 21, 26, .7); color: #fff; font-size: 12px; font-weight: 600; }
.ml-game-tile__body { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px; }
.ml-game-tile__info { flex: 1; min-width: 0; display: grid; }
.ml-game-tile__info strong { font-weight: 600; }
.ml-game-tile__info span, .ml-game-tile__stats { font-size: 13px; color: var(--ml-muted); }
.ml-game-tile__stats { padding: 0 14px 14px; }

/* ---------- Game library (full-width, design/library.html) ---------- */
.ml-library { max-width: 1440px; margin: 0 auto; padding: 32px 24px 64px; display: grid; gap: 20px; }
.ml-library__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ml-library__head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.ml-library__head p { margin-top: 4px; color: var(--ml-muted); }
.ml-library__search { position: relative; width: 420px; max-width: 100%; }
.ml-library__search .ml-icon { position: absolute; left: 16px; top: 15px; color: var(--ml-muted); pointer-events: none; }
.ml-library__search input { width: 100%; height: 48px; padding: 0 18px 0 44px; border: 1px solid var(--ml-border-input); border-radius: 24px; background: var(--ml-surface); outline: 0; }
.ml-library__search input:focus { border-color: var(--ml-primary); box-shadow: 0 0 0 3px var(--ml-primary-soft); }
.ml-library__filters { display: grid; gap: 12px; padding: 14px 16px; border-radius: 16px; }
.ml-library__genres { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.ml-library__genres::-webkit-scrollbar { display: none; }
.ml-lib-chip { flex: none; height: 38px; padding: 0 16px; border: 1px solid var(--ml-border); border-radius: 19px; background: var(--ml-surface); font-size: 14px; font-weight: 600; white-space: nowrap; }
.ml-lib-chip:hover { border-color: #CFD2DA; }
.ml-lib-chip.is-active { background: var(--ml-text); border-color: var(--ml-text); color: var(--ml-surface); }
.ml-library__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ml-lib-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--ml-surface-2); }
.ml-lib-seg__btn { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 500; color: var(--ml-muted); white-space: nowrap; }
.ml-lib-seg__btn:hover { color: var(--ml-text); }
.ml-lib-seg__btn.is-active { background: var(--ml-surface); color: var(--ml-text); font-weight: 700; box-shadow: 0 1px 3px rgba(20, 21, 26, .12); }
.ml-library__sort { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ml-library__count { color: var(--ml-muted); }
.ml-library__sort label { font-weight: 600; }
.ml-lib-select { height: 40px; min-width: 186px; padding: 0 36px 0 12px; border: 1px solid var(--ml-border-input); border-radius: 10px; font-size: 14px; appearance: none; background: var(--ml-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235D6270' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.ml-lib-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.ml-lib-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; }
.ml-lib-card:hover { border-color: #CFD2DA; }
.ml-lib-card__cover { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; background-size: cover; background-position: center; color: rgba(255, 255, 255, .9); }
.ml-lib-card__abbr { font-size: 44px; font-weight: 800; letter-spacing: -.02em; }
.ml-lib-card__score, .ml-lib-card__flag { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 8px; background: var(--ml-surface); color: var(--ml-text); font-size: 14px; font-weight: 800; line-height: 21px; box-shadow: 0 1px 3px rgba(20, 21, 26, .18); }
.ml-lib-card__score.is-high { background: #1E8E5A; color: #fff; }
.ml-lib-card__flag { background: rgba(20, 21, 26, .75); color: #fff; font-size: 12px; font-weight: 700; }
.ml-lib-card__platforms { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.ml-lib-card__platforms span { padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 700; line-height: 16.5px; }
.ml-lib-card__body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.ml-lib-card__name { font-size: 16px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-lib-card__name:hover { color: var(--ml-primary-ink); }
.ml-lib-card__genres, .ml-lib-card__stats { font-size: 13px; color: var(--ml-muted); }
.ml-lib-card__stats { color: var(--ml-text-2); }
.ml-lib-card__stats.is-empty { color: #9A4A00; }
.ml-lib-follow { display: inline-flex; align-items: center; justify-content: center; height: 40px; margin-top: auto; border: 1px solid var(--ml-border-input); border-radius: 20px; background: var(--ml-surface); color: var(--ml-primary-ink); font-size: 14px; font-weight: 600; }
.ml-lib-card__body > .ml-lib-follow { margin-top: auto; }
.ml-lib-card__body > :nth-last-child(2) { margin-bottom: 12px; }
.ml-lib-follow:hover { border-color: var(--ml-primary); background: var(--ml-primary-soft); }
.ml-lib-follow.is-active { border-color: transparent; background: var(--ml-surface-2); color: var(--ml-text-2); }
.ml-lib-follow .ml-when-off { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Communities (danh sach cong dong + trang chi tiet dung lai .ml-gd-*) ---------- */
.ml-cm-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ml-cm-quota { color: var(--ml-muted); font-size: 13px; }
.ml-cm-lock { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--ml-surface-2); color: var(--ml-muted); font-size: 13px; font-weight: 600; }
.ml-cm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ml-cm-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; }
.ml-cm-card:hover { border-color: #CFD2DA; }
.ml-cm-card__cover { display: block; aspect-ratio: 3 / 1; background-size: cover; background-position: center; }
.ml-cm-card__body { position: relative; flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 30px 16px 16px; }
.ml-cm-card__mark { position: absolute; top: -26px; left: 16px; display: grid; place-items: center; width: 52px; height: 52px; border: 3px solid var(--ml-surface); border-radius: 14px; color: #fff; font-size: 18px; font-weight: 800; }
.ml-cm-card__name { font-size: 17px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-cm-card__name:hover { color: var(--ml-primary-ink); }
.ml-cm-card__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; color: var(--ml-text-2); }
.ml-cm-card__stats { font-size: 13px; color: var(--ml-text-2); }
.ml-cm-card__stats.is-empty { color: #9A4A00; }
.ml-cm-card__body > .ml-lib-follow { margin-top: auto; }
.ml-cm-card__body > :nth-last-child(2) { margin-bottom: 8px; }
[data-action="join-community"] .ml-when-on, [data-action="join-community"][aria-pressed="true"] .ml-when-off { display: none; }
[data-action="join-community"] .ml-when-off, [data-action="join-community"][aria-pressed="true"] .ml-when-on { display: inline-flex; align-items: center; gap: 6px; }
span.ml-lib-follow[aria-disabled] { cursor: default; }
.ml-cm-cover { height: 96px; border-radius: 10px; background-size: cover; background-position: center; }
.ml-cm-hint { font-weight: 400; color: var(--ml-muted); }
.ml-gd-hero__poster--square { width: 128px; aspect-ratio: 1; font-size: 36px; }

/* Link Discord / Facebook ngay duoi ten cong dong + form sua link */
.ml-cm-social { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ml-cm-social__link, .ml-cm-social__edit { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--ml-border-input); border-radius: 50%; background: var(--ml-surface); color: var(--ml-text); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.ml-cm-social__link img { width: 20px; height: 20px; object-fit: contain; }
.ml-cm-social__link:hover { border-color: var(--ml-primary); background: var(--ml-primary-soft); transform: translateY(-1px); }
.ml-cm-social__edit { border-style: dashed; background: transparent; color: var(--ml-muted); }
.ml-cm-social__edit:hover { color: var(--ml-primary-ink); border-color: var(--ml-primary); }
.ml-links-intro { margin: 0; font-size: 14px; color: var(--ml-text-2); }
.ml-links-field { display: grid; gap: 6px; }
.ml-links-field > label { font-size: 13px; font-weight: 600; color: var(--ml-text-2); }
.ml-links-input { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 12px; border: 1px solid var(--ml-border); border-radius: 12px; background: var(--ml-surface); transition: border-color .15s, box-shadow .15s; }
.ml-links-input:focus-within { border-color: var(--ml-primary); box-shadow: 0 0 0 3px var(--ml-primary-soft); }
.ml-links-input.is-invalid { border-color: var(--ml-red-ink); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.ml-links-input img { flex: none; width: 20px; height: 20px; object-fit: contain; }
.ml-links-input input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ml-text); font-size: 15px; outline: 0; }
.ml-links-clear { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--ml-muted); cursor: pointer; }
.ml-links-clear:hover { background: var(--ml-surface-2); color: var(--ml-text); }
.ml-links-clear[hidden] { display: none; }

/* ---------- Modal pricing goi Membership tao cong dong ---------- */
.ml-modal--pricing { width: min(460px, calc(100vw - 32px)); }
.ml-pricing { gap: 18px; }
.ml-pricing__intro { margin: 0; color: var(--ml-text-2); font-size: 14px; }
.ml-pricing__plan { display: grid; gap: 6px; padding: 18px 20px; border: 1px solid var(--ml-primary); border-radius: 16px; background: var(--ml-primary-soft); }
.ml-pricing__badge { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--ml-primary); color: #fff; font-size: 12px; font-weight: 700; }
.ml-pricing__price { display: flex; align-items: baseline; gap: 6px; }
.ml-pricing__price strong { font-size: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--ml-text); }
.ml-pricing__price span { color: var(--ml-text-2); font-size: 14px; }
.ml-pricing__sub { margin: 0; font-size: 14px; font-weight: 600; color: var(--ml-primary-ink); }
.ml-pricing__perks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ml-pricing__perks li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; }
.ml-pricing__perks .ml-icon { flex: none; margin-top: 1px; color: var(--ml-green); }
.ml-pricing__cta { width: 100%; height: 48px; justify-content: center; border-radius: 24px; }
.ml-pricing__cta[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Sua anh cong dong: xem truoc giong trang that, keo de chinh vi tri ---------- */
.ml-modal--editor { width: min(600px, calc(100vw - 32px)); }
.ml-ae { display: grid; gap: 8px; min-width: 0; }
.ml-ae-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ml-ae__frame { position: relative; display: grid; place-items: center; overflow: hidden; border: 1.5px dashed var(--ml-border-input); border-radius: 12px; background: var(--ml-surface-2) center / cover no-repeat; color: var(--ml-muted); touch-action: none; cursor: pointer; transition: border-color .15s; }
.ml-ae--cover .ml-ae__frame { aspect-ratio: 3 / 1; }
.ml-ae--avatar .ml-ae__frame, .ml-ae--logo .ml-ae__frame { aspect-ratio: 1; }
.ml-ae-grid .ml-ae__frame { width: 128px; }
.ml-ae-grid .ml-ae__bar { flex-direction: column; align-items: flex-start; }
.ml-ae__frame:hover { border-color: var(--ml-primary); }
.ml-ae__frame:focus-visible { outline: 2px solid var(--ml-primary); outline-offset: 2px; }
.ml-ae.has-image .ml-ae__frame { border-style: solid; border-color: var(--ml-border); cursor: grab; }
.ml-ae__frame.is-dragging { cursor: grabbing; border-color: var(--ml-primary); }
.ml-ae__empty { display: grid; justify-items: center; gap: 4px; font-size: 13px; font-weight: 600; pointer-events: none; }
.ml-ae.has-image .ml-ae__empty { display: none; }
.ml-ae__drag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(20, 21, 26, .72); color: #fff; font-size: 11px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .15s; }
.ml-ae__frame:hover .ml-ae__drag, .ml-ae__frame:focus-visible .ml-ae__drag, .ml-ae__frame.is-dragging .ml-ae__drag { opacity: 1; }
.ml-ae--logo .ml-ae__drag, .ml-ae--avatar .ml-ae__drag { display: none; }
.ml-ae__busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 21, 26, .6); color: #fff; font-size: 13px; font-weight: 600; }
.ml-ae__busy[hidden], .ml-ae__drag[hidden] { display: none; }
.ml-ae__bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.ml-ae__bar strong { display: block; font-size: 14px; }
.ml-ae__bar small { display: block; font-size: 12px; color: var(--ml-muted); }
.ml-ae__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-ae__btns .ml-btn { gap: 6px; cursor: pointer; }
.ml-ae__btns input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ml-field--color input[type="color"] { width: 56px; height: 40px; padding: 2px; cursor: pointer; }
@media (max-width: 540px) {
  .ml-ae-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Game detail (full-width, design/game-detail.html) ---------- */
.ml-left--drawer { display: none; }
.ml-left__logo { display: none; }
.ml-detail { max-width: 1320px; margin: 0 auto; padding: 24px 24px 56px; display: grid; gap: 24px; }
.ml-detail__top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.ml-back { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 8px; border: 1px solid var(--ml-border); border-radius: 18px; background: var(--ml-surface); font-size: 14px; font-weight: 600; }
.ml-back:hover { border-color: #CFD2DA; color: var(--ml-primary-ink); }
.ml-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ml-muted); }
.ml-crumbs li + li::before { content: "/"; margin: 0 10px; color: #A3A7B2; }
.ml-crumbs a:hover { color: var(--ml-primary-ink); }
.ml-crumbs [aria-current] { color: var(--ml-text); font-weight: 500; }

.ml-gd-hero { overflow: hidden; }
.ml-gd-hero__art { height: 300px; background-size: cover; background-position: center; }
/* Banner cong dong: cung ti le 3:1 voi card danh sach va khung xem truoc trong form sua anh -> anh khong bi cat lech giua cac noi hien thi */
.ml-gd-hero__art--community { width: 100%; height: auto; aspect-ratio: 3 / 1; min-height: 110px; max-height: 400px; }
.ml-gd-hero__body { display: flex; align-items: flex-end; gap: 32px; padding: 0 32px 28px; }
.ml-gd-hero__poster { flex: none; width: 168px; aspect-ratio: 3 / 4; margin-top: -16px; border: 4px solid var(--ml-surface); border-radius: 16px; background-size: cover; background-position: center; box-shadow: 0 8px 24px rgba(20, 21, 26, .18); display: grid; place-items: center; color: #fff; font-size: 40px; font-weight: 800; position: relative; }
.ml-gd-hero__info { flex: 1; min-width: 0; padding-top: 20px; display: grid; gap: 10px; }
.ml-gd-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-gd-tags li { height: 28px; padding: 0 10px; border-radius: 8px; background: var(--ml-surface-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
.ml-gd-hero__info h1 { font-size: 40px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; overflow-wrap: anywhere; }
.ml-gd-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ml-muted); font-size: 15px; }
.ml-gd-flag { padding: 2px 8px; border-radius: 6px; background: var(--ml-primary-soft); color: var(--ml-primary-ink); font-size: 12px; font-weight: 600; }
.ml-gd-stats { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.ml-gd-stat { display: flex; flex-direction: column-reverse; }
.ml-gd-stat dd { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.ml-gd-stat dt { font-size: 13px; color: var(--ml-muted); }
.ml-gd-stat--score dd { color: var(--ml-green); }
.ml-gd-hero__actions { flex: none; display: grid; gap: 10px; justify-items: end; }
.ml-gd-follow { height: 48px; min-width: 140px; padding: 0 22px; border-radius: 24px; font-size: 15px; }
.ml-gd-follow .ml-when-off { display: inline-flex; align-items: center; gap: 6px; }
.ml-gd-hero__row { display: flex; gap: 10px; }
.ml-btn--outline { height: 44px; background: var(--ml-surface); border: 1px solid var(--ml-border-input); color: var(--ml-text); }
.ml-btn--outline:hover { background: var(--ml-surface-2); }

.ml-gd-tabs { display: flex; gap: 8px; padding: 0 24px; border-top: 1px solid var(--ml-border); overflow-x: auto; scrollbar-width: none; }
.ml-gd-tabs::-webkit-scrollbar { display: none; }
.ml-gd-tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 54px; padding: 0 16px; font-size: 15px; font-weight: 500; color: var(--ml-muted); white-space: nowrap; }
.ml-gd-tab:hover { color: var(--ml-text); }
.ml-gd-tab.is-active { color: var(--ml-text); font-weight: 700; }
.ml-gd-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--ml-primary); }
.ml-gd-tab__count { font-size: 13px; color: var(--ml-muted); font-weight: 500; }

.ml-gd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ml-gd-grid.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s; }
.ml-gd-main, .ml-gd-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.ml-gd-section { padding: 24px; display: grid; gap: 16px; align-content: start; }
.ml-gd-side .ml-gd-section { padding: 22px 20px; }
.ml-gd-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ml-gd-section__title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.ml-gd-side .ml-gd-section__title { font-size: 18px; }
.ml-gd-section__more { justify-self: start; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--ml-primary-ink); }
.ml-gd-about { color: var(--ml-text-2); line-height: 1.65; white-space: pre-line; }
.ml-gd-empty { color: var(--ml-muted); font-size: 14px; }

.ml-gd-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ml-gd-shot { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #2A2633; }
.ml-gd-shot img, .ml-gd-shot video { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.ml-gd-shot:hover img, .ml-gd-shot:hover video { transform: scale(1.03); }
.ml-gd-shot__play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ml-text); display: grid; place-items: center; }
.ml-gd-shot__play svg { fill: currentColor; margin-left: 2px; }
.ml-gd-shot__more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 21, 26, .6); color: #fff; font-weight: 700; font-size: 16px; }

.ml-gd-threads li + li { border-top: 1px solid var(--ml-border); }
.ml-gd-thread { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.ml-gd-threads li:first-child .ml-gd-thread { padding-top: 4px; }
.ml-gd-thread:hover strong { color: var(--ml-primary-ink); }
.ml-gd-type { flex: none; width: 92px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--ml-primary-soft); color: var(--ml-primary-ink); white-space: nowrap; overflow: hidden; }
.ml-gd-type--guide { background: #DDEBFF; color: #1E4C8F; }
.ml-gd-type--news { background: #FFEBD9; color: #9A4A0B; }
.ml-gd-type--deal { background: var(--ml-green-soft); color: var(--ml-green); }
.ml-gd-type--lfg { background: #FDE4EE; color: #9A1F4B; }
.ml-gd-type--poll { background: #FFF1C2; color: #7A5200; }
.ml-gd-thread__body { flex: 1; min-width: 0; display: grid; }
.ml-gd-thread__body strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-gd-thread__body span { font-size: 13px; color: var(--ml-muted); }
.ml-gd-thread__stats { flex: none; display: flex; gap: 16px; font-size: 13px; color: var(--ml-muted); white-space: nowrap; }

.ml-gd-price__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ml-gd-price__head span { font-size: 12px; color: var(--ml-muted); }
.ml-gd-price__best { display: flex; align-items: center; gap: 10px; }
.ml-gd-price__best strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.ml-gd-off { padding: 3px 8px; border-radius: 6px; background: var(--ml-green); color: #fff; font-weight: 700; font-size: 13px; }
.ml-gd-price__old { margin-top: -8px; font-size: 13px; color: var(--ml-muted); padding-bottom: 14px; border-bottom: 1px solid var(--ml-border); }
.ml-gd-stores { display: grid; gap: 8px; }
.ml-gd-store { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ml-border); border-radius: 12px; }
.ml-gd-store:hover { border-color: #CFD2DA; }
.ml-gd-store__mark { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--ml-text); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ml-gd-store__name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.ml-gd-store strong { font-size: 15px; white-space: nowrap; }
.ml-gd-block { width: 100%; height: 46px; border-radius: 23px; border-color: var(--ml-text); }

.ml-gd-info { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; font-size: 14px; }
.ml-gd-info dt { color: var(--ml-muted); }
.ml-gd-info dd { margin: 0; font-weight: 500; }

.ml-gd-similar-list li + li { border-top: 1px solid var(--ml-border); }
.ml-gd-similar { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ml-gd-similar__thumb { flex: none; width: 44px; height: 58px; border-radius: 8px; background-size: cover; background-position: center; }
.ml-gd-similar__body { flex: 1; min-width: 0; display: grid; }
.ml-gd-similar__body strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
.ml-gd-similar__body span { font-size: 13px; color: var(--ml-muted); }
.ml-gd-similar:hover strong { color: var(--ml-primary-ink); }

/* ---------- Modal ---------- */
.ml-modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--ml-radius-card); background: var(--ml-surface); color: var(--ml-text); box-shadow: var(--ml-shadow-pop); }
.ml-modal--sm { width: min(420px, calc(100vw - 32px)); }
.ml-crop { width: min(560px, calc(100vw - 32px)); }
.ml-crop__stage { position: relative; width: 100%; overflow: hidden; background: #14151A; border-radius: 12px; cursor: grab; touch-action: none; user-select: none; }
.ml-crop__stage:active { cursor: grabbing; }
.ml-crop__img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.ml-crop__stage.is-round { width: min(100%, 320px); margin: 0 auto; border-radius: 50%; }
.ml-crop__stage.is-round::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(20, 21, 26, .55); pointer-events: none; }
.ml-crop__hint { font-size: 13px; color: var(--ml-text-muted, #6B6F7B); text-align: center; }
.ml-crop__zoom { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.ml-crop__zoom input { width: 100%; }
.ml-modal::backdrop { background: rgba(20, 21, 26, .45); }
.ml-modal[open] { display: flex; flex-direction: column; }
.ml-modal form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.ml-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--ml-border); }
.ml-modal__head h2 { font-size: 18px; font-weight: 700; }
.ml-modal__body { padding: 20px 24px; display: grid; gap: 16px; overflow-y: auto; }
.ml-report__hint { font-size: 14px; color: var(--ml-text-2); }
.ml-report__option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--ml-border); border-radius: 10px; font-size: 15px; cursor: pointer; }
.ml-report__option:has(input:checked) { border-color: var(--ml-primary, currentColor); }
.ml-modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 18px; border-top: 1px solid var(--ml-border); }

/* Share dialog */
.ml-modal.ml-share-modal { width: min(362px, calc(100vw - 32px)); border-radius: 16px; }
.ml-share-modal .ml-modal__head { padding: 14px 12px 6px 20px; border-bottom: 0; }
.ml-share-modal .ml-modal__head h2 { font-size: 18px; }
.ml-share-modal__body { padding: 10px 20px 20px; }
.ml-share-modal__options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.ml-share-option { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font-size: 11px; white-space: nowrap; }
.ml-share-option__icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; transition: transform .15s; }
.ml-share-option:hover .ml-share-option__icon { transform: translateY(-2px); }
.ml-share-option__icon--facebook { background: #1877f2; font: 700 36px/1 Arial, sans-serif; padding-top: 6px; }
.ml-share-option__icon--discord { background: #5865f2; }
.ml-share-option__icon--x { background: #202124; border: 1px solid #525252; }
.ml-share-modal__link { display: flex; align-items: center; gap: 8px; padding: 6px; padding-left: 16px; border: 1px solid var(--ml-border); border-radius: 11px; background: var(--ml-surface-2); }
.ml-share-modal__link input { flex: 1; min-width: 0; width: 0; padding: 0; border: 0; background: transparent; color: var(--ml-muted); font-size: 11px; text-overflow: ellipsis; }
.ml-share-modal__copy { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 20px; color: #fff; background: #7828d7; font-size: 11px; font-weight: 600; }
.ml-share-modal__copy:hover { background: #6520b8; }
.ml-share-modal__status { margin-top: 10px; color: var(--ml-muted); font-size: 12px; }
.ml-login { justify-items: center; text-align: center; padding-bottom: 28px; }
.ml-login p { color: var(--ml-text-2); }
.ml-login small { color: var(--ml-muted); font-size: 12px; }
#ml-google-btn { min-height: 44px; }

/* Composer kieu Threads */
.ml-compose-modal { width: min(620px, calc(100vw - 32px)); }
.ml-compose { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.ml-compose__body { display: flex; gap: 12px; padding: 20px 20px 8px; overflow-y: auto; }
.ml-compose__main { flex: 1; min-width: 0; display: grid; gap: 10px; align-content: start; }
.ml-compose__meta { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.ml-compose__meta strong { font-weight: 700; white-space: nowrap; }
.ml-compose__meta .ml-icon { color: var(--ml-muted); }
.ml-compose__select { min-width: 0; max-width: 200px; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--ml-muted); font-size: 14px; cursor: pointer; text-overflow: ellipsis; }
.ml-compose__select:hover { background: var(--ml-surface-2); color: var(--ml-text); }
.ml-compose__close { margin-left: auto; flex: none; }
.ml-compose__label { color: var(--ml-muted); font-size: 14px; white-space: nowrap; }
.ml-compose__title { width: 100%; padding: 0; border: 0; background: transparent; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--ml-text); }
.ml-compose__title:focus { outline: none; }
.ml-compose__title::placeholder { color: #8A8F9C; font-weight: 600; }
.ml-compose__text { width: 100%; min-height: 48px; max-height: 50vh; padding: 0; border: 0; resize: none; background: transparent; font-size: 15px; line-height: 1.55; color: var(--ml-text); overflow-y: auto; }
.ml-compose__text:focus { outline: none; }
.ml-compose__text::placeholder { color: #8A8F9C; }
.ml-compose__bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px 14px 72px; }
.ml-compose__tools { display: flex; gap: 2px; margin-right: auto; }
.ml-compose__tool { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ml-muted); cursor: pointer; }
.ml-compose__tool:hover { background: var(--ml-surface-2); color: var(--ml-text); }
.ml-compose__tool[aria-pressed="true"] { background: var(--ml-primary-soft); color: var(--ml-primary-ink); }
.ml-compose__tool:focus-visible, .ml-compose__tool:has(input:focus-visible) { outline: 2px solid var(--ml-primary); outline-offset: 2px; }
/* Tooltip ten cong cu: hien ngay khi hover / focus ban phim (title cua trinh duyet hien cham va khong hien khi focus) */
.ml-compose__tool[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 2; padding: 5px 10px; border-radius: 8px; background: var(--ml-text); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, 4px); transition: opacity .12s, transform .12s; }
.ml-compose__tool[data-tooltip]:hover::after, .ml-compose__tool[data-tooltip]:focus-visible::after, .ml-compose__tool[data-tooltip]:has(input:focus-visible)::after { opacity: 1; transform: translate(-50%, 0); }
.ml-compose__cancel { margin-left: auto; }
.ml-compose__submit { min-width: 72px; }
.ml-compose__submit[disabled] { background: var(--ml-surface-2); color: #8A8F9C; opacity: 1; cursor: not-allowed; }
.ml-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ml-field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ml-field-row > .ml-field { flex: 1 1 160px; }
.ml-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ml-text-2); }
.ml-field input, .ml-field select, .ml-field textarea, .ml-poll-editor input { width: 100%; padding: 10px 12px; border: 1px solid var(--ml-border); border-radius: 10px; background: var(--ml-surface); font-size: 15px; font-weight: 400; color: var(--ml-text); }
.ml-field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.ml-field input:focus, .ml-field select:focus, .ml-field textarea:focus, .ml-poll-editor input:focus { outline: none; border-color: var(--ml-primary); box-shadow: 0 0 0 3px var(--ml-primary-soft); }
.ml-check { display: inline-flex; align-items: center; gap: 8px; height: 42px; font-size: 14px; }
.ml-check input { accent-color: var(--ml-primary); width: 16px; height: 16px; }
.ml-typebox { margin: 0; padding: 14px 16px 16px; border: 1px dashed #CFD2DA; border-radius: 14px; display: grid; gap: 12px; }
.ml-typebox legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--ml-primary-ink); }
.ml-poll-editor { display: grid; gap: 8px; }
/* Bình chọn trong composer: header + dong lua chon (dau tron/vuong theo "chon nhieu") + cong tac cai dat */
.ml-pollbox { gap: 10px; padding: 12px 14px 6px; border: 1px solid var(--ml-border); background: var(--ml-surface-2); }
.ml-pollbox legend.ml-pollbox__head { float: left; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 2px; }
.ml-pollbox legend.ml-pollbox__head + * { clear: both; }
.ml-pollbox__title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ml-primary-ink); }
.ml-pollbox__count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ml-muted); font-variant-numeric: tabular-nums; }
.ml-pollbox__close { width: 28px; height: 28px; margin-right: -6px; }
.ml-pollbox__close:hover { background: var(--ml-surface); color: var(--ml-text); }
.ml-poll-row { position: relative; display: flex; align-items: center; }
.ml-poll-editor .ml-poll-row input { padding: 10px 40px 10px 40px; background: var(--ml-surface); }
.ml-poll-row__mark { position: absolute; left: 14px; width: 16px; height: 16px; border: 2px solid var(--ml-border-input); border-radius: 50%; pointer-events: none; transition: border-radius .15s, border-color .15s; }
.ml-poll-row:focus-within .ml-poll-row__mark { border-color: var(--ml-primary); }
.ml-pollbox:has(input[name="poll.multiple"]:checked) .ml-poll-row__mark { border-radius: 4px; }
.ml-poll-row__remove { position: absolute; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ml-muted); cursor: pointer; }
.ml-poll-row__remove:hover, .ml-poll-row__remove:focus-visible { background: var(--ml-surface-2); color: var(--ml-red-ink); outline: none; }
.ml-poll-editor:not(:has(.ml-poll-row:nth-child(3))) .ml-poll-row__remove { display: none; }
.ml-poll-add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 1px dashed var(--ml-border-input); border-radius: 10px; background: transparent; color: var(--ml-primary-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ml-poll-add:hover, .ml-poll-add:focus-visible { border-color: var(--ml-primary); background: var(--ml-primary-soft); outline: none; }
.ml-pollbox__settings { display: grid; margin-top: 4px; border-top: 1px solid var(--ml-border); }
.ml-switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.ml-switch-row + .ml-switch-row { border-top: 1px solid var(--ml-border); }
.ml-switch-row__text { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px; color: var(--ml-text); }
.ml-switch-row__text small { font-size: 12px; color: var(--ml-muted); }
.ml-switch { flex: none; appearance: none; position: relative; width: 36px; height: 20px; margin: 0; border-radius: 999px; background: var(--ml-border-input); cursor: pointer; transition: background .15s; }
.ml-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.ml-switch:checked { background: var(--ml-primary); }
.ml-switch:checked::after { transform: translateX(16px); }
.ml-switch:focus-visible { outline: 2px solid var(--ml-primary); outline-offset: 2px; }
.ml-pollbox__duration { flex: none; padding: 6px 10px; border: 1px solid var(--ml-border); border-radius: 8px; background: var(--ml-surface); color: var(--ml-text); font: inherit; font-size: 13px; cursor: pointer; }
.ml-pollbox__duration:focus-visible { outline: 2px solid var(--ml-primary); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .ml-switch, .ml-switch::after, .ml-poll-row__mark { transition: none; } }
.ml-media-editor__list { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-media-editor__list:empty { display: none; }
.ml-thumb { position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--ml-surface-2); }
.ml-thumb img, .ml-thumb video { width: 100%; height: 100%; object-fit: cover; }
.ml-thumb.is-loading { opacity: .5; }
.ml-thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(20, 21, 26, .7); color: #fff; display: grid; place-items: center; }
.ml-compose__gif-icon { padding: 1px 4px; border: 1.75px solid currentColor; border-radius: 5px; font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: .02em; }
.ml-gif-picker { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--ml-border); border-radius: 14px; background: var(--ml-surface); }
.ml-gif-picker[hidden] { display: none; }
.ml-gif-picker__search { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--ml-border); border-radius: 9px; background: var(--ml-surface-2); color: var(--ml-text); font: inherit; font-size: 14px; }
.ml-gif-picker__grid { height: 280px; overflow-y: auto; overscroll-behavior: contain; border-radius: 9px; }
.ml-gif-picker__grid img { border-radius: 6px; cursor: pointer; }
.ml-gif-picker__status { margin: 0; color: var(--ml-muted); font-size: 13px; }
.ml-gif-picker__attribution { margin: 0; justify-self: end; color: var(--ml-muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
/* Dropdown emote: popover noi neo duoi nut emote; emote meliora theo nhom + emoji unicode, tab nhom o day */
.ml-emote-picker { position: fixed; inset: auto; margin: 0; width: min(300px, calc(100vw - 16px)); padding: 10px 10px 0; border: 1px solid var(--ml-border); border-radius: 16px; background: var(--ml-surface); color: var(--ml-text); box-shadow: var(--ml-shadow-pop); overflow: visible; }
.ml-emote-picker:popover-open { display: grid; gap: 8px; }
.ml-emote-picker__search { width: 100%; min-width: 0; padding: 10px 14px; border: 0; border-radius: 999px; background: var(--ml-surface-2); color: var(--ml-text); font: inherit; font-size: 14px; }
.ml-emote-picker__search:focus { outline: 2px solid var(--ml-primary); outline-offset: 0; }
.ml-emote-picker__list { height: 230px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 10px; align-content: start; }
.ml-emote-picker__group[hidden], .ml-emote-picker__item[hidden] { display: none; }
.ml-emote-picker__group h3 { margin: 0 0 4px; color: var(--ml-muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.ml-emote-picker__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.ml-emote-picker__item { display: grid; place-items: center; height: 42px; padding: 0; border: 0; border-radius: 10px; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; }
.ml-emote-picker__item:hover, .ml-emote-picker__item:focus-visible { background: var(--ml-surface-2); outline: none; }
.ml-emote-picker__item img { width: 30px; height: 30px; object-fit: contain; }
.ml-emote-picker__tabs { display: flex; justify-content: space-around; gap: 2px; padding: 4px 0; border-top: 1px solid var(--ml-border); overflow-x: auto; }
.ml-emote-picker__tabs[hidden] { display: none; }
.ml-emote-picker__tab { display: grid; place-items: center; flex: none; min-width: 36px; height: 34px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.ml-emote-picker__tab:hover, .ml-emote-picker__tab:focus-visible { background: var(--ml-surface-2); outline: none; }
.ml-emote-picker__tab img { width: 22px; height: 22px; object-fit: contain; }
/* Nut am thanh tron goc phai duoi (kieu Threads); icon theo trang thai chung html.is-sound-on */
.ml-media__mute { position: absolute; right: 10px; bottom: 10px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(20, 21, 26, .6); color: #fff; cursor: pointer; }
.ml-media__mute:hover { background: rgba(20, 21, 26, .8); }
.ml-media__mute .ml-icon:last-child, .is-sound-on .ml-media__mute .ml-icon:first-child { display: none; }
.is-sound-on .ml-media__mute .ml-icon:last-child { display: block; }
.ml-media__badge { position: absolute; left: 8px; bottom: 8px; padding: 2px 6px; border-radius: 6px; background: rgba(20, 21, 26, .7); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; pointer-events: none; }
.ml-error { color: var(--ml-red-ink); font-size: 13px; font-weight: 500; }

.ml-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translateX(-50%); padding: 10px 18px; border-radius: 12px; background: var(--ml-text); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--ml-shadow-pop); }
.ml-backdrop { position: fixed; inset: 0; z-index: 44; background: rgba(20, 21, 26, .4); }
.ml-notfound { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.ml-notfound h1 { font-size: 48px; }

/* ---------- Auth (dang nhap / dang ky / quen mat khau) ---------- */
body.ml-auth-page { background: var(--ml-surface); }
.ml-auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.ml-auth__mobile { display: none !important; }
.ml-auth__link { color: var(--ml-primary-ink); }
.ml-auth__link:hover { color: #2A2190; text-decoration: underline; }
.ml-auth__muted { color: var(--ml-muted); font-size: 14px; }
.ml-auth__muted .ml-auth__link, .ml-auth__head .ml-auth__link, .ml-auth__switch .ml-auth__link, .ml-auth__label-row .ml-auth__link { font-weight: 600; }

.ml-logo--inverse { color: #fff; }
.ml-logo--inverse .ml-logo__mark { width: 40px; height: 40px; border-radius: 11px; background: #fff; color: var(--ml-primary); }
.ml-logo--inverse .ml-logo__text { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ml-logo--inverse .ml-logo__text span { color: inherit; opacity: .75; font-weight: 600; }

/* Panel thuong hieu (desktop) */
.ml-auth__brand { flex: 1 1 520px; padding: 48px 56px; background: var(--ml-primary); color: #fff; display: flex; flex-direction: column; gap: 48px; }
.ml-auth__brand-head { display: grid; gap: 16px; max-width: 520px; }
.ml-auth__brand-head h2 { font-size: 44px; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.ml-auth__brand-head p { font-size: 17px; color: #E4E1FF; }
.ml-auth__points { display: grid; gap: 18px; max-width: 460px; }
.ml-auth__points li { display: flex; gap: 14px; align-items: flex-start; }
.ml-auth__points strong { display: block; font-weight: 700; }
.ml-auth__points li > span:last-child span { color: #E4E1FF; font-size: 14px; }
.ml-auth__point-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.ml-auth__point-icon--step { border-radius: 50%; font-weight: 800; }
.ml-auth__point-icon--step.is-current { background: #fff; color: var(--ml-primary); }
.ml-auth__spotlight { margin-top: auto; max-width: 440px; padding: 16px 18px; border-radius: 16px; background: var(--ml-surface); color: var(--ml-text); box-shadow: 0 12px 32px rgba(10, 8, 60, .25); display: grid; gap: 8px; }
.ml-auth__spotlight-head { display: flex; align-items: center; gap: 10px; }
.ml-auth__spotlight-head .ml-avatar { font-size: 13px; }
.ml-auth__spotlight-head > span { display: grid; font-size: 12px; color: var(--ml-muted); line-height: 1.4; }
.ml-auth__spotlight-head strong { font-size: 14px; color: var(--ml-text); }
.ml-auth__spotlight-title { font-weight: 600; font-size: 14px; }
.ml-auth__spotlight small { font-size: 12px; color: var(--ml-muted); }

/* Cot form */
.ml-auth__main { flex: 1 1 520px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.ml-auth__panel { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.ml-auth__topbar { display: none; }
.ml-auth__head { display: grid; gap: 6px; text-align: center; }
.ml-auth__head h1 { font-size: 32px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.ml-auth__head h1:focus { outline: none; }
.ml-auth__head p { color: var(--ml-muted); }

.ml-auth__socials { display: flex; justify-content: center; gap: 10px; }
.ml-auth__socials > * { flex: 1 1 0; min-width: 0; }
.ml-social { position: relative; }
.ml-social__btn { text-decoration: none; color: inherit; width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ml-border-input); border-radius: var(--ml-radius); background: var(--ml-surface); font-weight: 600; font-size: 15px; }
.ml-social__btn:hover:not([disabled]) { background: var(--ml-surface-2); }
.ml-social__btn[disabled] { cursor: not-allowed; color: var(--ml-muted); }
.ml-social__btn[disabled] .ml-social__mark { opacity: .55; }
.ml-social__mark { width: 24px; height: 24px; display: block; object-fit: contain; background: none; }
/* Nut Google that (iframe GIS) phu trong suot len nut thiet ke */
.ml-social__gsi { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; opacity: .01; }
.ml-social:has(.ml-social__gsi:hover) .ml-social__btn { background: var(--ml-surface-2); }
.ml-social:focus-within .ml-social__btn { outline: 2px solid var(--ml-primary); outline-offset: 2px; }

.ml-auth__divider { display: flex; align-items: center; gap: 12px; color: var(--ml-muted); font-size: 13px; }
.ml-auth__divider::before, .ml-auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--ml-border); }

.ml-auth__form { display: flex; flex-direction: column; gap: 16px; }
.ml-auth__field { display: grid; gap: 6px; }
.ml-auth__field label, .ml-auth__label-row label { font-size: 14px; font-weight: 600; }
.ml-auth__label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ml-auth__label-row .ml-auth__link { font-size: 14px; }
.ml-auth__input { width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--ml-border-input); border-radius: var(--ml-radius); background: var(--ml-surface); font-size: 15px; color: var(--ml-text); }
.ml-auth__input::placeholder { color: #8A8F9C; }
.ml-auth__input:focus { outline: none; border-color: var(--ml-primary); box-shadow: 0 0 0 3px var(--ml-primary-soft); }
.ml-auth__input[aria-invalid="true"] { border-color: var(--ml-red); }
.ml-auth__hint { font-size: 13px; color: var(--ml-muted); }
.ml-auth__pw { position: relative; }
.ml-auth__pw .ml-auth__input { padding-right: 56px; }
.ml-auth__eye { position: absolute; right: 4px; top: 2px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ml-muted); }
.ml-auth__eye:hover { color: var(--ml-text); }
.ml-auth__meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
.ml-auth__meter span { height: 4px; border-radius: 2px; background: var(--ml-border); }
.ml-auth__meter[data-level="1"] span:nth-child(-n+1) { background: var(--ml-red); }
.ml-auth__meter[data-level="2"] span:nth-child(-n+2) { background: #D9922B; }
.ml-auth__meter[data-level="3"] span:nth-child(-n+3), .ml-auth__meter[data-level="4"] span { background: #1E8E5A; }
.ml-auth__hint[data-level="1"] { color: var(--ml-red-ink); }
.ml-auth__hint[data-level="2"] { color: #7A5200; }
.ml-auth__hint[data-level="3"], .ml-auth__hint[data-level="4"] { color: var(--ml-green); }

.ml-auth__check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 14px; color: var(--ml-text-2); }
.ml-auth__check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ml-primary); }
.ml-auth__check--top { align-items: flex-start; }
.ml-auth__check--top input { margin-top: 2px; }
.ml-auth__submit { width: 100%; height: 52px; margin-top: 4px; border-radius: 26px; font-size: 16px; font-weight: 700; }
.ml-auth__secondary { width: 100%; height: 48px; border: 1px solid var(--ml-border-input); border-radius: 24px; background: var(--ml-surface); font-size: 15px; }
.ml-auth__secondary:hover { background: var(--ml-surface-2); }
.ml-auth__switch { text-align: center; color: var(--ml-muted); }
.ml-auth__terms { text-align: center; font-size: 13px; color: var(--ml-muted); }
.ml-auth__note { font-size: 13px; color: var(--ml-muted); }
.ml-auth__notice { padding: 12px 14px; border-radius: var(--ml-radius); background: var(--ml-green-soft); color: #1E5A3C; font-size: 14px; }

/* Trang dang the (quen / dat lai mat khau) */
.ml-auth-card-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--ml-bg); }
.ml-auth-card-page__header { padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ml-auth-card-page__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 24px 96px; }
.ml-auth-card { width: 100%; max-width: 460px; padding: 40px; border: 1px solid var(--ml-border); border-radius: var(--ml-radius-card); background: var(--ml-surface); display: flex; flex-direction: column; gap: 22px; }
.ml-auth-card .ml-auth__form, .ml-auth__sent { display: flex; flex-direction: column; gap: 22px; }
.ml-auth__sent { gap: 16px; }
.ml-auth-card .ml-auth__head h1 { font-size: 28px; }
.ml-auth-card__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--ml-primary-soft); color: var(--ml-primary-ink); display: grid; place-items: center; }
.ml-auth__back { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; color: var(--ml-primary-ink); font-weight: 600; }
.ml-auth__back:hover { color: #2A2190; }

@media (max-width: 760px) {
  .ml-auth__brand, .ml-auth__desktop, .ml-auth-card-page__header, .ml-auth__back { display: none !important; }
  .ml-auth__mobile { display: revert !important; }
  .ml-auth__mobile.ml-btn { display: inline-flex !important; }
  .ml-auth__main { align-items: flex-start; padding: 12px 20px 28px; }
  .ml-auth__panel { min-height: calc(100vh - 40px); }
  .ml-auth__topbar { display: flex; align-items: center; justify-content: space-between; }
  .ml-auth__topbar-btn { border: 0; background: var(--ml-surface-2); }
  .ml-auth__topbar .ml-logo__mark { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .ml-auth__topbar .ml-logo__text { display: inline; font-size: 18px; font-weight: 800; }
  .ml-auth__topbar-spacer { width: 44px; }
  .ml-auth__head { gap: 4px; }
  .ml-auth__head h1 { font-size: 28px; }
  .ml-auth__head p { font-size: 14px; }
  .ml-auth__socials { gap: 8px; }
  .ml-social__btn { gap: 8px; font-size: 14px; }
  .ml-auth__socials--icons .ml-social__btn { height: 52px; }
  .ml-auth__socials--icons .ml-social__name { display: none; }
  .ml-auth__socials--icons .ml-social__mark { width: 26px; height: 26px; font-size: 13px; }
  .ml-auth__input { font-size: 16px; } /* tranh iOS tu zoom */
  .ml-auth__terms { margin-top: auto; font-size: 12px; }
  .ml-auth-card-page { background: var(--ml-surface); }
  .ml-auth-card-page__main { align-items: flex-start; padding: 12px 20px 28px; }
  .ml-auth-card { max-width: none; padding: 0; border: 0; border-radius: 0; gap: 24px; }
  .ml-auth-card .ml-auth__head h1 { font-size: 26px; }
  .ml-auth-card .ml-auth__form { gap: 20px; }
}

/* ---------- Chi tiet bai viet + binh luan (kieu Threads) ---------- */
.ml-post__time:hover, .ml-post__title a:hover { color: var(--ml-primary-ink); }
a.ml-action:hover { background: var(--ml-surface-2); color: var(--ml-text); }
.ml-post--detail { border-radius: var(--ml-radius-card) var(--ml-radius-card) 0 0; }
.ml-post--detail .ml-post__title { font-size: 22px; }
.ml-post--detail .ml-post__content { font-size: 16px; color: var(--ml-text); }

.ml-thread-bar { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.ml-thread-bar h2 { font-size: 17px; font-weight: 700; }
.ml-thread-bar__views { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ml-muted); }

.ml-thread__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--ml-border); scroll-margin-top: calc(var(--ml-header-h) + 16px); }
.ml-thread__head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.ml-seg { display: inline-flex; padding: 3px; border-radius: 18px; background: var(--ml-surface-2); }
.ml-seg__btn { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 15px; font-size: 13px; font-weight: 600; color: var(--ml-muted); }
.ml-seg__btn:hover { color: var(--ml-text); }
.ml-seg__btn[aria-selected="true"] { background: var(--ml-surface); color: var(--ml-text); box-shadow: 0 1px 3px rgba(20, 21, 26, .12); }

.ml-thread__composer { display: flex; align-items: flex-start; gap: 12px; padding: 6px 20px 14px; border-bottom: 1px solid var(--ml-border); }
.ml-thread__guest { align-items: center; padding-top: 8px; }
.ml-thread__guest .ml-composer__input { height: 42px; }
.ml-reply-form__main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ml-reply-form textarea { width: 100%; min-height: 38px; max-height: 40vh; padding: 8px 0; border: 0; resize: none; background: transparent; font-size: 15px; line-height: 1.5; overflow-y: auto; }
.ml-reply-form textarea:focus { outline: none; }
.ml-reply-form textarea::placeholder { color: #8A8F9C; }
.ml-reply-form__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.ml-reply-form__foot .ml-compose__tools { margin-left: -8px; }
.ml-reply-form .ml-compose__tool { width: 32px; height: 32px; }
.ml-reply-form .ml-media-editor__list, .ml-reply-form .ml-gif-picker { margin-bottom: 2px; }
.ml-reply-form__counter { font-size: 12px; color: var(--ml-muted); }
.ml-reply-form__counter.is-over { color: var(--ml-red-ink); font-weight: 600; }
.ml-reply-form button[type="submit"][disabled] { background: var(--ml-surface-2); color: #8A8F9C; opacity: 1; cursor: not-allowed; }
.ml-reply-form__to { display: flex; gap: 4px; font-size: 13px; color: var(--ml-muted); }
.ml-reply-form--inline { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0 8px; }

.ml-cmts { display: grid; transition: opacity .15s; }
.ml-cmts.is-loading { opacity: .5; pointer-events: none; }
.ml-cmts > .ml-cmt { padding: 16px 20px 6px; border-top: 1px solid var(--ml-border); }
.ml-cmts > .ml-cmt:first-child { border-top: 0; }
.ml-cmt { scroll-margin-top: calc(var(--ml-header-h) + 16px); transition: background-color 1s; }
.ml-cmt:target > .ml-cmt__main, .ml-cmt.is-new > .ml-cmt__main { background: var(--ml-primary-soft); border-radius: 12px; transition: none; }
.ml-cmt__main { display: flex; gap: 12px; transition: background-color 1.2s; }
.ml-cmt__rail { flex: none; width: 36px; display: flex; flex-direction: column; align-items: center; }
.ml-cmt--reply .ml-cmt__rail { width: 30px; }
.ml-cmt__line { display: none; flex: 1; width: 2px; min-height: 8px; margin-top: 6px; border-radius: 1px; background: var(--ml-border); }
.ml-cmt:has(> .ml-cmt__thread .ml-cmt, > .ml-cmt__thread .ml-reply-form, > .ml-cmt__thread .ml-cmt__more-replies) > .ml-cmt__main .ml-cmt__line { display: block; }
.ml-cmt__body { flex: 1; min-width: 0; padding-bottom: 2px; }
.ml-cmt__head { display: flex; align-items: center; gap: 6px; min-height: 26px; font-size: 14px; }
.ml-cmt__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-cmt__op { flex: none; padding: 1px 7px; border-radius: 6px; background: var(--ml-surface-2); color: var(--ml-muted); font-size: 11px; font-weight: 600; }
.ml-cmt__time { flex: none; font-size: 13px; color: var(--ml-muted); }
.ml-cmt__time:hover { color: var(--ml-text); }
.ml-cmt__menu { position: relative; margin-left: auto; }
.ml-cmt__menu .ml-icon-btn { width: 30px; height: 30px; }
.ml-cmt__content { color: var(--ml-text-2); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ml-mention { color: var(--ml-primary-ink); font-weight: 600; }
/* Media binh luan: 1 cai hien theo ti le goc, nhieu cai xep hang ngang cuon (kieu Threads) */
.ml-cmt__media { display: flex; gap: 6px; margin: 8px 0 2px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.ml-cmt__media::-webkit-scrollbar { display: none; }
.ml-cmt__media .ml-media { flex: none; height: 220px; min-width: 120px; max-width: 80%; aspect-ratio: auto; border-radius: 12px; }
.ml-cmt__media .ml-media img, .ml-cmt__media .ml-media video { width: auto; max-width: 100%; height: 100%; }
.ml-cmt__media--single .ml-media { height: auto; max-width: min(100%, 420px); }
.ml-cmt__media--single .ml-media img, .ml-cmt__media--single .ml-media video { width: 100%; height: auto; max-height: 360px; }
.ml-mention--to { margin-right: 4px; }
.ml-cmt__actions { display: flex; gap: 2px; margin: 2px 0 0 -10px; }
.ml-action--sm { height: 32px; padding: 0 10px; gap: 6px; font-size: 13px; }
.ml-cmt__deleted { padding: 6px 0 10px; color: var(--ml-muted); font-size: 14px; font-style: italic; }

/* Nhanh reply: duong doc tu avatar goc + "khuyu tay" bo goc noi vao tung reply */
.ml-cmt__thread { margin-left: 17px; padding-left: 31px; }
.ml-cmt__thread:has(.ml-cmt, .ml-reply-form, .ml-cmt__more-replies) { padding-bottom: 6px; }
.ml-cmt__replies > .ml-cmt { position: relative; padding: 10px 0 2px; }
.ml-cmt__replies > .ml-cmt::before, .ml-cmt__thread > .ml-reply-form--inline::before, .ml-cmt__more-replies::before { content: ""; position: absolute; left: -31px; top: -6px; width: 22px; height: 31px; border-left: 2px solid var(--ml-border); border-bottom: 2px solid var(--ml-border); border-bottom-left-radius: 14px; pointer-events: none; }
.ml-cmt__replies > .ml-cmt:not(:last-child)::after,
.ml-cmt__thread.has-more > .ml-cmt__replies > .ml-cmt:last-child::after,
.ml-cmt__thread:has(> .ml-reply-form--inline) > .ml-cmt__replies > .ml-cmt:last-child::after { content: ""; position: absolute; left: -31px; top: 0; bottom: 0; width: 2px; background: var(--ml-border); }
.ml-cmt__thread > .ml-reply-form--inline { position: relative; }
.ml-cmt__thread.has-more:has(> .ml-reply-form--inline) .ml-cmt__more-replies::after { content: ""; position: absolute; left: -31px; top: 0; bottom: 0; width: 2px; background: var(--ml-border); }
.ml-cmt__more-replies { position: relative; display: flex; align-items: center; height: 36px; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--ml-muted); font-size: 13px; font-weight: 600; }
.ml-cmt__more-replies::before { top: -10px; height: 28px; }
.ml-cmt__more-replies:hover { color: var(--ml-text); }

.ml-thread__more { display: flex; justify-content: center; padding: 12px 20px 20px; border-top: 1px solid var(--ml-border); }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  :root { --ml-col-left: 248px; --ml-col-right: 280px; }
}
@media (max-width: 1240px) {
  .ml-lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .ml-shell { grid-template-columns: var(--ml-col-left) minmax(0, 1fr); }
  .ml-right { display: none; }
  .ml-gd-grid { grid-template-columns: minmax(0, 1fr); }
  .ml-gd-hero__body { flex-wrap: wrap; }
  .ml-gd-hero__actions { width: 100%; grid-template-columns: auto auto; justify-content: start; }
}
@media (max-width: 980px) {
  .ml-lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .ml-cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 860px) {
  /* iOS Safari tu zoom khi focus o nhap co font-size < 16px */
  input, select, textarea, [contenteditable] { font-size: 16px !important; }
  .ml-header__inner { display: flex; gap: 12px; padding: 0 16px; }
  .ml-header__menu { display: inline-grid; border: 0; }
  .ml-header__bell { display: none; }
  .ml-header .ml-logo { display: none; }
  .ml-left__logo { display: inline-flex; margin: 0 0 16px 14px; }
  .ml-search { flex: 1; max-width: none; }
  .ml-icon-btn { width: 40px; height: 40px; }
  .ml-header__actions { gap: 6px; }
  .ml-search { min-width: 0; }
  .ml-shell { display: block; padding: 16px 16px 40px; }
  .ml-main { gap: 12px; }
  .ml-left { position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: 280px; padding: 20px 12px; background: var(--ml-surface); overflow-y: auto; transform: translateX(-100%); transition: transform .2s ease; }
  body.is-drawer-open .ml-left { transform: none; box-shadow: var(--ml-shadow-pop); }
  .ml-composer { padding: 14px; }
  .ml-filter__label { display: none; }
  .ml-post { padding: 16px 14px 4px; }
  .ml-post__head { flex-wrap: wrap; }
  .ml-post__more { align-self: flex-start; margin: -8px -6px 0 0; }
  .ml-post__author { flex: 1 1 calc(100% - 112px); }
  .ml-chip--game { order: 3; margin-left: 56px; max-width: calc(100% - 56px); }
  .ml-chip--game span { overflow: hidden; text-overflow: ellipsis; }
  .ml-post__title { font-size: 17px; }
  .ml-deal { flex-wrap: wrap; }
  .ml-deal__thumb { width: 88px; height: 52px; }
  .ml-deal__price { width: 100%; justify-items: start; grid-template-columns: auto auto auto; }
  .ml-deal__off { grid-row: auto; }
  .ml-deal__old { grid-column: auto; }
  .ml-action { padding: 0 10px; }
  .ml-game-hero__cover { height: 120px; }
  .ml-game-hero__body { flex-wrap: wrap; }
  .ml-game-hero__info { flex-basis: 100%; order: 3; padding-top: 0; }
  .ml-game-hero__body > .ml-btn { margin: 44px 0 0 auto; }
  .ml-left--drawer { display: block; }
  .ml-detail { padding: 12px 16px 40px; gap: 16px; }
  .ml-library { padding: 16px 16px 40px; gap: 16px; }
  .ml-library__head { flex-direction: column; align-items: stretch; }
  .ml-library__head h1 { font-size: 26px; }
  .ml-library__search { width: 100%; }
  .ml-library__search input { height: 44px; }
  .ml-library__search .ml-icon { top: 13px; }
  .ml-library__filters { padding: 12px; }
  .ml-lib-seg { width: 100%; overflow-x: auto; }
  .ml-lib-seg__btn { flex: 1; padding: 0 10px; }
  .ml-library__sort { width: 100%; }
  .ml-library__count { margin-right: auto; }
  .ml-lib-select { min-width: 0; flex: 0 1 186px; }
  .ml-lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ml-cm-grid { grid-template-columns: minmax(0, 1fr); }
  .ml-cm-actions { width: 100%; margin-left: 0; }
  .ml-library__head { flex-wrap: wrap; }
  .ml-lib-card__body { padding: 10px 12px 12px; }
  .ml-lib-card__name { font-size: 15px; }
  .ml-crumbs { display: none; }
  .ml-gd-hero__art { height: 160px; }
  .ml-gd-hero__body { flex-wrap: wrap; align-items: flex-start; gap: 14px 16px; padding: 0 16px 20px; }
  .ml-gd-hero__poster { width: 96px; margin-top: -40px; border-width: 3px; border-radius: 12px; font-size: 24px; }
  .ml-gd-hero__info { flex-basis: calc(100% - 112px); padding-top: 10px; gap: 8px; }
  .ml-gd-hero__info h1 { font-size: 26px; }
  .ml-gd-hero__meta { font-size: 14px; }
  .ml-gd-stats { gap: 10px 24px; }
  .ml-gd-stat dd { font-size: 20px; }
  .ml-gd-hero__actions { width: 100%; grid-template-columns: 1fr auto; align-items: center; }
  .ml-gd-follow { width: 100%; height: 44px; }
  .ml-gd-tabs { padding: 0 8px; }
  .ml-gd-tab { height: 48px; padding: 0 12px; font-size: 14px; }
  .ml-gd-section { padding: 18px 16px; }
  .ml-gd-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ml-gd-gallery .ml-gd-shot:first-child { grid-column: span 2; }
  .ml-gd-thread { flex-wrap: wrap; gap: 6px 12px; }
  .ml-gd-thread__body { flex-basis: 100%; order: 2; }
  .ml-gd-thread__body strong { white-space: normal; }
  .ml-gd-thread__stats { order: 3; }
  .ml-modal { max-height: calc(100vh - 16px); width: calc(100vw - 16px); }
  .ml-modal__body { padding: 16px; }
  .ml-compose__body { padding: 16px 14px 8px; gap: 10px; }
  .ml-compose__bar { padding: 8px 12px 12px; }
  .ml-post--detail .ml-post__title { font-size: 19px; }
  .ml-thread__head, .ml-thread__composer { padding-left: 14px; padding-right: 14px; }
  .ml-cmts > .ml-cmt { padding: 14px 14px 4px; }
  .ml-reply-form textarea { font-size: 16px; } /* tranh iOS tu zoom */
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Appearance ---------- */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --ml-bg: #101218;
  --ml-surface: #191C25;
  --ml-header-bg: rgba(25, 28, 37, .72);
  --ml-surface-2: #222633;
  --ml-border: #303545;
  --ml-border-input: #454C60;
  --ml-text: #F0F1F7;
  --ml-text-2: #CDD1DF;
  --ml-muted: #A1A9BE;
  --ml-primary: #7262F5;
  --ml-primary-ink: #B4AAFF;
  --ml-primary-soft: #2E2850;
  --ml-green: #70D7A2;
  --ml-green-soft: #183A2D;
  --ml-red: #FF858B;
  --ml-red-ink: #FF9CA1;
  --ml-shadow-pop: 0 16px 40px rgba(0, 0, 0, .4);
}
.ml-theme-toggle__sun { display: none; }
[data-theme="dark"] .ml-theme-toggle__sun { display: block; }
[data-theme="dark"] .ml-theme-toggle__moon { display: none; }
.ml-auth-page > .ml-theme-toggle { position: fixed; top: 18px; right: 18px; z-index: 60; }
[data-theme="dark"] .ml-btn--primary:hover { background: #8576FF; }
[data-theme="dark"] .ml-btn--soft:hover,
[data-theme="dark"] .ml-tag:hover { background: #3C3468; }
[data-theme="dark"] .ml-follow:hover { background: var(--ml-surface-2); }
[data-theme="dark"] .ml-gd-shot__play { color: #14151A; }
[data-theme="dark"] .ml-lib-card__stats.is-empty { color: #F0A65C; }
[data-theme="dark"] .ml-lib-card__score.is-high { background: #2E9E68; }
[data-theme="dark"] .ml-gd-store__mark,
[data-theme="dark"] .ml-compose__tool[data-tooltip]::after,
[data-theme="dark"] .ml-toast { background: #E2E5F0; color: #191C25; }
[data-theme="dark"] .ml-gd-type--guide { background: #203551; color: #A6CEFF; }
[data-theme="dark"] .ml-gd-type--news { background: #493020; color: #FFC391; }
[data-theme="dark"] .ml-gd-type--lfg { background: #48283A; color: #FFA9CE; }
[data-theme="dark"] .ml-gd-type--poll { background: #41371C; color: #F5D77D; }
[data-theme="dark"] .ml-auth__notice { color: var(--ml-green); }
[data-theme="dark"] .ml-auth__hint[data-level="2"] { color: #F5D77D; }
[data-theme="dark"] .ml-auth__link:hover,
[data-theme="dark"] .ml-auth__back:hover { color: #D1CAFF; }
[data-theme="dark"] .ml-deal__off,
[data-theme="dark"] .ml-gd-off { background: #24724E; }
[data-theme="dark"] .ml-auth__brand { background: #352982; }
@media (max-width: 600px) {
  .ml-header__actions { gap: 6px; }
  .ml-header__actions .ml-theme-toggle { width: 36px; height: 36px; }
  .ml-auth-page > .ml-theme-toggle { top: auto; bottom: 18px; right: 18px; }
}

/* Searchable game picker in the post composer. */
.ml-game-picker { min-width: 0; }
.ml-game-picker__trigger { display: flex; align-items: center; gap: 6px; max-width: 200px; }
.ml-game-picker__trigger span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ml-game-picker__trigger[aria-expanded="true"] { background: var(--ml-primary-soft); color: var(--ml-primary-ink); }
.ml-game-picker__panel { position: fixed; margin: 0; padding: 8px; box-sizing: border-box; border: 1px solid var(--ml-border); border-radius: 14px; background: var(--ml-surface); color: var(--ml-text); box-shadow: var(--ml-shadow-pop); overflow: auto; }
.ml-game-picker__panel:popover-open { display: flex; flex-direction: column; gap: 6px; }
.ml-game-picker__search { flex: none; width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--ml-border); border-radius: 9px; background: var(--ml-surface-2); color: var(--ml-text); font: inherit; font-size: 14px; }
.ml-game-picker__search::placeholder { color: var(--ml-muted); }
.ml-game-picker__options { min-height: 0; overflow-y: auto; }
.ml-game-picker__option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ml-text); text-align: left; font: inherit; font-size: 14px; cursor: pointer; }
.ml-game-picker__option::after { content: ""; width: 14px; margin-left: auto; flex: none; }
.ml-game-picker__option[aria-pressed="true"] { background: var(--ml-primary-soft); color: var(--ml-primary-ink); }
.ml-game-picker__option[aria-pressed="true"]::after { content: "✓"; }
.ml-game-picker__option:hover { background: var(--ml-surface-2); }
.ml-game-picker__option[data-game-value=""] { color: var(--ml-muted); }
.ml-game-picker__option[hidden], .ml-game-picker__group[hidden], .ml-game-picker__empty[hidden] { display: none; }
.ml-game-picker__group-label { margin: 8px 0 2px; padding: 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ml-muted); }
.ml-game-picker__empty { margin: 0; padding: 12px; font-size: 13px; color: var(--ml-muted); }
.ml-game-picker__trigger:focus-visible, .ml-game-picker__search:focus-visible, .ml-game-picker__option:focus-visible { outline: 2px solid var(--ml-primary); outline-offset: -2px; }
@media (max-width: 540px) {
  .ml-compose__meta { flex-wrap: wrap; }
  .ml-compose__meta strong { max-width: calc(100% - 48px); overflow: hidden; text-overflow: ellipsis; }
  .ml-compose__close { position: absolute; top: 16px; right: 14px; }
  .ml-compose__meta { padding-right: 28px; }
  .ml-game-picker__trigger { max-width: 160px; }
}

/* Hashtag suggestions while typing "#" in composer / comments (public/js/community.js initHashtagSuggest). */
.ml-tag-suggest { position: fixed; inset: auto; margin: 0; width: min(280px, calc(100vw - 16px)); max-height: 264px; overflow-y: auto; padding: 6px; box-sizing: border-box; border: 1px solid var(--ml-border); border-radius: 12px; background: var(--ml-surface); color: var(--ml-text); box-shadow: var(--ml-shadow-pop); }
.ml-tag-suggest__item { display: flex; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.ml-tag-suggest__item:hover, .ml-tag-suggest__item[aria-selected="true"] { background: var(--ml-primary-soft); color: var(--ml-primary-ink); }
.ml-tag-suggest__name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.ml-tag-suggest__count { margin-left: auto; flex: none; font-size: 12px; color: var(--ml-muted); }
.ml-tag-suggest__item--topic .ml-tag-suggest__count { padding: 1px 6px; border-radius: 6px; background: var(--ml-surface-2); }

/* Game suggestions in the header search. */
.ml-search__results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; max-height: min(420px, 65vh); overflow-y: auto; padding: 6px; border: 1px solid var(--ml-border); border-radius: 14px; background: var(--ml-surface); box-shadow: var(--ml-shadow-pop); }
.ml-search__results[hidden] { display: none; }
.ml-search__result { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; color: var(--ml-text); }
.ml-search__result:hover, .ml-search__result[aria-selected="true"] { background: var(--ml-surface-2); }
.ml-search__result span:last-child { min-width: 0; overflow-wrap: anywhere; }
.ml-search__status { margin: 0; padding: 12px; color: var(--ml-muted); font-size: 14px; }

/* Keep the published post context in the same order as the composer. */
.ml-post__meta { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; min-width: 0; }
.ml-post__meta .ml-post__name { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; gap: 6px; }
.ml-post__meta .ml-post__author-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-post__separator { display: inline-flex; color: var(--ml-muted); flex: none; }
.ml-post__topic { display: flex; align-items: center; flex: 0 3 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; }
.ml-vbadge { display: inline-flex; flex: none; vertical-align: middle; }
.ml-vbadge--official { color: #1D9BF0; }
.ml-vbadge--creator { color: #22A861; }
.ml-post__game, .ml-post__mode { min-width: 0; color: var(--ml-muted); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ml-post__topic .ml-post__game, .ml-post__topic .ml-post__mode { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.ml-post__game:hover, .ml-post__mode:hover { color: var(--ml-primary-ink); }
.ml-post__head > .ml-avatar, .ml-post__more { flex-shrink: 0; }

.ml-feed-scopes { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-feed-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.ml-game-quick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.ml-game-quick::-webkit-scrollbar { display: none; }
.ml-game-quick__item { flex: none; display: grid; place-items: center; padding: 3px; border: 2px solid transparent; border-radius: 12px; transition: opacity .15s, border-color .15s, transform .15s; }
.ml-game-quick .ml-game-quick__item:hover { opacity: 1; transform: translateY(-1px); }
.ml-game-quick.has-active .ml-game-quick__item:not(.is-active) { opacity: .55; }
.ml-game-quick__item.is-active { border-color: var(--ml-primary); }
.ml-feed-toolbar .ml-feed-filter { flex: none; }
.ml-feed-filter { position: relative; border: 1px solid var(--ml-border); background: var(--ml-surface); }
.ml-feed-filter.is-active { color: var(--ml-primary-ink); background: var(--ml-primary-soft); }
.ml-feed-filter__dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#ml-feed-filter .ml-field select, #ml-feed-filter .ml-field input { width: 100%; min-width: 0; }
#ml-feed-filter .ml-field select:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Trang ca nhan + the hover (design: Trang ca nhan & the hover) ---------- */
.ml-post__avatar, .ml-cmt__avatar { flex: none; display: block; border-radius: 50%; }
.ml-post__author-name:hover, .ml-cmt__name:hover { color: var(--ml-primary-ink); }
.ml-menu a.ml-menu__item { color: var(--ml-text); }

/* Mau theo bac cap do: --tier (nen dac, chu trang), --tier-ink (chu tren nen sang), --tier-soft */
.ml-tier--rookie { --tier: #1E7A4E; --tier-ink: #1E7A4E; --tier-soft: #E3F5EC; }
.ml-tier--warrior { --tier: #2F6FDE; --tier-ink: #1E4C8F; --tier-soft: #DDEBFF; }
.ml-tier--elite { --tier: #7C3AED; --tier-ink: #6B21A8; --tier-soft: #F1E3FB; }
.ml-tier--legend { --tier: #9A6400; --tier-ink: #8A5A00; --tier-soft: #FFF1C7; }

.ml-pbadge { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--b-bg); color: var(--b-fg); }
.ml-pbadge--creator { --b-fg: #4B3BE8; --b-bg: #ECEAFD; }
.ml-pbadge--official { --b-fg: #0E6E8C; --b-bg: #D8F1F8; }
.ml-pbadge--pioneer { --b-fg: #1E7A4E; --b-bg: #E3F5EC; }
.ml-pbadge--guide { --b-fg: #1E4C8F; --b-bg: #DDEBFF; }
.ml-pbadge--dealhunter { --b-fg: #B4235A; --b-bg: #FFE0EA; }
.ml-pbadge--topcomment { --b-fg: #0F7B6C; --b-bg: #DDF3EF; }
.ml-pbadge--popular { --b-fg: #C2410C; --b-bg: #FFEBD6; }
.ml-pbadge--legend { --b-fg: #6B21A8; --b-bg: #F1E3FB; }
.ml-pbadge.is-locked { --b-fg: #8A8F9C; --b-bg: var(--ml-surface-2); }
.ml-pbadge .ml-icon { stroke-width: 2.1; }

.ml-pf-bar { height: 8px; border-radius: 4px; background: var(--ml-surface-2); overflow: hidden; }
.ml-pf-bar span { display: block; height: 100%; border-radius: inherit; background: var(--tier); }

.ml-pf { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); grid-template-areas: "hero hero" "tabs tabs" "main side"; row-gap: 0; align-items: start; }
.ml-pf-hero { grid-area: hero; overflow: hidden; border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ml-pf-tabs { grid-area: tabs; display: flex; gap: 4px; padding: 0 24px; border-top-left-radius: 0; border-top-right-radius: 0; overflow-x: auto; scrollbar-width: none; }
.ml-pf-tabs::-webkit-scrollbar { display: none; }
.ml-pf-tabs .ml-gd-tab { height: 52px; }
.ml-pf-main { grid-area: main; margin-top: 24px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ml-pf-side { grid-area: side; margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

.ml-pf-hero__cover { position: relative; height: 200px; background: #2B2346 center / cover no-repeat; }
.ml-pf-hero__cover-btn { position: absolute; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .92); color: #14151A; font-size: 14px; font-weight: 600; }
.ml-pf-hero__cover-btn:hover { background: #fff; }
.ml-pf-hero__body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 28px; padding: 0 32px 24px; }
.ml-pf-hero__avatar { position: relative; flex: none; margin-top: -64px; }
.ml-pf-hero__avatar > .ml-avatar { border: 5px solid var(--ml-surface); box-shadow: 0 0 0 3px var(--tier); font-size: 40px; font-weight: 800; }
.ml-pf-hero__lv { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: 1px 10px; border: 2px solid var(--ml-surface); border-radius: 10px; background: var(--tier); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.ml-pf-hero__avatar-btn { position: absolute; inset: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(20, 21, 26, .55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ml-pf-hero__avatar:hover .ml-pf-hero__avatar-btn, .ml-pf-hero__avatar-btn:focus-visible { opacity: 1; }
.ml-pf-hero__lv { z-index: 1; }
.ml-pf-hero__info { flex: 999 1 420px; min-width: 0; padding-top: 16px; display: grid; gap: 6px; }
.ml-pf-hero__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ml-pf-hero__title h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ml-pf-tier { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--tier-soft); color: var(--tier-ink); font-size: 12px; font-weight: 700; }
.ml-pf-hero__meta { display: flex; flex-wrap: wrap; gap: 4px; color: var(--ml-muted); font-size: 14px; }
.ml-pf-hero__bio { max-width: 640px; margin-top: 4px; color: var(--ml-text-2); white-space: pre-line; overflow-wrap: anywhere; }
.ml-pf-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; font-size: 14px; color: var(--ml-muted); }
.ml-pf-stats li { display: flex; align-items: baseline; gap: 5px; }
.ml-pf-stats strong { color: var(--ml-text); font-size: 16px; font-weight: 700; }
.ml-pf-hero__actions { flex: 1 1 240px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.ml-pf-hero__follow, .ml-pf-hero__edit { height: 48px; padding: 0 24px; border-radius: 24px; font-size: 15px; font-weight: 700; }
.ml-pf-hero__edit { background: var(--ml-text); color: var(--ml-surface); }
.ml-pf-hero__edit:hover { opacity: .9; }
.ml-pf-hero__share { width: 48px; height: 48px; border-color: var(--ml-border-input); }
[data-action="follow-member"] .ml-when-on, [data-action="follow-member"][aria-pressed="true"] .ml-when-off { display: none; }
[data-action="follow-member"] .ml-when-off, [data-action="follow-member"][aria-pressed="true"] .ml-when-on { display: inline-flex; align-items: center; gap: 6px; }

.ml-pf-private { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 13px; color: var(--ml-muted); }
.ml-pf-comments { padding: 4px 20px; }
.ml-pf-comment { display: grid; gap: 6px; padding: 16px 0; }
.ml-pf-comment + .ml-pf-comment { border-top: 1px solid var(--ml-border); }
.ml-pf-comment__meta { font-size: 13px; color: var(--ml-muted); overflow-wrap: anywhere; }
.ml-pf-comment__meta a:first-child { color: var(--ml-primary-ink); font-weight: 600; }
.ml-pf-comment__meta a:hover { text-decoration: underline; }
.ml-pf-comment__text { color: var(--ml-text); line-height: 1.55; overflow-wrap: anywhere; }
.ml-pf-comment__stats { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ml-muted); }

.ml-pf-level__head { display: flex; align-items: center; gap: 14px; }
.ml-pf-level__mark { flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--tier); color: #fff; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ml-pf-level__mark small { font-size: 11px; font-weight: 600; opacity: .85; }
.ml-pf-level__mark strong { font-size: 24px; font-weight: 800; }
.ml-pf-level__info { display: grid; }
.ml-pf-level__info strong { font-size: 18px; font-weight: 800; }
.ml-pf-level__info span { font-size: 13px; color: var(--ml-muted); }
.ml-pf-level__next { font-size: 13px; color: var(--ml-text-2); }
.ml-pf-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.ml-pf-tiers li { display: grid; padding: 8px 4px; border: 1px solid var(--ml-border); border-radius: 10px; background: var(--ml-surface-2); }
.ml-pf-tiers strong { font-size: 12px; font-weight: 700; color: var(--ml-muted); }
.ml-pf-tiers span { font-size: 11px; color: var(--ml-muted); }
.ml-pf-tiers li.is-current { border-color: var(--tier); background: var(--tier-soft); }
.ml-pf-tiers li.is-current strong { color: var(--tier-ink); }
.ml-pf-rules { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--ml-border); }
.ml-pf-rules h3 { font-size: 14px; font-weight: 700; }
.ml-pf-rules ul { display: grid; gap: 8px; }
.ml-pf-rules li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ml-text-2); }
.ml-pf-rules strong { color: var(--ml-green); white-space: nowrap; }

.ml-pf-badges__count { font-size: 14px; font-weight: 500; color: var(--ml-muted); }
.ml-pf-badges__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ml-pf-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; text-align: center; }
.ml-pf-badge strong { font-size: 12px; font-weight: 600; line-height: 1.3; }
.ml-pf-badge span:not(.ml-pbadge) { font-size: 11px; color: var(--ml-muted); }
.ml-pf-badge.is-locked { background: var(--ml-surface-2); }
.ml-pf-badge.is-locked strong { color: var(--ml-muted); }

.ml-pf-xp { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--ml-surface-2); }
.ml-pf-xp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ml-pf-xp__head strong { font-weight: 800; }
.ml-pf-xp__tier { font-weight: 600; color: var(--tier-ink); }
.ml-pf-xp__count { font-size: 12px; color: var(--ml-muted); white-space: nowrap; }
.ml-pf-xp .ml-pf-bar { height: 6px; background: var(--ml-border); }

/* The hover: popover vi tri fixed, JS dat top/left (initProfileCards) */
.ml-pcard-pop { position: fixed; z-index: 70; width: 340px; max-width: calc(100vw - 32px); }
.ml-pcard { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--ml-border); border-radius: 16px; background: var(--ml-surface); box-shadow: 0 16px 40px rgba(20, 21, 26, .16); font-size: 14px; line-height: 1.5; }
.ml-pcard__head { display: flex; align-items: center; gap: 12px; }
.ml-pcard__avatar { flex: none; display: grid; place-items: center; width: 56px; height: 56px; margin: 4px; border-radius: 50%; line-height: 0; box-shadow: 0 0 0 2px var(--ml-surface), 0 0 0 4px var(--tier); }
.ml-pcard__avatar .ml-avatar { display: grid; width: 100% !important; height: 100% !important; border-radius: 50%; object-fit: cover; }
.ml-pcard__avatar .ml-avatar { font-size: 18px; font-weight: 800; }
.ml-pcard__id { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ml-pcard__name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ml-pcard__name a { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.ml-pcard__name a:hover { color: var(--ml-primary-ink); }
.ml-pcard__handle { font-size: 13px; color: var(--ml-muted); }
.ml-pcard__bio { color: var(--ml-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ml-pcard__stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.ml-pcard__stats div { display: flex; flex-direction: column-reverse; }
.ml-pcard__stats div + div { border-left: 1px solid var(--ml-border); }
.ml-pcard__stats dd { margin: 0; font-size: 16px; font-weight: 800; }
.ml-pcard__stats dt { font-size: 12px; color: var(--ml-muted); }
.ml-pcard__badges { display: flex; align-items: center; gap: 6px; }
.ml-pcard__more { padding-left: 2px; font-size: 12px; font-weight: 700; color: var(--ml-muted); }
.ml-pcard__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ml-pcard__actions .ml-btn, .ml-pcard__wide { height: 40px; padding: 0 12px; }
.ml-pcard__wide { width: 100%; }

/* Sua anh bia / anh dai dien truc tiep tren trang cong dong */
.ml-gd-hero__art, .ml-gd-hero__poster { position: relative; }
.ml-gd-admin-flag { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--ml-primary-soft); color: var(--ml-primary); font-size: 12px; font-weight: 600; }
.ml-hero-edit { position: absolute; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: rgba(255, 255, 255, .92); color: var(--ml-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(20, 21, 26, .22); transition: background .15s; }
.ml-hero-edit:hover { background: #fff; }
.ml-hero-edit--cover { right: 16px; bottom: 16px; height: 36px; padding: 0 14px; border-radius: 10px; }
.ml-hero-edit--avatar { right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%; }
.is-art-editing .ml-hero-edit { display: none; }
.is-art-active { outline: 3px solid var(--ml-primary); outline-offset: -3px; }
.is-art-active::after { content: ""; position: absolute; inset: 0; background: rgba(20, 21, 26, .12); pointer-events: none; }
.is-art-draggable { cursor: grab; touch-action: none; }
.is-art-draggable.is-dragging { cursor: grabbing; }
.ml-hero-bar { position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: calc(100vw - 24px); padding: 10px 12px; border: 1px solid var(--ml-border); border-radius: 14px; background: var(--ml-surface); box-shadow: var(--ml-shadow-pop); }
.ml-hero-bar[hidden] { display: none; }
.ml-hero-bar__hint { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--ml-text-2); }
.ml-hero-bar { position: fixed; }
.ml-hero-bar label.ml-btn { position: relative; }
.ml-hero-bar input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 860px) {
  .ml-hero-edit--cover span { display: none; }
  .ml-hero-edit--cover { width: 36px; padding: 0; right: 10px; bottom: 10px; }
}

@media (max-width: 1100px) {
  .ml-pf { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "tabs" "side" "main"; }
  .ml-pf-side { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 860px) {
  /* Mobile theo ProfileMobile: header -> cap do + huy hieu -> tab -> noi dung */
  .ml-pf { grid-template-areas: "hero" "side" "tabs" "main"; row-gap: 12px; }
  .ml-pf-hero { border-bottom: 1px solid var(--ml-border); border-radius: var(--ml-radius-card); }
  .ml-pf-tabs { padding: 0 4px; border-radius: var(--ml-radius-card); }
  .ml-pf-tabs .ml-gd-tab { flex: 1; justify-content: center; height: 46px; }
  .ml-pf-main, .ml-pf-side { margin-top: 0; }
  .ml-pf-side { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ml-pf-hero__cover { height: 128px; }
  .ml-pf-hero__cover-btn { top: 10px; right: 12px; height: 36px; font-size: 13px; }
  .ml-pf-hero__body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 8px 10px; padding: 0 16px 16px; }
  .ml-pf-hero__avatar { margin-top: -44px; justify-self: start; width: fit-content; }
  .ml-pf-hero__avatar > .ml-avatar { width: 88px !important; height: 88px !important; border-width: 4px; box-shadow: 0 0 0 2px var(--tier); font-size: 28px; }
  .ml-pf-hero__lv { font-size: 11px; padding: 0 8px; border-radius: 9px; }
  .ml-pf-hero__actions { justify-content: flex-end; gap: 8px; }
  .ml-pf-hero__follow, .ml-pf-hero__edit { height: 40px; padding: 0 16px; font-size: 14px; }
  .ml-pf-hero__share { width: 40px; height: 40px; }
  .ml-pf-hero__info { grid-column: 1 / -1; padding-top: 4px; }
  .ml-pf-hero__title h1 { font-size: 22px; }
  .ml-pf-hero__meta { font-size: 13px; }
  .ml-pf-hero__bio { font-size: 14px; }
  .ml-pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 4px; padding: 8px 0; border: 1px solid var(--ml-border); border-radius: 12px; text-align: center; }
  .ml-pf-stats li { flex-direction: column; align-items: center; gap: 0; font-size: 11px; }
  .ml-pf-stats strong { font-size: 15px; }
  .ml-pf-level .ml-gd-section__title, .ml-pf-tiers, .ml-pf-level__next { display: none; }
  .ml-pf-level__mark { width: 48px; height: 48px; border-radius: 14px; }
  .ml-pf-level__mark strong { font-size: 18px; }
  .ml-pf-badges__grid { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .ml-pf-badges__grid::-webkit-scrollbar { display: none; }
  .ml-pf-badge { flex: none; width: 84px; padding: 6px 2px; }
  .ml-pf-comments { padding: 4px 14px; }
}

[data-theme="dark"] .ml-tier--rookie { --tier: #24724E; --tier-ink: #70D7A2; --tier-soft: #183A2D; }
[data-theme="dark"] .ml-tier--warrior { --tier: #2F6FDE; --tier-ink: #A6CEFF; --tier-soft: #203551; }
[data-theme="dark"] .ml-tier--elite { --tier: #7C3AED; --tier-ink: #D7B8FF; --tier-soft: #3A2752; }
[data-theme="dark"] .ml-tier--legend { --tier: #9A6400; --tier-ink: #F5D77D; --tier-soft: #41371C; }
[data-theme="dark"] .ml-pbadge--creator { --b-fg: #B4AAFF; --b-bg: #2E2850; }
[data-theme="dark"] .ml-pbadge--official { --b-fg: #8FDBF2; --b-bg: #173A47; }
[data-theme="dark"] .ml-pbadge--pioneer { --b-fg: #70D7A2; --b-bg: #183A2D; }
[data-theme="dark"] .ml-pbadge--guide { --b-fg: #A6CEFF; --b-bg: #203551; }
[data-theme="dark"] .ml-pbadge--dealhunter { --b-fg: #FFA9CE; --b-bg: #48283A; }
[data-theme="dark"] .ml-pbadge--topcomment { --b-fg: #7FE0D0; --b-bg: #163C37; }
[data-theme="dark"] .ml-pbadge--popular { --b-fg: #FFC391; --b-bg: #493020; }
[data-theme="dark"] .ml-pbadge--legend { --b-fg: #D7B8FF; --b-bg: #3A2752; }
[data-theme="dark"] .ml-pbadge.is-locked { --b-fg: #7C8396; }
[data-theme="dark"] .ml-pcard { box-shadow: var(--ml-shadow-pop); }

/* Diem danh hang ngay (the Cap do, chi chinh chu) */
.ml-pf-checkin { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #FFF4EC; }
.ml-pf-checkin__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #FFE3CF; color: #C2410C; }
.ml-pf-checkin__info { flex: 1; min-width: 0; display: grid; }
.ml-pf-checkin__info strong { font-size: 14px; font-weight: 700; }
.ml-pf-checkin__info span { font-size: 12px; color: var(--ml-muted); }
.ml-pf-checkin__done { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ml-green-soft); color: var(--ml-green); }
.ml-pf-checkin.is-done { background: var(--ml-surface-2); }
.ml-pbadge--streak { --b-fg: #C2410C; --b-bg: #FFE3CF; }
[data-theme="dark"] .ml-pf-checkin { background: #3A2618; }
[data-theme="dark"] .ml-pf-checkin.is-done { background: var(--ml-surface-2); }
[data-theme="dark"] .ml-pf-checkin__icon { background: #4D2E1A; color: #FFB37A; }
[data-theme="dark"] .ml-pbadge--streak { --b-fg: #FFB37A; --b-bg: #4D2E1A; }

/* Inline formatting is shared between the advanced editor and published posts. */
.ml-rich-size-small { font-size: .75em; }
.ml-rich-size-large { font-size: 1.5em; }
.ml-rich-size-huge { font-size: 2.5em; }
.ml-editor-toggle__icon { font-size: 15px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.ml-editor-toggle[aria-expanded="true"] { background: var(--ml-primary-soft); color: var(--ml-primary-ink); }
/* Formatting bar: a light pill above the text; the text area itself stays borderless like the plain textarea. */
.ml-rich-toolbar.ql-toolbar.ql-snow { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; padding: 4px 6px; border: 0; border-radius: 10px; background: var(--ml-surface-2); font-family: inherit; }
.ml-rich-toolbar.ql-toolbar.ql-snow[hidden] { display: none; }
.ml-rich-toolbar.ql-snow .ql-formats { display: inline-flex; align-items: center; margin-right: 0; }
.ml-rich-toolbar.ql-snow .ql-formats + .ql-formats { padding-left: 6px; border-left: 1px solid var(--ml-border); }
.ml-rich-toolbar.ql-snow button { width: 32px; height: 32px; padding: 6px; border-radius: 8px; }
.ml-rich-toolbar.ql-snow button:hover, .ml-rich-toolbar.ql-snow .ql-picker-label:hover { background: var(--ml-border); }
.ml-rich-toolbar.ql-snow button.ql-active { background: var(--ml-primary-soft); }
.ml-rich-toolbar.ql-snow .ql-picker-label { padding: 4px 8px; border-radius: 8px; }
.ml-rich-toolbar.ql-snow .ql-picker.ql-size { width: 96px; }
.ml-rich-toolbar.ql-snow .ql-picker-options { max-height: 220px; overflow-y: auto; border-color: var(--ml-border); border-radius: 10px; box-shadow: var(--ml-shadow-pop); }
.ml-rich-toolbar.ql-snow .ql-stroke { stroke: var(--ml-text); }
.ml-rich-toolbar.ql-snow .ql-fill { fill: var(--ml-text); }
.ml-rich-toolbar.ql-snow button.ql-active .ql-stroke { stroke: var(--ml-primary-ink); }
.ml-rich-toolbar.ql-snow button.ql-active .ql-fill { fill: var(--ml-primary-ink); }
.ml-rich-toolbar.ql-snow .ql-picker { color: var(--ml-text); }
.ml-rich-toolbar.ql-snow .ql-picker-options { background: var(--ml-surface); color: var(--ml-text); }
.ml-rich-editor.ql-container.ql-snow { border: 0; font: inherit; color: var(--ml-text); }
.ml-rich-editor .ql-editor { min-height: 160px; max-height: 50vh; padding: 0; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ml-rich-editor .ql-editor:focus, .ml-rich-editor .ql-editor:focus-visible { outline: none; box-shadow: none; }
.ml-rich-editor .ql-editor.ql-blank::before { left: 0; right: 0; color: #8A8F9C; font-style: normal; }
.ml-compose__main { min-width: 0; }
@media (max-width: 540px) {
  /* Compose as a bottom sheet; dvh keeps it clear of the on-screen keyboard. */
  .ml-compose-modal { width: 100vw; max-width: 100vw; max-height: 92vh; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .ml-compose__body { padding-top: 14px; }
  .ml-compose__body > .ml-avatar { display: none; }
  .ml-compose__text { font-size: 16px; } /* tranh iOS tu zoom */
  .ml-rich-editor .ql-editor { min-height: 140px; max-height: 38vh; max-height: 38dvh; font-size: 16px; }
  .ml-rich-toolbar.ql-toolbar.ql-snow { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 6px; }
  .ml-rich-toolbar.ql-toolbar.ql-snow::-webkit-scrollbar { display: none; }
  .ml-rich-toolbar.ql-snow .ql-formats { flex: none; }
  .ml-rich-toolbar.ql-snow button { width: 40px; height: 40px; padding: 9px; }
  .ml-rich-toolbar.ql-snow .ql-picker-label { padding: 8px 10px; }
  .ml-rich-toolbar.ql-snow .ql-picker.ql-size { width: 104px; }
  .ml-compose__bar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ml-compose__tools { gap: 0; }
  .ml-compose__tool { width: 40px; height: 40px; }
  .ml-compose__tool[data-tooltip]::after { display: none; }
  .ml-typebox .ml-field-row > .ml-field { flex-basis: 100%; }
}

/* Save-draft confirmation shown when closing a non-empty composer. */
.ml-draft-modal { width: min(300px, calc(100vw - 48px)); border-radius: 16px; overflow: hidden; text-align: center; }
.ml-draft-modal__text { padding: 22px 20px 18px; }
.ml-draft-modal h2 { font-size: 16px; font-weight: 700; }
.ml-draft-modal p { margin-top: 8px; color: var(--ml-muted); font-size: 14px; line-height: 1.45; }
.ml-draft-modal__actions { display: grid; }
.ml-draft-modal__actions button { height: 50px; border: 0; border-top: 1px solid var(--ml-border); background: transparent; color: var(--ml-text); font: inherit; font-size: 15px; cursor: pointer; }
.ml-draft-modal__actions button[data-draft="save"] { font-weight: 700; }
.ml-draft-modal__actions button.is-danger { color: #E5383B; }
.ml-draft-modal__actions button:hover { background: var(--ml-surface-2); }
.ml-draft-modal__actions button:focus-visible { outline: 2px solid var(--ml-primary); outline-offset: -2px; }

/* Search results page. */
.ml-search-page__head { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; }
.ml-search-page__head h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.ml-search-page__head p { margin: 0; color: var(--ml-muted); font-size: 14px; }
.ml-search-page__tabs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.ml-search-page__tabs::-webkit-scrollbar { display: none; }
.ml-search-page__tabs a { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--ml-border); border-radius: 18px; background: var(--ml-surface); color: var(--ml-text-2); font-size: 14px; font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
.ml-search-page__tabs a:hover { background: var(--ml-surface-2); }
.ml-search-page__tabs a.is-active { border-color: var(--ml-primary); background: var(--ml-primary-soft); color: var(--ml-primary-ink); font-weight: 600; }
.ml-search-page__group { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 18px 12px 12px; }
.ml-search-page__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 8px; }
.ml-search-page__heading h2 { margin: 0; font-size: 17px; }
.ml-search-page__heading .ml-link { font-size: 14px; }
.ml-search-page__empty { margin: 0; padding: 20px 12px 16px; text-align: center; color: var(--ml-muted); font-size: 14px; }
.ml-search-page__item { display: flex; align-items: flex-start; gap: 14px; padding: 12px; border-radius: var(--ml-radius); color: var(--ml-text); transition: background .15s; }
.ml-search-page__item:hover { background: var(--ml-surface-2); }
.ml-search-page__item .ml-avatar, .ml-search-page__item .ml-game-icon { flex: none; width: 52px !important; height: 52px !important; border-radius: 14px; object-fit: cover; }
.ml-search-page__item .ml-avatar { border-radius: 50%; }
.ml-search-page__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ml-search-page__text strong { font-size: 15px; overflow-wrap: anywhere; }
.ml-search-page__text span { color: var(--ml-muted); font-size: 13px; }
.ml-search-page__text p { margin: 2px 0 0; color: var(--ml-text-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ml-search-page__pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 4px; color: var(--ml-muted); font-size: 14px; }
@media (max-width: 860px) {
  .ml-search-page__head { padding: 16px; }
  .ml-search-page__head h1 { font-size: 20px; }
  .ml-search-page__group { padding: 14px 6px 8px; }
  .ml-search-page__item .ml-avatar, .ml-search-page__item .ml-game-icon { width: 44px !important; height: 44px !important; }
}

/* pull to refresh */
.ml-ptr { position: fixed; top: env(safe-area-inset-top, 0px); left: 50%; z-index: 90; width: 40px; height: 40px; margin-top: 8px; border-radius: 50%; background: var(--ml-surface, #1a1d2b); border: 1px solid var(--ml-border, rgba(255,255,255,.15)); display: flex; align-items: center; justify-content: center; opacity: 0; transform: translate(-50%, -48px); transition: transform .2s, opacity .2s; pointer-events: none; }
.ml-ptr.is-dragging { transition: none; }
.ml-ptr__spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; }
.ml-ptr.is-loading { opacity: 1; }
.ml-ptr.is-loading .ml-ptr__spinner { animation: ml-ptr-spin .7s linear infinite; }
@keyframes ml-ptr-spin { to { transform: rotate(360deg); } }

/* ---------- Bottom nav (mobile) ---------- */
.ml-bottom-nav { display: none; }
@media (max-width: 860px) {
  :root { --ml-bottom-nav-h: 64px; }
  body.ml-page { padding-bottom: calc(var(--ml-bottom-nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  .ml-bottom-nav { position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 43; display: flex; align-items: center; justify-content: space-between; gap: 4px; max-width: 460px; height: var(--ml-bottom-nav-h); margin: 0 auto; padding: 6px; border: 1px solid var(--ml-border); border-radius: 999px; background: color-mix(in srgb, var(--ml-surface) 82%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); box-shadow: var(--ml-shadow-pop); }
  .ml-bottom-nav__item { flex: 1; display: grid; place-items: center; height: 100%; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--ml-text); -webkit-tap-highlight-color: transparent; transition: background .15s ease; }
  .ml-bottom-nav__item:active { background: var(--ml-surface-2); }
  .ml-bottom-nav__item.is-active { background: var(--ml-surface-2); }
  .ml-bottom-nav__item.is-active .ml-icon { fill: currentColor; }
  .ml-bottom-nav__item .ml-icon { stroke-width: 2; }
  .ml-toast { bottom: calc(var(--ml-bottom-nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  .ml-install { bottom: calc(var(--ml-bottom-nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  .ml-hero-bar { bottom: calc(var(--ml-bottom-nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  body.is-drawer-open .ml-bottom-nav { display: none; }
}

/* ---------- Skeleton loading (public/js/skeleton.js) ---------- */
.ml-sk { display: block; border-radius: 8px; background-color: var(--ml-surface-2); background-image: linear-gradient(90deg, transparent 0, color-mix(in srgb, var(--ml-surface) 70%, transparent) 50%, transparent 100%); background-size: 200% 100%; background-repeat: no-repeat; background-position: 200% 0; animation: ml-sk-shimmer 1.4s ease-in-out infinite; }
@keyframes ml-sk-shimmer { to { background-position: -100% 0; } }
.ml-sk-line { height: 14px; width: 100%; }
.ml-sk-line--sm { height: 11px; }
.ml-sk-line--lg { height: 20px; }
.ml-sk-line--xl { height: 28px; }
.ml-sk-circle { border-radius: 50%; flex: none; }
.ml-sk-pill { height: 32px; border-radius: 16px; }
.ml-sk-block { border-radius: 12px; }
.ml-sk-row { display: flex; align-items: center; gap: 12px; }
.ml-sk-stack { display: grid; gap: 8px; min-width: 0; }
.ml-sk-card { padding: 20px; }
.ml-sk-lib { overflow: hidden; border-radius: 16px; list-style: none; }
.ml-sk-hero { overflow: hidden; }
.ml-sk-hero__body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 28px; padding: 0 32px 28px; }
.ml-sk-hero__avatar { flex: none; width: 128px; height: 128px; margin-top: -40px; border-radius: 50%; border: 5px solid var(--ml-surface); }
.ml-navigating .ml-sk-shell, .ml-navigating .ml-main[aria-busy] { cursor: progress; }
.ml-main[aria-busy] { pointer-events: none; }
@media (max-width: 860px) {
  .ml-sk-hero__body { padding: 0 16px 20px; }
  .ml-sk-card { padding: 16px; }
}

/* Chuyen trang kieu cross-document: header/bottom-nav giu nguyen, noi dung doi bang crossfade ngan (Chrome/Edge/Safari moi; trinh duyet khac bo qua) */
@view-transition { navigation: auto; }
.ml-header { view-transition-name: ml-header; }
.ml-bottom-nav { view-transition-name: ml-bottom-nav; }
::view-transition-group(ml-header), ::view-transition-group(ml-bottom-nav) { animation-duration: 0s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
/* Mobile: header an khi cuon xuong, hien lai khi cuon len (class do community.js gan) */
@media (max-width: 860px) {
  .ml-header { transition: transform .25s ease; }
  .ml-header.is-hidden { transform: translateY(-100%); }
  /* Mo chi tiet bai viet: trang moi truot tu phai sang, trang cu lui nhe sang trai */
  @keyframes ml-slide-in { from { transform: translateX(100%); } to { transform: none; } }
  @keyframes ml-slide-out { to { transform: translateX(-25%); opacity: .6; } }
  html:has(.ml-page--post)::view-transition-new(root) { animation: ml-slide-in .3s cubic-bezier(.22, .8, .3, 1) both; z-index: 2; }
  html:has(.ml-page--post)::view-transition-old(root) { animation: ml-slide-out .3s ease both; }
  html:has(.ml-page--post) .ml-header { view-transition-name: none; }
  html:has(.ml-page--post) .ml-bottom-nav { view-transition-name: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ml-header { transition: none; }
  html:has(.ml-page--post)::view-transition-new(root), html:has(.ml-page--post)::view-transition-old(root) { animation: none; }
  .ml-sk { animation: none; }
  @view-transition { navigation: none; }
}

/* ---------- notifications: dropdown (desktop) + trang /notifications (mobile) ---------- */
.ml-notif-wrap { position: relative; }
.ml-notif-btn { position: relative; }
.ml-notif-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--ml-red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; pointer-events: none; }
.ml-notif-badge[hidden] { display: none; }
.ml-bottom-nav__item { position: relative; }
.ml-bottom-nav__item .ml-notif-badge { top: 8px; right: calc(50% - 22px); }
.ml-notif-menu { width: min(400px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.ml-notif-menu .ml-notif__list { max-height: min(60vh, 520px); overflow-y: auto; }
.ml-notif-page { padding: 0; overflow: hidden; }
.ml-notif__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--ml-border); }
.ml-notif__title { margin: 0; font-size: 17px; font-weight: 700; }
.ml-notif__filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--ml-border); }
.ml-notif__filters [aria-pressed="true"] { background: var(--ml-primary-soft); color: var(--ml-primary-ink); border-color: var(--ml-primary); }
.ml-notif__tools { display: flex; align-items: center; gap: 2px; }
.ml-notif__tools .ml-icon-btn[hidden] { display: none; }
.ml-notif__push span { display: inline-grid; }
.ml-notif__push span[hidden] { display: none; }
.ml-notif__prompt { display: grid; gap: 6px; padding: 12px 16px; background: var(--ml-primary-soft); border-bottom: 1px solid var(--ml-border); font-size: 14px; }
.ml-notif__prompt p { margin: 0; color: var(--ml-text-2); }
.ml-notif__prompt-actions { display: flex; gap: 8px; margin-top: 4px; }
.ml-notif__list { list-style: none; margin: 0; padding: 0; }
.ml-notif__row { position: relative; }
.ml-notif__remove { position: absolute; top: 50%; right: 6px; width: 32px; height: 32px; transform: translateY(-50%); opacity: 0; }
.ml-notif__row:hover .ml-notif__remove, .ml-notif__remove:focus-visible { opacity: 1; }
@media (hover: none) { .ml-notif__remove { opacity: 1; } }
.ml-notif__remove:hover { background: var(--ml-surface-2); color: var(--ml-text); }
.ml-notif__item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 44px 12px 16px; border-bottom: 1px solid var(--ml-border); color: inherit; text-decoration: none; }
.ml-notif__item:hover { background: var(--ml-surface-2); }
.ml-notif__item.is-unread { background: color-mix(in srgb, var(--ml-primary-soft) 55%, transparent); }
.ml-notif__img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--ml-surface-2); display: grid; place-items: center; color: var(--ml-primary-ink); }
.ml-notif__body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.ml-notif__text { font-size: 14px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.ml-notif__detail { font-size: 13px; color: var(--ml-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-notif__time { font-size: 12px; color: var(--ml-muted); }
.ml-notif__dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--ml-primary); }
.ml-notif__empty { margin: 0; padding: 28px 20px; text-align: center; color: var(--ml-muted); font-size: 14px; }
.ml-notif__empty[hidden], .ml-notif__more[hidden], .ml-notif__prompt[hidden] { display: none; }
.ml-notif__more { display: block; margin: 12px auto; }

/* ---------- Banner sat header + ambient light (game / cong dong / ca nhan) ---------- */
/* Anh bia lam mo lan ra nen quanh trang (nhu YouTube ambient mode), mo dan ve --ml-bg o phia duoi */
.ml-ambient { position: absolute; top: var(--ml-header-h); left: 0; right: 0; z-index: 0; height: 820px; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); }
.ml-ambient__img { position: absolute; inset: -12% -6%; background: var(--tier, var(--ml-primary)) center / cover no-repeat; filter: blur(100px) saturate(1.6); opacity: .42; transform: translateZ(0); animation: ml-ambient-in .9s ease-out both; }
[data-theme="dark"] .ml-ambient__img { opacity: .62; filter: blur(100px) saturate(1.4) brightness(.9); }
@keyframes ml-ambient-in { from { opacity: 0; } }
.ml-detail { position: relative; z-index: 1; }

.ml-detail--flush { padding-top: 0; }
.ml-detail--flush > .ml-gd-hero, .ml-detail--flush > .ml-pf-hero { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; box-shadow: 0 24px 48px -28px rgba(20, 21, 26, .35); }
[data-theme="dark"] .ml-detail--flush > .ml-gd-hero, [data-theme="dark"] .ml-detail--flush > .ml-pf-hero { box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .6); }
.ml-detail--flush .ml-pf-hero__cover { height: 260px; }

/* Nut quay lai + breadcrumb dang pill kinh mo de len goc trai anh bia */
.ml-gd-hero { position: relative; }
.ml-gd-hero__art::before { content: ""; position: absolute; inset: 0 0 auto; height: 110px; background: linear-gradient(rgba(10, 11, 15, .42), transparent); pointer-events: none; }
.ml-gd-hero > .ml-detail__top { position: absolute; top: 16px; left: 16px; right: 16px; z-index: 2; pointer-events: none; transition: opacity .2s; }
.ml-gd-hero > .ml-detail__top > * { pointer-events: auto; }
.ml-gd-hero .ml-back, .ml-gd-hero .ml-crumbs { border: 1px solid rgba(255, 255, 255, .16); background: rgba(14, 15, 20, .42); color: #fff; -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.ml-gd-hero .ml-back:hover { border-color: rgba(255, 255, 255, .32); background: rgba(14, 15, 20, .6); color: #fff; }
.ml-gd-hero .ml-crumbs { display: flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 18px; }
.ml-gd-hero .ml-crumbs ol { color: rgba(255, 255, 255, .72); }
.ml-gd-hero .ml-crumbs li + li::before { color: rgba(255, 255, 255, .4); }
.ml-gd-hero .ml-crumbs a:hover, .ml-gd-hero .ml-crumbs [aria-current] { color: #fff; }
.ml-gd-hero.is-art-editing > .ml-detail__top { opacity: 0; visibility: hidden; }

@media (max-width: 860px) {
  .ml-ambient { height: 520px; }
  .ml-ambient__img, [data-theme="dark"] .ml-ambient__img { filter: blur(60px) saturate(1.5); }
  /* Mobile: banner tran vien, chi bo goc duoi */
  .ml-detail--flush > .ml-gd-hero, .ml-detail--flush > .ml-pf-hero { margin: 0 -16px; border-left: 0; border-right: 0; border-radius: 0 0 var(--ml-radius-card) var(--ml-radius-card); }
  .ml-detail--flush .ml-pf-hero__cover { height: 150px; }
  .ml-gd-hero > .ml-detail__top { top: 10px; left: 12px; right: 12px; }
  .ml-gd-hero .ml-crumbs { display: none; }
}

.ml-compose__draft-status, .ml-compose__draft-hint { font-size: 12px; line-height: 1.5; color: var(--ml-muted, #888); margin: 8px 0 0; }

/* Locally hidden feed posts keep an accessible undo action. */
.ml-post__hidden-note { display: none; align-items: center; justify-content: space-between; gap: 12px; color: var(--ml-text-2); font-size: 14px; }
.ml-post.is-locally-hidden > :not(.ml-post__hidden-note) { display: none !important; }
.ml-post.is-locally-hidden > .ml-post__hidden-note { display: flex; }
.ml-post__hidden-note button { flex-shrink: 0; }
