/*
 * Inpi Sumbawm — mobile app shell
 * ===============================
 * Loaded after platform.css, only from this checkout's override asset root, so the
 * shared CodeIgniter tree (and the site on :8030) is untouched.
 *
 * Everything here is behind a mobile media query or a coarse-pointer query. Desktop
 * rendering is deliberately unchanged: the audit that motivated each rule was run at
 * 390x844, and the desktop layout at >768px already works.
 *
 * The rules are grouped by the defect they fix, measured on /dashboard/admin:
 *   - inputs rendered at 12-13px, which makes iOS Safari zoom the page on focus
 *   - 29 tap targets below the 44px floor (sidebar nav items are 40px, the drawer
 *     button 34x34)
 *   - a data table 785px wide inside a 327px column, so the only way to read a row
 *     was to scroll it sideways
 *   - no bottom navigation, the one chrome element that most separates a web page
 *     from an app on a phone
 */

/* ---------------------------------------------------------------------------
 | 1. Tokens
 |
 | Safe-area values are 0 unless the document opts in with viewport-fit=cover,
 | which the shell now sets. env() with a fallback keeps this valid on browsers
 | that never expose the variables at all.
 --------------------------------------------------------------------------- */
:root {
  --mapp-safe-top: env(safe-area-inset-top, 0px);
  --mapp-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mapp-safe-left: env(safe-area-inset-left, 0px);
  --mapp-safe-right: env(safe-area-inset-right, 0px);
  --mapp-tabbar-height: 58px;
  --mapp-ink: #0f3d7a;
  --mapp-ink-dim: #64748b;
  --mapp-surface: #ffffff;
  --mapp-line: rgba(15, 61, 122, .14);
  --mapp-press: rgba(15, 61, 122, .08);
  --mapp-radius: 14px;
  --mapp-shadow: 0 2px 10px rgba(13, 27, 62, .07);
  /* Set by mobile-app.js from the real element height so content can clear it. */
  --mapp-topbar-height: 0px;
}

/* ---------------------------------------------------------------------------
 | 2. Native feel primitives
 |
 | Applied on touch devices rather than by width: a narrow desktop window should
 | keep its text selection and hover affordances.
 --------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    /* Stops the scroll chaining that makes a page feel like a document: without
       it, scrolling past the end of a modal drags the page behind it. */
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
  }

  /* Removes the ~300ms click delay without disabling pinch-zoom on the page. */
  a, button, .nav-item, [role="button"], [onclick], input[type="submit"], label {
    touch-action: manipulation;
  }

  /* App chrome should not look like selectable text. Content still selects. */
  .navbar, .topbar, .sidebar, .mapp-tabbar, .nav-item, .nav-toggle,
  .mobile-menu-btn, .mapp-card__label {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* Press feedback. Native controls dim or depress on touch; web buttons do
     nothing until the click lands, which reads as lag.

     After a short wait (2026-10-02, "the screen blinks when scrolling"): a finger
     that lands on a card or button to scroll the page makes it :active for the
     moment before the scroll starts, so every scroll that began on one shrank it
     and snapped it back — a blink under the finger. The .08s delay lets a scroll
     cancel the press before anything shows; a real tap still depresses, and
     letting go snaps back at once as before. */
  button:active, .nav-item:active, .btn:active, .mapp-tab:active,
  .mapp-card:active, [role="button"]:active {
    transform: scale(.975);
    transition: transform .06s ease-out .08s;
  }

  @media (prefers-reduced-motion: reduce) {
    button:active, .nav-item:active, .btn:active, .mapp-tab:active,
    .mapp-card:active, [role="button"]:active { transform: none; }
  }
}

/* ---------------------------------------------------------------------------
 | 3. Form controls
 |
 | iOS Safari zooms the viewport whenever a focused control computes below 16px,
 | then leaves the page zoomed. The audit found five such controls on the admin
 | dashboard alone (12-13px). Padding is trimmed so the control does not grow.
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
    /* 16px in a control sized for 13px would otherwise overflow its box. */
    line-height: 1.25;
  }

  .search-bar__input,
  .search-bar input {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Date inputs on iOS render a native picker; give it room to breathe. */
  input[type="date"], input[type="datetime-local"], input[type="time"] {
    min-height: 44px;
  }
}

