/* =====================================================================
   Hatlx vertical card feed  (v8)
   1. Tokens (dark default + light)   2. Page + stage   3. Card
   4. Top bar   5. Action rail   6. Caption   7. Progress / tap feedback
   8. Feed nav, hint, status   9. Explore box   10. Comments sheet
   11. Misc helpers   12. Animations   13. Responsive   14. Motion
   ===================================================================== */

/* 1. Tokens ------------------------------------------------------------ */
:root {
  /* dark is the default, even before JS runs */
  --hx-page-bg: #0a0b0f;
  --hx-glow-a: rgb(22 131 255 / .16);
  --hx-glow-b: rgb(255 95 162 / .10);
  --hx-surface: rgb(20 22 29 / .84);
  --hx-surface-solid: #15171d;
  --hx-surface-2: #1d2029;
  --hx-surface-3: #262a35;
  --hx-line: rgb(255 255 255 / .08);
  --hx-line-strong: rgb(255 255 255 / .14);
  --hx-text: #f4f6fa;
  --hx-muted: #8e95a3;
  --hx-accent: #4b9dff;
  --hx-accent-hover: #74b3ff;
  --hx-like: #ff3b6b;
  --hx-gold: #ffc94d;
  --hx-ok: #22d3a0;
  --hx-grad: linear-gradient(135deg, #1683ff 0%, #7c5cff 55%, #ff5fa2 100%);
  --hx-card-shadow: 0 30px 70px -24px rgb(0 0 0 / .95), 0 0 0 1px rgb(255 255 255 / .06);
  --hx-float-shadow: 0 24px 60px -18px rgb(0 0 0 / .75), 0 0 0 1px rgb(255 255 255 / .04);
  --hx-on-media: #fff;
  --hx-icon-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .35)) drop-shadow(0 2px 8px rgb(0 0 0 / .35));
  --hx-text-shadow: 0 1px 2px rgb(0 0 0 / .6), 0 0 10px rgb(0 0 0 / .25);

  --hx-gutter: 10px;
  --hx-radius: 24px;
  --hx-card-gap: 18px;
  --hx-rail-icon: 32px;
  --hx-card-ratio: .5625; /* 9:16 */
  color-scheme: dark;
}

html[data-hx-background="light"] {
  --hx-page-bg: #eef1f6;
  --hx-glow-a: rgb(22 131 255 / .12);
  --hx-glow-b: rgb(124 92 255 / .10);
  --hx-surface: rgb(255 255 255 / .88);
  --hx-surface-solid: #ffffff;
  --hx-surface-2: #f3f5f9;
  --hx-surface-3: #e7ebf2;
  --hx-line: rgb(15 23 42 / .08);
  --hx-line-strong: rgb(15 23 42 / .14);
  --hx-text: #131722;
  --hx-muted: #636b7a;
  --hx-accent: #1683ff;
  --hx-accent-hover: #0868ef;
  --hx-like: #ff2d55;
  --hx-card-shadow: 0 28px 60px -24px rgb(15 23 42 / .55), 0 0 0 1px rgb(15 23 42 / .06);
  --hx-float-shadow: 0 22px 50px -18px rgb(15 23 42 / .35), 0 0 0 1px rgb(15 23 42 / .04);
  color-scheme: light;
}

/* 2. Page + stage ------------------------------------------------------ */
body.hx-feed-page { background: var(--hx-page-bg); transition: background-color .3s ease; }

#video-container {
  --hx-vh: 100vh;
  --hx-feed-offset: var(--hx-desktop-offset, 76px);
  position: relative;
  width: 100%;
  height: calc(var(--hx-vh) - var(--hx-feed-offset));
  min-height: 0;
  margin: 0;
  padding: var(--hx-gutter);
  box-sizing: border-box;
  overflow: hidden;               /* clips the cards above/below the viewport */
  background:
    radial-gradient(55% 45% at 50% -5%, var(--hx-glow-a), transparent 70%),
    radial-gradient(35% 40% at 92% 105%, var(--hx-glow-b), transparent 70%),
    var(--hx-page-bg);
}
@supports (height: 100dvh) { #video-container { --hx-vh: 100dvh; } }

#hxSwipeStage {
  position: relative;
  width: min(100%, calc((var(--hx-vh) - var(--hx-feed-offset) - 2 * var(--hx-gutter)) * var(--hx-card-ratio)));
  height: 100%;
  margin: 0 auto;
  outline: none;
}

