/* Shared mobile layout overrides; every rule is restricted to mobile/tablet widths. */
@media (max-width: 900px) {
    body[data-hhp-responsive].admin-body .admin-layout {display:block!important;width:100%!important;min-width:0!important;}
    body[data-hhp-responsive].admin-body .admin-content {width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;padding:18px 12px!important;}
    body[data-hhp-responsive].admin-body .admin-topbar {flex-wrap:wrap!important;align-items:flex-start!important;gap:12px!important;}
    body[data-hhp-responsive].admin-body .admin-topbar > * {min-width:0;max-width:100%;}
    body[data-hhp-responsive].admin-body .admin-topbar h1 {font-size:clamp(22px,6vw,30px)!important;overflow-wrap:anywhere;}
    body[data-hhp-responsive].admin-body :is(.dashboard-chart-grid,.dashboard-list-grid,.storage-path-grid) {grid-template-columns:minmax(0,1fr)!important;}
    body[data-hhp-responsive].admin-body :is(.dashboard-kpi-grid,.user-stat-grid) {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    body[data-hhp-responsive].admin-body :is(.form-grid,.filter-grid,.user-filter-grid,.promotion-filter-grid,.recommend-filter-form,.recommend-form-grid,.promotion-form,.location-filter-grid,.type-filter-grid) {grid-template-columns:minmax(0,1fr)!important;min-width:0!important;}
    body[data-hhp-responsive].admin-body :is(.form-grid,.recommend-form-grid,.promotion-form) > * {grid-column:1/-1!important;min-width:0!important;}
    body[data-hhp-responsive].admin-body :is(.form-card,.card,.admin-table-card,.chart-card) {min-width:0!important;max-width:100%;}
    body[data-hhp-responsive].admin-body :is(.admin-topbar-actions,.user-filter-actions,.promotion-filter-actions,.recommend-filter-actions) {flex-wrap:wrap!important;gap:8px!important;max-width:100%;}
    body[data-hhp-responsive].admin-body .admin-sidebar {max-width:calc(100vw - 40px)!important;max-height:100dvh;overflow-y:auto!important;overscroll-behavior:contain;}
    body[data-hhp-responsive].admin-body .admin-mobile-header {max-width:100%;}
}
@media (max-width: 768px) {
    body[data-hhp-responsive] {width:100%;max-width:100%;margin-inline:0;-webkit-text-size-adjust:100%;}
    body[data-hhp-responsive] *,body[data-hhp-responsive] *::before,body[data-hhp-responsive] *::after {box-sizing:border-box;}
    body[data-hhp-responsive] :is(main,section,article,aside,form) {min-width:0;}
    body[data-hhp-responsive] .container {width:100%!important;max-width:100%!important;padding-inline:12px!important;}
    body[data-hhp-responsive] :is(img,video,iframe,canvas) {max-width:100%;}
    body[data-hhp-responsive] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea) {max-width:100%;font-size:16px!important;}
    body[data-hhp-responsive] :is(input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="search"],input[type="password"],input[type="date"],select) {min-height:44px;}
    body[data-hhp-responsive] :is(.btn,button.btn,.nav-toggle,.admin-menu-toggle) {min-height:44px;}
    body[data-hhp-responsive] :is(.form-grid,.search-grid,.filter-grid,.contact-grid,.hero-search-grid,.detail-grid,.property-detail-grid,.listing-layout,.detail-layout,.property-showcase-grid,.project-content-grid,.pj-filter-form,.room-type-card-grid,.issue-contact-grid) {grid-template-columns:minmax(0,1fr)!important;}
    body[data-hhp-responsive] :is(.form-grid,.search-grid,.filter-grid,.room-type-card-grid) > * {grid-column:1/-1!important;min-width:0!important;}
    body[data-hhp-responsive] :is(.filter-sidebar,.contact-sidebar,.post-wizard-sidebar,.detail-main,.listing-main) {width:100%!important;min-width:0!important;max-width:100%!important;position:static!important;}
    body[data-hhp-responsive] :is(.pj-grid,.project-property-grid,.project-grid,.property-grid,.article-grid,.promotion-grid,.internal-link-grid) {grid-template-columns:minmax(0,1fr)!important;}
    body[data-hhp-responsive] :is(.property-info-grid,.property-extra-grid,.project-facts-grid,.project-facility-grid,.checkbox-grid) {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    body[data-hhp-responsive] :is(.property-card,.project-card,.article-card,.promotion-card,.pj-card) {min-width:0!important;max-width:100%;}
    body[data-hhp-responsive] :is(.pj-toolbar,.listing-toolbar,.listing-results-header,.section-header,.contact-actions,.form-actions,.property-wizard-actions,.post-wizard-actions) {flex-wrap:wrap!important;gap:10px;}
    body[data-hhp-responsive] :is(.form-actions,.contact-actions,.property-wizard-actions-left,.property-wizard-actions-right,.post-wizard-actions-left,.post-wizard-actions-right) {max-width:100%;flex-wrap:wrap!important;}
    body[data-hhp-responsive] :is(.property-wizard-actions,.post-wizard-actions) {position:static!important;margin-bottom:12px!important;}
    body[data-hhp-responsive] :is(.property-wizard-panel,.post-wizard-panel) {max-width:100%;min-width:0;padding-inline:12px!important;}
    body[data-hhp-responsive] .nearby-row {display:grid!important;grid-template-columns:minmax(0,1fr)!important;min-width:0;}
    body[data-hhp-responsive] :is(.property-wizard-nav,.post-wizard-steps,.pagination,.gallery-thumbs) {max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
    body[data-hhp-responsive] :is(.property-wizard-step,.page-link,.gallery-thumb) {flex-shrink:0;}
    body[data-hhp-responsive] :is(.table-responsive,.table-scroll,.hhp-mobile-table-scroll,.package-price-table-wrap) {display:block;min-width:0!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;}
    body[data-hhp-responsive] table.hhp-mobile-wide-table {min-width:640px!important;}
    body[data-hhp-responsive] table.hhp-mobile-compact-table {width:100%!important;min-width:0!important;table-layout:auto!important;}
    body[data-hhp-responsive] :is(.property-name,.detail-card p,.article-content,.article-body,.project-description) {overflow-wrap:anywhere;}
    body[data-hhp-responsive] pre {max-width:100%;overflow-x:auto;}
    body[data-hhp-responsive] :is(.auth-card,.login-card,.register-card,.auth-shell,.auth-container) {max-width:100%!important;min-width:0!important;}
    /* Keep outer modal/backdrop geometry intact; scroll the dialog content instead. */
    body[data-hhp-responsive] :is(.promotion-modal-dialog,.recommend-modal-dialog,.user-modal-dialog,.location-modal-dialog,.type-modal-dialog,.legal-modal-card,.post-wizard-url-dialog,.issue-report-dialog,.phone-picker-dialog) {width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;margin-inline:auto!important;overflow:auto;overscroll-behavior:contain;}
    body[data-hhp-responsive] :is(.promotion-modal-card,.recommend-modal-card,.user-modal-card,.location-modal-card,.type-modal-card) {width:100%!important;min-width:0!important;padding-inline:14px!important;}
    body[data-hhp-responsive] :is(.promotion-select-menu,.promotion-property-menu,.admin-search-select-menu,.searchable-select-menu,.recommend-property-menu) {max-width:100%;max-height:min(300px,50dvh);overflow-y:auto;overscroll-behavior:contain;}
    body[data-hhp-responsive] .main-nav {max-width:100%;max-height:calc(100dvh - 80px);overflow-y:auto;overscroll-behavior:contain;}
    body[data-hhp-responsive] .main-header-inner {gap:8px!important;}
    body[data-hhp-responsive] .nav-toggle {flex:0 0 44px;min-width:44px;}
    /* Include .active so the six-column desktop selector cannot beat the mobile override. */
    body[data-hhp-responsive] .province-recommend-section .province-recommend-grid,
    body[data-hhp-responsive] .province-recommend-section .province-recommend-grid.active {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;overflow:visible!important;}
    body[data-hhp-responsive] .province-recommend-section .recommend-property-card {width:100%!important;min-width:0!important;flex:none!important;}
    body[data-hhp-responsive] .province-recommend-section .recommend-property-body {padding:12px!important;}
    body[data-hhp-responsive] .province-recommend-section .recommend-property-link {width:auto!important;max-width:100%;white-space:normal;}
    body[data-hhp-responsive] .province-recommend-section .recommend-property-body h3 {overflow-wrap:anywhere;}
}
@media (max-width: 480px) {
    body[data-hhp-responsive] .province-recommend-section .province-recommend-grid,
    body[data-hhp-responsive] .province-recommend-section .province-recommend-grid.active {grid-template-columns:minmax(0,1fr)!important;}
    body[data-hhp-responsive] :is(.property-info-grid,.property-extra-grid,.project-facts-grid,.issue-contact-grid) {grid-template-columns:minmax(0,1fr)!important;}
    body[data-hhp-responsive].admin-body :is(.dashboard-kpi-grid,.user-stat-grid) {grid-template-columns:minmax(0,1fr)!important;}
    body[data-hhp-responsive] :is(.property-wizard-actions-left,.property-wizard-actions-right,.post-wizard-actions-left,.post-wizard-actions-right,.promotion-modal-actions,.recommend-modal-actions) {width:100%;}
    body[data-hhp-responsive] :is(.property-wizard-actions-right,.post-wizard-actions-right,.promotion-modal-actions,.recommend-modal-actions) > .btn {flex:1 1 100%;width:100%;}
}
@media (max-width: 768px) {
    body[data-hhp-responsive] [hidden][hidden][hidden] {display:none!important;}
    body[data-hhp-responsive] table.hhp-mobile-compact-table :is(th,td) {white-space:normal!important;overflow-wrap:anywhere;}
}