/* ---------------------------------------------------------------------------
 | 4. Tap targets
 |
 | 44px is the documented minimum on both platforms. These were 40px (sidebar
 | rows) and 34px (the drawer button).
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-item,
  .sidebar a,
  .sidebar button {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mobile-menu-btn,
  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar button,
  .topbar a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Row actions inside the cards. These were 28x28 icon buttons and an 18px-tall
     text button for the applicant name — the two things a staff member taps most
     on this screen. Padding rather than height keeps the card compact. */
  .tbl-action-icon-btn,
  .btn-verify,
  .dash-applicant-name-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .tbl-action-icon-btn,
  .btn-verify {
    min-width: 44px;
    justify-content: center;
  }

  /* The name button is a link-like control on its own line; keep it left aligned
     and let it wrap rather than forcing a 44px-wide box around short names. */
  .dash-applicant-name-btn {
    text-align: left;
    white-space: normal;
  }

  /* Native selects measured 43px — one pixel under the floor. */
  select {
    min-height: 44px;
  }

  /* Filter buttons sat at 38px. */
  .filter-apply-btn,
  .btn.btn-primary,
  .btn.btn-secondary {
    min-height: 44px;
  }

  /* .btn-sm is deliberately compact on desktop; on touch it still has to be
     reachable. Grow the hit area with padding so the visual size barely moves. */
  .btn.btn-sm,
  .btn-outline.btn-sm {
    min-height: 44px;
    padding-top: .4rem;
    padding-bottom: .4rem;
  }
}

/* ---------------------------------------------------------------------------
 | 5. Safe areas
 |
 | Only meaningful once the shell sets viewport-fit=cover. Without these the
 | sticky topbar sits under the notch and the tab bar under the home indicator.
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .topbar,
  .navbar {
    padding-top: calc(.5rem + var(--mapp-safe-top));
    padding-left: calc(1rem + var(--mapp-safe-left));
    padding-right: calc(1rem + var(--mapp-safe-right));
  }

  /* The public site's sticky header: opaque, no backdrop blur on a phone — the same
     reason as the tab bar's (section 8). It was 96% white, so it looks the same. */
  .navbar {
    background: rgba(255, 255, 255, .99);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sidebar {
    padding-top: var(--mapp-safe-top);
    padding-bottom: calc(var(--mapp-safe-bottom) + 1rem);
  }
}

/* ---------------------------------------------------------------------------
 | 6. Drawer
 |
 | .sidebar is position:fixed at 300px and was simply shown or hidden. Sliding it
 | from the edge over a backdrop is what makes it read as a drawer rather than a
 | panel that blinks into existence.
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    will-change: transform;
    z-index: 1200;
    max-width: 86vw;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mapp-scrim {
    position: fixed;
    inset: 0;
    background: rgba(9, 20, 45, .44);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  .mapp-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* The drawer is a modal surface; the page behind it must not scroll. */
  body.mapp-drawer-open {
    overflow: hidden;
    touch-action: none;
  }

  /*
   * The public site's menu lives inside nav.navbar, which is sticky at z-index 50
   * and so a stacking context — its contents cannot rise above the scrim at 1150
   * no matter what z-index they are given. Opening the menu on a phone therefore
   * painted the scrim straight over it: the menu looked blank and every tap hit
   * the scrim instead of a link.
   *
   * Raising the bar itself is what lets the menu through. Only while the menu is
   * open, so the header keeps its usual place in the stack the rest of the time.
   */
  body.mapp-public-menu-open .navbar {
    z-index: 1200;
  }

  /* The menu panel needs its own surface, or the page shows through the gaps. */
  body.mapp-public-menu-open .nav-links.open {
    position: relative;
    z-index: 1;
  }

  @media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
    .mapp-scrim { transition: none; }
  }
}

/* ---------------------------------------------------------------------------
 | 6a. The drawer's menu scrolls
 |
 | An administrator's menu is taller than the drawer — 841px of items in the 700px
 | the nav is given — and two things went wrong with that.
 |
 | The overflow was visible, so the items past the fold were PAINTED over the
 | Recycle Bin link pinned below the nav: "Profile" and "Recycle Bin" sat on the
 | same line, one struck through the other.
 |
 | And .sidebar itself was overflow-y:hidden, so the items below the drawer's own
 | edge — Change Password and Logout — could not be reached by any gesture.
 |
 | Scrolling the nav rather than the whole drawer settles both: the brand stays at
 | the top, the Recycle Bin link stays pinned and visible at the bottom, and the
 | menu between them scrolls. body.mapp-drawer-open sets touch-action:none to stop
 | the page behind scrolling, and that inherits, so the nav has to opt back in.
 |
 | The breakpoint is 1024px, not 768px, because that is where platform.css turns
 | the sidebar into a drawer — a tablet had the same collision.
 --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .sidebar-nav {
    /* min-height:0 is what lets a flex child shrink below its content and
       scroll; without it the nav keeps its full height and overflows again. */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  /* A thin bar, so it is clear the menu continues without it taking any width. */
  .sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .28) transparent;
  }

  .sidebar-nav::-webkit-scrollbar { width: 4px; }
  .sidebar-nav::-webkit-scrollbar-track { background: transparent; }

  .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .28);
    border-radius: 4px;
  }

  /* The drawer itself no longer needs to move; the nav inside it does. */
  .sidebar {
    overflow: hidden;
  }
}

