/* The app frame around every page (app/frame.js, spec/nav/FRAME.md, spec/nav/UX.md): one sticky top bar whose content
   sits in the same contained width as the pages, the account menu, the phone's bottom tabs, each layout's page slots,
   the site footer, and the shared moments (sign-in wall, "didn't load", inline errors). Colours:
   tokens only.

   Sizes: 1024 (a page's side panel stacks under it), 900 (the phone frame: a short bar on top, tabs at the bottom),
   600 (16px gutters). */

:root {
  --page-w: 1120px;   /* the one contained width: the bar's content and every page */
  --f-gutter: 24px;
  --f-top-h: calc(64px + env(safe-area-inset-top, 0px));    /* the bar, its 2px edge included (and the phone's
                       status-bar strip when the browser lets the page run under it: viewport-fit=cover) */
  --f-tabs-h: 0px;    /* the phone's bottom tabs */
  --f-side-w: 320px;
}
@media (max-width: 899px) {
  :root { --f-top-h: calc(56px + env(safe-area-inset-top, 0px)); --f-tabs-h: calc(68px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 599px) {
  :root { --f-gutter: 16px; }
}
/* ---------------------------------------------------------------- the site's size on a computer */
/* Every page drawn at 85%, as if the browser were zoomed out: on a computer (a mouse or trackpad, the desktop frame),
   never on a phone or tablet (fingers keep the full size: spec/nav/UX.md rules 20 and 26) nor in the admin (no
   frame.css). Under it, a length in vh or vw is the window's × 0.85: write calc(100vh / var(--zoom, 1)) for "the whole
   window". Scripts measure in two kinds of pixels: app/zoom.js says which, and converts. */
:root { --zoom: 1; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  :root { --zoom: 0.85; zoom: var(--zoom); }
}
/* a jump to an anchor or a focused field never lands under the sticky bar */
html { scroll-padding-top: calc(var(--f-top-h) + 16px); scroll-padding-bottom: calc(var(--f-tabs-h) + 16px); }   /* ...nor under the phone's bottom tabs (Tab moving down a page) */
body[data-layout="bare"] { --f-top-h: 0px; --f-tabs-h: 0px; }

/* ---------------------------------------------------------------- the first screen of a visit comes whole */
/* A page the server sent as its frame alone (the signed-in pages: Settings, Chats, your page; a trade) keeps its bar,
   its tabs and its notice out of sight until the app has drawn the page into #app (frame.show), so the first screen is
   the whole page at once: never the bar over an empty page, never the bars of a chat that then steps aside. After
   1.5 s they show anyway (a slow page, no script). */
body:has(> #app:empty) > :is(#banner, #topbar, #tabbar) { animation: f-hold 1.5s; }
@keyframes f-hold { from, to { visibility: hidden; } }
/* the cookie question waits with the page, however long, then slides in (never shown still, then sliding in again) */
body:has(> #app:empty) > #ck { visibility: hidden; animation-play-state: paused; }

/* ---------------------------------------------------------------- the top bar: logo · Trades · Values ··· search · + Post · icons · you */
.f-top {
  position: sticky; top: 0; z-index: 300; height: var(--f-top-h); padding-top: env(safe-area-inset-top, 0px);
  background: var(--color-snow); border-bottom: 2px solid var(--color-swan);
}
/* iOS Safari (26) draws the page under its see-through bars too: the bars' colour reaches past the screen's edges, so
   nothing that scrolled away shows above the top bar (or under the tabs, below). The banner sits above it (app/banner.css). */
.f-top::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: calc(100vh / var(--zoom, 1)); background: var(--color-snow); pointer-events: none; }
body[data-layout="bare"] .f-top, body[data-layout="bare"] .f-tabbar { display: none; }
.f-top__in {
  display: flex; align-items: center; gap: 24px; height: 100%;
  max-width: calc(var(--page-w) + 2 * var(--f-gutter)); margin: 0 auto;
  padding: 0 max(var(--f-gutter), env(safe-area-inset-right, 0px)) 0 max(var(--f-gutter), env(safe-area-inset-left, 0px));
}
.f-top__logo { flex-shrink: 0; height: 44px; border-radius: 12px; }
.f-top__logo .u-logo__word { font-size: 26px; }
.f-top__logo:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }

/* the game menu's button (spec/games/SPEC.md): the game you are in as its icon (a rounded square, as Roblox shows it)
   with a small chevron, right after the logo; the same quiet hover as the page links */
.f-game {
  position: relative; display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; height: 44px; margin: 0 -8px;
  padding: 0 4px 0 6px; border: 0; border-radius: 12px; background: none; color: var(--color-wolf); cursor: pointer;
}
.f-game__ic { display: block; width: 32px; height: 32px; border-radius: 9px; background: var(--color-swan); object-fit: cover; }
@media (hover: hover) { .f-game:hover { background: var(--color-polar); color: var(--color-eel); } }
.f-game[aria-expanded="true"] { background: var(--color-polar); color: var(--color-eel); }
.f-game[aria-expanded="true"] > .u-ic { transform: rotate(180deg); }
.f-game > .u-ic { transition: transform var(--m-fast) var(--m-ease-out); }
.f-game:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }

/* page links: plain words; the page you are on is macaw with a 3px line under it (quiet, no box) */
.f-links { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.f-link {
  position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--color-wolf); font: 700 17px/20px var(--font); text-decoration: none; white-space: nowrap;
}
@media (hover: hover) { .f-link:not(.is-active):hover { background: var(--color-polar); color: var(--color-eel); } }
.f-link.is-active { color: var(--color-macaw); }
.f-link.is-active::after, .f-ib.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 2px; background: var(--color-macaw);
}
.f-link:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }
/* Earn (frame-markup.js earnLinkHTML): a gold coin and the word in gold (the earn page's countdown colour, 4.8:1), so it
   stands out from the plain links; a pale gold under the pointer, a gold line under it on its own pages */
