/* HUA.RS mobile app experience: native-size controls, persistent tabs and feed states. */
.hua-mobile-refresh,
.hua-mobile-feed-loader,
.hua-mobile-skeleton {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --hua-mobile-tab-height: 60px;
    --hua-mobile-item-actions-height: 52px;
    --hua-mobile-touch: 48px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    -webkit-tap-highlight-color: rgba(201, 31, 47, .1);
    text-size-adjust: 100%;
  }

  main,
  section,
  article,
  aside,
  form,
  fieldset,
  .hua-page-content,
  .hua-page-content > #main,
  .hua-page-content > #sidebar,
  .hua-results-panel,
  .hua-results-list,
  .listing-card-list,
  .hua-vertical-card,
  .hua-vertical-card-body {
    min-width: 0;
  }

  img,
  video,
  canvas,
  svg {
    max-width: 100%;
  }

  table,
  pre,
  code {
    max-width: 100%;
  }

  table,
  pre {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  a,
  strong,
  span,
  dd,
  dt {
    overflow-wrap: anywhere;
  }

  html[data-hua-mobile-app="ready"] body button,
  html[data-hua-mobile-app="ready"] body [role="button"],
  html[data-hua-mobile-app="ready"] body input[type="submit"],
  html[data-hua-mobile-app="ready"] body input[type="button"],
  html[data-hua-mobile-app="ready"] body input[type="reset"],
  html[data-hua-mobile-app="ready"] body .hua-button {
    min-width: var(--hua-mobile-touch);
    min-height: var(--hua-mobile-touch) !important;
    touch-action: manipulation;
  }

  button,
  input,
  select,
  textarea {
    max-width: 100%;
    font-family: inherit;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
  select {
    min-height: var(--hua-mobile-touch) !important;
    font-size: 16px !important;
  }

  textarea {
    min-height: var(--hua-mobile-touch);
    font-size: 16px !important;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 22px;
    height: 22px;
    min-height: 0;
  }

  .hua-button,
  a.hua-button,
  .hua-category-child-grid > a,
  .hua-category-children > div:first-child > a,
  .hua-life-stage-topics > a,
  .hua-directory-card,
  .hua-taxonomy-browser a {
    min-height: var(--hua-mobile-touch);
  }

  .hua-category-children > div:first-child > a {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding-block: 8px;
  }

  .hua-bottom-nav {
    z-index: 1700;
    height: calc(var(--hua-mobile-tab-height) + env(safe-area-inset-bottom));
    padding: 3px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    border-top-color: rgba(211, 217, 226, .92);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -6px 22px rgba(17, 34, 58, .09);
  }

  .hua-bottom-nav > a {
    min-width: 0;
    min-height: 54px;
    justify-content: center;
    gap: 2px;
    padding: 2px 1px;
    border-radius: 13px;
    font-size: 10px;
    line-height: 1.1;
    touch-action: manipulation;
  }

  .hua-bottom-nav > a:active {
    background: #f7f8fb;
    transform: scale(.97);
  }

  .hua-bottom-nav > a > span {
    display: -webkit-box;
    width: 100%;
    max-width: 72px;
    min-height: 11px;
    overflow: hidden;
    text-align: center;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hua-bottom-nav > a > .hua-icon {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
  }

  .hua-bottom-publish b {
    width: 34px;
    height: 34px;
    margin-top: 0;
    flex: 0 0 34px;
    border-width: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #f42c38, #d91f2b);
    box-shadow: 0 5px 12px rgba(218, 35, 49, .24);
  }

  .hua-bottom-publish b .hua-icon {
    width: 18px;
    height: 18px;
  }

  .hua-bottom-publish > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body:not(.login):not(.register):not(.recover) {
    padding-bottom: calc(var(--hua-mobile-tab-height) + env(safe-area-inset-bottom));
  }

  html body.item:not(.item-post) {
    padding-bottom: calc(var(--hua-mobile-tab-height) + var(--hua-mobile-item-actions-height) + env(safe-area-inset-bottom)) !important;
  }

  body.item:not(.item-post) .hua-item-action-bar {
    z-index: 1650;
    bottom: calc(var(--hua-mobile-tab-height) + env(safe-area-inset-bottom));
    grid-template-columns: repeat(2, 48px) clamp(88px, 28vw, 112px) repeat(2, 48px);
    justify-content: space-between;
    gap: 0;
    min-height: var(--hua-mobile-item-actions-height);
    padding: 5px 6px;
  }

  body.item:not(.item-post) .hua-item-action-bar .hua-item-action {
    min-height: 52px;
  }

  body.item:not(.item-post) .hua-item-action-status {
    bottom: calc(100% + 6px);
  }

  body.item-post.hua-publish-mobile-ready {
    padding-bottom: calc(var(--hua-mobile-tab-height) + 74px + env(safe-area-inset-bottom)) !important;
  }

  .hua-header-actions > .hua-header-messages:not(.hua-header-notifications) {
    display: none !important;
  }

  body.item-post.hua-publish-mobile-ready .hua-bottom-nav {
    display: grid !important;
  }

  body.item-post.hua-publish-mobile-ready #content {
    padding-bottom: 174px;
  }

  body.item-post.hua-publish-mobile-ready .hua-publish-mobile-actions:not([hidden]) {
    z-index: 1650;
    bottom: calc(var(--hua-mobile-tab-height) + env(safe-area-inset-bottom));
    padding-top: 8px;
    padding-bottom: 8px;
  }

  body.item-post.hua-publish-mobile-ready .hua-publish-mobile-actions button {
    min-height: var(--hua-mobile-touch);
  }

  .hua-results-list > .listing-card-list,
  .hua-category-latest > .listing-card-list,
  .hua-seo-content > .listing-card-list,
  .hua-alert-matches > .listing-card-list,
  body.user-items .listing-card-list {
    display: grid;
    width: 100%;
    gap: 11px;
    margin: 0;
    padding: 0;
  }

  .hua-page-content .hua-seo-content.hua-home-width {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  .hua-results-list .hua-vertical-card,
  .hua-category-latest .hua-vertical-card,
  .hua-seo-content > .listing-card-list .hua-vertical-card,
  .hua-alert-matches .hua-vertical-card,
  body.user-items .hua-vertical-card {
    display: grid;
    width: 100%;
    min-height: 168px;
    overflow: hidden;
    border-radius: 16px;
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .hua-results-list .hua-vertical-card-media,
  .hua-results-list .hua-card-placeholder,
  .hua-category-latest .hua-vertical-card-media,
  .hua-category-latest .hua-card-placeholder,
  .hua-seo-content > .listing-card-list .hua-vertical-card-media,
  .hua-seo-content > .listing-card-list .hua-card-placeholder,
  .hua-alert-matches .hua-vertical-card-media,
  .hua-alert-matches .hua-card-placeholder,
  body.user-items .hua-vertical-card-media,
  body.user-items .hua-card-placeholder {
    width: 100%;
    height: 100%;
    min-height: 168px;
    aspect-ratio: auto;
  }

  .hua-results-list .hua-media-foreground,
  .hua-category-latest .hua-media-foreground,
  .hua-seo-content > .listing-card-list .hua-media-foreground,
  .hua-alert-matches .hua-media-foreground,
  body.user-items .hua-media-foreground {
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: cover;
  }

  .hua-results-list .hua-media-backdrop,
  .hua-category-latest .hua-media-backdrop,
  .hua-seo-content > .listing-card-list .hua-media-backdrop,
  .hua-alert-matches .hua-media-backdrop,
  body.user-items .hua-media-backdrop {
    display: none;
  }

  .hua-results-list .hua-vertical-card-body,
  .hua-category-latest .hua-vertical-card-body,
  .hua-seo-content > .listing-card-list .hua-vertical-card-body,
  .hua-alert-matches .hua-vertical-card-body,
  body.user-items .hua-vertical-card-body {
    min-height: 168px;
    padding: 11px 12px 10px;
  }

  .hua-results-list .hua-card-title,
  .hua-category-latest .hua-card-title,
  .hua-seo-content > .listing-card-list .hua-card-title,
  .hua-alert-matches .hua-card-title,
  body.user-items .hua-card-title {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.36;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hua-results-list .hua-card-price,
  .hua-category-latest .hua-card-price,
  .hua-seo-content > .listing-card-list .hua-card-price,
  .hua-alert-matches .hua-card-price,
  body.user-items .hua-card-price {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hua-results-list .hua-card-summary,
  .hua-category-latest .hua-card-summary,
  .hua-seo-content > .listing-card-list .hua-card-summary,
  .hua-alert-matches .hua-card-summary,
  body.user-items .hua-card-summary {
    display: none;
  }

  .hua-results-list .hua-card-topline,
  .hua-category-latest .hua-card-topline,
  .hua-seo-content > .listing-card-list .hua-card-topline,
  .hua-alert-matches .hua-card-topline,
  body.user-items .hua-card-topline,
  .hua-results-list .hua-card-footer,
  .hua-category-latest .hua-card-footer,
  .hua-seo-content > .listing-card-list .hua-card-footer,
  .hua-alert-matches .hua-card-footer,
  body.user-items .hua-card-footer {
    gap: 5px;
    font-size: 9px;
  }

  .hua-results-list .hua-card-topline > *,
  .hua-category-latest .hua-card-topline > *,
  .hua-seo-content > .listing-card-list .hua-card-topline > *,
  .hua-alert-matches .hua-card-topline > *,
  body.user-items .hua-card-topline > *,
  .hua-results-list .hua-card-footer > span,
  .hua-category-latest .hua-card-footer > span,
  .hua-seo-content > .listing-card-list .hua-card-footer > span,
  .hua-alert-matches .hua-card-footer > span,
  body.user-items .hua-card-footer > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The persistent bottom tab is the primary publish entry. Keep the drawer
     action secondary and compact instead of repeating a full-width CTA. */
  .hua-mobile-menu-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 8px 2px;
  }

  .hua-mobile-menu-actions > a {
    width: auto;
    min-width: 48px;
    min-height: 48px;
    flex: 0 1 auto;
    padding: 0 15px;
    border-radius: 14px;
    white-space: nowrap;
  }

  .hua-mobile-menu-actions > a:not(.hua-button) {
    flex: 1 1 auto;
  }

  .hua-mobile-menu-actions > .hua-mobile-menu-publish {
    display: inline-flex;
    width: auto;
    max-width: 148px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-inline: 15px;
    box-shadow: 0 7px 16px rgba(217, 31, 43, .18);
  }

  .hua-mobile-menu-publish .hua-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
  }

  .hua-mobile-menu-publish span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hua-results-list .hua-card-facts,
  .hua-category-latest .hua-card-facts,
  .hua-seo-content > .listing-card-list .hua-card-facts,
  .hua-alert-matches .hua-card-facts,
  body.user-items .hua-card-facts {
    display: grid;
    gap: 4px;
    margin-top: 6px;
    grid-template-columns: minmax(0, 1fr);
  }

  .hua-results-list .hua-card-facts > div,
  .hua-category-latest .hua-card-facts > div,
  .hua-seo-content > .listing-card-list .hua-card-facts > div,
  .hua-alert-matches .hua-card-facts > div,
  body.user-items .hua-card-facts > div {
    width: 100%;
    min-width: 0;
    padding: 3px 6px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hua-results-list .hua-card-facts > div:nth-child(n+3),
  .hua-category-latest .hua-card-facts > div:nth-child(n+3),
  .hua-seo-content > .listing-card-list .hua-card-facts > div:nth-child(n+3),
  .hua-alert-matches .hua-card-facts > div:nth-child(n+3),
  body.user-items .hua-card-facts > div:nth-child(n+3) {
    display: none;
  }

  .hua-results-list .hua-card-footer,
  .hua-category-latest .hua-card-footer,
  .hua-seo-content > .listing-card-list .hua-card-footer,
  .hua-alert-matches .hua-card-footer,
  body.user-items .hua-card-footer {
    margin-top: auto;
    padding-top: 6px;
  }

  .hua-results-list .hua-card-badge,
  .hua-category-latest .hua-card-badge,
  .hua-seo-content > .listing-card-list .hua-card-badge,
  .hua-alert-matches .hua-card-badge,
  body.user-items .hua-card-badge {
    top: 7px;
    left: 7px;
    max-width: calc(100% - 14px);
    padding: 5px 7px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hua-filter-panel .hua-filter-form {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.hua-filter-open .hua-bottom-nav {
    display: none !important;
  }

  .hua-filter-mobile-head,
  .hua-filter-mobile-head > button,
  .hua-filter-mobile-head > a,
  .hua-filter-field input,
  .hua-filter-field select,
  .hua-filter-actions > a,
  .hua-filter-actions .hua-filter-submit {
    min-height: var(--hua-mobile-touch);
  }

  .hua-filter-mobile-head > button,
  .hua-location-dialog > header > button,
  .hua-language-dialog > header > button,
  .hua-item-report-dialog header button,
  .hua-publish-preview > header button {
    width: var(--hua-mobile-touch) !important;
    height: var(--hua-mobile-touch) !important;
    min-width: var(--hua-mobile-touch);
  }

  .hua-location-dialog,
  .hua-language-dialog,
  .hua-filter-panel,
  dialog.hua-item-report-dialog,
  dialog.hua-publish-preview {
    max-width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    overscroll-behavior: contain;
  }

  dialog:not([open]) {
    display: none;
  }

  .hua-publish-preview > footer > button,
  .hua-publish-verticals > header button,
  .hua-category-picker-grid [data-hua-category-options] > button,
  .hua-publish-draft button {
    min-height: var(--hua-mobile-touch) !important;
  }

  .hua-photo-upload .qq-upload-list img,
  .hua-publish-preview-photos img,
  .hua-message-media-grid img,
  .hua-comment-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hua-message-tools button,
  .hua-message-tools label,
  .hua-message-send,
  .hua-message-mobile-back,
  .hua-message-menu > summary {
    width: var(--hua-mobile-touch);
    height: var(--hua-mobile-touch);
    min-width: var(--hua-mobile-touch);
    min-height: var(--hua-mobile-touch);
  }

  .hua-message-composer textarea {
    min-height: var(--hua-mobile-touch) !important;
  }

  .hua-message-emoji-picker {
    max-width: calc(100vw - 24px);
    grid-template-columns: repeat(5, 44px);
  }

  .hua-message-emoji-picker button {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .hua-mobile-refresh {
    position: fixed;
    z-index: 1800;
    top: max(6px, env(safe-area-inset-top));
    left: 50%;
    display: flex;
    min-height: 42px;
    max-width: calc(100vw - 28px);
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(214, 221, 230, .9);
    border-radius: 999px;
    color: #253348;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 28px rgba(17, 34, 58, .16);
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -64px);
    transition: transform .16s ease, opacity .16s ease;
  }

  .hua-mobile-refresh.is-visible {
    opacity: 1;
  }

  .hua-mobile-refresh.is-refreshing {
    transform: translate(-50%, 0) !important;
  }

  .hua-mobile-refresh > i,
  .hua-mobile-feed-loader > i,
  .is-hua-submitting [type="submit"]::after {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid #d9e0e8;
    border-top-color: var(--hua-red);
    border-radius: 50%;
  }

  .hua-mobile-refresh.is-refreshing > i,
  .hua-mobile-feed-loader.is-loading > i,
  .is-hua-submitting [type="submit"]::after {
    animation: hua-mobile-spin .72s linear infinite;
  }

  .hua-mobile-feed-loader {
    display: grid;
    width: 100%;
    min-height: 82px;
    align-items: center;
    justify-items: center;
    gap: 8px;
    padding: 12px 0 8px;
    color: #6b7788;
    font-size: 12px;
  }

  .hua-mobile-feed-loader > i {
    display: none;
  }

  .hua-mobile-feed-loader.is-loading > i {
    display: block;
  }

  .hua-mobile-feed-loader button {
    min-width: min(220px, 76vw);
    min-height: var(--hua-mobile-touch);
    padding: 0 20px;
    border: 1px solid #d8dee7;
    border-radius: 14px;
    color: #1f3555;
    background: #fff;
    font-weight: 850;
  }

  .hua-mobile-feed-loader.is-loading button,
  .hua-mobile-feed-loader.is-complete button {
    display: none;
  }

  .hua-mobile-feed-loader [data-hua-feed-sentinel] {
    width: 100%;
    height: 1px;
  }

  .hua-pagination.is-hua-infinite {
    display: none;
  }

  .hua-mobile-skeleton {
    display: grid;
    min-height: 168px;
    overflow: hidden;
    border: 1px solid #edf0f4;
    border-radius: 16px;
    background: #fff;
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .hua-mobile-skeleton > i,
  .hua-mobile-skeleton > span > i {
    display: block;
    background: linear-gradient(100deg, #eef1f5 20%, #f8f9fb 40%, #eef1f5 60%);
    background-size: 220% 100%;
    animation: hua-mobile-shimmer 1.2s ease-in-out infinite;
  }

  .hua-mobile-skeleton > span {
    display: grid;
    align-content: start;
    gap: 11px;
    padding: 16px 13px;
  }

  .hua-mobile-skeleton > span > i {
    height: 12px;
    border-radius: 7px;
  }

  .hua-mobile-skeleton > span > i:nth-child(1) { width: 55%; }
  .hua-mobile-skeleton > span > i:nth-child(2) { width: 92%; height: 18px; }
  .hua-mobile-skeleton > span > i:nth-child(3) { width: 68%; }

  html.hua-mobile-navigating::before {
    position: fixed;
    z-index: 2200;
    top: 0;
    left: 0;
    width: 72%;
    height: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, var(--hua-red), var(--hua-blue));
    box-shadow: 0 1px 8px rgba(201, 31, 47, .25);
    content: "";
    animation: hua-mobile-progress 1.05s ease-in-out infinite;
  }

  .is-hua-submitting [type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: progress;
  }

  .is-hua-submitting [type="submit"]::after {
    display: inline-block;
    border-color: rgba(255, 255, 255, .45);
    border-top-color: currentColor;
    content: "";
  }
}

@media (max-width: 350px) {
  body.item:not(.item-post) .hua-item-action-bar {
    grid-template-columns: repeat(2, 48px) clamp(82px, 27vw, 92px) repeat(2, 48px);
    justify-content: space-between;
    gap: 0;
    padding-inline: 5px;
  }

  .hua-results-list .hua-vertical-card,
  .hua-category-latest .hua-vertical-card,
  .hua-seo-content > .listing-card-list .hua-vertical-card,
  .hua-alert-matches .hua-vertical-card,
  body.user-items .hua-vertical-card,
  .hua-mobile-skeleton {
    min-height: 158px;
    grid-template-columns: 102px minmax(0, 1fr);
  }

  .hua-results-list .hua-vertical-card-media,
  .hua-results-list .hua-card-placeholder,
  .hua-results-list .hua-vertical-card-body,
  .hua-category-latest .hua-vertical-card-media,
  .hua-category-latest .hua-card-placeholder,
  .hua-category-latest .hua-vertical-card-body,
  .hua-seo-content > .listing-card-list .hua-vertical-card-media,
  .hua-seo-content > .listing-card-list .hua-card-placeholder,
  .hua-seo-content > .listing-card-list .hua-vertical-card-body,
  .hua-alert-matches .hua-vertical-card-media,
  .hua-alert-matches .hua-card-placeholder,
  .hua-alert-matches .hua-vertical-card-body,
  body.user-items .hua-vertical-card-media,
  body.user-items .hua-card-placeholder,
  body.user-items .hua-vertical-card-body {
    min-height: 158px;
  }

  .hua-bottom-nav > a {
    font-size: 9px;
  }

  .hua-message-emoji-picker { grid-template-columns: repeat(5, 48px); }
}

@keyframes hua-mobile-spin {
  to { transform: rotate(360deg); }
}

@keyframes hua-mobile-shimmer {
  to { background-position-x: -220%; }
}

@keyframes hua-mobile-progress {
  0% { opacity: .6; transform: translateX(-100%); }
  65% { opacity: 1; transform: translateX(55%); }
  100% { opacity: 0; transform: translateX(140%); }
}

@media (prefers-reduced-motion: reduce) {
  .hua-bottom-nav > a,
  .hua-mobile-refresh,
  .hua-mobile-skeleton > i,
  .hua-mobile-skeleton > span > i,
  html.hua-mobile-navigating::before {
    animation: none !important;
    transition: none !important;
  }
}
