/* The phone tab bar (spec 0060).
 *
 * PHONE ONLY. Above 900px nothing here applies and the site is untouched – 900 is the
 * site's own phone breakpoint (it is where `.hm-search` already hides), not a new one
 * invented for this file.
 *
 * The bar's geometry (buttons 41x38, gap 8, outer padding 12/8, 22 from the bottom,
 * press scale 0.9) was READ FROM the iOS app's FloatingTabBar.swift (frozen in
 * playingsaga/saga-mobile-old). The tab icons are not: they are pixel art (spec 0148),
 * 16x16 grids drawn in tabbar.js.
 */
/* Cross-document view transitions: tapping a tab cross-fades instead of flashing white.
   The bar carries its own name so it PERSISTS across the navigation rather than fading
   out and back in - which is what makes it read as one app rather than five pages. */
@view-transition { navigation: auto; }

/* THE TRANSITION WAS THE DELAY, and it was never set - Chrome's default cross-fade is
   250ms, so every tab tap held the old page on screen for a quarter second after the new
   one was ready. Measured in Saaim's own browser over CDP: pages load in 91-359ms with a
   124-192ms first paint, so the wait he reported as "1-2s switching between pages" was
   almost entirely animation playing over a page that had already finished.

   90ms still reads as motion - the bar visibly carries across rather than cutting - but it
   is under the ~100ms threshold where a delay stops being felt as waiting. One variable,
   so making it faster or slower later is one number. */
:root { --vt: 90ms; }
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) { animation-duration: var(--vt); }

/* Somebody who asked for less motion asked for less of THIS. A cross-fade between
   documents is exactly the kind of movement that setting exists to suppress, and at 1ms it
   is a cut rather than a transition without disabling the navigation behaviour itself. */
@media (prefers-reduced-motion: reduce) {
  :root { --vt: 1ms; }
}

/* ---- THE PROFILE ICON (Saaim, 2026-09-12) ---------------------------------------
   "it should be the profile image ... the square with the corners like circular."

   ONE shape wherever a person's face appears, and it is the app's, not a circle.
   The radius is the app's own ratio rather than a number picked by eye:
   ProfileHeaderView is 96pt at cornerRadius 16, so side/6, which is why it is
   written as a calc off --face. Set --face and the tile, the corners and the
   letter all scale together; nothing here hard-codes a size.

   The fallback is the app's too. CommentAvatar draws `initial` - the FIRST LETTER
   of the display name, uppercased - in white Saga Text at 0.44x the tile, on
   BrandColor.primary (#EB3E28) at 0.85. Not two initials: one letter is what the
   phone ships, and two surfaces disagreeing about somebody's own icon is worse
   than either choice.

   This lives in tabbar.css because it is the one stylesheet every page carrying
   the nav loads - index.html has its own inlined shell and does not read
   shell.css - and because the profile screen's avatar was already here. */
.sg-face { --face: 38px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--face); height: var(--face); border-radius: calc(var(--face) / 6);
  overflow: hidden; background: rgba(255,255,255,.08); }

/* THE CORNER ITSELF, where a browser can draw it (Saaim asked whether the proportions
   were really the app's, which is how this got measured rather than asserted).
   `border-radius` draws a CIRCULAR arc. SwiftUI's `.continuous` does not: it spreads
   the curve much further along the edge and runs flatter through the turn, so the two
   are different curves and matching the radius alone does not match the shape.

   Measured, not guessed. `RoundedRectangle(cornerRadius: 16, style: .continuous)` at
   96pt was rendered in the iOS simulator, screenshotted at 3x, and the corner's
   silhouette compared row by row against a sweep of browser corners:

     circular, side/6           worst row 3.0pt out
     superellipse(1.8), side/3.75   worst row 0.33pt out

   The radius has to GROW to match, which is the counter-intuitive part and the reason
   these two values only mean anything together. Set one without the other and the tile
   comes out visibly wrong: side/3.75 with a circular corner is a pill-ish blob, and
   superellipse at side/6 is a hard square with the corners nicked off.

   Chrome-only today, so it is written as an enhancement over a shape that is already
   right rather than as the shape itself: everything else keeps the circular
   approximation above, which is 3pt off at 96pt and about a pixel at the sizes the
   web actually uses. */
@supports (corner-shape: superellipse(1.8)) {
  .sg-face { border-radius: calc(var(--face) / 3.75); corner-shape: superellipse(1.8); }
}
.sg-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* the letter tile: only worn when there is no picture, so the red never sits under one */
.sg-face-letter { background: rgba(235,62,40,.85); color: #fff;
  font-weight: var(--type-regular); font-size: calc(var(--face) * .44); line-height: 1;
  user-select: none; }

/* The nav's copy of it. It replaced a word pill reading "me", so it takes the
   pill's height exactly and keeps the pills' hover lift - the row must not
   change height or rhythm because one item became a picture. */
.hm-av { --face: var(--navh); text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease; }
/* TWO-TONE, BECAUSE A PICTURE CAN BE ANY COLOUR. This was one white ring, and Saaim's own
   avatar is black ink on WHITE: the ring and the picture merged into a single fat white
   block with a halo round it, which is not a hover state, it is a smudge. A dark ring
   immediately outside the picture separates the two whatever the picture is, and the pale
   ring outside THAT is what reads against the nav's dark ground. Neither alone works for
   both a light and a dark avatar, which is why they only mean anything together.
   Not `outline`: that is spoken for by :focus-visible across this file, and hover and
   keyboard focus must not say the same thing. */