.f-earn { gap: 6px; padding-left: 8px; color: var(--color-timer); }
.f-earn > .u-art { flex: none; width: 24px; height: 24px; }
@media (hover: hover) { .f-earn:not(.is-active):hover { background: var(--color-canary); color: var(--color-timer); } }
.f-earn.is-active { color: var(--color-timer); }
.f-earn.is-active::after { left: 8px; background: var(--color-fox); }
/* its menu (frame.js openEarn): a small chevron says there is one; open, the link keeps its pale gold and the chevron
   turns */
.f-earn > .u-ic { flex: none; margin-left: -3px; transition: transform var(--m-fast) var(--m-ease-out); }
.f-earn[aria-expanded="true"] { background: var(--color-canary); }
.f-earn[aria-expanded="true"] > .u-ic { transform: rotate(180deg); }

/* the item search (results: app/components/search.css), on the right before + Post; / jumps here */
.f-search { position: relative; flex: 0 1 300px; min-width: 150px; margin-left: auto; }
.f-search__field { height: 42px; }
.f-search__field > svg { margin-left: 12px; }
.f-search__field > input { min-width: 0; padding: 8px; font-size: 16px; }

/* the right end: + Post, Chats (an icon with its count), your picture: 44px targets on one line */
.f-end { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-height: 44px; }
/* + Post and Sign in: one small green button, sentence case (the page's own buttons stay the big ones) */
.f-ai, .f-signin { --h: 38px; --pad: 0 16px; --fs: 16px; --ls: 0; gap: 4px; text-transform: none; }
.f-ai { --pad: 0 16px 0 6px; gap: 6px; }
.f-ai__face { display: block; flex: none; border-radius: 50%; }
.f-ai::after, .f-signin::after { content: ""; position: absolute; inset: -3px 0 -7px; }   /* a 44px hit area around the 38px button and its lip */
.f-icons { display: flex; align-items: center; gap: 4px; }
.f-ib { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; text-decoration: none; }
.f-ib > .u-art { width: 32px; height: 32px; }
.f-ib.is-active::after { left: 10px; right: 10px; }
@media (hover: hover) { .f-ib:hover { background: var(--color-polar); } }
.f-ib:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }
.f-ib > .u-count { position: absolute; top: 0; right: -2px; }
.f-me { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -4px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }   /* the 36px picture flush with the page's right edge, as the logo is with its left */
@media (hover: hover) { .f-me:hover { background: var(--color-polar); } }
.f-me[aria-expanded="true"] { box-shadow: inset 0 0 0 3px var(--color-blue-jay); }
.f-me:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }
/* the server knows a session cookie, not whose: a circle holds the picture's place until the app knows */
.f-me__ph { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--color-swan); }
/* ...and keeps holding it until the picture itself is ready (frame.js calm): then the picture on its colour comes at
   once, never the letter circle for a moment (the bar's picture, the You tab's) */
.u-avatar.f-wait > .u-avatar__img { background: var(--color-swan); color: transparent; }
.u-avatar.f-wait > .u-avatar__img > img { visibility: hidden; }
.f-find { display: none; }
/* Post a trade's "New chat" on phones, once there is a chat: in reach however far the chat has scrolled (pages/post.css
   shows it; not [hidden], whose !important would win) */