/* ---------------------------------------------------------------------------
 | 7. Tables rendered as cards
 |
 | The queue table was 785px wide in a 327px column. Sideways scrolling hides the
 | column you need and was what made the applicant name appear to collide with the
 | phone number. mobile-app.js copies each header into a data-label on the cell;
 | these rules stack them into one card per row, label left, value right.
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  table.mapp-carded thead {
    /* Not display:none — that removes the headers from the accessibility tree.
       The labels are reproduced per cell below. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* The header cells must also stop behaving like a table row. Left as
     table-cell they still lay out side by side — "Actions" measured a right edge
     of 482px inside a 327px column — and that phantom row is scrollable width
     even though nothing of it is painted. */
  table.mapp-carded thead tr,
  table.mapp-carded thead th {
    display: block;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
  }

  table.mapp-carded,
  table.mapp-carded tbody,
  table.mapp-carded tr,
  table.mapp-carded td {
    display: block;
    width: 100%;
    /* Without this the cell padding is added to the 100% width and each card
       overhangs its column by the padding — 15px of residual sideways scroll. */
    box-sizing: border-box;
    max-width: 100%;
  }

  table.mapp-carded {
    border-collapse: separate;
    border-spacing: 0;
    /* Undo the horizontal scroller the desktop layout puts around it. */
    min-width: 0 !important;
    overflow: visible !important;
  }

  table.mapp-carded tr {
    background: var(--mapp-surface);
    border: 1px solid var(--mapp-line);
    border-radius: var(--mapp-radius);
    box-shadow: var(--mapp-shadow);
    padding: .25rem .15rem;
    margin: 0 0 .6rem;
  }

  table.mapp-carded td {
    display: grid;
    /* Both tracks must be allowed to shrink. With a 6.5rem floor on the label and
       a bare 1fr value, a wide flex cell (.dash-applicant-cell: avatar + name +
       reference) refuses to compress and pushes the card past the column. */
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    padding: .5rem .8rem;
    border: 0;
    text-align: left;
    min-height: 0;
  }

  /* Grid and flex children default to min-width:auto, which means "never shrink
     below my content". Everything inside a card must be allowed to wrap instead. */
  table.mapp-carded td > *,
  table.mapp-carded td > * > * {
    min-width: 0;
    max-width: 100%;
  }

  /* Below ~360px the two-column card stops being readable; stack instead. */
  @media (max-width: 359px) {
    table.mapp-carded td {
      grid-template-columns: 1fr;
      gap: .15rem;
    }
  }

  table.mapp-carded td + td {
    border-top: 1px dashed rgba(15, 61, 122, .1);
  }

  table.mapp-carded td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mapp-ink-dim);
    padding-top: .12rem;
  }

  /* A cell whose header was blank (checkboxes, row actions) spans the card. */
  table.mapp-carded td[data-label=""] {
    grid-template-columns: 1fr;
  }

  table.mapp-carded td[data-label=""]::before {
    display: none;
  }

  /* Long unbroken values — emails, reference codes — must wrap, not overflow. */
  table.mapp-carded td {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /*
   * Inside a card there is vertical room, so nothing needs to be clipped. The
   * desktop table truncates with ellipses to keep columns aligned — a member name
   * was set nowrap in a 128px box and ran to 186px — but a card can simply wrap,
   * and a staff member reading a list of names should see all of each one.
   */
  table.mapp-carded td,
  table.mapp-carded td strong,
  table.mapp-carded td span,
  table.mapp-carded td div,
  table.mapp-carded td a {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
  }

  /* The wrapper platform.css puts around tables no longer needs to scroll. */
  .mapp-carded-wrap {
    overflow-x: visible !important;
  }

  /* Stand-in sort control for a carded table — see addSortControl(). */
  .mapp-sortbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .6rem;
    padding: .4rem .6rem;
    background: rgba(15, 61, 122, .045);
    border: 1px solid var(--mapp-line);
    border-radius: 10px;
  }

  .mapp-sortbar__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--mapp-ink-dim);
    flex: 0 0 auto;
  }

  .mapp-sortbar__select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
    border: 1px solid var(--mapp-line);
    border-radius: 8px;
    background: var(--mapp-surface);
    color: var(--mapp-ink);
    padding: 0 .5rem;
  }

  /*
   * Empty-state rows. These are a single cell spanning the table with a sentence
   * set to white-space:nowrap — fine across a desktop table, 457px wide inside a
   * 333px phone column, where it was the largest remaining overflow in the app.
   * A sentence has no reason not to wrap.
   */
  .table-empty-cell,
  .table-empty-cell *,
  [class*="-empty__hint"],
  [class*="-empty__title"],
  td[colspan] {
    white-space: normal !important;
  }
}