/* NO RING. Saaim, 2026-09-17: "why does this outer layer appear when i hover over the sign
   up button? remove the outer layer." It was a double box-shadow drawn for the small round
   face - a halo that made sense on a 38px tile and reads as a stray outline on a pill. Every
   other control in this nav hovers the same way: the fill lifts and the whole thing rises a
   pixel. The face does that now too, so the row has one hover behaviour instead of two.
   text-decoration is restated because these slots are anchors and a hover underline is the
   browser's default, not ours. */
.hm-av:hover { transform: translateY(-1px); background: rgba(255,255,255,.28);
  text-decoration: none; }
.hm-av:hover, .hm-signin:hover, .hm-make:hover, .hm-nw:hover { text-decoration: none; }

/* THE ONE PLACE THE NAV DOES NOT TAKE THE APP'S PAINT, and the screenshot is why:
   the Saga red letter tile sits 10px from the red `make` pill, and the two read as
   one red blob cut in half. The app never puts them next to each other. So in the
   nav the letter wears the nav's own ground - the same 16% white the word pills
   already wear - and the red stays on the profile screen, where the app puts it.
   The precedent is directly above: the tab bar masks the app's icons to
   currentColor rather than shipping their own paint, for the same reason. */
.hm-av.sg-face-letter { background: rgba(255,255,255,.16); }
/* SIGNED OUT: the slot stops being a face and becomes a pill. Same fill, same height and
   same hover as .hm-nw beside it, so the nav is one row of one kind of control rather than
   a face-shaped hole sitting among pills. The tile rules are overridden rather than
   duplicated - width and radius are all that differ. */
/* IDENTICAL TO .hm-signin, because they are the same kind of control. The weight was 700
   while sign up was the filled primary; making both grey without undoing it left one word
   5px wider than the other for no reason a reader could see. Both are .hm-nw's weight now,
   which is also what every other pill in this nav uses. */
/* A SHARED MINIMUM, because matching every style still left them 5px apart: with the same
   weight, padding and radius, "sign up" is simply wider than "sign in" - "up" is a wider
   pair of glyphs than "in". Two pills side by side differing by the accident of
   which letters are in them is the kind of thing you see without being able to name. The
   min-width is the wider word's natural size, so neither is squeezed and both are equal. */
/* PIXEL CORNERS, the same stair as the sign-in card (shell.css `--px-clip`, the filled-button
   treatment). The slot is a face tile until it becomes the Sign up pill, so it sheds the
   face's radius (`.sg-face`) and takes the clip instead: a radius left under the stair is
   what the eye would read. scripts/test-web-buttons-shape.py requires the clip here and no
   radius. The first-frame selector below is the same rule, so the shape cannot change when
   navav.js paints. */
.hm-av.hm-av-out, html[data-nav-first="out"] .hm-av { width: auto; min-width: 82px; justify-content: center;
  padding: 0 0.9rem;
  border-radius: 0; clip-path: var(--px-clip);
  background: rgba(255,255,255,.16); color: #fff; font-weight: var(--type-regular); font-size: var(--type-text);
  letter-spacing: 0; }