.f-newchat { display: none; }

/* ---------------------------------------------------------------- the account menu (your picture) */
.f-acct {
  position: fixed; z-index: 330; width: 280px; max-width: calc(100vw / var(--zoom, 1) - 16px); max-height: calc(100vh / var(--zoom, 1) - var(--f-top-h) - 16px); max-height: calc(100dvh / var(--zoom, 1) - var(--f-top-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
  border: 2px solid var(--u-drop-edge); border-radius: 16px; background: var(--color-snow);
  box-shadow: var(--u-drop-shadow); scrollbar-width: thin;
  animation: f-drop var(--m-fast) var(--m-ease-out) both; transform-origin: top right;
}
.f-acct.is-closing { animation: f-drop-out var(--m-fast) var(--m-ease-in) both; pointer-events: none; }
@keyframes f-drop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes f-drop-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
/* you (a link to your page): your name and one quiet line, "11 items · worth 🔥8,450" */
.f-acct__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none; }
@media (hover: hover) { .f-acct__head:hover { background: var(--color-polar); } }
.f-acct__head:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; border-radius: 14px; }
.f-acct__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.f-acct__name { color: var(--color-eel); font: 700 17px/22px var(--font); overflow-wrap: anywhere; }
.f-acct__line { color: var(--color-wolf); font: 400 15px/20px var(--font); }
/* one string, the coin glued to its number (UX.md rule 16) */
.f-acct__line .u-val { display: inline; color: var(--color-wolf); }
.f-acct__line .u-coin { margin-right: 2px; }
.f-acct__sec { padding: 6px 0; border-top: 2px solid var(--color-swan); }
/* plain rows: the words say where each goes */
.f-acct__row {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: none;
  color: var(--color-eel); font: 400 16px/20px var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
@media (hover: hover) { .f-acct__row:hover { background: var(--color-polar); } }
.f-acct__row.is-active { color: var(--color-macaw); font-weight: 700; }
.f-acct__row--quiet { color: var(--color-wolf); }
.f-acct__row:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; border-radius: 12px; }
/* phones: a sheet from the bottom, over a scrim and the tabs */
.f-acct.is-sheet {
  top: auto; right: 0; left: 0; bottom: 0; width: auto; max-width: none; max-height: calc(86vh / var(--zoom, 1)); max-height: calc(86dvh / var(--zoom, 1));
  border-width: 2px 0 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: f-sheet-up var(--m-base) var(--m-ease-out) both;
}
.f-acct.is-sheet.is-closing { animation: f-sheet-down var(--m-fast) var(--m-ease-in) both; }
.f-acct.is-sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: var(--color-swan); }
.f-acct.is-sheet .f-acct__row { min-height: 48px; font-size: 17px; }
@keyframes f-sheet-up { from { transform: translateY(100%); } }
@keyframes f-sheet-down { to { transform: translateY(100%); } }
.f-acct__scrim { z-index: 325; }

/* ---------------------------------------------------------------- page slots: one contained width, the page's own side panel */
.f-bare { display: block; min-height: calc(100vh / var(--zoom, 1) - var(--f-banner-h, 0px)); min-height: calc(100svh / var(--zoom, 1) - var(--f-banner-h, 0px)); outline: none; }
.f-main { outline: none; min-width: 0; }
/* a page change puts the focus on the new page's heading, a jump in the page on its section's (app/router.js): for
   screen readers and Tab, no ring on a heading */
