/* JUJUBUR V1.3.92 — phone-only presentation and touch refinement.
   No style in this file applies to desktop widths >= 768px. */
.jj-mobile-glyph { display: contents; } /* Desktop: render exactly like original text nodes. */
@media screen and (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust:100%; }
  body.jj-phone-page { -webkit-tap-highlight-color: transparent; }
  body.jj-phone-page :is(button,a,summary,[role="button"],input,select,textarea) { touch-action: manipulation; }
  body.jj-phone-page :is(button,a,summary,[role="button"]):focus-visible {
    outline: 2px solid #d9b98a; outline-offset: 2px;
  }
  body.jj-phone-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) {
    font-size: 16px; max-width: 100%; min-width: 0;
  }
  /* Never rely on emoji/text-font fallback for navigation arrows on iOS. */
  .jj-mobile-glyph {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.1em; height: 1.1em; font-size: 0; vertical-align: -0.12em;
    white-space: nowrap; flex: none;
  }
  .jj-mobile-glyph::before {
    content: ""; display: block; width: 14px; height: 14px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12h14m-6-6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12h14m-6-6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  .jj-mobile-glyph--ne::before { transform: rotate(-45deg); }
  .jj-mobile-glyph--left::before { transform: rotate(180deg); }
  .jj-mobile-glyph--up::before { transform: rotate(-90deg); }
  .jj-mobile-glyph--down::before { transform: rotate(90deg); }
  .jj-mobile-glyph--prev::before, .jj-mobile-glyph--next::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E");
  }
  .jj-mobile-glyph--prev::before { transform: rotate(180deg); }
  /* Dialogs: respect the dynamic viewport, including iPhone browser chrome. */
  body.jj-phone-page :is(.modal-cover,.overlay,.camera-lock,.library-modal,.modal) :is(input,select,textarea) { max-width:100%; }
  body.jj-phone-page :is(.share-dialog,.access-panel,.camera-lock-card,.term-popup-card,.library-dialog,.dialog) {
    max-width: calc(100vw - 24px); max-height: calc(100dvh - 28px - env(safe-area-inset-bottom)); overflow-y:auto;
    overscroll-behavior:contain;
  }
  /* Homepage: keep mobile menu and video controls comfortably touchable. */
  .jj-page-home .menu-btn { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
  .jj-page-home .menu { max-height:100dvh; overflow-y:auto; padding-bottom:max(18px,env(safe-area-inset-bottom)); }
  .jj-page-home .menu nav a { min-height:43px; }
  .jj-page-home :is(.cinema__controls button,.cinema__controls [role="button"],.detail__back,.detail__nav button) { min-height:42px; }
  .jj-page-home .cinema__timeline input[type="range"] { min-height:30px; touch-action:pan-y; }
  /* Archive and wallpapers: readable filters and swipe-friendly controls. */
  .jj-page-works .navright a, .jj-page-wallpapers .navright a { min-height:40px;display:inline-flex;align-items:center;font-size:12px; }
  .jj-page-works :is(.toolbar input,.archive-location-filters select),
  .jj-page-wallpapers :is(.toolbar input,.archive-location-filters select) { min-height:44px; }
  .jj-page-works .mode button, .jj-page-works .topics button,
  .jj-page-wallpapers .topics button { min-height:40px; }
  .jj-page-works .viewtabs, .jj-page-wallpapers .viewtabs { gap:12px; }
  .jj-page-works .viewtabs h2, .jj-page-wallpapers .viewtabs h2 { min-width:0; overflow-wrap:anywhere; }
  .jj-page-works .viewer__arrow { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
  /* PPT access: prevent two side-by-side controls becoming too narrow. */
  .jj-page-ppt .access-panel { width: min(100%, 470px); padding:clamp(20px,6vw,35px); }
  .jj-page-ppt .access-form { display:flex; flex-wrap:wrap; gap:10px; }
  .jj-page-ppt .access-form input { flex:1 1 100%; width:100%; min-height:46px; }
  .jj-page-ppt .access-form button { flex:1 1 100%; min-height:46px; }
  .jj-page-ppt .filters :is(input,select,button) { min-height:44px; }
  .jj-page-ppt .nav a { min-height:40px;display:inline-flex;align-items:center; }
  /* Camera recommender: navigation, questions and modal close targets. */
  .jj-page-camera .mobile-nav { min-width:44px; min-height:44px; }
  .jj-page-camera .topbar nav.open { max-height:calc(100dvh - 65px); overflow-y:auto; }
  .jj-page-camera :is(.hero-actions .btn,.wizard-controls .btn,.term-popup-close,.option,.term-help) { min-height:44px; }
  .jj-page-camera .wizard-controls { gap:9px; }
  .jj-page-camera .wizard-controls .btn { flex:1 1 auto; }
  .jj-page-camera .term-popup { padding:12px; }
  /* Camera database admin: keep controls usable in narrow portrait view. */
  .jj-page-camera-manager .header nav { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:12px; }
  .jj-page-camera-manager .header nav a { display:inline-flex; min-height:40px; align-items:center; }
  .jj-page-camera-manager :is(.studio-nav-item,.toolbar button,.catalog-primary button,.modal-actions button) { min-height:44px; }
  .jj-page-camera-manager .dialog { max-height:calc(100dvh - 22px); }
  .jj-page-camera-manager .settings-footer { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
  /* Administrator: long navigation and form controls need full touch targets. */
  .jj-page-admin .top-actions a { display:inline-flex; align-items:center; min-height:40px; }
  .jj-page-admin :is(.tab,.admin-nav-link,.tabs button) { min-height:42px; }
  .jj-page-admin :is(.primary,.secondary,.library-actions button,.library-kind-tabs button) { min-height:42px; }
  .jj-page-admin :is(.panel input,.panel select,.panel textarea,.library-filters input,.library-filters select) { min-height:44px; }
  .jj-page-admin :is(.library-modal,.modal) { padding:12px; }
  .jj-page-admin .library-dialog { padding:16px; }
  /* ATLAS: mobile-only owner actions menu, never hide functions off-screen. */
  .jj-page-atlas .topbar { min-width:0; position:relative; }
  .jj-page-atlas .topbar .brand { min-width:0; }
  .jj-page-atlas .atlas-phone-actions-toggle { margin-left:auto; flex:none; min-width:42px; min-height:40px; display:inline-flex!important; align-items:center; justify-content:center; }
  .jj-page-atlas .topbar__right.owner-only { display:none!important; }
  .jj-page-atlas .topbar__right.owner-only.is-phone-open {
    display:flex!important; position:absolute; right:10px; left:auto; top:calc(100% - 1px);
    z-index:1800; width:min(285px,calc(100vw - 20px)); max-height:min(70dvh,440px); overflow-y:auto;
    flex-direction:column; align-items:stretch; gap:6px; padding:12px;
    border:1px solid #7c674b; border-radius:8px; background:rgba(13,16,19,.98);
    box-shadow:0 14px 46px #000a;
  }
  .jj-page-atlas .topbar__right.owner-only.is-phone-open :is(button,a) {
    display:flex!important; justify-content:center; align-items:center; min-height:42px; max-width:100%!important;
    flex:none; white-space:normal; overflow-wrap:anywhere; font-size:12px!important;
  }
  .jj-page-atlas .topbar__right.owner-only.is-phone-open [hidden] { display:none!important; }
  /* Preserve existing guest/read-only/editor permission visibility. */
  .jj-page-atlas:is(.share-view,.collab-view,.collab-editor,.atlas-guest,.atlas-photos) .atlas-phone-actions-toggle,
  .jj-page-atlas:is(.share-view,.collab-view,.collab-editor,.atlas-guest,.atlas-photos) .topbar__right.owner-only.is-phone-open {
    display:none!important;
  }
  .jj-page-atlas :is(.map-filter-panel,.map-filter-pop,.share-dialog,.atlas-import-dialog,.atlas-repair-dialog) {
    max-width:calc(100vw - 20px);
  }
  .jj-page-atlas .map-toplabel { overflow-wrap:anywhere; }
  .jj-page-atlas .modal-cover { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
  .jj-page-atlas :is(.modal-footer,.atlas-import-footer) { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
  /* Never displace mobile map markers or Leaflet's pan/zoom layer. */
}
@media screen and (max-width: 360px) {
  .jj-page-home .menu nav a { min-height:41px; }
  .jj-page-camera .topbar .brand__latin { display:none; }
  .jj-page-camera .lens-choices { grid-template-columns:1fr; }
  .jj-page-works .navright, .jj-page-wallpapers .navright { gap:7px; }
  .jj-page-works .navright a, .jj-page-wallpapers .navright a { font-size:11px; }
  .jj-page-atlas .topbar__label { display:none; }
}
@media screen and (max-width:767px) and (prefers-reduced-motion:reduce) {
  body.jj-phone-page *, body.jj-phone-page *::before, body.jj-phone-page *::after { scroll-behavior:auto!important; }
}