#video-row {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  touch-action: none;             /* vertical drag is handled in JS */
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

/* 3. Card -------------------------------------------------------------- */
#video-row .video-item {
  position: absolute;
  inset: 0;
  border-radius: var(--hx-radius);
  background: #000;
  box-shadow: var(--hx-card-shadow);
  overflow: hidden;
  transform-origin: 50% 50%;
  transition: transform .44s cubic-bezier(.22, .8, .24, 1);
  will-change: transform;
  backface-visibility: hidden;
  contain: layout style;
}
#video-row.is-dragging .video-item { transition: none; }
#video-row .video-item:not(.is-current) { box-shadow: none; }

#video-row .video-box {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #000;
  overflow: hidden;
  isolation: isolate;
}
.card-ui { display: contents; }

/* top + bottom scrims travel with the card */
#video-row .video-box::before,
#video-row .video-box::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}
#video-row .video-box::before { top: 0; height: 120px; background: linear-gradient(rgb(0 0 0 / .45), transparent); }
#video-row .video-box::after  { bottom: 0; height: 46%; background: linear-gradient(transparent, rgb(0 0 0 / .2) 40%, rgb(0 0 0 / .72)); }

#video-row video.video-responsive {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  cursor: pointer;
}

/* 4. Top bar ----------------------------------------------------------- */
#hxSwipeStage .hx-video-actions {
  position: absolute;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top, 0px)) 8px 0 16px;
  pointer-events: none;
}
#hxSwipeStage .hx-video-actions > * { pointer-events: auto; }

.hx-tabs { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hx-top-action {
  position: relative;
  padding: 6px 0;
  color: rgb(255 255 255 / .72);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  text-shadow: var(--hx-text-shadow);
  white-space: nowrap;
  transition: color .15s ease;
}
.hx-top-action:hover { color: #fff; }
.hx-top-action.is-active { color: #fff; }
.hx-top-action.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgb(0 0 0 / .4);
}

.hx-top-tools { display: flex; align-items: center; gap: 2px; }
.hx-tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s ease, opacity .15s ease;
}
.hx-tool svg { width: 24px; height: 24px; filter: var(--hx-icon-shadow); }
.hx-tool:hover { opacity: .85; }
.hx-tool:active { transform: scale(.88); }

.hx-theme-toggle .hx-theme-sun { display: block; }
.hx-theme-toggle .hx-theme-moon { display: none; }
html[data-hx-background="light"] .hx-theme-toggle .hx-theme-sun { display: none; }
html[data-hx-background="light"] .hx-theme-toggle .hx-theme-moon { display: block; }


.hx-explore-toggle .hx-ping {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hx-grad);
  box-shadow: 0 0 0 2px rgb(0 0 0 / .25);
}
.hx-explore-toggle .hx-ping::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #ff5fa2;
  animation: hxPing 1.8s ease-out infinite;
}
.hx-explore-toggle[aria-expanded="true"] .hx-ping,
.hx-explore-toggle.is-seen .hx-ping { display: none; }

/* 5. Action rail ------------------------------------------------------- */
#video-row .right-box {
  position: absolute;
  right: 4px;
  bottom: 96px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.right-box li { display: flex; flex-direction: column; align-items: center; }

#video-row .icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 52px;
  padding: 0;
  border: 0;
  background: none;                /* no circle behind icons */
  color: var(--hx-on-media);
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  transition: transform .15s ease;
}
#video-row .icon-btn svg {
  display: block;
  width: var(--hx-rail-icon);
  height: var(--hx-rail-icon);
  fill: currentColor;
  filter: var(--hx-icon-shadow);
  transition: color .2s ease, transform .2s ease;
}
#video-row .icon-btn:active svg { transform: scale(.86); }
#video-row .icon-btn.is-small svg { width: 26px; height: 26px; }