:is(.f-main, .f-bare) :is(h1, h2, h3)[tabindex="-1"]:focus { outline: none; }
/* a part holding the focus while the button it was on is drawn again or busy (frame.js onFocusLost): no ring on it */
[data-focus-hold]:focus { outline: none; }
.f-page { display: flex; flex-direction: column; min-height: calc(100vh / var(--zoom, 1) - var(--f-top-h) - var(--f-tabs-h) - var(--f-banner-h, 0px)); min-height: calc(100svh / var(--zoom, 1) - var(--f-top-h) - var(--f-tabs-h) - var(--f-banner-h, 0px)); }   /* svh: iOS's 100vh is taller than what shows, so a short page would scroll; the banner's height (app/banner.js) too */
.f-grid {
  flex: 1 0 auto; display: flex; align-items: flex-start; gap: 32px; width: 100%;
  max-width: calc(var(--page-w) + 2 * var(--f-gutter)); margin: 0 auto;
  padding: 28px max(var(--f-gutter), env(safe-area-inset-right, 0px)) 64px max(var(--f-gutter), env(safe-area-inset-left, 0px));
}
.f-grid > .f-main { flex: 1 1 0; }
/* the page's side panel (ctx.side): 320 wide, sticks under the bar while it fits the window; empty, it isn't there */
.f-side {
  flex: 0 0 var(--f-side-w); width: var(--f-side-w); min-width: 0; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: calc(var(--f-top-h) + 24px);
}
.f-side.is-tall { position: static; }
.f-side:empty { display: none; }
/* 'full': the whole window under the bar, no footer (Chats) */
.f-page--full { height: calc(100vh / var(--zoom, 1) - var(--f-top-h) - var(--f-tabs-h) - var(--f-banner-h, 0px)); height: calc(100dvh / var(--zoom, 1) - var(--f-top-h) - var(--f-tabs-h) - var(--f-banner-h, 0px)); min-height: 360px; }
.f-page--full > .f-main {
  flex: 1 1 auto; min-height: 0; width: 100%; max-width: calc(var(--page-w) + 2 * var(--f-gutter)); margin: 0 auto;
  padding: 0 max(var(--f-gutter), env(safe-area-inset-right, 0px)) 0 max(var(--f-gutter), env(safe-area-inset-left, 0px));
}
/* the same grid for panels inside a page: .pg-grid > .pg-main + .pg-aside */
.pg-grid { display: flex; align-items: flex-start; gap: 32px; }
.pg-main { flex: 1 1 0; min-width: 0; }
.pg-aside { flex: 0 0 var(--f-side-w); width: var(--f-side-w); min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--f-top-h) + 24px); }

/* ---------------------------------------------------------------- the site footer (every page but 'full' and 'bare'): one row */
.f-foot { flex-shrink: 0; border-top: 2px solid var(--color-swan); }
/* a page whose first answer is on its way ([data-loading]: its placeholder block, removed in the frame the page is
   drawn) keeps the footer unseen meanwhile, so it doesn't sit under the short placeholder and then jump */
.f-page:has([data-loading]) .f-foot { visibility: hidden; }
.f-foot__in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px;
  max-width: calc(var(--page-w) + 2 * var(--f-gutter)); margin: 0 auto;
  padding: 12px max(var(--f-gutter), env(safe-area-inset-right, 0px)) 16px max(var(--f-gutter), env(safe-area-inset-left, 0px));
}
.f-foot__links { display: flex; flex-wrap: wrap; column-gap: 20px; }
.f-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-label); font: 700 14px/20px var(--font); text-decoration: none; }
@media (hover: hover) { .f-foot a:hover { color: var(--color-macaw); } }
.f-foot a:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- the phone's bottom tabs (hidden on desktop) */
.f-tabbar { display: none; }
.f-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
  padding: 0; border: 0; background: none; color: var(--color-label); font: 700 11px/14px var(--font); letter-spacing: .02em;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.f-tab__ic { position: relative; display: flex; align-items: center; justify-content: center; width: 52px; height: 34px; border-radius: 12px; }
.f-tab__ic > .u-count { position: absolute; top: -6px; right: 0; }
.f-tab.is-active { color: var(--color-macaw); }
.f-tab.is-active .f-tab__ic { background: var(--color-iguana); }
.f-tab__label { max-width: 100%; overflow: hidden; white-space: nowrap; }
/* You: your picture (28px) where the other tabs have their art; a grey circle until the app knows who you are */
.f-tab__ph { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--color-swan); }
.f-tab:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; border-radius: 12px; }
/* AI: the AI's face on a big green button with its lip, standing out of the bar */
.f-tab--ai .f-tab__ai {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 52px; margin-top: -18px; border-radius: 18px;
  background: var(--color-owl); box-shadow: 0 4px 0 var(--color-owl-lip); color: var(--color-on-bright); outline: 4px solid var(--color-snow);
}
.f-tab--ai:active .f-tab__ai { transform: translateY(4px); box-shadow: none; }

/* ---------------------------------------------------------------- the cookie question (index.html #ck, app/cookies.js)
   A toast-like bar until it is answered: one short line, then Reject and Accept, one button twice (no answer looks
   like the right one). Centred at the foot of the screen like the toasts, with the drop edge and shadow of everything
   that drops over the page (UX.md rule 24); under the bars' layer (299): their menus, popovers and windows come over
   it. Phones (< 600): the buttons under the line, across. Above the phone's tabs, clear of the big + that stands out
   of them (--ck-at: where its foot is). */
