/* Nect Me: styles for the Phones lane (lane word native, class prefix nt-). Use the tokens in app.css; never type a colour or a corner size by hand. */

/* ---------------------------------------------------------------------------------------------
   The top of the screen inside the phone apps (docs/master-plan/working/map-phone-apps.md, section 4).

   Why: the iPhone app draws the page edge to edge (no automatic room for the notch), and a thumb aimed at a button in the top row
   landed partly in the clock strip, where nothing could be tapped. The bars gave no breathing room under the notch, the Back
   arrow sat 10 points from the left edge (exactly where the iPhone's own swipe back starts), and six things ignored the notch.

   Where it applies: inside the iPhone app (the app adds the class nt-app to the page at once, before anything is drawn), and in any
   page shown as an installed app (the Android app and a site added to the Home Screen). In an ordinary browser tab nothing changes.
   --------------------------------------------------------------------------------------------- */
:root{--nt-gap:0px}
html.nt-app{--nt-gap:8px;--d-bar:52px}
@media (display-mode:standalone),(display-mode:fullscreen){
  :root{--nt-gap:8px;--d-bar:52px}
}

/* Room under the notch, and a taller bar, on every top bar. */
.topbar{padding-top:calc(env(safe-area-inset-top) + var(--nt-gap));min-height:calc(var(--d-bar) + env(safe-area-inset-top) + var(--nt-gap))}
.apphead{padding-top:calc(env(safe-area-inset-top) + var(--nt-gap));min-height:calc(var(--d-bar) + env(safe-area-inset-top) + var(--nt-gap))}
.wiz__top{padding-top:calc(env(safe-area-inset-top) + var(--nt-gap));min-height:calc(var(--d-bar) + env(safe-area-inset-top) + var(--nt-gap))}
.wiz__prog{margin-top:calc((env(safe-area-inset-top) + var(--nt-gap)) / 2)}
.app--list .listtools{top:calc(var(--d-bar) + env(safe-area-inset-top) + var(--nt-gap))}

/* The Back arrow: moved in from the very edge (the iPhone's swipe back starts there), and a tap area at least 56 wide that reaches
   the full height of the bar and up to the top of the screen, so a thumb that lands in the clock strip still presses it. */
.topbar--back{padding-left:20px}
.topbar--back>.iconbtn:first-child{position:relative;width:56px;height:var(--d-bar);border-radius:var(--r-s)}
.topbar--back>.iconbtn:first-child::before{content:"";position:absolute;left:0;right:0;bottom:0;top:calc(-1 * (env(safe-area-inset-top) + var(--nt-gap)))}
.wiz__top .iconbtn:first-child{position:relative}

/* Six things that ignored the notch. */
.mo-box__x{top:calc(10px + env(safe-area-inset-top))}                 /* the photo viewer's close button */
.mo-box__by{bottom:calc(16px + env(safe-area-inset-bottom))}
.bs__bar{top:calc(12px + env(safe-area-inset-top))}                   /* the big screen's bar */
.cap__rec{top:calc(12px + env(safe-area-inset-top))}                  /* the recording mark */
.navbar{top:env(safe-area-inset-top)}                                 /* the page loading line */
.skip:focus{top:calc(12px + env(safe-area-inset-top))}                /* the skip link */
/* The create-event progress line sticks under the top bar (the bar itself carries the notch). Before, both stuck at the very top and the line hid behind the bar. */
.eprog{top:calc(var(--d-bar) + env(safe-area-inset-top) + var(--nt-gap))}

/* ---------------------------------------------------------------------------------------------
   Hiding what an app store does not allow, or what does nothing there.
   The page script (native.js) puts nt-ios or nt-android on the page; the server also leaves the matching words in the page.
   Print buttons do nothing inside the iPhone app (audit MOB-16).
   --------------------------------------------------------------------------------------------- */
html.nt-ios [data-print],html.nt-ios .nt-noapp{display:none!important}
html.nt-android .nt-noapp{display:none!important}

/* The settings row that tries hold and talk (Settings > About), and the words it shows. */
.nt-try{display:grid;gap:12px;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.nt-try__box{min-height:5.5em;padding:12px 14px;border:1px solid var(--line);border-radius:var(--r-s);background:var(--paper);color:var(--ink);font:var(--fs-body)/1.4 var(--f-b,system-ui);overflow-wrap:anywhere}
.nt-try__box.is-empty{color:var(--mute)}
.nt-try__hold{touch-action:none}
.nt-try__hold.is-on{background:var(--danger);color:var(--paper)}
.nt-try__note{margin:0;color:var(--mute);font-size:var(--fs-sec)}

/* The ring that shows while the phone is listening. It is always visible, never a hidden recording. */
.nt-ring{display:inline-flex;align-items:center;gap:8px;font:600 var(--fs-sec) var(--f-b,system-ui)}
.nt-ring[hidden]{display:none}
.nt-ring i{width:12px;height:12px;border-radius:50%;background:var(--danger);outline:2px solid var(--danger);outline-offset:3px;animation:nt-ring 1.2s ease-in-out infinite}
@keyframes nt-ring{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.nt-ring i{animation:none}}