/* ---------------------------------------------------------------------------
 | 8. Bottom tab bar
 |
 | Built by mobile-app.js from the sidebar's own entries, so it stays correct for
 | whichever role is signed in rather than hardcoding an admin's menu.
 --------------------------------------------------------------------------- */
.mapp-tabbar {
  display: none;
}

@media (max-width: 768px) {
  .mapp-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    /*
     * Opaque, without a backdrop blur (2026-10-02, "the screen blinks when
     * scrolling"). A blur behind a fixed bar is recomputed from the content moving
     * under it on every frame of a scroll, and on many Android phones that shows as
     * flashing at the bar's edge. At 93% white the blur was barely visible anyway.
     */
    background: #fff;
    border-top: 1px solid rgba(26, 45, 90, .08);
    padding-bottom: var(--mapp-safe-bottom);
    padding-left: calc(6px + var(--mapp-safe-left));
    padding-right: calc(6px + var(--mapp-safe-right));
    box-shadow: 0 -6px 18px rgba(13, 27, 62, .07);
  }

  /*
   * Redrawn 2026-10-06 (owner: "re design the button menu"): line icons in one style
   * (mobile-app.js draws them), and the tab you are on carried by a soft pill behind
   * its icon with its word in the brand navy — the way Android and iOS mark the
   * current tab — instead of a 1px nudge. One design for the public site, members and
   * staff.
   */
  .mapp-tab {
    flex: 1 1 0;
    min-width: 0;
    height: var(--mapp-tabbar-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: none;
    color: #6b7894;
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    padding: 0 2px;
    -webkit-tap-highlight-color: transparent;
  }

  .mapp-tab__icon {
    width: 48px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background-color .18s ease, color .18s ease;
  }

  .mapp-tab__icon svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .mapp-tab__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mapp-tab[aria-current="page"],
  .mapp-tab.is-active {
    color: #14306b;
  }

  .mapp-tab[aria-current="page"] .mapp-tab__icon,
  .mapp-tab.is-active .mapp-tab__icon {
    background: rgba(20, 48, 107, .1);
  }

  .mapp-tab[aria-current="page"] .mapp-tab__label,
  .mapp-tab.is-active .mapp-tab__label {
    font-weight: 700;
  }

  /* The press, felt before the page changes. */
  .mapp-tab:active .mapp-tab__icon {
    background: rgba(20, 48, 107, .06);
  }

  .mapp-tab:focus-visible {
    outline: none;
  }

  .mapp-tab:focus-visible .mapp-tab__icon {
    box-shadow: 0 0 0 2px #2f6fbf;
  }

  @media (prefers-reduced-motion: reduce) {
    .mapp-tab__icon { transition: none; }
  }

  /* A number on the icon's corner: instalments to pay, on the Loan tab. */
  .mapp-tab__icon {
    position: relative;
  }

  .mapp-tab__badge {
    position: absolute;
    top: -5px;
    left: calc(50% + 5px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    box-sizing: border-box;
    font-family: inherit;
  }

  /*
   * Content must clear the bar, including on devices with a home indicator.
   *
   * Applied to #app only. Listing .content and .dash-layout as well added the same
   * ~66px three times over on a dashboard, where the nesting is
   * #app > .dash-layout > .content — 132px of dead space below every screen. The page
   * scrolls as one document, so a single clearance on the outermost element is what
   * is actually needed.
   */
  body.mapp-has-tabbar #app {
    padding-bottom: calc(var(--mapp-tabbar-height) + var(--mapp-safe-bottom) + 8px);
  }

  /* The drawer covers the tab bar while open, as on iOS/Android. */
  body.mapp-drawer-open .mapp-tabbar {
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
}

/* ---------------------------------------------------------------------------
 | 8a. The public header, on a phone (2026-10-06)
 |
 | Menu button first, then the logo, and Login — My Account for someone signed in —
 | in the right-hand corner, where it was the last tab of the bottom bar before.
 | mobile-app.js adds the button (.mapp-account-btn) and marks the header
 | .mapp-public-head. The home page's bar has the menu; the About, Contact, Ready
 | Reckoner and policy pages keep their "Back to Home" beside the logo.
 |
 | public-layout.css hides every inner-page header button but the way home, with
 | !important; the selectors below out-rank it for this one button.
 --------------------------------------------------------------------------- */
body .mapp-public-head button.mapp-account-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .mapp-public-head {
    display: flex !important;
    align-items: center !important;
    column-gap: .5rem !important;
  }

  /* Home: ☰ · logo ··· Login. The menu panel, when open, takes its own row below. */
  .public-page .navbar.mapp-public-head {
    flex-wrap: wrap;
  }

  .public-page .navbar.mapp-public-head > .nav-toggle {
    order: -1;
    margin: 0 !important;
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .public-page .navbar.mapp-public-head > .brand-home-link,
  .public-page .navbar.mapp-public-head > .nav-logo {
    order: 0;
  }

  .public-page .navbar.mapp-public-head > .mapp-account-btn {
    order: 1;
  }

  .public-page .navbar.mapp-public-head > .nav-links {
    order: 2;
  }

  body .mapp-public-head button.mapp-account-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-left: auto !important;
    flex: 0 0 auto;
    /* Owner 2026-10-08: "a bit smaller and longer" — lower than Back to Home, wider pill. */
    height: 34px;
    min-height: 34px;
    min-width: 108px;
    padding: 0 1.2rem 0 1rem;
    border: 0;
    border-radius: 999px;
    background: #14306b;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(20, 48, 107, .18);
    -webkit-tap-highlight-color: transparent;
  }

  body .mapp-public-head button.mapp-account-btn svg {
    width: 16px;
    height: 16px;
    display: block;
  }

  body .mapp-public-head button.mapp-account-btn:active {
    background: #0f2552;
  }

  body .mapp-public-head button.mapp-account-btn:focus-visible {
    outline: 2px solid #2f6fbf;
    outline-offset: 2px;
  }
}