body { --ck-at: 24px; }
#ck {   /* the id: the calculator page's own root is .ck (pages/calculator-markup.js), which these rules turned into a fixed bar */
  position: fixed; z-index: 299; bottom: var(--ck-at); left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px);
  display: flex; align-items: center; gap: 24px;
  width: max-content; max-width: calc(100% - 2 * var(--f-gutter)); margin: 0 auto; padding: 12px 12px 12px 20px;
  border: 2px solid var(--u-drop-edge); border-radius: 16px; background: var(--color-snow); box-shadow: var(--u-drop-shadow);
  animation: ck-in var(--m-slow) var(--m-spring) both;
}
.ck__text { flex: 0 1 auto; min-width: 0; margin: 0 0 3px; color: var(--color-eel); font: 400 16px/22px var(--font); text-wrap: pretty; }   /* 1.5px up: on the buttons' words, which their lip lifts */
.ck__text a { color: var(--color-label); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; border-radius: 4px; transition: color var(--m-fast) var(--m-ease-out); }
@media (hover: hover) { .ck__text a:hover { color: var(--color-eel); } }
.ck__text a:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: 2px; }
.ck__acts { display: flex; flex: none; gap: 8px; }
.ck__acts > .u-btn { --h: 44px; --fs: 16px; --ls: 0; --pad: 0 20px; text-transform: none; }
/* a reload or the next page: already there, so it stays still; answered: it drops away */
#ck.is-still { animation: none; }
#ck.is-closing { animation: ck-out var(--m-fast) var(--m-ease-in) both; pointer-events: none; }
@keyframes ck-in { from { opacity: 0; translate: 0 16px; } }
@keyframes ck-out { to { opacity: 0; translate: 0 16px; } }
/* the site footer scrolls clear of it: room under the footer for it (less the phone tabs' room the page has already) */
html.ck-room .f-foot { padding-bottom: calc(var(--ck-at) - var(--f-tabs-h) + var(--ck-h, 0px)); }
/* a chat whose box is docked at the screen's foot (the landing once asked, /post): 16px over the box (assistant.css
   .as-dock: 12px over its 70px box, max(16px, the safe area) under it; the line of messages left today 24px more) */
body:has(.as.is-chat) { --ck-at: calc(98px + max(16px, env(safe-area-inset-bottom, 0px))); }
body:has(.as.is-chat.has-left) { --ck-at: calc(122px + max(16px, env(safe-area-inset-bottom, 0px))); }
/* toasts stand above it while it is there */
html.ck-on:not(.kb) .u-toasts { bottom: calc(var(--ck-at) + var(--ck-h, 0px) + 16px); }
@media print { #ck { display: none !important; } }

/* ---------------------------------------------------------------- shared moments */
.f-skip { position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 8px 12px; border-radius: 12px; background: var(--color-macaw); color: var(--color-on-bright); font-weight: 700; text-decoration: none; }
.f-skip:focus { top: 8px; }
.f-failed { padding: 48px 16px; }
/* a whole page that isn't here or didn't load (pages/notfound-markup.js, failed() on #main): the site's face over the
   title, a little lower on the page, as one centred moment at every size */
.f-art { display: block; flex: none; width: 120px; height: 120px; margin: 0 0 24px; border-radius: 50%; background: var(--color-iguana); object-fit: cover; transition: opacity var(--m-base) var(--m-ease-out); }
.f-art[data-wait] { opacity: 0; transition: none; }   /* app/frame.js artIn: out of sight until the face is loaded */
.f-failed:has(> .f-art), #main > .f-failed { padding-top: 72px; }   /* a whole page, with or without its face */
.f-wall { display: flex; justify-content: center; padding: 48px 0; }
.f-failed .u-btn + .u-btn { margin-top: 8px; }
/* phones (spec/nav/UX.md rule 20): "not found" and "This didn't load" read like any page's header, from the left: the
   title 20px, the line 15px, the button across the page (44px) */
@media (max-width: 699px) {
  .f-failed { align-items: stretch; padding: 24px 0 32px; text-align: left; }
  .f-failed .u-empty__title { font-size: 20px; line-height: 28px; }
  .f-failed .u-empty__text { font-size: 15px; line-height: 22px; }
  .f-failed .u-btn { width: 100%; max-width: none; }
  .f-failed .u-empty__title + .u-btn { margin-top: 12px; }   /* no line under the title: 20px to the button, not 8 */
  /* ...but a whole page (the face over it, or the page itself that didn't load: frame.js leaves the face out when it
     couldn't come either) is one centred moment, as on a computer: the face 96px, the title and the line centred over
     the button across the page */
  .f-failed:has(> .f-art), #main > .f-failed { align-items: center; padding-top: 48px; text-align: center; }
  .f-failed > .f-art { width: 96px; height: 96px; margin-bottom: 20px; }
}
/* a toast's bold line that wraps on a phone ("frosty_fern signed up with your link") never leaves one word alone */
.u-toast__text > b { text-wrap: balance; }
.f-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 2px solid var(--color-walking-fish); background: var(--color-walking-fish); border-radius: 16px; color: var(--color-fire-ant); }
.f-error p { margin: 0; font: 700 15px/20px var(--font); }
.u-chart__empty { margin: 0; padding: 72px 16px; text-align: center; color: var(--color-label); font: 700 15px/20px var(--font); }
.u-chart.is-loading .u-chart__plot { opacity: .45; transition: opacity var(--m-base) var(--m-ease-out); }
.u-val.is-none { color: var(--color-label); }
/* tap targets: small buttons keep their look, an invisible frame around them takes taps to at least 44px (like
   .lp-strip__arrow): Try again, buttons on banners, "See all" links, chart ranges */
