/* I-Port native feel (native.js). Loaded last so it can settle how taps, pages and sheets behave on a phone.
   Goal: no grey tap flash, no accidental text selection, a press response on everything tappable,
   page changes that move like an app, and bottom sheets that slide in and out. */

/* 1. Taps: no grey flash, no long-press text selection or link preview, no double-tap zoom delay */
html{-webkit-tap-highlight-color:transparent;touch-action:manipulation;-webkit-text-size-adjust:100%}
.mobile-journal body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.mobile-journal :is(input,textarea,select,[contenteditable]){-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.mobile-journal img{-webkit-user-drag:none;-webkit-touch-callout:none}

/* 2. Press response. native.js adds .nv-press while a finger is down. */
.mobile-journal .nv-press{transform:scale(var(--nv-s,.97))!important;opacity:.86;transition:transform .08s ease,opacity .08s ease!important}
.mobile-journal .nv-press-row{background-color:color-mix(in srgb,var(--mj-text,#fff) 7%,transparent)!important;transition:background-color .06s!important}

/* 3. Bottom bar: frosted glass like iOS, content shows softly through it */
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 .mobile-journal #mobile-nav{background:color-mix(in srgb,var(--mj-card,#1b1b1d) 78%,transparent)!important;-webkit-backdrop-filter:blur(22px) saturate(170%);backdrop-filter:blur(22px) saturate(170%);border-top:.5px solid color-mix(in srgb,var(--mj-text,#fff) 10%,transparent)!important}
}
.mobile-journal #mobile-nav :is(a,button) svg{transition:transform .2s cubic-bezier(.3,1.6,.5,1)}
.mobile-journal #mobile-nav [aria-current=page] svg{transform:translateY(-1px) scale(1.06)}

/* 4. Bottom sheets: slide up on open and down on close, the dim fades with them.
   Uses @starting-style + allow-discrete (iOS 17.4+, Chrome 117+); older phones just open without motion. */
@media (max-width:767px){
 .mobile-journal #dialog,.mobile-journal #mj-choice-dialog{transition:transform .32s cubic-bezier(.22,1,.36,1),overlay .32s allow-discrete,display .32s allow-discrete!important;transform:translateY(105%)!important}
 .mobile-journal #dialog[open],.mobile-journal #mj-choice-dialog[open]{transform:translateY(var(--nv-drag,0px))!important;animation:none!important}
 .mobile-journal :is(#dialog,#mj-choice-dialog).nv-dragging{transition:none!important}
 @starting-style{.mobile-journal #dialog[open],.mobile-journal #mj-choice-dialog[open]{transform:translateY(105%)!important}}
 .mobile-journal #dialog:not([open]),.mobile-journal #mj-choice-dialog:not([open]){transition-duration:.26s!important;transition-timing-function:cubic-bezier(.4,0,1,1)!important}
 .mobile-journal :is(#dialog,#mj-choice-dialog)::backdrop{transition:background-color .3s,overlay .3s allow-discrete,display .3s allow-discrete;background-color:rgba(0,0,0,0)!important}
 .mobile-journal :is(#dialog,#mj-choice-dialog)[open]::backdrop{background-color:rgba(0,0,0,.55)!important}
 @starting-style{.mobile-journal :is(#dialog,#mj-choice-dialog)[open]::backdrop{background-color:rgba(0,0,0,0)!important}}
 .mobile-journal #dialog .mj-sheet-content,.mobile-journal #dialog #dialog-content{overscroll-behavior:contain}
}

/* 5. Page changes (native.js plays them with the Web Animations API). Keep the page above the fixed bar. */
.mobile-journal #page{will-change:auto}
@media (prefers-reduced-motion:reduce){
 .mobile-journal .nv-press{transform:none!important}
 .mobile-journal :is(#dialog,#mj-choice-dialog){transition:none!important}
}

/* 6. No web-style scroll bar on the right while scrolling (apps hide it) */
html,body,.mobile-journal *{scrollbar-width:none}
html::-webkit-scrollbar,body::-webkit-scrollbar,.mobile-journal ::-webkit-scrollbar{display:none;width:0;height:0}