.hm-av.hm-av-out, html[data-nav-first="out"] .hm-av { background: rgba(255,255,255,.16); color: #fff; }
.hm-av.hm-av-out:hover { background: rgba(255,255,255,.28); }
/* the quiet half of the pair: a word, not a pill, so the filled one is unmistakably the
   thing to press. it takes the nav's own link colour rather than a fill of its own. */
/* Saaim, 2026-09-17: "let's just have two of those grey backdrops behind the sign in the
   sign up button." Both are the nav's own pill now - the white fill made one of them read
   as an advert again, which is the same note the make button got. */
.hm-signin, html[data-nav-first="out"] .hm-icons::before { display: inline-flex; align-items: center; justify-content: center;
  height: var(--navh, 38px); min-width: 82px;
  padding: 0 0.9rem;
  clip-path: var(--px-clip);
  background: rgba(255,255,255,.16);
  color: #fff; font-weight: var(--type-regular); font-size: var(--type-text); text-decoration: none;
  transition: background .15s ease, transform .12s ease; }
.hm-signin:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
/* The clip also cuts an outline drawn outside the box, so keyboard focus on the nav's pixel
   pills draws inside it (the same inset the go buttons use). */
:is(.hm-signin, .hm-av.hm-av-out, .hm-make, .hm-yours):focus-visible {
  outline: 2px solid rgba(255,255,255,.7); outline-offset: -4px; }
/* THE FIRST FRAME, BEFORE navav.js HAS RUN. The nav markup is the signed-in nav and navav.js
   (deferred) turns it into the signed-out one, so every frame painted before that script ran
   was the wrong nav: signed-out visitors saw "make a saga", "my sagas" and an empty avatar
   tile, then Sign in / Sign up replaced them. The page's inline head script sets
   data-nav-first on <html> from the `saga.face` entry navav.js already keeps, which is the
   same read navav.js makes for its own first paint, so the two cannot disagree. "out" draws
   the signed-out nav here in CSS (the Sign in pill is .hm-icons::before, the Sign up pill is
   the slot's own ::after, both the sizes the real ones have); "in" draws the markup as it is
   and hides "my sagas" unless the cache says the account owns a saga. navav.js removes both
   attributes once it has painted, and what it painted is what these rules drew, so nothing
   moves. A page whose navav.js never arrives keeps the drawn nav. */
html[data-nav-first="out"] .hm-icons::before { content: "Sign in"; }
html[data-nav-first="out"] .hm-av::after { content: "Sign up"; }
html[data-nav-first="out"] .hm-av:empty::before { display: none; }
html[data-nav-first="out"] :is(.hm-make, .hm-yours, .hm-bell),
html[data-nav-first="in"]:not([data-nav-yours]) .hm-yours { display: none; }
/* `hidden` LOSES TO `display`, every time, and this repo has now paid for that three times
   in one day: the phone box's code field, the account panel's report menu, and these two.
   An element with a display rule ignores the attribute entirely, so anything toggled with
   .hidden needs a rule that outranks its own. Scoped to the nav rather than global so it
   cannot surprise anything else. */
.hm-nav [hidden] { display: none !important; }
/* THE BELL HAS NO PLATE. Saaim, 2026-09-17: "remove the grey backdrop behind the
   notifications icon." It is an icon, not a destination - the pills beside it are places
   you can go, and giving the bell the same fill made it claim to be one. The hit area stays
   the full pill size; only the paint goes. */
.hm-nav .hm-bell { background: none; }
.hm-nav .hm-bell:hover { background: rgba(255,255,255,.12); }



.hm-av.sg-face-letter:hover { background: rgba(255,255,255,.28); }

/* Signed out, or signed in with neither a picture nor a name yet: the app's own You
   glyph as pixel art (assets/pixel/nav-you.svg, 24px = 1.5px a cell). An empty plate reads as
   a broken image rather than as an account, which is the wrong thing to say to
   somebody who has not signed in. `:empty` is exactly the state paint() leaves
   behind when it has nothing to draw, so this can never disagree with the JS. */
.hm-av:empty::before { content: ""; display: block; width: 24px; height: 24px;
  background-color: rgba(255,255,255,.62);
  -webkit-mask: url(/assets/pixel/nav-you.svg) no-repeat center / contain;
  mask: url(/assets/pixel/nav-you.svg) no-repeat center / contain; }

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

/* ---- the three tab screens (spec 0060, phases 8-10) ----------------------------
   Deliberately quiet: these live inside the existing .mk shell, so they inherit its
   type and ground and add only what a list or a profile needs. Every colour is an
   existing token or a plain alpha on white - no new palette entries. */
.sg-btn { font: inherit; font-size: var(--type-text); color: #fff; background: none;
  border: 1px solid rgba(255,255,255,.28);
  --h: 44px;
  border-radius: calc(var(--h) / var(--pill-k, 0.5));
  corner-shape: var(--pill-shape, round);
  padding: 11px 20px; min-height: 44px; cursor: pointer; }
.sg-btn:hover { border-color: rgba(255,255,255,.5); }
.sg-quiet { color: rgba(255,255,255,.42); }

.sg-me { display: flex; flex-direction: column; gap: 6px; }

.sg-results { list-style: none; margin: 0; padding: 0; }

.sg-search { margin: 0 0 18px; }
.sg-search input { width: 100%; font: inherit; font-size: var(--type-text); color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  --h: 46px;
  border-radius: calc(var(--h) / var(--pill-k, 0.5));
  corner-shape: var(--pill-shape, round);
  padding: 13px 18px; min-height: 46px; }
.sg-search input::placeholder { color: rgba(255,255,255,.38); }
.sg-r { display: flex; gap: 12px; align-items: center; padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,.1); }
.sg-r:first-child { border-top: none; }
.sg-thumb { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; flex: none;
  display: block; }
/* the empty slot keeps one left edge across a list where some rows have art */
.sg-thumb-none { background: rgba(255,255,255,.06); }
.sg-rt { font-size: var(--type-text); }
.sg-rb { margin-left: auto; color: rgba(255,255,255,.4);
  font-family: var(--font); font-size: var(--type-text); }
.sg-sec { font: var(--type-regular) var(--type-text)/1 var(--font); letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.38); margin: 22px 0 6px; }
.sg-sec:first-child { margin-top: 4px; }

/* ---- THE BELL, AND THE PANEL IT OPENS (Saaim, 2026-09-13) ------------------------
   "i don't think it needs to be its own separate page ... it should be a mini section
   ... once you hit the bell icon it just opens this kind of box."

   The nav's second pill was the word "notifs" and a link to a page. It is now the app's
   own bell glyph, and it opens the list in place. The page is still there - it is the
   phone's tab and the no-JavaScript fallback - but on a laptop nothing goes to it any
   more, which is what "not its own separate page" means in practice.

   Three sections, his call: all / people / yours. People is every type the API has
   today - somebody liked, commented, replied, mentioned or followed. Yours is your own
   work moving, and it is empty until the server sends its first one.

   Everything here is the site's existing language rather than a new one: the pill ground
   the word pills already wear, the tab bar's glass, the profile tile's shape, the red
   that is already the only red on the page. The panel is OURS, not the reference's -
   no mono type, no green, no full-bleed black plate.

   It lives in tabbar.css for the reason the profile tile does: this is the one
   stylesheet every page carrying the nav loads, and index.html has its own inlined
   shell and never reads shell.css. */