.f-error .u-btn--sm::after, .u-btn--ghost.u-btn--link::after, .u-seg--sm .u-seg__opt::after { content: ""; position: absolute; inset: min(0px, calc((100% - 44px) / 2)); }
/* a picture never draws past its own size (item pictures are 150, 250 or 420px): a bigger box keeps it centred and sharp */
.u-pic > img { width: auto; height: auto; max-width: 100%; max-height: 100%; }

/* ---------------------------------------------------------------- the game menu (the game button) */
/* a box under the button, like your menu: the games you can use (the one you are in tinted and ticked), then the ones
   coming soon, named but faded and not links. Phones: a sheet from the bottom over a scrim. */
.f-games {
  position: fixed; z-index: 330; width: 288px; max-width: calc(100vw / var(--zoom, 1) - 16px); max-height: calc(100vh / var(--zoom, 1) - var(--f-top-h) - 16px); max-height: calc(100dvh / var(--zoom, 1) - var(--f-top-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
  border: 2px solid var(--u-drop-edge); border-radius: 16px; background: var(--color-snow);
  box-shadow: var(--u-drop-shadow); scrollbar-width: thin;
  animation: f-drop var(--m-fast) var(--m-ease-out) both; transform-origin: top left;
}
.f-games.is-closing { animation: f-drop-out var(--m-fast) var(--m-ease-in) both; pointer-events: none; }
.f-games__sec { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.f-games__sec + .f-games__sec { border-top: 2px solid var(--color-swan); }
.f-games__label { margin: 4px 8px 6px; color: var(--color-wolf); font: 700 14px/18px var(--font); }
.f-games__row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px; border-radius: 12px;
  color: var(--color-eel); font: 700 16px/20px var(--font); text-decoration: none;
}
a.f-games__row { cursor: pointer; }
@media (hover: hover) { a.f-games__row:not(.is-on):hover { background: var(--color-polar); } }
.f-games__row.is-on { background: var(--color-iguana); color: var(--color-whale); }
.f-games__row > .u-ic { flex: none; margin-left: auto; color: var(--color-macaw); }
.f-games__row:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; }
.f-games__ic { display: block; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--color-swan); object-fit: cover; }
.f-games__name { min-width: 0; overflow-wrap: anywhere; }
.f-games__row.is-soon { color: var(--color-wolf); cursor: default; }
.f-games__row.is-soon > .f-games__ic { opacity: .5; }
.f-games.is-sheet {
  top: auto; right: 0; left: 0; bottom: 0; width: auto; max-width: none; max-height: calc(86vh / var(--zoom, 1)); max-height: calc(86dvh / var(--zoom, 1));
  border-width: 2px 0 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: f-sheet-up var(--m-base) var(--m-ease-out) both;
}
.f-games.is-sheet.is-closing { animation: f-sheet-down var(--m-fast) var(--m-ease-in) both; }
.f-games.is-sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: var(--color-swan); }
.f-games.is-sheet .f-games__sec { padding: 8px max(12px, env(safe-area-inset-left, 0px)) 8px max(12px, env(safe-area-inset-right, 0px)); }
.f-games.is-sheet .f-games__row { min-height: 56px; font-size: 17px; }

/* ---------------------------------------------------------------- the Earn menu (the bar's Earn: frame.js openEarn) */
/* a box under the link like the game menu: the earn section's three pages, a picture and one line each, the page you
   are on tinted and ticked; it fades in lifting 6px (150 ms), at once under reduced motion. Phones: a sheet from the
   bottom over a scrim, like the game menu's */
