/* UI118: additive mobile/tablet layout only. Desktop reference styles remain untouched. */
@media (max-width: 767px) {
  .jf-mobile-header { gap: 6px; }
  .jf-member .jf-mobile-header .jf-logo { width: clamp(125px, 38vw, 170px); height: 42px; flex-shrink: 0; }
  .jf-mobile-header .jf-user-trigger { width: 44px; height: 44px; max-width: 44px; justify-content: center; padding: 8px; overflow: visible; }
  .jf-mobile-header .jf-user-trigger > span.truncate,
  .jf-mobile-header .jf-user-trigger > svg { display: none; }
  .jf-user-menu > div[x-show] { max-width: calc(100vw - 24px); max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; }
  .jf-member .jf-side { top: 74px; bottom: 0; width: min(290px, calc(100vw - 40px)); max-height: calc(100vh - 74px); max-height: calc(100dvh - 74px); padding-bottom: env(safe-area-inset-bottom, 0px); overscroll-behavior: contain; }
  .jf-member .jf-wrap .grid > *, .jf-member .jf-wrap.grid > * { min-width: 0; }
  .jf-member main input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),
  .jf-member main select, .jf-member main textarea { font-size: 16px; min-height: 44px; }
  .jf-member main textarea { min-height: 112px; }
  .jf-member main input[type=file] { max-width: 100%; }
  .jf-service-detail-panel { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overflow-wrap: anywhere; overscroll-behavior: contain; padding: 20px; }
  .jf-service-detail-panel > * { min-width: 0; }
}
@media (max-width: 639px) {
  .jf-mobile-header .jf-header-dashboard { display: none; }
  .jf-mobile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .jf-mobile-stats > * { min-width: 0; padding: 12px; gap: 10px; align-items: flex-start; }
  .jf-mobile-stats > * > :first-child { width: 32px; height: 32px; flex-shrink: 0; }
  .jf-mobile-stats > * > :last-child { min-width: 0; }
  .jf-mobile-stats .text-lg { font-size: 15px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
  .jf-mobile-stats .text-sm { font-size: 12px; line-height: 1.4; }
  .jf-member .jf-wrap { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 1199px) {
  .jf-admin .native-navbar .navbar-toggler { display: block !important; min-width: 44px; min-height: 44px; }
  .jf-admin .native-navbar .navbar-header { flex: 1 1 auto; }
  .jf-admin .native-navbar .navbar-menu { display: none !important; position: absolute !important; inset: 55px 0 auto !important; width: 100%; background: var(--latar, #fff); border-bottom: 1px solid var(--border, #ddd); box-shadow: 0 6px 10px #0001; max-height: calc(100vh - 55px); max-height: calc(100dvh - 55px); overflow-y: auto; }
  .jf-admin .native-navbar .navbar-menu.navbar-menu--terbuka { display: block !important; }
  .jf-admin .native-navbar .navbar-menu .navbar-nav { display: block !important; float: none; margin: 0 !important; }
  .jf-admin .native-navbar .navbar-menu .navbar-nav > li { float: none; width: 100%; }
  .jf-admin .native-navbar .navbar-menu .navbar-nav > li > a { min-height: 44px; padding: 12px 16px; }
  /* Let the data area scroll, not the page toolbar. Columns/data are not hidden. */
  .jf-admin table.table { display: block; width: 100%; min-width: 0 !important; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .jf-admin .services-native-list > .loader-container { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .jf-admin .services-native-layout .service-table__container { will-change: auto; }
  .jf-admin .services-native-list .service-table__relative { width: 1280px; min-width: 1280px; }
  .jf-admin .services-native-list .service-table__header-wrapper { width: 1280px; }
  .jf-admin .services-native-list table.table { display: table; min-width: 1280px !important; max-width: none; overflow: visible; }
  .jf-admin .toolbar { flex-wrap: wrap; gap: 10px; }
  .jf-admin .toolbar__group { min-width: 0; flex-wrap: wrap; }
  .jf-admin .toolbar__spacer { max-width: 100%; }
  .jf-admin .search-input { width: 100% !important; min-width: 0; max-width: 100%; flex: 1 1 auto !important; }
  .jf-admin .search-input__input { width: 0 !important; min-width: 0 !important; flex: 1 1 0 !important; }
  .jf-admin .search-input__select { max-width: 130px; flex-shrink: 0; }
  .jf-admin .search-input__select select { max-width: 130px; }
  .jf-admin .modal-dialog { max-width: calc(100vw - 24px) !important; margin: 12px auto; }
  .jf-admin .modal-body input:not([type=checkbox]):not([type=radio]),
  .jf-admin .modal-body select, .jf-admin .modal-body textarea { max-width: 100%; }
  .jf-admin .modal-body textarea, .jf-admin .modal-body input[type=text], .jf-admin .modal-body input[type=password] { font-size: 16px; }
  /* The helper changes positioning only; menu DOM/React ownership stays intact. */
  .jf-admin .dropdown-menu[data-jf-mobile-menu] { position: fixed !important; left: var(--jf-menu-x) !important; right: auto !important; top: var(--jf-menu-y) !important; bottom: auto !important; transform: none !important; width: var(--jf-menu-w) !important; min-width: 0 !important; max-width: calc(100vw - 16px) !important; max-height: var(--jf-menu-h) !important; overflow-y: auto !important; overscroll-behavior: contain; z-index: 1080; }
  .jf-admin .dropdown-menu[data-jf-mobile-menu] .dropdown-submenu-items { position: static !important; float: none; margin: 0 0 0 12px; min-width: 0; max-width: 100%; box-shadow: none; }
  .jf-admin .dropdown-menu[data-jf-mobile-menu] > li > a,
  .jf-admin .dropdown-menu[data-jf-mobile-menu] .dropdown-submenu-items > li > a { white-space: normal; overflow-wrap: anywhere; min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
}
@media (max-width: 991px) {
  .jf-admin .settings-wrap .page-tabs { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; white-space: nowrap; padding-bottom: 8px; margin-bottom: 8px; overscroll-behavior-x: contain; }
  .jf-admin .settings-wrap .page-tabs > li { flex: 0 0 auto; float: none; margin-top: 0; }
  .jf-admin .settings-wrap .page-tabs > li > a { min-height: 42px; padding: 10px 12px; }
  .jf-admin .tickets-view .details__col { width: 100%; max-width: 100%; }
  .jf-admin .tickets-view .details__col > .row { display: flex; flex-direction: column; }
  .jf-admin .tickets-view .details__main { order: -1; }
  .jf-admin .tickets-view .details__main, .jf-admin .tickets-view .details__sidebar { width: 100%; min-width: 0; }
  .jf-admin .tickets-view .ticket-chat__messages { min-height: 280px; max-height: 60vh; max-height: 60dvh; }
}

@media (max-width: 1199px) {
  /* Calendars stay within their menu, rather than opening a clipped desktop flyout. */
  .jf-admin .reports-reference .calendar-wrap .daterangepicker.opensleft { position: static !important; inset: auto !important; width: 100% !important; min-width: 0; margin: 8px 0 0 !important; box-shadow: none; }
  .jf-admin > .daterangepicker { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: 12px !important; width: auto !important; max-width: 488px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; margin: 0 auto; z-index: 1090; }
  .jf-admin .daterangepicker .drp-calendar { float: none; width: 100%; max-width: none; padding: 8px !important; }
  .jf-admin .daterangepicker .drp-buttons { white-space: normal; }
  .jf-admin .daterangepicker .drp-selected { display: block; margin-bottom: 8px; }
  .jf-admin .bootstrap-datetimepicker-widget.dropdown-menu[data-jf-mobile-menu] { padding: 8px; }
  .jf-admin .reports-reference .reports-nav__kanan { flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%; margin-left: 0; }
  .jf-admin .reports-reference .reports-filters__items { min-width: 0; max-width: 100%; justify-content: flex-start; }
  .jf-admin .reports-reference .reports-service-controls,
  .jf-admin .reports-reference .reports-churn-controls { display: flex !important; flex-wrap: wrap; width: 100%; min-width: 0; max-width: 100%; }
  .jf-admin .reports-reference .reports-search-row { width: 100% !important; min-width: 0; max-width: 100%; margin-left: 0 !important; flex: 1 1 100% !important; }

  /* Remove the entered modal identity transform, which otherwise offsets fixed menus. */
  .jf-admin .modal.in .modal-dialog { transform: none !important; -webkit-transform: none !important; }

}

/* UI119 CUSTOMER ONLY: content-driven grids and bounded overlays across device sizes. */
.jf-storefront .jf-mobile-header { grid-template-columns: auto minmax(0, 1fr) auto; }
.jf-member #depositForm .grid[class~="sm:grid-cols-2"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(230px, calc(50% - 5px))), 1fr)); }
.jf-member #depositForm label .truncate { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.jf-member .jf-service-detail-panel,
.jf-storefront .jf-service-detail-panel { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overflow-wrap: anywhere; overscroll-behavior: contain; }
.jf-member .jf-user-menu > div[x-show],
.jf-storefront .jf-user-menu > div[x-show] { max-width: calc(100vw - 24px); max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; }
.jf-member .jf-ticket-chat__zoom-bar > span { min-width: 0; overflow-wrap: anywhere; }
.jf-member .jf-ticket-chat__zoom-bar > button { flex-shrink: 0; }
@media (max-width: 1399px) {
  .jf-storefront .jf-mobile-header { grid-template-columns: minmax(0, 1fr) auto; }
  .jf-storefront .jf-mobile-header .jf-logo { width: clamp(125px, 20vw, 253px); height: clamp(36px, 5vw, 52px); max-width: 100%; }
  .jf-storefront .jf-mobile-header .jf-nav { display: none; }
  .jf-storefront .jf-mobile-header button[aria-label="Menu"] { display: block; min-width: 40px; min-height: 40px; }
  .jf-storefront header > div[x-show="mobileMenu"] { display: block; max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 639px) {
  .jf-member .jf-mobile-stats,
  .jf-storefront .jf-mobile-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
  .jf-member #depositForm .grid[class~="sm:grid-cols-2"] > label { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: start; }
  .jf-member #depositForm .grid[class~="sm:grid-cols-2"] > label > span.flex-1 { grid-column: 2; grid-row: 1; }
  .jf-member #depositForm .grid[class~="sm:grid-cols-2"] > label > span:last-child:not(.flex-1):not(.grid) { grid-column: 2; justify-self: start; }
}

@media (max-width: 1023px) {
  .jf-member .jf-mobile-header > div:first-child { width: auto; flex-shrink: 1; }
  .jf-member .jf-mobile-header .jf-logo { width: clamp(125px, 23vw, 200px); max-width: 100%; height: 42px; }
  .jf-member .jf-mobile-header button[aria-controls="jf-member-sidebar"] { display: inline-flex; min-width: 44px; min-height: 44px; }
  .jf-member .jf-mobile-header .jf-header-dashboard { display: none; }
  .jf-member #jf-member-sidebar { position: fixed; top: 74px; bottom: 0; z-index: 40; width: min(290px, calc(100vw - 40px)); max-height: calc(100vh - 74px); max-height: calc(100dvh - 74px); transform: translateX(-100%); }
  .jf-member #jf-member-sidebar.translate-x-0 { transform: translateX(0); }
  .jf-member div[x-show="sidebar"] { display: block; }
  .jf-member main input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),
  .jf-member main select, .jf-member main textarea,
  .jf-storefront main input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),
  .jf-storefront main select, .jf-storefront main textarea { font-size: 16px; min-height: 44px; }
}

/* Keep the brand within its grid track on narrow logged-out screens. */
.jf-storefront .jf-mobile-header > a:first-child { max-width: 100%; }

/* UI120: mobile order pickers only; desktop retains the original native controls. */
.jf-member #orderForm .jf-order-picker { display: none; }
@media (max-width: 1023px) {
  .jf-member #orderForm .jf-order-native-select { display: none; }
  .jf-member #orderForm .jf-order-picker { display: block; min-width: 0; --jf-picker-bg: #fef3f9; --jf-picker-hover: #fce7f3; --jf-picker-text: #0f172a; --jf-picker-border: #cbd5e1; }
  .jf-member #orderForm .jf-order-picker:where(.dark *) { --jf-picker-bg: #020617; --jf-picker-hover: #4a173b; --jf-picker-text: #fff; --jf-picker-border: #334155; }
  .jf-member #orderForm .jf-order-picker__trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; border: 1px solid var(--jf-picker-border); border-radius: 8px; background: var(--jf-picker-bg); color: var(--jf-picker-text); text-align: left; font-size: 16px; line-height: 1.5; }
  .jf-member #orderForm .jf-order-picker__trigger > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .jf-member #orderForm .jf-order-picker__trigger > svg { flex-shrink: 0; }
  .jf-member #orderForm .jf-order-picker__trigger:focus-visible { outline: 2px solid #ec4899; outline-offset: 2px; }
  .jf-member #orderForm .jf-order-picker__trigger[aria-expanded="true"] { border-color: #ec4899; }
  .jf-member #orderForm .jf-order-picker__trigger:disabled { opacity: .6; cursor: not-allowed; }
  .jf-member #orderForm .jf-order-picker__list { position: fixed; z-index: 80; max-width: calc(100vw - 16px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 4px; border: 1px solid var(--jf-picker-border); border-radius: 8px; background: var(--jf-picker-bg); color: var(--jf-picker-text); box-shadow: 0 8px 24px #0f172a26; }
  .jf-member #orderForm .jf-order-picker__option { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 4px; background: transparent; color: inherit; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; }
  .jf-member #orderForm .jf-order-picker__option.is-active { background: var(--jf-picker-hover); }
  .jf-member #orderForm .jf-order-picker__option.is-selected { font-weight: 600; }
}

/* UI121: compact phone order controls, not field labels or platform buttons. */
@media (max-width: 767px) {
  .jf-member #orderForm input[type="search"],
  .jf-member #orderForm input[name="link"],
  .jf-member #orderForm input[name="quantity"] { height: 38px; min-height: 38px; padding: 8px 12px; font-size: 14px; line-height: 20px; }
  .jf-member #orderForm input[type="search"] { padding-left: 40px; }
  .jf-member #orderForm .jf-order-picker__trigger { min-height: 38px; padding: 8px 12px; font-size: 14px; line-height: 20px; }
  .jf-member #orderForm .jf-order-picker__option { min-height: 38px; padding: 8px 12px; font-size: 14px; line-height: 20px; }
  .jf-member #orderForm div[x-text^="cur.description"] { min-height: 38px; max-height: 128px; padding: 8px 12px; font-size: 14px; line-height: 20px; }
  .jf-member #orderForm > div.mt-4 > div.flex.items-center.justify-between { min-height: 38px; padding: 8px 12px; font-size: 14px; line-height: 20px; }
  .jf-member #orderForm > div.mt-4 > div.flex.items-center.justify-between > span:last-child { font-size: 16px; line-height: 20px; }
  .jf-member #orderForm > button { min-height: 38px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; line-height: 20px; }
}
