/* The app's frame on a phone (18 November 2026). Loaded last, after rules-pass.css.

   The owner: "este componente es sumamente feo, mejorarlo considerablemente, además el topbar de móvil también es super
   feo. Mejóralo, y quizás su aparición de uno y de otro puede depender del scroll".

   - The bar at the foot: one frosted capsule, five equal places, each an icon over a short word on the same line as the
     others. The place you are in sits on a soft lilac plate that slides to the next place with the family's spring; New post
     is a small ink pill with its plus, over its word, in line with the rest; Me is the portrait.
   - The bar at the top: clear over the page's field at the very top, frosted paper with a hairline once the page moves under
     it. Search is a pill with its word; the notifications are a round bell with the count on it. On an inner page Back is a
     pill of the same kind.
   - Going down a page both bars slide away, the top one up and the bottom one down, on the same long soft curve; any move up
     brings both back (index.html already says when: #appTopbar.topbar-hidden and html.top-away). Back to top steps down
     to the corner while the foot bar is away. */

@media (max-width: 1023.98px) {
  /* ── the bar at the foot ── */
  html body .mnav { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; height: 66px; padding: 6px; border: 1px solid var(--cl-line-2); border-radius: 24px; background: color-mix(in srgb, var(--cl-surface) 84%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 14px 34px -16px rgba(14, 14, 18, .3); isolation: isolate; transition: transform .46s cubic-bezier(.32, .72, 0, 1); }
  /* a tablet (640-1023): the capsule stays 560 px at most and centred between its 12 px edges. index.html centres it there
     with left 50% and a translate of -50%, which this sheet's left/right undo, so the translate is undone too (it threw the
     capsule 280 px off the left edge, Home and Discussions out of reach; 19 November 2026). html.top-away below is the
     stronger rule, so the slide away still happens. */
  html body .mnav { width: auto; max-width: 560px; margin-inline: auto; transform: none; }
  /* the plate under the place you are in, sliding from place to place */
  html body .mnav { --mi: 0; }
  html body .mnav::before { content: ''; position: absolute; z-index: -1; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); border-radius: 18px; background: color-mix(in srgb, var(--cl-lilac) 14%, var(--cl-surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cl-lilac) 18%, transparent); transform: translateX(calc(var(--mi) * 100%)); transition: transform .45s var(--cl-spring), opacity .2s var(--cl-out); }
  html body .mnav:has(> :nth-child(2).mnav-active) { --mi: 1; }
  html body .mnav:has(> :nth-child(4).mnav-active) { --mi: 3; }
  html body .mnav:has(> :nth-child(5)[aria-expanded="true"]) { --mi: 4; }
  html body .mnav:not(:has(> .mnav-active)):not(:has(> [aria-expanded="true"]))::before { opacity: 0; }
  html body .mnav-item, html body .mnav-create { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 52px; min-width: 0; margin: 0; padding: 0 2px; border-radius: 18px; background: transparent !important; font-family: var(--cl-sans); font-size: 11.5px !important; font-weight: 400; letter-spacing: 0 !important; line-height: 1.1; color: var(--cl-ink-3); white-space: nowrap; transition: color .2s var(--cl-out); }
  html body .mnav-item .mnav-ic { font-size: 23px; color: var(--cl-ink-3); transform: none !important; transition: color .2s var(--cl-out); }
  html body .mnav-item.mnav-active, html body .mnav-item[aria-expanded="true"] { color: var(--cl-ink); }
  html body .mnav-item.mnav-active .mnav-ic { color: color-mix(in srgb, var(--cl-lilac) 70%, var(--cl-ink)); }
  html body .mnav-item:active, html body .mnav-create:active { scale: .95; }
  /* New post: a small ink pill with its plus, its word under it like the others */
  html body .mnav-create-w { font-size: 11.5px !important; color: var(--cl-ink-2); }
  html body .mnav-create-btn { width: 46px !important; height: 28px !important; border-radius: 10px !important; background: var(--cl-ink) !important; color: var(--cl-surface) !important; box-shadow: 0 6px 14px -8px rgba(14, 14, 18, .5) !important; }
  html body .mnav-create-btn i { font-size: 17px !important; }
  /* Me: the portrait, ringed in lilac while the account sheet is open */
  html body .mnav-avatar { width: 25px; height: 25px; border: 1px solid var(--cl-line-2); transform: none !important; }
  html body .mnav-item[aria-expanded="true"] .mnav-avatar { box-shadow: 0 0 0 2px var(--cl-surface), 0 0 0 3.5px var(--cl-lilac) !important; }
  html body .mnav-item:focus-visible, html body .mnav-create:focus-visible { outline: 2px solid var(--cl-lilac); outline-offset: -2px; }

  /* going down, the foot bar slides away, and Back to top leaves with it: in the corner it covered a card's Save and the words
     of a comment (19 November 2026). It fades and settles a little smaller, then is hidden so Tab does not stop on it; any move
     up brings it back with the bars, where it was. */
  html.top-away body .mnav { transform: translateY(calc(100% + 24px + env(safe-area-inset-bottom))); }
  html body #backTop { transition: opacity .3s var(--cl-out), scale .3s var(--cl-out), transform .3s var(--cl-out), visibility 0s linear .3s; }
  html.top-away body #backTop { opacity: 0; scale: .9; visibility: hidden; pointer-events: none; transition: opacity .3s var(--cl-out), scale .3s var(--cl-out), visibility 0s linear .3s; }

  /* ── the bar at the top ── */
  html body #appTopbar { height: 60px; transition: transform .46s cubic-bezier(.32, .72, 0, 1), background-color .25s var(--cl-out), box-shadow .25s var(--cl-out) !important; }
  html.is-scrolled body #appTopbar { background: color-mix(in srgb, var(--cl-surface) 88%, transparent) !important; -webkit-backdrop-filter: blur(18px) saturate(1.35) !important; backdrop-filter: blur(18px) saturate(1.35) !important; box-shadow: 0 1px 0 var(--cl-line) !important; }
  html.is-scrolled body #appTopbar::before { opacity: 0 !important; }
  /* an inner page lets it go too, as a wide screen does; any move up brings Back with it */
  html.bs-inner body #appTopbar.topbar-hidden { transform: translateY(calc(-100% - 36px)); }
  /* Search: a pill with its word */
  html body #appTopbar #mSearchBtn { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; width: auto; min-width: 0; height: 40px; padding: 0 15px 0 13px; border: 1px solid var(--cl-line-2) !important; border-radius: 999px; background: var(--cl-surface) !important; color: var(--cl-ink) !important; }
  html body #appTopbar #mSearchBtn > i { font-size: 17px !important; color: var(--cl-ink-3) !important; }
  html body #appTopbar #mSearchBtn .cl-w { font-size: 14.5px !important; color: var(--cl-ink); }
  /* the bell: round, the count on it; its word stays for a screen reader */
  html body #appTopbar #notifBtn { position: relative; display: grid; place-items: center; width: 40px; min-width: 0; height: 40px; padding: 0; border: 1px solid var(--cl-line-2) !important; border-radius: 50%; background: var(--cl-surface) !important; color: var(--cl-ink) !important; }
  html body #appTopbar #notifBtn > i { font-size: 18px !important; color: var(--cl-ink-2) !important; }
  html body #appTopbar #notifBtn .cl-w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html body #appTopbar #notifBtn #notifBadge { top: -3px !important; right: -3px !important; left: auto !important; min-width: 18px; height: 18px; border: 2px solid var(--cl-surface); font-size: 10.5px; line-height: 14px; }
  html body #appTopbar :is(#mSearchBtn, #notifBtn):hover { border-color: var(--cl-line-3) !important; background: var(--cl-surface) !important; }
  html body #appTopbar :is(#mSearchBtn, #notifBtn):active { scale: .96; }
  /* Back on an inner page: a pill of the same kind */
  html body #appTopbar #bsBack { height: 40px; padding: 0 15px 0 12px; border: 1px solid var(--cl-line-2); border-radius: 999px; background: var(--cl-surface); font-size: 14.5px; color: var(--cl-ink); }
  html body #appTopbar #bsBack > i { font-size: 17px; color: var(--cl-ink-3); }
}
@media (max-width: 1023.98px) and (prefers-reduced-motion: reduce) { html body .mnav, html body .mnav::before, html body #appTopbar, html body #backTop { transition: none !important; } }
html.a11y-reduce-motion body .mnav, html.a11y-reduce-motion body .mnav::before { transition: none !important; }

/* a tablet (768-1023) has the search field itself in the top bar (index.html #searchBox, md:block), so the Search pill of a
   phone is not drawn beside it: one search, not two (19 November 2026) */
@media (min-width: 768px) and (max-width: 1023.98px) {
  html body #appTopbar #mSearchBtn { display: none !important; }
}

/* the phone's Me sheet shows every row without a box that scrolls inside it (19 November 2026: Settings and Help were hidden
   under the fold of an inner list, 133 of 251 px shown at 390 x 844, 67 at 360 x 740). The sheet may rise to 24 px under the
   top of the screen, and its rows stand a little closer (48 px, more than a finger needs). On a screen too short even so (an
   SE, 667 px) the sheet scrolls as one, in the order it reads, and no row is hidden inside a smaller box. */
@media (max-width: 639.98px) {
  html body #userMenu.pop { max-height: calc(100dvh - 110px - env(safe-area-inset-bottom) - env(safe-area-inset-top)) !important; overflow-y: auto; overscroll-behavior: contain; }
  html body #userMenu .user-menu__links { flex: none; gap: 4px; padding-bottom: .5rem; overflow: visible; }
  html body #userMenu .user-menu__item { min-height: 48px; }
}

/* a touch screen: 44 px to the finger for the small controls that had no larger hit area (19 November 2026). Each takes the
   press on an ::after nobody sees, centred on it and at least 44 x 44 (an element already 44 or more keeps its own size);
   nothing changes how it looks. The composer's ways to start slide in a row that clips what leaves it, so on a phone the row
   lends them 7 px above and below and takes the same back from its margins: it stands where it stood. Controls whose ::after is
   already the hit area (Close in the composer and in Filters, a post's topics) are left as they are. */
@media (pointer: coarse) {
  html body #feedEveryBtn, html body #feedEveryInfo, html body #bsFirstWeek .fw-hide, html body .fc .fc-act, html body .cl-foot__links button,
  html body .fl-help, html body .cf-sheet .cr-start, html body .pf-seg button { position: relative; }
  html body #feedEveryBtn::after, html body #feedEveryInfo::after, html body #bsFirstWeek .fw-hide::after, html body .fc .fc-act::after, html body .cl-foot__links button::after,
  html body .fl-help::after, html body .cf-sheet .cr-start::after, html body .pf-seg button::after { content: ''; position: absolute; inset: min(0px, calc(50% - 22px)); }
}
/* (the row slides sideways up to 760 px, clean-post.css; its margin there is 10 px above and none below) */
@media (pointer: coarse) and (max-width: 760px) {
  html body .cf-sheet .cr-starts { padding-top: 7px; padding-bottom: 7px; margin-top: 3px; margin-bottom: -7px; }
}

/* A tablet has no sidebar: Me in the foot bar opens the account menu as a card over the bar, centred like the bar
   (index.html openMenu moves it to the body and marks it; 19 November 2026, it opened nothing at 640-1023 px) */
@media (min-width: 640px) and (max-width: 1023.98px) {
  body > #userMenu.is-tab-card { position: fixed; top: auto; right: 0; left: 0; bottom: calc(92px + env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 128px); margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; z-index: 360; transform-origin: 50% 100%; }
}

/* ── A sheet open on a phone or a tablet (19 November 2026) ──
   The owner: "cuando abres notificaciones en mobile y haces scroll down, desaparece el bottom bar pero se mantiene el modal de
   notificaciones abajo, eso está mal. Además quizás en mobile con modals así deberíamos hacer blurry la pantalla detrás del
   modal", and "lo mismo con el searchbar en mobile cuando abre". While a sheet is open the page under it holds still (family.js
   BS_SHEET pins it; html.sheet-lock), so neither bar leaves and the sheet stays where it opened. Behind the sheet the page is
   veiled as behind the centred dialogs (clean.css .hl-scrim): the page colour at 62 % and a 6 px blur, firmer under Higher
   contrast, fading in and out with the sheet, still for reduced motion. A press on the veil closes the sheet. The bars are
   under the veil with the page, as they are under a dialog: only the sheet is sharp. A wide screen keeps its dropdown cards
   over a page that stays clear (the veil is never drawn there). */
.sheet-veil { display: none; }
@media (max-width: 1023.98px) {
  html.sheet-lock { overscroll-behavior: none; }
  html body .sheet-veil { display: block; position: fixed; inset: 0; z-index: 355; background: color-mix(in srgb, var(--cl-page) 62%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; pointer-events: none; touch-action: none; -webkit-tap-highlight-color: transparent; transition: opacity .24s var(--cl-out), visibility 0s linear .24s; }
  html body .sheet-veil.is-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .24s var(--cl-out), visibility 0s; }
  html.more-contrast body .sheet-veil { background: color-mix(in srgb, var(--cl-page) 78%, transparent); }
  /* the sheets over it (the day is already above it, at 400) and their own lists, which scroll inside and never pass the
     scroll on to the page */
  html body > #notifMenu, html body > #userMenu { z-index: 360 !important; }
  html body #notifList, html body > #userMenu.pop, html body #dayPick { overscroll-behavior: contain; }

  /* the search: the same veil, blurred like the others. A phone has one veil over everything but the field (#mSearchBackdrop,
     with the top bar's own veil over its other controls); the page's second veil under it (#searchDim) is not drawn there,
     so the page is not washed twice. It fades out with the field (index.html closes it in a moment, .is-leaving). */
  html body #mSearchBackdrop { background: color-mix(in srgb, var(--cl-page) 62%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); touch-action: none; animation: sheet-veil-in .24s var(--cl-out); transition: opacity .24s var(--cl-out); }
  html body #mSearchBackdrop.is-leaving { opacity: 0; pointer-events: none; }
  html:root body #searchDim, html:root body #appTopbar::after { -webkit-backdrop-filter: blur(6px) !important; backdrop-filter: blur(6px) !important; }
  html body.msearch-open #searchDim { visibility: hidden !important; opacity: 0 !important; }
  html.more-contrast body #mSearchBackdrop, html.more-contrast:root body #searchDim, html.more-contrast:root body #appTopbar::after { background: color-mix(in srgb, var(--cl-page) 78%, transparent) !important; }
  /* a tablet's search is the field in the top bar: its veil covers the foot bar too, and the bar with the field rises over it */
  html body #searchDim { z-index: 355; }
  html body.search-open:not(.msearch-open) #appTopbar { z-index: 360 !important; }

  /* the notifications on a tablet hang from the bell, inside the top bar: the bar rises over the veil while they are open,
     its other controls veiled by its own veil (index.html adds html.veil-top) */
  html.veil-top body #appTopbar { z-index: 360 !important; }
  html.veil-top body #appTopbar::after { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .24s var(--cl-out), visibility 0s; }
  html.veil-top body #appTopbar #notifMenu { z-index: 3; }
  html.veil-top body #appTopbar #searchBox { z-index: 0; }
}
@keyframes sheet-veil-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 1023.98px) and (prefers-reduced-motion: reduce) {
  html body .sheet-veil, html body .sheet-veil.is-on, html body #mSearchBackdrop, html.veil-top body #appTopbar::after { transition: none !important; animation: none !important; }
}
html.a11y-reduce-motion body .sheet-veil, html.a11y-reduce-motion body #mSearchBackdrop { transition: none !important; animation: none !important; }