#video-row .stat-label {
  color: var(--hx-on-media);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: var(--hx-text-shadow);
  pointer-events: none;
}

#video-row .like-btn.liked { color: var(--hx-like); }
#video-row .like-btn.liked svg { animation: hxPop .38s cubic-bezier(.2, .9, .3, 1.4); }
#video-row .gift-pill { color: #ffd35a; }
#video-row .gift-pill svg { animation: none; }
.video-item.is-current .gift-pill svg { animation: hxWiggle 3.2s ease-in-out infinite; }

/* collapsible extras (search / report) */
#video-row .right-box > .toggle-item { display: none; }
#video-row .right-box > .toggle-item.is-visible { display: flex; animation: hxRise .22s ease both; }
#video-row .actions-toggle svg { transition: transform .25s ease; }
#video-row .actions-toggle.is-open svg { transform: rotate(90deg); }

/* creator avatar + follow */
#video-row .avatar-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
  text-decoration: none;
}
#video-row .avatar-ring {
  display: block;
  width: 48px;
  height: 48px;
  padding: 2px;
  border-radius: 50%;
  background: var(--hx-grad);
  box-shadow: 0 4px 14px rgb(0 0 0 / .35);
}
#video-row .avatar-ring img {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #000;
  border-radius: 50%;
  background: #222;
  object-fit: cover;
  box-sizing: border-box;
}
#video-row .follow-text {
  position: absolute;
  left: 50%;
  bottom: -9px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--hx-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgb(0 0 0 / .35);
  transition: transform .15s ease, filter .15s ease;
}
#video-row .follow-text svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; }
#video-row .avatar-frame:active .follow-text { transform: translateX(-50%) scale(.92); }

/* 6. Caption ----------------------------------------------------------- */
#video-row .description-box {
  position: absolute;
  left: 16px;
  right: 76px;
  bottom: 30px;
  z-index: 20;
  color: var(--hx-on-media);
  text-shadow: var(--hx-text-shadow);
  pointer-events: none;
}
#video-row .description-box a,
#video-row .description-box .desc-text { pointer-events: auto; }

#video-row .mini-ad-cube {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  padding: 5px 10px 5px 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgb(255 255 255 / .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgb(255 255 255 / .2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-shadow: none;
}
#video-row .mini-ad-cube svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#video-row .mini-ad-cube .hx-ad-tag {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--hx-gold);
  color: #1a1300;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
}
#video-row .mini-ad-cube::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .35) 50%, transparent 70%);
  transform: translateX(-100%);
  pointer-events: none;
}
.video-item.is-current .mini-ad-cube::after { animation: hxShine 3s ease-in-out 1s infinite; }

#video-row .user-tag {
  display: block;
  max-width: 100%;
  margin-bottom: 4px;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#video-row .user-tag:hover { text-decoration: underline; }
#video-row .desc-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.4;
  opacity: .95;
  cursor: pointer;
}
#video-row .desc-text.is-expanded { -webkit-line-clamp: 8; }
#video-row .desc-text:empty { display: none; }

/* 7. Progress + tap feedback ------------------------------------------ */
.hx-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  z-index: 25;
  height: 18px;
  cursor: pointer;
  touch-action: none;
}
.hx-progress::before,
.hx-progress-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 3px;
  transition: height .15s ease, margin .15s ease;
}
.hx-progress::before { background: rgb(255 255 255 / .22); }
.hx-progress-fill {
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 50%;
  box-shadow: 0 0 8px rgb(255 255 255 / .35);
}
.hx-progress:hover::before, .hx-progress:hover .hx-progress-fill,
.hx-progress.is-seeking::before, .hx-progress.is-seeking .hx-progress-fill { height: 5px; margin-top: -2.5px; }

.hx-flash {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hx-flash svg {
  width: 72px;
  height: 72px;
  fill: #fff;
  opacity: 0;
  filter: drop-shadow(0 4px 18px rgb(0 0 0 / .45));
}
.hx-flash.is-flashing svg { animation: hxFlashIcon .6s ease-out both; }
.video-item.is-paused .hx-flash svg { opacity: .92; animation: none; }

.hx-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 21;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 3px solid rgb(255 255 255 / .25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.video-item.is-buffering .hx-spinner { animation: hxSpin .8s linear infinite, hxFadeIn .2s ease .35s forwards; }

.hx-burst {
  position: absolute;
  z-index: 30;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  pointer-events: none;
  animation: hxBurst .85s cubic-bezier(.2, .9, .3, 1.2) forwards;
}
.hx-burst svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 20px rgb(255 45 85 / .55)); }