.f-earnm {
  position: fixed; z-index: 330; width: 300px; max-width: calc(100vw / var(--zoom, 1) - 16px); max-height: calc(100vh / var(--zoom, 1) - var(--f-top-h) - 16px); max-height: calc(100dvh / var(--zoom, 1) - var(--f-top-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
  border: 2px solid var(--u-drop-edge); border-radius: 16px; background: var(--color-snow);
  box-shadow: var(--u-drop-shadow); scrollbar-width: thin;
  animation: f-lift 150ms var(--m-ease-out) both; transform-origin: top left;
}
.f-earnm.is-closing { animation: f-lift-out var(--m-fast) var(--m-ease-in) both; pointer-events: none; }
@keyframes f-lift { from { opacity: 0; transform: translateY(6px); } }
@keyframes f-lift-out { to { opacity: 0; transform: translateY(4px); } }
.f-earnm__sec { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.f-earnm__row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px; border-radius: 12px;
  color: var(--color-eel); text-decoration: none; cursor: pointer;
}
@media (hover: hover) { .f-earnm__row:not(.is-on):hover { background: var(--color-polar); } }
.f-earnm__row.is-on { background: var(--color-iguana); }
.f-earnm__row:focus-visible { outline: 2px solid var(--color-macaw); outline-offset: -2px; }
.f-earnm__ic { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--color-polar); }
.f-earnm__row.is-on .f-earnm__ic { background: var(--color-snow); }
.f-earnm__ic > .u-art { width: 28px; height: 28px; }
.f-earnm__t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.f-earnm__name { color: var(--color-eel); font: 700 16px/20px var(--font); }
.f-earnm__row.is-on .f-earnm__name { color: var(--color-whale); }
.f-earnm__sub { color: var(--color-wolf); font: 400 14px/18px var(--font); }
.f-earnm__row > .u-ic { flex: none; margin-left: auto; color: var(--color-macaw); }
.f-earnm.is-sheet {
  top: auto; right: 0; left: 0; bottom: 0; width: auto; max-width: none; max-height: calc(86vh / var(--zoom, 1)); max-height: calc(86dvh / var(--zoom, 1));
  border-width: 2px 0 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: f-sheet-up var(--m-base) var(--m-ease-out) both;
}
.f-earnm.is-sheet.is-closing { animation: f-sheet-down var(--m-fast) var(--m-ease-in) both; }
.f-earnm.is-sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: var(--color-swan); }
.f-earnm.is-sheet .f-earnm__sec { padding: 8px max(12px, env(safe-area-inset-left, 0px)) 12px max(12px, env(safe-area-inset-right, 0px)); }
.f-earnm.is-sheet .f-earnm__row { min-height: 64px; }
.f-earnm.is-sheet .f-earnm__name { font-size: 17px; }
.f-earnm.is-sheet .f-earnm__sub { font-size: 15px; }

/* the game's own icon for a face (a game coming soon: pages/notfound-markup.js soonHTML) */
.f-art--game { border-radius: 28px; background: var(--color-swan); }

/* ---------------------------------------------------------------- narrower desktops */
@media (max-width: 1023px) {
  .f-top__in { gap: 16px; }
  .f-grid { flex-direction: column; align-items: stretch; gap: 24px; }
  .f-side { position: static; flex-basis: auto; width: auto; }
  .pg-grid { flex-direction: column; align-items: stretch; gap: 24px; }
  .pg-aside { position: static; flex-basis: auto; width: auto; }
}