/* ---------------------------------------------------------------------------
 | 9. Install prompt
 |
 | Shown only when the browser actually fires beforeinstallprompt, and only once
 | per dismissal (mobile-app.js remembers the choice).
 --------------------------------------------------------------------------- */
.mapp-install {
  display: none;
}

@media (max-width: 768px) {
  .mapp-install.is-visible {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--mapp-tabbar-height) + var(--mapp-safe-bottom) + 12px);
    z-index: 1160;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    background: var(--mapp-surface);
    border: 1px solid var(--mapp-line);
    border-radius: var(--mapp-radius);
    box-shadow: 0 8px 28px rgba(13, 27, 62, .16);
    animation: mapp-rise .26s cubic-bezier(.32, .72, 0, 1);
  }

  .mapp-install__icon { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; }
  .mapp-install__text { flex: 1 1 auto; min-width: 0; font-size: 12.5px; line-height: 1.3; color: var(--mapp-ink); }
  .mapp-install__text b { display: block; font-size: 13.5px; }
  .mapp-install__go,
  .mapp-install__no {
    flex: 0 0 auto;
    min-height: 44px;
    border-radius: 9px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 0 .8rem;
    cursor: pointer;
  }
  .mapp-install__go { background: var(--mapp-ink); color: #fff; border: 0; }
  .mapp-install__no { background: none; color: var(--mapp-ink-dim); border: 0; padding: 0 .4rem; }
}

@keyframes mapp-rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------------------------------------
 | 10. Offline banner
 --------------------------------------------------------------------------- */
.mapp-offline {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1300;
  transform: translateY(-100%);
  transition: transform .24s ease;
  background: #8a1c1c;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  padding: calc(.42rem + var(--mapp-safe-top)) .8rem .42rem;
}