/* 8. Feed nav, hint, status -------------------------------------------- */
.hx-feed-nav {
  position: absolute;
  top: 50%;
  left: calc(100% + 20px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
}
.hx-video-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hx-line);
  border-radius: 14px;
  background: var(--hx-surface-2);
  color: var(--hx-text);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, color .15s ease;
}
.hx-video-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hx-video-arrow:hover:not(:disabled) { border-color: var(--hx-accent); color: var(--hx-accent); }
.hx-video-arrow:active:not(:disabled) { transform: scale(.92); }
.hx-video-arrow:disabled { opacity: .35; cursor: default; }
.hx-feed-count {
  color: var(--hx-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* shown only when the browser blocked sound; any tap turns sound on */
.hx-unmute-chip {
  position: absolute;
  left: 16px;
  top: calc(max(12px, env(safe-area-inset-top, 0px)) + 44px);
  z-index: 41;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 9px;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 999px;
  background: rgb(0 0 0 / .42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  animation: hxRise .3s ease both;
}
.hx-unmute-chip svg { width: 15px; height: 15px; fill: currentColor; }

#hxFeedStatus {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 42;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgb(0 0 0 / .6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}
#hxFeedStatus:empty { display: none; }
#hxFeedRetry {
  position: absolute;
  top: calc(44% + 54px);
  left: 50%;
  z-index: 43;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--hx-grad);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
}
#hxSwipeStage [hidden] { display: none !important; }

/* 9. Explore box ------------------------------------------------------- */
.hx-video-integration { position: relative; width: 100%; height: 0; z-index: 1040; }

.hx-explore {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1052;
  width: 312px;
  max-width: calc(100vw - 24px);
  padding: 12px 12px 10px;
  box-sizing: border-box;
  border: 1px solid var(--hx-line);
  border-radius: 22px;
  background: var(--hx-surface);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: var(--hx-float-shadow);
  color: var(--hx-text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(.96);
  transform-origin: 100% 100%;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, .9, .3, 1.15), visibility 0s linear .3s;
}
.hx-explore.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, .9, .3, 1.15), visibility 0s;
}
.hx-explore::before {   /* gradient hairline across the top */
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4b9dff, #ff5fa2, transparent);
  opacity: .9;
}

.hx-ex-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hx-ex-logo {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--hx-grad);
  box-shadow: 0 6px 16px -6px rgb(124 92 255 / .8);
}
.hx-ex-logo svg { width: 19px; height: 19px; fill: #fff; }
.hx-ex-titles { flex: 1; min-width: 0; }
.hx-ex-titles h2 { margin: 0; color: var(--hx-text); font-size: 14.5px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hx-ex-titles p { margin: 1px 0 0; color: var(--hx-muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
.hx-ex-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hx-muted);
  cursor: pointer;
  transition: color .15s ease, transform .15s ease;
}
.hx-ex-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hx-ex-close:hover { color: var(--hx-text); }
.hx-ex-close:active { transform: scale(.88); }

/* sections: Services on top, Rewards below */
.hx-ex-section + .hx-ex-section { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hx-line); }
.hx-ex-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hx-ex-section-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--hx-text);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.hx-ex-section-head h3 svg { width: 15px; height: 15px; }
.hx-ex-section-head .ic-services { fill: #22d3a0; }
.hx-ex-section-head .ic-rewards { fill: var(--hx-gold); }
.hx-see-all { color: var(--hx-accent); font-size: 11.5px; font-weight: 750; text-decoration: none; white-space: nowrap; transition: color .15s ease; }
.hx-see-all:hover { color: var(--hx-accent-hover); }
.hx-ex-track {
  display: flex;
  gap: 8px;
  margin: 0 -12px;
  padding: 7px 12px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 12px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent);
}
.hx-ex-track::-webkit-scrollbar { display: none; }