/* ---------------------------------------------------------------- phones (< 900): a short bar on top, tabs at the bottom */
@media (max-width: 899px) {
  body:not([data-layout="bare"]) { padding-bottom: var(--f-tabs-h); }
  .f-top__in { gap: 8px; }
  .f-top__logo .u-logo__word { display: inline; font-size: 24px; }
  .f-top__in { justify-content: space-between; }
  /* the game button sits by the logo, the search glass at the other end */
  .f-top .f-game { margin-right: auto; }
  /* your picture is the You tab here (Instagram's way); your menu opens from the "···" on your own page */
  .f-top .f-search, .f-top .f-ai, .f-top .f-icons, .f-top .f-me { display: none; }
  /* of the page links only Earn stays up here, before the search glass (Trades and Values are bottom tabs, which have
     no room for a sixth) */
  .f-top .f-links:not(:has(.f-earn)), .f-top .f-link:not(.f-earn) { display: none; }
  .f-end { gap: 8px; }
  .f-find { display: inline-flex; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--color-eel); cursor: pointer; }   /* flat; the glass flush with the page's right edge, as the logo is with its left */
  body:not([data-layout="bare"]) .f-tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
    height: var(--f-tabs-h); padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    background: var(--color-snow); border-top: 2px solid var(--color-swan);
  }
  body:not([data-layout="bare"]) .f-tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: calc(100vh / var(--zoom, 1)); background: var(--color-snow); pointer-events: none; }
  /* typing (app/viewport.js): the keyboard is up, the tabs step aside and the page takes their room */
  html.kb { --f-tabs-h: 0px; }
  html.kb .f-tabbar { display: none !important; }
  /* a page that needs the whole screen (an open chat): frame.immersive(true) */
  body.f-immersive { padding-bottom: 0; --f-top-h: 0px; --f-tabs-h: 0px; --f-banner-h: 0px; }
  body.f-immersive .f-top, body.f-immersive .f-tabbar, body.f-immersive .f-banner { display: none !important; }
  /* ...exactly the screen, however short (a phone on its side is ~340px tall): no least height of its own */
  body.f-immersive .f-page--full { min-height: 0; }
  /* with the keyboard up iOS slides the page under it: the open chat stays exactly the part that is visible (its
     head on top, the box to type in on the keyboard) */
  html.kb body.f-immersive .f-page--full { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, calc(100dvh / var(--zoom, 1))); min-height: 0; z-index: 1; }
  .f-grid { padding-top: 20px; padding-bottom: 40px; }
  .f-page--full > .f-main { padding: 0; }
  /* the sign-in wall on a full page (/post, /messages, signed out): the page's normal gutters, as everywhere else */
  .f-page--full > .f-main > .f-wall { padding-left: max(var(--f-gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--f-gutter), env(safe-area-inset-right, 0px)); }
  .u-toasts { bottom: calc(var(--f-tabs-h) + 12px); }
  /* the cookie question: 12px over the + that stands 8px out of the tabs (or 16px over the screen's foot where there
     are none); away while typing */
  body { --ck-at: calc(env(safe-area-inset-bottom, 0px) + 16px); }
  body:not([data-layout="bare"]):not(.f-immersive) { --ck-at: calc(var(--f-tabs-h) + 20px); }
  /* /post's box sits on the tabs (pages/post.css: 12px, the box, 12px): 16px over it */
  body:has(.pa.is-chat) { --ck-at: calc(var(--f-tabs-h) + 110px); }
  body:has(.pa.is-chat.has-left) { --ck-at: calc(var(--f-tabs-h) + 134px); }
  html.ck-on:not(.kb) .u-toasts { bottom: calc(var(--ck-at) + var(--ck-h, 0px) + 12px); }
  html.kb #ck { display: none; }
  /* typing: a toast shows just above the keyboard, not behind it */
  html.kb .u-toasts { bottom: auto; top: calc(var(--vv-top, 0px) + var(--vv-h, calc(100vh / var(--zoom, 1))) - 12px); transform: translate(-50%, -100%); }
  .f-foot__links { column-gap: 16px; }
}
@media (max-width: 599px) {
  #ck { flex-direction: column; align-items: stretch; gap: 12px; width: auto; padding: 14px 16px 16px; }
  .ck__text { margin: 0; }
  .ck__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 380px) {
  .f-top__logo .u-logo__word { font-size: 22px; }
  .f-tab__ic { width: 48px; }
}
/* a visitor's short bar also holds Sign in: on a narrow phone Earn is its coin alone (still a 44px target, its name in
   the label); under 375px the logo's word is 2px smaller and Sign in a little narrower, so the bar never runs past the
   screen */
@media (max-width: 439px) {
  .f-top__in:has(.f-signin) .f-earn { justify-content: center; width: 44px; padding: 0; }
  .f-top__in:has(.f-signin) .f-earn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .f-top__in:has(.f-signin) .f-earn > .u-ic { display: none; }
}
@media (max-width: 374px) {
  .f-top__in:has(.f-signin):has(.f-earn) .f-top__logo .u-logo__word { font-size: 20px; }
  .f-top__in:has(.f-earn) .f-signin { --pad: 0 12px; }
}
/* the smallest phones (320–359): the coin alone for everyone, and a visitor's logo is its flame alone */
@media (max-width: 359px) {
  .f-top .f-earn { justify-content: center; width: 44px; padding: 0; }
  .f-top .f-earn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .f-top .f-earn > .u-ic { display: none; }
  .f-top__in:has(.f-signin):has(.f-earn) .f-top__logo .u-logo__word { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .f-acct, .f-acct.is-sheet, .f-games, .f-games.is-sheet, .f-earnm, .f-earnm.is-sheet { animation-duration: 1ms; }
  .f-game > .u-ic, .f-earn > .u-ic { transition: none; }
}