/* THE TRIGGER. Circular, because the site's law is that a button is a pill and a pill as
   wide as it is tall is a circle (scripts/test-web-buttons-shape.py). It keeps
   .hm-nw so the row's height, ground and hover lift stay exactly the word pills'. */
.hm-bell { width: var(--navh); padding: 0;
  --h: var(--navh);
  border-radius: calc(var(--h) / var(--pill-k, 0.5));
  corner-shape: var(--pill-shape, round);
  position: relative; display: inline-grid; place-items: center; flex: none; }
.hm-bell .ic { display: block; width: 24px; height: 24px;
  background-color: #fff;
  -webkit-mask: url(/assets/pixel/tab-bell.svg) no-repeat center / contain;
  mask: url(/assets/pixel/tab-bell.svg) no-repeat center / contain; }
/* Open wears the filled glyph, the same outline/fill pair the tab bar uses for active.
   The bell is not "on a page" the way a tab is, so open is the only state it can show. */
.hm-bell.on { background: rgba(255,255,255,.28); }
.hm-bell.on .ic {
  -webkit-mask-image: url(/assets/pixel/tab-bell-fill.svg);
  mask-image: url(/assets/pixel/tab-bell-fill.svg); }

/* THE BADGE IS THE APP'S, ported rather than invented: FloatingTabBar draws
   `badgeCount > 9 ? "9+" : count` on a red capsule, 5pt of horizontal padding, offset up
   and to the right of the glyph. The count is text size like every small thing on the site. The count comes from the
   attribute so the same rule draws 1 and 9+ without JS touching a style. */
.hm-bell[data-unread]::after {
  content: attr(data-unread);
  position: absolute; top: -2px; right: -4px;
  font: var(--type-regular) var(--type-text)/1 var(--font);
  color: #fff; background: var(--red, #eb3e28);
  padding: 2px 5px; border-radius: 999px; /* 0120: not a button */
  box-shadow: 0 0 0 2px #0b0a09; }

/* THE PANEL. Fixed rather than absolute: the nav is inside .hm-page, which has its own
   stacking context and horizontal padding, and a dropdown that inherits either of those
   is a dropdown that clips itself. bell.js measures the bell and sets top/right. */
/* `display: flex` on a class BEATS the browser's own `[hidden] { display: none }`, which
   is a UA rule: setting panel.hidden left the closed panel fully drawn on the page, and
   the first version of this file's tests could not see it because they asserted the
   HIDDEN PROPERTY rather than what the browser painted. The property was true the whole
   time. This rule is what actually closes it, and the tests now measure getClientRects. */
.sgn[hidden] { display: none; }
/* ONE FAMILY WITH THE ACCOUNT PANEL (Saaim, 2026-09-17). These two hang off the same nav
   a few pixels apart, and he opened both at once to put them side by side: different fill,
   different radius, different border, different shadow. Every value below now matches
   account-panel.css's `.acp-panel` exactly, and the two must be changed together.

   THE GLASS IS GONE, and that is a strict improvement on what it was for. The note it
   replaced worried that the homepage weave read through the rows as a moving red wash,
   because SENTENCES sit on this panel - so it raised the opacity to .94 and leaned on a
   blur. A solid fill is more opaque than .94, so the weave cannot read through at all.
   The blur was buying nothing the fill does not buy outright, and it cost this panel its
   resemblance to the one beside it. */
/* WIDER THAN THE ACCOUNT PANEL, on purpose. This one holds sentences: at 300px a reply wrapped
   to four or five lines beside a face pinned top-left and the row read as a slab of empty
   space. 380px lets a short reply wrap to two or three. Fill, corner and edge still
   match .acp-panel; bell.js place() clamps the box to the viewport, so it is safe at 390. */
.sgn { box-sizing: border-box;
  position: fixed; z-index: 1000; width: 380px;
  display: flex; flex-direction: column;
  max-height: min(66vh, 520px);
  overflow: hidden;
  /* the stepped pixel corner of .acp-panel and the account boxes (shell.css `--px-clip`).
     The clip cuts a border's corners and any box-shadow, so the 1px lit edge is the
     `::after` ring below, drawn on the clip's own stair. */
  background: #17140f; clip-path: var(--px-clip);
  border: 0; --px-line: rgba(255,255,255,.10); }
.sgn::after { content: ""; position: absolute; inset: 0; background: var(--px-line);
  clip-path: var(--px-ring); pointer-events: none; }
/* bell.js focuses the dialog itself on open (no chip to land on since tabs came out) -
   the div is a landing spot, not a control, so it wears no ring. Rows keep their own
   focus-visible styling. */
#sgnPanel:focus { outline: none; }

/* No padding: an unread row's tint must reach the box's edge, and the box's own pixel clip
   already cuts the first and last row's corners. */
.sgn-body { overflow-y: auto; overscroll-behavior: contain; }
.sgn-body::-webkit-scrollbar { width: 8px; }
.sgn-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14);
  border-radius: 999px; /* 0120: not a button */ border: 2px solid transparent; background-clip: content-box; }

/* ONE LIST, ONE LEFT EDGE (design law 5): every row, read or not, starts its face at the same
   x and its sentence at the same x beside it. The unread dot is NOT in a gutter of its own - it
   is a badge on the face's top-right corner, so a read row and an unread row cost the same
   width and the list has no empty strip down its left side. */
.sgn-row { display: flex; align-items: center; gap: 10px; position: relative;
  padding: 9px 14px; text-decoration: none; color: inherit;
  border-top: 1px solid rgba(255,255,255,.06); }