.hx-mini {
  position: relative;
  flex: 0 0 98px;
  overflow: hidden;
  border: 1px solid var(--hx-line);
  border-radius: 14px;
  background: var(--hx-surface-2);
  color: var(--hx-text);
  text-decoration: none;
  scroll-snap-align: start;
  transition: transform .2s ease, border-color .2s ease;
}
.hx-mini:hover { transform: translateY(-2px); border-color: var(--hx-line-strong); color: var(--hx-text); }
.hx-mini-media { position: relative; height: 58px; overflow: hidden; background: var(--hx-surface-3); }
.hx-mini-media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hx-mini-avatar {
  position: absolute;
  left: 7px;
  top: 47px;
  z-index: 2;
  width: 22px;
  height: 24px;
  padding: 1.5px;
  border-radius: 50%;
  background: var(--hx-grad);
}
.hx-mini-avatar img { display: block; width: 100%; height: 100%; border: 1.5px solid var(--hx-surface-2); border-radius: 50%; object-fit: cover; box-sizing: border-box; background: var(--hx-surface-3); }
.hx-mini-views {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgb(0 0 0 / .55);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
}
.hx-mini-views.is-new { background: var(--hx-grad); }
.hx-mini-body { padding: 7px 8px 8px; min-width: 0; }
.hx-mini.is-service .hx-mini-body { padding-top: 15px; }
.hx-mini-name { overflow: hidden; color: var(--hx-text); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.hx-mini-title { margin-top: 1px; overflow: hidden; color: var(--hx-muted); font-size: 10.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hx-mini-price { margin-top: 4px; color: var(--hx-muted); font-size: 9.5px; font-weight: 600; }
.hx-mini-price strong {
  font-size: 13px;
  font-weight: 900;
  background: var(--hx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* reward mini cards */
.hx-mini.is-reward .hx-mini-media {
  height: 66px;
  background: radial-gradient(120% 90% at 50% 30%, #1d5cff 0%, #12267a 50%, #070b24 100%);
}
.hx-reward-face {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8fe3ff, #ffc94d);
  box-shadow: 0 0 18px rgb(80 170 255 / .65);
  transform: translate(-50%, -56%);
}
.hx-reward-face img { display: block; width: 100%; height: 100%; border: 2px solid #0b1440; border-radius: 50%; object-fit: cover; box-sizing: border-box; }
.hx-reward-spark { position: absolute; z-index: 1; color: var(--hx-gold); font-size: 11px; text-shadow: 0 0 6px #ffcf5c; pointer-events: none; }
.hx-reward-spark.s1 { top: 10px; left: 12px; }
.hx-reward-spark.s2 { top: 22px; right: 12px; font-size: 9px; }
.hx-reward-crown { position: absolute; top: 4px; right: 5px; z-index: 3; font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
.hx-mini-amount {
  position: absolute;
  left: 6px;
  bottom: 5px;
  z-index: 3;
  padding: 1px 7px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ffe08a, #ffb627);
  color: #2a1a00;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  box-shadow: 0 2px 8px rgb(255 182 39 / .45);
}
.hx-reward-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(4px) brightness(.7); transform: scale(1.1); }
.hx-reward-video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
.hx-mini.has-video-frame .hx-reward-video { opacity: 1; }
.hx-reward-play {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.hx-reward-play svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 2px 8px rgb(0 0 0 / .6)); transition: transform .15s ease; }
.hx-reward-play:hover svg { transform: scale(1.12); }
.hx-mini.is-playing .hx-reward-play svg,
.hx-mini.is-playing .hx-mini-amount,
.hx-mini.is-playing .hx-reward-crown { opacity: 0; }
.hx-mini-status { display: flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--hx-muted); font-size: 9.5px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.hx-mini-status i { flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--hx-accent); box-shadow: 0 0 0 2px rgb(75 157 255 / .18); }
.hx-mini-status i.is-paid { background: var(--hx-ok); box-shadow: 0 0 0 2px rgb(34 211 160 / .18); }

/* skeleton + empty */
.hx-mini.is-skeleton { height: 112px; border-color: transparent; background: linear-gradient(100deg, var(--hx-surface-2) 30%, var(--hx-surface-3) 50%, var(--hx-surface-2) 70%) 0 0 / 300% 100%; animation: hxShimmer 1.3s linear infinite; }
.hx-ex-empty { flex: 1 0 100%; padding: 30px 8px; color: var(--hx-muted); font-size: 12px; font-weight: 600; text-align: center; }

.hx-ex-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--hx-line);
  font-size: 11.5px;
  font-weight: 700;
}
.hx-ex-foot a { color: var(--hx-muted); text-decoration: none; transition: color .15s ease; }
.hx-ex-foot a:hover { color: var(--hx-text); }

/* 10. Comments sheet --------------------------------------------------- */
.comments-section {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 64%;
  border-radius: 22px 22px 0 0;
  background: var(--hx-surface-solid);
  color: var(--hx-text);
  transform: translateY(calc(100% + 40px));
  visibility: hidden;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.1, .7, .1, 1), visibility 0s linear .32s;
}
.comments-section.active {
  transform: none;
  visibility: visible;
  pointer-events: auto;
  box-shadow: 0 -12px 34px rgb(0 0 0 / .35);
  transition: transform .32s cubic-bezier(.1, .7, .1, 1), visibility 0s;
}
.comments-section::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--hx-line-strong);
}
.comment-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; border-bottom: 1px solid var(--hx-line); }
.comment-header h5 { color: inherit; font-size: 15px; font-weight: 800; }
.close-comments { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--hx-muted); cursor: pointer; }
.close-comments svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.close-comments:hover { color: var(--hx-text); }
.comments-list { flex: 1; padding: 12px 16px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.comment-input-area { display: flex; gap: 8px; padding: 8px 12px max(12px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--hx-line); }
.comment-input-area .form-control,
.comments-section .reply-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--hx-line);
  background: var(--hx-surface-2);
  color: var(--hx-text);
}
.comment-input-area .form-control { height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; outline: none; }
.comment-input-area .form-control:focus { border-color: var(--hx-accent); }
.comment-input-area .form-control::placeholder { color: var(--hx-muted); }
.submit-comment {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hx-grad);
  color: #fff;
  cursor: pointer;
}
.submit-comment svg { width: 18px; height: 18px; fill: currentColor; }
.comment-item { margin-bottom: 14px; }
.comment-item .fw-bold { color: var(--hx-text); }
.nested-comments { margin-left: 40px; padding-left: 10px; border-left: 2px solid var(--hx-line); }
.nested-comments:empty { display: none; }
.comment-actions { display: flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--hx-muted); font-size: 12px; }
.comment-actions .like-comment-btn { display: inline-grid; place-items: center; cursor: pointer; color: var(--hx-muted); }
.comment-actions .like-comment-btn svg { width: 14px; height: 14px; fill: currentColor; }
.comment-actions .like-comment-btn.text-danger { color: var(--hx-like) !important; }
.comment-actions .like-count-span { margin-right: 12px; }
.comment-actions .reply-btn { cursor: pointer; }
.comment-actions .reply-btn:hover { color: var(--hx-text); }
.comments-section .text-muted { color: var(--hx-muted) !important; }
.reply-section { margin-top: 10px; }