.mapp-offline.is-visible {
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
 | 11. Standalone (installed) mode
 |
 | With no browser chrome the page owns the whole screen, so it must supply the
 | padding the URL bar used to occupy.
 --------------------------------------------------------------------------- */
@media (display-mode: standalone) {
  .navbar,
  .topbar {
    padding-top: calc(.55rem + var(--mapp-safe-top));
  }

  /* A back gesture is not available in standalone on Android the way it is in a
     tab; mobile-app.js reveals this control when history allows it. */
  .mapp-back.is-visible {
    display: inline-flex;
  }
}

.mapp-back {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: none;
  font-size: 20px;
  color: var(--mapp-ink);
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
 | 12. Remaining tap targets on the public pages
 |
 | Each selector below came from measuring the page at 390px, not from guessing.
 | The aim throughout is to grow the touch area while leaving the design alone —
 | padding rather than height, and for the carousel dots a transparent border that
 | enlarges the target without enlarging the dot.
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Hero calls to action measured 42px; the section tab strip 39px.
     `.hero-landing .hero-btns .btn` in platform.css pins min-height:42px at
     specificity (0,3,0), so the first selector has to match that weight or the
     44px floor is silently ignored. */
  .hero-landing .hero-btns .btn,
  .hero-btns .btn,
  .reckoner-section-tab,
  .home-contact-cta__btn,
  .home-contact-cta__detail {
    min-height: 44px;
  }

  /* Side-scrolling lists of links that behave as navigation: 34px and 23px. */
  nav.reckoner-nav a,
  .legal-nav a,
  .reckoner-section-tabs button {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Carousel previous/next were 34x34. */
  .slider-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* The calendar toggle beside date fields on the registration form: 38x40. */
  .platform-date-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  /* Status filter chips on the members hub measured 31px tall. They are the
     primary filter on that screen, so they have to be comfortable to hit. */
  /* Matched on the element as well as the class: a bare [class*="status-chip"]
     also selects .members-hub-status-chip__dot, the 7x7 circle inside each chip,
     and stretching that to 44px turned it into a vertical bar down the chip. */
  button[class*="status-chip"],
  a[class*="status-chip"],
  button[class*="filter-chip"],
  a[class*="filter-chip"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Their row is a wrapping flex container left at align-items:normal, so every
     chip stretched to the tallest one on its line — a 44px pill rendered 59px tall
     and egg-shaped once the radius was applied. Centring keeps each at its own
     height. */
  .members-hub-status-nav__chips,
  [class*="status-nav__chips"],
  [class*="chips"] {
    align-items: center;
  }

  /*
   * Carousel dots are 7x7 — far below the floor, and the control a thumb reaches
   * for most on the hero. A transparent border enlarges the hit box while
   * background-clip keeps the painted dot exactly the size it was; negative
   * margins stop the row from growing.
   */
  .hero-dot {
    /* 7px dot + 2x19px transparent border = a 45px target. */
    border: 19px solid transparent;
    /* !important because platform.css sets `background` as a shorthand on .hero-dot
       and again on .hero-dot.active, and a background shorthand resets
       background-clip to border-box. Without this the transparent border paints as a
       45px filled circle and the ten dots overlap into one blob. */
    background-clip: content-box !important;
    margin: -19px -13px;
    box-sizing: content-box;
  }

  /*
   * Footer links are 18px tall inline text. Stretching them to 44px would double
   * the footer, so give each a comfortable vertical hit area instead and let the
   * rows space themselves.
   */
  .footer-contact-line a,
  .footer-bottom-links a {
    display: inline-block;
    /* 18px of text + 2x13.6px = a 45px target, without a 44px-tall box around
       each one that would double the footer's height. */
    padding-block: .85rem;
  }

  /* The footer link lists (10 entries at 23px tall). Same treatment: a taller hit
     area per row, which a stacked footer has room for. */
  footer li > a,
  .footer li > a,
  .site-footer li > a,
  .footer-links li > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ---------------------------------------------------------------------------
 | 13. Public site fixes found in the mobile audit
 --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* The advisory strip clipped mid-sentence ("Use only this official portal and
     your r"). It is a security notice, so it has to be readable: let it wrap. */
  .topnotice, .top-notice, .notice-bar, .alert-strip {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.35;
  }

  /*
   * Hero copy sits over a photograph.
   *
   * The markup already calls this element a panel and carries a blur, but its
   * background computes to transparent at phone width, so dark body text landed
   * directly on a bright photo and could not be read. The panel is restored rather
   * than invented — same shape, same blur, just actually opaque enough to hold text.
   *
   * --panel is named explicitly and marked important because the plain .hero-content
   * rule loses to it.
   */
  .hero-copy,
  .hero-content,
  .hero-content--panel,
  .hero-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(255, 255, 255, .88)) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: 12px;
  }
}