.sgn-row:first-child { border-top: 0; }
a.sgn-row:hover { background: rgba(255,255,255,.05); }
.sgn-row.unread { background: rgba(235,62,40,.05); }
/* The badge: 9px red disc ringed in the panel's own fill so it reads as cut out of the face.
   The face clips its picture with overflow:hidden, which would clip the badge too, so .sgn-av
   lets it overflow and the picture takes the face's corner itself. */
.sgn-av { --face: 36px; position: relative; overflow: visible; }
.sgn-av img { border-radius: inherit; corner-shape: inherit; }
.sgn-row.unread .sgn-av::after { content: ""; position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 999px; /* 0120: not a button */
  background: var(--red, #eb3e28); box-shadow: 0 0 0 2px #17140f; }
/* THE LETTER TILE IS NEUTRAL HERE, and the reason is directly above in this file: the
   app paints it Saga red, and the nav already had to drop that because one red tile
   beside the red `make` pill read as one red blob cut in half. A list of seven of them
   is that mistake seven times over - the panel came out a column of red squares. The
   picture, when somebody has one, is untouched. */
.sgn-av.sg-face-letter { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85);
  font-weight: var(--type-regular); }
.sgn-line { flex: 1; min-width: 0; font-size: var(--type-text); line-height: 1.45; }
.sgn-who { color: #fff; font-weight: var(--type-bold); }
.sgn-what { color: rgba(255,255,255,.62); }
.sgn-when { flex: none; align-self: flex-start; line-height: 1.45; /* the sentence's own line, so the clock sits on its first line */
  color: rgba(255,255,255,.34);
  font-family: var(--font); font-size: var(--type-text); }

/* A FEEDBACK REPLY (spec 0204): the ordinary row with two more lines in the text column,
   Saaim's reply then the player's own note quoted back. Folded, the reply is at most 3 lines
   and the quote 1; a tap (notifs.js wireRows) adds .open, which lifts both clamps. Both keep
   their line breaks (pre-line) and break anywhere so one long word cannot widen the row. */
.sgn-reply, .sgn-quote { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; white-space: pre-line; }
.sgn-reply { margin-top: 2px; color: rgba(255,255,255,.92);
  -webkit-line-clamp: 3; line-clamp: 3; }
.sgn-quote { margin-top: 4px; font-size: var(--type-text); line-height: 1.4; color: rgba(255,255,255,.42);
  -webkit-line-clamp: 1; line-clamp: 1; }
/* a tall row keeps its face on the first line, beside the clock (which already top-aligns) */
.sgn-row.reply { align-items: flex-start; cursor: pointer; }
/* A reply row lets the reply and the quote run the row's full width, under the clock: the
   clock (first in a reply row's markup) floats right beside the sentence's line only, and the
   face floats left. The clock's line is the sentence's own 1.45, so it is no taller than that
   line and the reply, a box of its own, starts clear of it. At 18px text the live short reply
   needs 283px for two lines; beside the clock it had 250 on a phone. */
.sgn-row.reply { display: flow-root; }
.sgn-row.reply .sgn-av { float: left; }
.sgn-row.reply .sgn-when { float: right; margin-left: 10px; }
.sgn-row.reply .sgn-line { display: block; margin-left: 46px; } /* the 36px face and the row's 10px gap */
.sgn-row.reply:hover { background: rgba(255,255,255,.05); }
.sgn-row.reply.open .sgn-reply,
.sgn-row.reply.open .sgn-quote { display: block; -webkit-line-clamp: unset; line-clamp: none; }

.sgn-empty, .sgn-state { margin: 0; padding: 26px 18px; text-align: center;
  font-size: var(--type-text); line-height: 1.6; color: rgba(255,255,255,.45); }
.sgn-state p { margin: 0 0 12px; }
.sgn-state p:last-child { margin: 0; }

/* The pixel empty state (spec 0148). Compact by default - this is the 300px bell dropdown: a
   32px bell over the heading, one centred stack with equal padding on every side, so it sits
   in the middle of the box on both axes. The bell is 20 cells, so 32px is 1.6px a cell; it is
   crisp via shape-rendering, not by size. The heading's line box is its text box (line-height 1:
   Saga Text's ascent + descent is exactly 1em), so there is no invisible half-leading under the
   words to pull the visible stack above the middle; the margin above carries that space instead. */
.sgn-empty-art { display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 24px 18px; }
.sgn-empty-ico { display: block; width: 32px; height: 32px;
  color: rgba(255,255,255,.35); fill: currentColor; }
.sgn-empty-title { margin: 14px 0 0; font-size: var(--type-text); line-height: 1; font-weight: var(--type-regular); color: #fff; }

/* THE SAME LIST ON THE PAGE. /notifs/ is already inside the reading column, so the rows
   take a little less on the right. Nothing else about a row changes between the panel and
   the page. */
.sgn-page .sgn-row { padding-right: 8px; }

/* Full size only on /notifs/ (boards/Notifs.html): 60px bell (3px a cell), centred stack. */
.sgn-page .sgn-empty-art { display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 0 20px; }
.sgn-page .sgn-empty-ico { width: 60px; height: 60px; }
.sgn-page .sgn-empty-title { margin: 22px 0 0; font-size: var(--type-head); line-height: 1; }
/* On desktop .mk is a row flex box, so the screen shrinks to its content and the centred
   stack would sit at the column's left edge; full width lets it centre in the column. */
.mk:has(.sgn-empty) > [data-screen="notifs"] { width: 100%; }

/* The panel's own spinner. .sg-load is deliberately fixed to the VIEWPORT - it is the
   whole-screen wait - so it cannot be reused inside a 380px box without covering the
   page. Same ring, same 400ms delay, placed in the panel. */
.sgn-load { display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.sgn-load::after { content: ""; display: block; width: 22px; height: 22px;
  border-radius: 50%; border: 2.5px solid rgba(255,255,255,.13);
  border-top-color: var(--red, #eb3e28); opacity: 0;
  animation: sg-reveal .18s ease 400ms forwards, sg-turn .7s linear infinite; }
/* index.html carries its own inlined shell and never loads shell.css, where these two
   are declared. A keyframes name that does not resolve animates nothing and reports
   nothing, so the ring would sit at opacity 0 on the homepage only. */
@keyframes sg-turn { to { transform: rotate(360deg); } }
@keyframes sg-reveal { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sgn-load::after { animation: sg-reveal .18s ease 400ms forwards; }
}

/* This used to read `@media (max-width: 900px) { .sgn { display: none !important } }` –
   below the phone breakpoint the nav was hidden, so the bell did not exist and the panel
   had nothing to hang off. The nav is on at every width now, so the bell is a real button
   on a phone and suppressing its panel would give it nothing to open. place() in bell.js
   already clamps the panel to the viewport (it hangs off the nav's right edge and takes a
   maxWidth of `innerWidth - right - 12`), which is what makes 380px safe at 390. /notifs/
   is still a page and the bell still points at it. */

/* The old account menu's sign-out row (account.js now draws .acp-*); kept because
   scripts/test-web-button-tokens.py pins its red. */
.sga-out { color: var(--red, #eb3e28);
  border-top: 1px solid rgba(255,255,255,.08); }
.sga-out:hover { background: rgba(235,62,40,.28); color: #ff7a63; }

/* ---- THE DOCKED PHONE TAB BAR (spec 0121) -----------------------------------------
   Phone only (max-width 900px, the site's own breakpoint - see the file banner at the
   top of this file). Docked, full width, square corners, not floating: 56px content
   plus the safe-area inset, above everything (z-index 1100, over
   .sgn's 1000). tabbar.js builds this element and appends it to <body> on every
   page that links this file; `display: none` here is what keeps it off the desktop -
   the element exists everywhere, only the media query below turns it on, so at 1440
   wide `elementFromPoint` at the bar's would-be centre still hits page content. */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(11,10,9,.72);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,.12); }
/* Fallback for a browser with no backdrop-filter support: a flat panel near the
   glass's own resting colour, not a see-through bar with nothing drawn behind it (H). */
@supports not (backdrop-filter: blur(1px)) {
  .tabbar { background: rgba(11,10,9,.94); }
}
.tabbar-row { display: flex; height: 56px; }
.tab { flex: 1 1 0; min-width: 44px; min-height: 44px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  position: relative; color: var(--ink-quiet); text-decoration: none; }
.tab-icon-wrap { width: 24px; height: 24px; position: relative; }
.tab-icon-wrap svg, .tab-icon-wrap svg * { display: block; fill: currentColor; }
.tab-icon-wrap svg { width: 100%; height: 100%; }
.tab-label {
  font: var(--type-regular) var(--type-text)/1 var(--font);
  text-transform: lowercase; letter-spacing: 0; }
/* Active: a white glyph (its fill twin, swapped in by tabbar.js) and a white word; there
   is no box behind the tab (spec 0148). */
.tab.active { color: #fff; }
/* The notifs tab's badge, ported from .hm-bell[data-unread]::after above (same recipe,
   this bar's own resting colour for the ring instead of the page background) -
   tabbar.js mirrors bell.js's data-unread attribute from .hm-bell onto this element, so
   one source of truth feeds both bells. PR 2 owns read-on-open; PR 1 only displays. */
.tab-icon-wrap[data-unread]::after {
  content: attr(data-unread);
  position: absolute; top: -5px; right: -7px;
  min-width: 23px; height: 23px; box-sizing: border-box; padding: 2px 5px; /* the bell badge's own size: an 18px count's 19px glyph box and 2px above and below */
  border-radius: 999px; /* 0120: a count, not a button */
  background: var(--red, #eb3e28); color: #fff; text-align: center;
  font: var(--type-regular) var(--type-text)/1 var(--font);
  box-shadow: 0 0 0 2px rgba(11,10,9,.72); }

/* /make/'s phone empty state (spec 0121 PR 3, H: "make body: empty state as drawn").
   Hidden here so a no-JS or pre-900px paint never shows it; the 900px block below is the
   only place that turns it on - desktop keeps the old line untouched (H). */
.mk-empty { display: none; }

@media (max-width: 900px) {
  .tabbar { display: flex; }
  /* On phones the top-right group leaves entirely: bell, avatar, make pill and the
     navav-injected sign-in pill, and the empty top row goes with them - the wordmark
     does not return (H). `display`, not `[hidden]`: an author `display` rule beats the
     UA `[hidden] { display: none }` rule every time (reference_home_hero_surface.md).
     This one rule covers index.html, notifs/index.html and make/index.html alike,
     since all three carry the same .hm-nav + .hm-icons markup; navav.js and bell.js
     keep running against a hidden nav, harmless. */
  .hm-nav { display: none; }
  /* Room under the docked bar so nothing on any page scrolls beneath it (H). One rule
     here covers every page that links this file. */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

  /* ---- /notifs/ phone body (spec 0121 PR 2) ----------------------------------------
     H: "chips all · people · yours dead centre ... list at the top directly under the
     chips." The .mk shell centres its child vertically for the one-line pages (terms,
     privacy); the notifs list is not one of those, so it starts at the top instead. */
  /* .mk is a ROW flex container (no flex-direction set), so `align-items` is its
     VERTICAL axis - that alone moves the child to the top without also stretching it
     across the horizontal (main) axis, which `justify-content`'s default `flex-start`
     leaves at its own shrink-to-fit width. Without `width: 100%` here, "dead centre"
     below centres the chips inside that narrower, left-anchored box instead of the
     viewport - caught by the tap test's chip-union measurement, not by eye. */
  .mk:has([data-screen="notifs"]) { align-items: flex-start; padding-top: 0; }
  .mk:has([data-screen="notifs"]) > [data-screen="notifs"] { width: 100%; }
  /* The empty state (and the offline / broke lines, which are `.sgn-empty` too) centre on
     the screen. Keyed on the empty state being PRESENT, never on the notifs screen, so a
     short list stays top-aligned under the nav. Same specificity as the rule above, later.
     Centring only: the height it centres inside is the stable screen box below, which is
     reserved from the first paint whatever the screen is showing. */
  .mk:has(.sgn-empty) { align-items: center; }
  /* THE STABLE SCREEN (spec 0148 fix 8). Every app screen reserves the same height from
     the FIRST paint, loading spinner included: the screen fills the space above the docked
     bar (56px + the home indicator), so the footer links and marks sit below the fold in
     the loading state exactly where they sit once it renders. Before this the spinner
     (.sg-load is position:fixed, so it takes no room) left .mk a few pixels tall, the
     footer showed mid-screen, and when the empty state arrived a second or two later the
     height jumped and the footer fell below the fold: 257px of layout shift on /notifs/.
     Keyed on the page's [data-screen] container, not on what it will turn out to hold.
     svh, never dvh: dvh follows the Safari toolbar as it slides in and out while you
     scroll, so the box (and the footer under it) would resize with every pull. svh is the
     toolbar-OUT height and does not move. A tall list is taller than this and simply
     grows; `min-height` only ever reserves. The bottom padding is 0 for every screen, so a
     card on /me/ and an empty state on /notifs/ end the same box (the page's own 40px
     bottom pad used to make the two footers sit 40px apart). /yours/ has no .mk, its
     screen sits straight in .hm-page. */
  .mk:has(> [data-screen]), .hm-page > [data-screen] {
    box-sizing: border-box; padding-bottom: 0;
    min-height: calc(100svh - 56px - env(safe-area-inset-bottom, 0px)); }
  /* Cancels the desktop-only right inset two rules up: the phone page is not inside a reading
     column narrower than the panel already assumes. */
  .sgn-page .sgn-row { padding-right: 14px; }
  /* Signed out: H's line + a sign-in pill, sitting in the upper third rather than at the
     very top - an empty page with one sentence flush against the status bar reads as
     unfinished, not as "nothing to show yet". */
  .sgn-page .sgn-state, .mk .sgn-state { margin-top: 30vh; padding: 0 20px; }
  .sgn-page .sgn-state p, .mk .sgn-state p { font-size: var(--type-text); line-height: 1.5;
    color: rgba(255,255,255,.75); }
}
/* ---- /me/ body, every width (spec 0148) --------------------------------------------------
   The me rules used to sit inside the max-width:900px block above, so /me/ opened by URL on a
   desktop painted bare UA buttons (the desktop reaches these settings through the account
   panel, but the page itself still exists). The block is closed here and reopened below;
   the notifs and make rules around it stay phone-only. */
  /* ---- /me/ phone body (spec 0121 PR 3) --------------------------------------------
     H: "me is ONE flat page: avatar 96px ... centred with a solid white 28px disc ...
     holding the pencil ..., @username centred under it ..., then five rows ...". Own
     `sgm-` prefix (screen me) so this page never depends on account-panel.css, which
     only loads because a hidden nav happens to exist (P1 rule 8), not because anything
     here names it. All of this page's layout lives in this one block (every width, spec 0148). */
  .mk:has([data-screen="me"]) { align-items: flex-start; padding-top: 0; }
  .mk:has([data-screen="me"]) > [data-screen="me"] { width: 100%; }

  .sgm-avatar { position: relative; width: 96px; margin: 40px auto 0; }
  /* Spec 0148: a solid white 32px disc in #111 (no ring) holding the 12-cell pixel pencil at
     18px (1.5 CSS px per cell). Round, not a 0120 capsule - H exempts round marks ("count
     badges stay round"), and the class name avoids every fragment
     scripts/test-web-buttons-shape.py's BUTTONISH list scans for. */
  .sgm-edit { position: absolute; right: -4px; bottom: -4px; width: 32px; height: 32px;
    border-radius: 999px; background: #fff; color: #111; border: 0; padding: 0;
    display: flex; align-items: center; justify-content: center; }
  .sgm-edit svg { width: 18px; height: 18px; display: block; flex: none; fill: currentColor; }

  /* `.mk .sgm-at` (0,2,0): the page's own `.mk p { font-size: var(--type-head)}` (me/index.html, 0,1,1)
     beats a bare class, which is why the handle read 19px and not the size it was given. */
  .mk .sgm-at { margin: 8px 0 0; text-align: center; font: var(--type-regular) var(--type-head)/1.3 var(--font); color: #fff; }

  /* ONE card for all five rows (spec 0148 criterion 5): a 4% white wash over the page ground,
     a hairline border, 16px corners. overflow hidden clips the row highlight to the corners. */
  .sgm-rows { display: flex; flex-direction: column; }
  /* 100% - 4px inside .hm-page's 14px gutter is the board's 16px from the screen edge at 390;
     420px caps it on wide phones and tablets, centred. */
  .me-card { width: calc(100% - 4px); max-width: 420px; margin: 28px auto 0; overflow: hidden; border-radius: 16px;
    background: linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)), #0b0a09;
    border: 1px solid rgba(255,255,255,.08); }
  /* Row recipe: 52px tall, icon, label, chevron pinned right by the label's flex: 1. The
     divider is the row's ::after, inset 48px (16 padding + 20 icon + 12 gap) so it starts
     at the label, and the last row has none. Copied rather than shared - this page never
     links account-panel.css. */
  .sgm-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
    height: 52px; padding: 0 16px; border: 0; border-radius: 0; background: transparent;
    color: rgba(255,255,255,.92); text-align: left;
    font: var(--type-regular) var(--type-text)/1 var(--font); box-sizing: border-box; }
  .sgm-row:not(:last-child)::after { content: ""; position: absolute; left: 48px; right: 0;
    bottom: 0; height: 1px; background: rgba(255,255,255,.08); }
  .sgm-row:active { background: rgba(255,255,255,.06); }
  .sgm-row:focus-visible { outline: 2px solid rgba(255,255,255,.45); outline-offset: -2px; }
  .sgm-row-label { flex: 1; min-width: 0; }
  .sgm-row .acp-ico { width: 20px; height: 20px; flex: none; opacity: .7; display: block; }
  .sgm-row[data-which="delete"] .acp-ico { opacity: 1; }
  .sgm-row[data-which="delete"] { color: var(--red); }
  /* THE RULE PROTECTING THE CHEVRON (spec 0121 PR 3 rule 7, widened by spec 0148): the row
     icons and the chevron are pixel art now - filled rects, not strokes - so they take
     `fill: currentColor`, and `fill: none` would draw nothing. No OTHER selector reaching an
     svg inside .sgm-row may set `fill`; the stray-fill bug this guards was a stroke path
     turning into a solid triangle. Enforced by tests/web/test_me_tab.py's parsed CSS check,
     never by a comment. */
  .sgm-chev { flex: none; color: var(--ink-quiet); display: flex; align-items: center; margin-left: auto; }
  .sgm-chev svg { width: 16px; height: 16px; fill: currentColor; opacity: 1; display: block; }

@media (max-width: 900px) {
  .sgn-page .sgn-in, .sgm-in, .mk-empty-go {
    --h: 40px; min-height: var(--h);
    border-radius: calc(var(--h) / var(--pill-k, 0.5));
    corner-shape: var(--pill-shape, round);
    padding: 0 18px; font: var(--type-regular) var(--type-text)/1 var(--font);
    color: #fff; background: rgba(255,255,255,.12); border: 0;
    /* .mk-empty-go is an <a>, the only .sg-btn user that is one - .sg-btn itself never
       resets text-decoration because every other user is a <button>. */
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

  /* ---- /make/ phone empty state (spec 0121 PR 3) -----------------------------------
     H: "make body: empty state as drawn (pencil, 'make a saga', one line, go home pill)."
     The old sentence stays in the DOM (untouched above 900px) and is only hidden here -
     .mk is the only page on this file with a bare `<p>` as .mk's direct child, so this
     selector cannot reach /notifs/ or /me/'s own markup. */
  .mk > p { display: none; }
  /* Anchors the column to the bottom of the body (D's own frame), 22px clear above the
     bar's top edge, rather than under the glass where it could not be tapped (Q1). */
  .mk:has(.mk-empty) { display: flex; flex-direction: column; padding: 0; box-sizing: border-box;
    min-height: calc(100svh - 56px - env(safe-area-inset-bottom, 0px)); }
  .mk-empty { display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 10px; padding: 0 28px 22px; margin-top: auto; }
  .mk-empty-ico { opacity: .35; color: #fff; fill: currentColor; }
  .mk-empty-h { margin: 4px 0 0; font: var(--type-regular) var(--type-text)/1.3 var(--font);
    color: #fff; text-transform: lowercase; }
  .mk-empty-sub { margin: 0; font: var(--type-regular) var(--type-text)/1.5 var(--font);
    color: rgba(255,255,255,.75); }
  .mk-empty-go { margin-top: 4px; }
  /* The centred labels keep their Saga Text width while the stand-in face draws them, so they
     do not shrink and re-centre when Saga Text lands (shell.css, LABEL WIDTH PINS: the number
     rides on each label where it is made, assets/make/claim.mjs and assets/yours.js). */
  .mk-empty-h { width: var(--label-w); white-space: nowrap; }
  .mk-empty-go { box-sizing: border-box; width: calc(var(--label-w) + 36px); white-space: nowrap; }
}