.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgb(0 0 0 / .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

/* 11. Misc helpers (header search etc., used outside the feed) -------- */
.freelancer-icon { display: none; }
.toggle-search { display: none; }
.nav-search-btn { color: inherit; text-decoration: none; }
.searching-form { width: 100%; max-width: 650px; padding: 1px; border-radius: 50px; background: #fff; }
.searching-form .form-control,
.searching-form .form-select { border: 0; box-shadow: none; background: transparent; font-size: 1rem; }
.border-end-custom { border-right: 1px solid #e0e0e0; }
.feed-loader { padding: 20px; text-align: center; color: var(--hx-muted); }

#hxSwipeStage a:focus-visible,
#hxSwipeStage button:focus-visible,
#hxSwipeStage [role="button"]:focus-visible,
.hx-explore a:focus-visible,
.hx-explore button:focus-visible {
  outline: 2px solid var(--hx-accent);
  outline-offset: 2px;
  border-radius: 10px;
}

/* 12. Animations ------------------------------------------------------- */
@keyframes hxPop { 0% { transform: scale(.6); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes hxWiggle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 94% { transform: rotate(-6deg); } }
@keyframes hxRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hxShine { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }
@keyframes hxPing { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes hxFlashIcon { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes hxSpin { to { transform: rotate(360deg); } }
@keyframes hxFadeIn { to { opacity: 1; } }
@keyframes hxBurst {
  0% { opacity: 0; transform: scale(.3) rotate(var(--r, 0deg)); }
  25% { opacity: 1; transform: scale(1.15) rotate(var(--r, 0deg)); }
  45% { transform: scale(.95) rotate(var(--r, 0deg)); }
  100% { opacity: 0; transform: translateY(-70px) scale(1.25) rotate(var(--r, 0deg)); }
}
@keyframes hxBob { 0%, 100% { transform: translateY(6px); opacity: .6; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes hxShimmer { to { background-position: -300% 0; } }

/* 13. Responsive ------------------------------------------------------- */
@media (min-width: 992px) {
  :root { --hx-gutter: 14px; }
}
@media (min-width: 1400px) {
  :root { --hx-gutter: 18px; }
}

@media (max-width: 991.98px) {
  :root { --hx-gutter: 8px; --hx-radius: 20px; }
  #video-container {
    --hx-feed-offset: calc(var(--hx-mobile-bottom-nav, 58px) + var(--hx-feed-top-offset, 0px));
    padding-left: max(var(--hx-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--hx-gutter), env(safe-area-inset-right, 0px));
  }
  #hxSwipeStage { width: 100%; }
  .hx-feed-nav { display: none; }

  .hx-explore {
    left: 12px;
    right: 12px;
    bottom: calc(var(--hx-mobile-bottom-nav, 58px) + 14px);
    width: auto;
    max-width: 360px;
    margin: 0 auto;
    transform-origin: 50% 100%;
  }
  .hx-ex-titles p { display: none; }
  .hx-ex-logo { flex-basis: 30px; height: 30px; border-radius: 10px; }
}

@media (min-width: 600px) and (max-width: 991.98px) and (orientation: portrait) {
  #hxSwipeStage { width: min(100%, 560px); }
}

@media (max-width: 768px) {
  .freelancer-icon { display: block; }
  .toggle-search { display: flex; }
}
@media (min-width: 769px) {
  #video-row .right-box > .toggle-search.is-visible { display: none; }  /* header search is visible on desktop */
}

@media (max-width: 380px) {
  :root { --hx-rail-icon: 29px; --hx-radius: 18px; }
  .hx-tabs { gap: 11px; }
  .hx-top-action { font-size: 14px; }
  #hxSwipeStage .hx-video-actions { padding-left: 12px; padding-right: 4px; }
  .hx-tool { width: 36px; }
  #video-row .description-box { right: 66px; }
}

@media (max-height: 680px) {
  :root { --hx-rail-icon: 28px; }
  #video-row .right-box { gap: 8px; bottom: 80px; }
  #video-row .avatar-ring { width: 42px; height: 42px; }
}

@media (max-width: 991.98px) and (orientation: landscape) and (max-height: 500px) {
  #hxSwipeStage { width: min(100%, calc((var(--hx-vh) - var(--hx-feed-offset)) * 1.1)); }
  #video-row .description-box { right: 40%; }
  .hx-explore { bottom: 10px; }
}

/* 14. Motion + input preferences --------------------------------------- */
@media (pointer: coarse) {
  #video-row .video-item { contain: layout paint style; box-shadow: none; }
  #video-row .avatar-ring { box-shadow: none; }
  .hx-explore { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}

@media (prefers-reduced-motion: reduce) {
  #video-row .video-item,
  .comments-section,
  .modal-overlay,
  .hx-explore,
  #video-row .like-btn.liked svg,
  .video-item.is-current .gift-pill svg,
  .video-item.is-current .mini-ad-cube::after,
  .hx-explore-toggle .hx-ping::after,
  .hx-mini.is-skeleton { animation: none; }
}