/* ── HornyFans mobile layer (phone chrome ≤767, touch ≤1023) ───────────────
 * Loaded after styles.css + figma-theme.css. Prefer existing --wb-* / --sp-* tokens.
 * Use !important only to beat figma-theme.css !important rules.
 */

:root {
  --hf-mobile-tabbar-height: 56px;
  --hf-mobile-topbar-height: 56px;
  --hf-z-topbar: 1000;
  --hf-z-tabbar: 1100;
  --hf-z-drawer: 1200;
  --hf-z-sheet: 1300;
  --hf-z-toast: 1400;
}

/* ≤1023: mobile chrome + shared touch primitives */
@media (max-width: 1023px) {
  :root {
    --hf-topbar-height: var(--hf-mobile-topbar-height);
    --home-sticky-top: calc(env(safe-area-inset-top, 0px) + var(--hf-topbar-height));
    --hf-content-pad-bottom: calc(var(--hf-mobile-tabbar-height) + env(safe-area-inset-bottom, 0px));
  }

  input,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  textarea,
  select {
    font-size: 16px !important;
  }

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

  button,
  .link-btn,
  .btn-sm,
  .btn-ghost,
  .btn-primary,
  .btn-danger {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 40px;
    padding: 8px 12px;
  }

  table {
    min-width: 0 !important;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chat-page-wrap,
  .inbox-wrap,
  .chat-mobile-shell {
    min-height: calc(100dvh - var(--hf-topbar-height, 56px));
  }

  body {
    min-height: 100dvh;
  }

  body.hf-mobile-chrome > .topbar,
  body.hf-mobile-chrome .topbar {
    display: none !important;
  }

  body.hf-mobile-drawer-open {
    overflow: hidden;
  }

  main.container {
    padding-bottom: calc(1rem + var(--hf-content-pad-bottom, 0px)) !important;
  }

  main.container.container--chat-messenger,
  main.container.container--hide-mobile-tabbar {
    padding-bottom: 1rem !important;
  }

  main.container.container--chat-messenger:not(.container--hide-mobile-tabbar) {
    overscroll-behavior: none;
  }

  .account-sidebar,
  .account-tabs-bar {
    top: calc(var(--hf-topbar-height, 56px) + env(safe-area-inset-top, 0px) + 0.5rem) !important;
  }

  .notif-dropdown {
    top: calc(var(--hf-topbar-height, 56px) + env(safe-area-inset-top, 0px) + 0.35rem) !important;
  }

  /* Mobile sheet / fullscreen dialog shell */
  dialog.hf-mobile-sheet,
  .hf-mobile-sheet {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
  }

  dialog.hf-mobile-sheet::backdrop,
  .hf-mobile-sheet-backdrop {
    background: rgba(0, 0, 0, 0.65);
  }

  .hf-mobile-sheet-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--hf-vv-bottom-inset, 0px);
    max-height: min(92dvh, 100%);
    display: flex;
    flex-direction: column;
    background: var(--wb-bg, #000);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    border: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    border-bottom: 0;
    z-index: var(--hf-z-sheet);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(0);
    transition: transform 0.22s ease;
  }

  .hf-mobile-sheet-panel--fullscreen {
    top: 0;
    bottom: 0;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .hf-mobile-sheet-handle {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 0.25rem;
    margin: 0.5rem auto 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
  }

  .hf-mobile-sheet-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
  }

  .hf-mobile-sheet-title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wb-text, #fff);
  }

  .hf-mobile-sheet-close {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--wb-radius, 0.625rem);
    background: transparent;
    color: var(--wb-muted, #9ca3af);
  }

  .hf-mobile-sheet-body {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1rem;
  }

  .hf-mobile-sheet-footer {
    flex: 0 0 auto;
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    background: var(--wb-bg, #000);
  }

  .hf-mobile-sheet-footer > * {
    flex: 1 1 auto;
  }

  .hf-mobile-topbar {
    position: sticky;
    top: 0;
    z-index: var(--hf-z-topbar);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--hf-mobile-topbar-height);
    padding: env(safe-area-inset-top, 0px) 0.75rem 0;
    background: var(--wb-bg, #000);
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
  }

  .hf-mobile-topbar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: var(--hf-mobile-topbar-height);
    gap: 0.5rem;
  }

  .hf-mobile-topbar-leading,
  .hf-mobile-topbar-trail {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
  }

  .hf-mobile-topbar-leading {
    flex: 1 1 auto;
  }

  .hf-mobile-topbar-trail {
    flex: 0 0 auto;
  }

  .hf-mobile-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--wb-radius, 0.625rem);
    background: transparent;
    color: var(--wb-text, #fff);
    position: relative;
  }

  .hf-mobile-icon-btn .nav-unread-badge,
  .hf-mobile-icon-btn .notif-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 999px;
    background: var(--sp-red-600, #dc2626);
    color: #fff;
    text-align: center;
  }

  .hf-mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--wb-text, #fff);
    text-decoration: none;
  }

  .hf-mobile-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
  }

  .hf-mobile-brand-name,
  .hf-mobile-topbar-title {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hf-mobile-avatar-btn {
    padding: 0;
    overflow: hidden;
  }

  .hf-mobile-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
  }

  .hf-mobile-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 600;
  }

  .hf-mobile-avatar-fallback--lg {
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }

  .hf-mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--hf-vv-bottom-inset, 0px);
    width: 100%;
    box-sizing: border-box;
    z-index: var(--hf-z-tabbar);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    min-height: calc(var(--hf-mobile-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--wb-bg, #000);
    border-top: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  body.hf-hide-mobile-tabbar .hf-mobile-tabbar {
    display: none;
  }

  /* Soft keyboard: hide tab bar on chat/composer pages (Safari resizes layout). */
  body.hf-keyboard-open:not(.hf-hide-mobile-tabbar) .hf-mobile-tabbar {
    visibility: hidden;
    pointer-events: none;
  }

  .hf-mobile-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--hf-mobile-tabbar-height);
    padding: 0.35rem 0.15rem;
    color: var(--wb-muted, #9ca3af);
    text-decoration: none;
    font-size: 0.625rem;
    line-height: 1.1;
    background: transparent;
    border: 0;
    position: relative;
  }

  .hf-mobile-tab--active {
    color: var(--wb-text, #fff);
  }

  .hf-mobile-tab-dot {
    position: absolute;
    top: 6px;
    right: calc(50% - 14px);
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--sp-red-600, #dc2626);
  }

  .hf-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: var(--hf-z-drawer);
  }

  .hf-mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    width: 100%;
    height: 100%;
    padding: 0;
  }

  .hf-mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: min(86vw, 320px);
    display: flex;
    flex-direction: column;
    background: var(--wb-bg, #000);
    border-left: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    border-right: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(0);
    transition: transform 0.22s ease;
  }

  .hf-mobile-drawer-user {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    color: inherit;
    text-decoration: none;
    text-align: right;
  }

  .hf-mobile-drawer-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .hf-mobile-drawer-user-name {
    font-weight: 600;
    color: var(--wb-text, #fff);
  }

  .hf-mobile-drawer-nav {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0.5rem;
  }

  .hf-mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    border-radius: var(--wb-radius, 0.625rem);
    color: var(--wb-text, #fff);
    text-decoration: none;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .hf-mobile-drawer-link--active {
    background: rgba(255, 255, 255, 0.08);
  }

  .hf-mobile-drawer-link-icon {
    display: inline-flex;
    width: 22px;
    justify-content: center;
    color: var(--wb-muted, #9ca3af);
  }

  .hf-mobile-drawer-link-label {
    flex: 1 1 auto;
  }

  .hf-mobile-drawer-footer {
    padding: 0.5rem;
    border-top: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
  }

  .hf-mobile-notif-list .notif-item,
  .hf-mobile-actions-list > * {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    color: inherit;
    text-decoration: none;
  }

  .hf-mobile-actions-list a,
  .hf-mobile-actions-list button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 0;
    border-radius: var(--wb-radius, 0.625rem);
    background: transparent;
    color: var(--wb-text, #fff);
    font: inherit;
    text-align: left;
  }

  /* Footer accordion-friendly stacking */
  .site-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* ≤767: denser page layouts */
@media (max-width: 767px) {
  .account-form-grid,
  .edit-grid,
  .security-form-row {
    grid-template-columns: 1fr !important;
  }

  table.hf-table-cards thead {
    display: none;
  }

  table.hf-table-cards,
  table.hf-table-cards tbody,
  table.hf-table-cards tr,
  table.hf-table-cards td {
    display: block;
    width: 100%;
  }

  table.hf-table-cards tr {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    border-radius: var(--wb-radius, 0.625rem);
    background: var(--wb-surface, #000);
  }

  table.hf-table-cards td {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border: 0;
  }

  table.hf-table-cards td::before {
    content: attr(data-label);
    color: var(--wb-muted, #9ca3af);
    font-size: 0.8125rem;
    flex: 0 0 40%;
  }

  /* Browse / bought: keep 2-col grid, compact card bodies */
  .browse-grid,
  .bought-grid,
  .grid.browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  .card-body,
  .browse-card .card-body {
    padding: 0.4rem 0.35rem !important;
  }

  .card-title,
  .browse-card .card-title {
    font-size: 0.8125rem !important;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Feed media edge-to-edge */
  .home-blog-card .feed-media,
  .blog-page .feed-media,
  .creator-profile-page .feed-media {
    border-radius: 0 !important;
    max-height: none !important;
  }

  .home-blog-card,
  .blog-page .home-blog-card {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
  }

  /* Auth full-bleed card */
  .auth-page .auth-card,
  .age-gate-panel {
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }

  .auth-form input,
  .auth-form select,
  .auth-form textarea,
  .age-gate-form input {
    min-height: 48px;
  }

  .auth-submit-btn,
  .age-gate-form button[type="submit"] {
    width: 100%;
    min-height: 48px;
  }

  /* Watch player full bleed */
  .sp-watch-page .sp-watch-player-wrap,
  .sp-watch-page .watch-player,
  .sp-watch-page .watch-player-inner,
  .sp-watch-page video {
    border-radius: 0 !important;
  }

  .sp-watch-page .sp-watch-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .sp-watch-page .sp-watch-meta-row,
  .sp-watch-page .sp-watch-comments,
  .sp-watch-page .sp-watch-breadcrumb {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Pay sticky CTA already exists; reinforce safe-area */
  .pay-sticky-submit,
  .pay-checkout-submit {
    bottom: calc(
      var(--hf-vv-bottom-inset, 0px) + var(--hf-mobile-tabbar-height, 0px) + env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  body.hf-hide-mobile-tabbar .pay-sticky-submit,
  body.hf-hide-mobile-tabbar .pay-checkout-submit {
    bottom: calc(var(--hf-vv-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Creator profile OF-style hero — full-bleed; sizing in styles.css */
  .creator-profile-hero {
    margin: -1rem -1rem 1rem;
    width: calc(100% + 2rem);
  }

  .creator-profile-cover-wrap {
    border-radius: 0;
  }

  .creator-profile-avatar-wrap {
    margin-left: 1rem;
  }

  .creator-profile-tabs {
    position: sticky;
    top: var(--hf-topbar-height, 56px);
    z-index: 5;
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    background: var(--wb-bg, #000);
    margin: 0 -1rem;
    width: calc(100% + 2rem);
  }

  .creator-profile-tab {
    flex: 1 1 0;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--wb-muted, #9ca3af);
    font: inherit;
    border-bottom: 2px solid transparent;
  }

  .creator-profile-tab--active {
    color: var(--wb-text, #fff);
    border-bottom-color: var(--wb-text, #fff);
  }

  .creator-profile-subscribe-cta .link-btn,
  .creator-profile-subscribe-cta a {
    display: flex;
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Chat full-thread chrome */
  .chat-mobile-shell[data-chat-pane="thread"] .chat-mobile-thread-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
  }

  /* Composer stays in flex column — sticky caused overlap with message scroll */
  .chat-mobile-shell .chat-composer,
  .chat-mobile-shell .chat-reply-form,
  .chat-mobile-shell #chat-send-form,
  .chat-mobile-shell .chat-page-input,
  .chat-mobile-shell .chat-thread-reply {
    position: static;
    background: var(--wb-bg, #000);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Horizontal chip filters trigger */
  .browse-mobile-filter-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: sticky;
    top: var(--hf-topbar-height, 56px);
    z-index: 4;
    padding: 0.5rem 0;
    background: var(--wb-bg, #000);
  }

  .browse-mobile-filter-bar .btn-sm {
    min-height: 36px;
  }

  .tag-cloud,
  .live-now-strip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
  }

  .tag-cloud .tag-pill,
  .live-now-strip > * {
    flex: 0 0 auto;
  }

  /* About: always-visible overlay labels on touch */
  .about-featured-overlay {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Admin / account section picker trigger */
  .hf-mobile-section-picker-btn {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
  }

  .account-sidebar {
    display: none !important;
  }

  .account-wrap--sidebar .account-main {
    width: 100% !important;
  }
}

@media (min-width: 768px) {
  .hf-mobile-topbar,
  .hf-mobile-tabbar,
  .hf-mobile-drawer,
  .hf-mobile-section-picker-btn,
  .browse-mobile-filter-bar,
  .hf-pwa-install-banner {
    display: none !important;
  }
}

/* ── Modal presentations on phone (tablet+ uses desktop-dialog.css) ───── */
@media (max-width: 767px) {
  /* Fullscreen: feed/product/admin editors, calendar, provisional password, watch viewer */
  dialog.blog-feed-post-dialog[open],
  dialog.about-creator-edit-modal[open],
  dialog.book-cal-modal[open],
  dialog.logout-provisional-dialog:not(.logout-provisional-dialog--confirm)[open] {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--wb-bg, #000) !important;
  }

  dialog.blog-feed-post-dialog[open] .blog-feed-post-dialog-panel,
  dialog.about-creator-edit-modal[open] .about-creator-modal-panel,
  dialog.book-cal-modal[open] .about-creator-modal-panel,
  dialog.logout-provisional-dialog:not(.logout-provisional-dialog--confirm)[open] .logout-provisional-dialog-panel {
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  dialog.blog-feed-post-dialog[open] .blog-feed-post-dialog-body,
  dialog.about-creator-edit-modal[open] .about-creator-modal-body,
  dialog.book-cal-modal[open] .about-creator-modal-body {
    flex: 1 1 auto !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  dialog.blog-feed-post-dialog[open] .blog-feed-post-dialog-footer,
  dialog.about-creator-edit-modal[open] .about-creator-modal-footer,
  dialog.book-cal-modal[open] .about-creator-modal-footer {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--wb-bg, #000) !important;
  }

  /* Bottom sheets: about view, pay-booking family, catalog picker (not logout confirm) */
  dialog.about-creator-modal:not(.about-creator-edit-modal)[open] {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    display: flex !important;
    align-items: flex-end !important;
  }

  dialog.about-creator-modal:not(.about-creator-edit-modal)[open] .about-creator-modal-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: min(92dvh, 100%) !important;
    margin: 0 !important;
    border-radius: 1rem 1rem 0 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* Logout confirm: centered card + dimmed backdrop (not bottom sheet) */
  dialog.logout-provisional-dialog--confirm[open] {
    margin: auto !important;
    padding: 0 !important;
    width: min(100vw - 2rem, 28rem) !important;
    max-width: calc(100vw - 1.5rem) !important;
    height: fit-content !important;
    max-height: min(92dvh, calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.5rem)) !important;
    background: var(--wb-surface, #111) !important;
    border: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22)) !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }

  dialog.logout-provisional-dialog--confirm::backdrop {
    background: rgba(0, 0, 0, 0.72) !important;
  }

  dialog.logout-provisional-dialog--confirm[open] .logout-provisional-dialog-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 12px !important;
    padding-bottom: 0 !important;
  }

  .pay-booking-modal-backdrop,
  .hf-modal-overlay {
    align-items: flex-end !important;
    justify-content: stretch !important;
    padding: 0 !important;
  }

  .pay-booking-modal-backdrop .pay-booking-modal-panel,
  .hf-modal-overlay > div,
  .hf-modal-overlay .hf-modal-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: min(92dvh, 100%) !important;
    margin: 0 !important;
    border-radius: 1rem 1rem 0 0 !important;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .watch-media-viewer {
    inset: 0 !important;
    border-radius: 0 !important;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) !important;
  }
}

@media (max-width: 767px) {
  /* Filters live in MobileSheet; hide aside disclosure on phone */
  .browse-page > .browse-layout > aside.browse-filters {
    display: none !important;
  }

  .hf-mobile-sheet .browse-filters,
  .hf-mobile-sheet .browse-filters-disclosure,
  .hf-mobile-sheet .browse-filters-disclosure > summary {
    display: block !important;
  }

  .hf-mobile-sheet .browse-filters-disclosure > summary {
    display: none !important;
  }

  .hf-mobile-sheet .browse-filters-disclosure {
    border: 0 !important;
  }

  .hf-mobile-sheet .browse-filters-inner {
    display: block !important;
  }
}

@media (max-width: 767px) {
  /* Admin denser tables as cards when marked */
  .admin-cms table.hf-table-cards,
  .admin-cms .data-table,
  .admin-cms table.users-table,
  .admin-cms table.security-table,
  .admin-cms table.payments-table {
    min-width: 0 !important;
  }

  .admin-cms .table-wrap {
    margin: 0 -0.25rem;
  }

  /* Watch comments accordion-friendly */
  .sp-watch-comments details,
  .sp-watch-page details.report-toggle {
    border: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    border-radius: var(--wb-radius, 0.625rem);
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
  }

  .sp-watch-page .sp-watch-queue-edge {
    width: 44px !important;
    height: 44px !important;
  }

  /* Live room stack */
  .live-room-shell,
  .live-room-layout {
    display: flex !important;
    flex-direction: column !important;
  }

  .live-room-video {
    width: 100% !important;
    max-height: 45dvh !important;
  }

  /* Chat list rows */
  .chat-mobile-shell .chat-contacts-list a,
  .chat-mobile-shell .chat-conv-list a,
  .chat-mobile-shell .inbox-conv-link {
    min-height: 64px;
  }
}

@media (max-width: 1023px) {
  body.hf-hide-mobile-topbar .hf-mobile-topbar {
    display: none !important;
  }

  body.hf-hide-mobile-topbar {
    --hf-topbar-height: 0px;
  }

  /* Messenger thread: full viewport under own back header */
  .container--chat-messenger.container--hide-mobile-tabbar {
    padding-bottom: 0 !important;
  }

  .chat-mobile-shell[data-chat-pane="thread"] {
    min-height: 100dvh !important;
  }

  .chat-mobile-shell[data-chat-pane="thread"] .chat-mobile-back {
    min-width: 44px;
    min-height: 44px;
  }

  #chat-send-form textarea,
  .chat-reply-form textarea {
    max-height: 30dvh;
    field-sizing: content;
  }
}

@media (max-width: 767px) {
  .site-footer-acc {
    border-bottom: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
  }
  .site-footer-acc > summary.site-footer-acc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 48px;
    margin: 0;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    list-style: none;
    border-radius: var(--wb-radius, 0.625rem);
    transition: background-color 0.15s;
  }
  .site-footer-acc > summary.site-footer-acc-summary::-webkit-details-marker {
    display: none;
  }
  .site-footer-acc > summary.site-footer-acc-summary:hover,
  .site-footer-acc > summary.site-footer-acc-summary:active {
    background: rgba(255, 255, 255, 0.06);
  }
  .site-footer-acc > summary.site-footer-acc-summary:focus-visible {
    outline: 2px solid var(--wb-focus, rgba(255, 255, 255, 0.55));
    outline-offset: 2px;
  }
  .site-footer-acc-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sp-white, var(--wb-text, #fff));
    text-align: left;
  }
  .site-footer-acc-chevron {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--wb-muted, #9ca3af);
    transition: transform 0.15s ease;
  }
  .site-footer-acc[open] .site-footer-acc-chevron {
    transform: rotate(180deg);
  }
  .site-footer-acc-chevron-svg {
    display: block;
  }
  .site-footer-acc > ul {
    padding-bottom: 0.75rem;
  }

  .hf-pwa-install-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(
      var(--hf-vv-bottom-inset, 0px) + var(--hf-mobile-tabbar-height) + env(safe-area-inset-bottom, 0px)
    );
    z-index: calc(var(--hf-z-tabbar) - 1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--wb-bg, #000);
    border-top: 1px solid var(--wb-border, rgba(255, 255, 255, 0.22));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  }

  body.hf-hide-mobile-tabbar .hf-pwa-install-banner {
    bottom: calc(var(--hf-vv-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px));
  }

  .hf-pwa-install-banner-text {
    flex: 1 1 10rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8125rem;
    color: var(--wb-muted, #9ca3af);
  }

  .hf-pwa-install-banner-text strong {
    color: var(--wb-fg, #fff);
    font-size: 0.875rem;
  }

  .hf-pwa-install-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .hf-pwa-install-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--wb-fg, #fff);
  }

  .hf-pwa-install-steps ol {
    margin: 0;
    padding-left: 1.25rem;
  }

  .hf-pwa-install-steps li + li {
    margin-top: 0.5rem;
  }

  .hf-pwa-install-android-hint {
    margin: 0;
    color: var(--wb-muted, #9ca3af);
    font-size: 0.875rem;
  }

  .hf-pwa-install-dismiss {
    align-self: flex-start;
  }
}
