/* ── Base. Three rules, so a freshly scaffolded app looks finished
      before it has any CSS of its own. Delete them if your app owns
      its own base styles. ──────────────────────────────────────────── */
:where([rst-shell-brand], [rst-shell-nav] a, [rst-shell-menu] > summary, [rst-shell-chrome] > summary, [rst-shell-account] > summary, [rst-shell-back] > a, [rst-shell-up]) .icon {
  block-size: 1rem;
  inline-size: 1rem;
}

/* ── The structural idioms: box, list grid, row-menu, dropdown, ftok ── */
:where([rst-shell-main]) > :where([rst-card]) { margin-block: var(--rst-sp-4); }
:where([rst-shell-main]) > :where([rst-box-head]) + :where([rst-card]), :where([rst-shell-main]) > :where([rst-card]:first-child) { margin-block-start: 0; }
:where([rst-shell-main]) > :where([rst-card]:last-child) { margin-block-end: 0; }
:where([rst-shell-main]) > :where([rst-card]):has(+ :where([rst-count-line])) { margin-block-end: 0; }
[rst-shell-tail] [rst-dropdown], [rst-shell-rail-foot] [rst-dropdown] { inline-size: auto; }
/* The account summary carries two faces, as the console's Menu did: the
   avatar, and the word Account with its caret. Below 800px it is the
   avatar alone, the end of the phone's one header row; from 800px it
   is "Account" and the caret, the desktop bar's account menu as it
   was. Keyed on the label, so an account menu written before it, a
   plain "Account" summary, keeps its caret everywhere. */
[rst-shell-account] > summary [rst-shell-account-label] { display: inline; }
@media (max-width: 799.98px) {
  [rst-shell-account] > summary [rst-shell-account-label], [rst-shell-account] > summary:has([rst-shell-account-label]) > [rst-caret] { display: none; }
}
@media (min-width: 800px) {
  [rst-shell-account] > summary:has([rst-shell-account-label]) > [rst-shell-avatar] { display: none; }
}

/* ── Shells: the page frames an app's layout template wraps .rst-page
      in — topbar and sidebar. Written in logical properties throughout,
      so a right-to-left locale gets a mirrored shell for free: the rail
      moves to the inline end, the account menu with it, and nothing
      here needs a second rule. ─────────────────────────────────────── */
[rst-shell-brand] { color: inherit; font-weight: 650; text-decoration: none; }
[rst-shell-nav] { display: flex; gap: var(--rst-sp-4); }
[rst-shell-nav] a { border-block-end: 2px solid transparent; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); padding-block: 0.3rem; text-decoration: none; -webkit-tap-highlight-color: transparent; }
[rst-shell-nav] a:hover { color: var(--rst-text); }
[rst-shell-nav] a[aria-current] { border-block-end-color: var(--rst-accent); color: var(--rst-text); font-weight: 550; }
[rst-shell-account] { margin-inline-start: auto; }
/* an account menu whose block was never overridden has an empty menu; hide the whole control rather than show a dead summary. */
[rst-shell-account]:has(> [rst-dropdown-menu]:empty) { display: none; }
[rst-shell-foot] { border-block-start: 1px solid var(--rst-line); color: var(--rst-text-muted); font-size: var(--rst-fs-xs); padding-block: var(--rst-sp-4); padding-inline: var(--rst-sp-4); text-align: center; }
/* the topbar shell emits a foot even when the block is un-overridden; an empty one is a stray rule and padding, so draw nothing. */
[rst-shell-foot]:empty { display: none; }

/* sidebar shell — a rail beside the page. Below 800px the rail is not
   shown on a content page and IS the page on the index (the index/back
   block after the console's). The main column carries min-inline-size:
   0 so a wide child (a list grid, a <pre>) scrolls itself instead of
   stretching the grid track.

   LEGACY, kept for layouts written before the phone index: the
   <details rst-shell-chrome> drawer, which opened the rail into the
   page flow. Its rules are the ones naming rst-shell-chrome, below and
   in the wide block. None of the index/back rules match an old
   layout's root (it has no view), so an app that re-vendors tokens.css
   but keeps its old layout still has its drawer. Delete these rules
   together once no layout and no gallery page writes rst-shell-chrome. */
[rst-shell-main] { min-inline-size: 0; }
[rst-shell-group] { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); font-weight: 550; letter-spacing: 0.05em; margin-block: var(--rst-sp-3) 0.2rem; text-transform: uppercase; }
/* The rail's foot — the language switcher and the person, in the corner
   an app puts them in everywhere else. margin-block-start: auto is the
   whole mechanism: the rail is a column flex box, so the auto margin
   eats whatever height is left between the nav and the bottom.

   Below 800px the rail on the phone index is STILL a flex column, and
   it has a min-block-size of the whole screen there, so this auto
   margin would float the foot to the bottom of the screen, where the
   language menu would open off it. The index rules replace it with a
   fixed gap; the 390px leg of
   TestTheSidebarRailPutsThePersonAtItsFootAndTheLanguageMenuOpensUpward
   measures that gap for exactly that reason. */
[rst-shell-rail-foot] { display: flex; flex-direction: column; gap: var(--rst-sp-3); margin-block-start: auto; }
/* An un-overridden shell renders the wrapper with nothing in it; draw
   no gap for it, the same way .rst-shell__foot handles its own. Kept
   for layouts from before the profile menu, whose foot held the two
   blocks bare. */
[rst-shell-rail-foot]:empty { display: none; }
/* The profile menu: the rail foot's one control, an avatar button
   whose card holds the person's name, the language and the account's
   links. It is an rst-dropdown, so rastrillo.js already closes it on an
   outside click and on Escape, and the anchored-menu rules already keep
   its card on screen; these rules are its shape.

   The foot goes only for the layout's placeholder (the empty avatar
   named Account, marked placeholder) when there is also nothing to
   choose: a button opening an empty card. A real person stays even
   with no language and no links, because the signed-in person must not
   vanish from the rail. Without :has() the placeholder stays, a button
   opening a card that holds "Account", which is harmless. */
[rst-shell-rail-foot]:has([rst-shell-who]:only-child [rst-person-av~="placeholder"]) { display: none; }
/* The avatar is the person partial's own circle at its own size. The
   name stays in the summary, clipped rather than hidden, because it is
   the button's accessible name: the circle is aria-hidden decoration.
   The email is out of the name, display: none, so a screen reader hears
   who, not their address. */
[rst-shell-avatar] { align-items: center; display: inline-flex; justify-content: center; }
[rst-shell-avatar] [rst-person-name] { block-size: 1px; clip-path: inset(50%); inline-size: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
[rst-shell-avatar] [rst-person-email] { display: none; }
/* inline-flex, not the dropdown summary's flex: a summary as wide as
   the rail would draw the round hover fill as a long oval. */
[rst-shell-profile] > summary { border-radius: 50%; color: var(--rst-text); display: inline-flex; justify-content: center; padding: 4px; }
[rst-shell-profile] > summary:hover, [rst-shell-profile][open] > summary { background: var(--rst-accent-soft); }
[rst-shell-profile] > summary:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: 2px; }
[rst-shell-profile] > [rst-dropdown-menu] { box-sizing: border-box; inline-size: min(17rem, calc(100vw - 1.5rem)); }
/* CLOSING ON AN OUTSIDE TAP with scripts off, the topbar card's way:
   while open the summary grows an invisible layer over the viewport,
   under the card, so a tap outside the card is a click on the summary
   and closes it natively. On a desktop the rail is lifted while the
   menu is open (the wide block below). */
[rst-shell-profile][open] > summary::before { content: ""; cursor: default; inset: 0; position: fixed; z-index: 1; }
/* The card's head: the name and the email the summary keeps out of
   sight. The avatar is already on screen as the button. The console
   writes the same head into its tail, where it shows only on the phone
   index; hidden here so the wide bar's display: contents cannot make
   it a flex item of the bar. */
[rst-shell-who] { border-block-end: 1px solid var(--rst-line); margin-block-end: 0.25rem; min-inline-size: 0; padding-block: 0.35rem 0.55rem; padding-inline: 0.65rem; }
[rst-shell-who] [rst-person-av] { display: none; }
[rst-shell-tail] > [rst-shell-who] { display: none; }
/* A menu inside the card (the language switcher) opens IN PLACE, as
   the topbar card's do: a popover inside a popover has nowhere good to
   go on a phone, and on a desktop it would cover the card it came
   from. Its summary reads as one of the card's rows. */
[rst-shell-profile] [rst-dropdown-menu] [rst-dropdown-menu] { border: 0; box-shadow: none; inset: auto; margin: 0; max-block-size: none; min-width: 0; padding-block: 0; padding-inline: 0.5rem 0; position: static; }
[rst-shell-profile] [rst-dropdown-menu] [rst-dropdown] > summary { border-radius: var(--rst-radius-sm); color: var(--rst-text); font-size: var(--rst-fs-sm); justify-content: space-between; padding: 0.4rem 0.65rem; }
[rst-shell-profile] [rst-dropdown-menu] [rst-dropdown] > summary:hover { background: var(--rst-accent-soft); }
@media (min-width: 800px) {
  /* A menu at the foot of a full-height rail is a DROPUP: the same
     <details> panel, opened block-start-ward instead of block-end-ward,
     because below it there is only the window's edge. No script — this
     is one pair of inset values. Only inside this query: below 800px
     the rail is a content-height column with the whole page under it,
     so the same menu opens downward there like every other menu in the
     system. */
  [rst-shell-rail-foot] [rst-dropdown-menu] { inset-block-end: calc(100% + 4px); inset-block-start: auto; margin-block-start: 0; }
  /* Where anchor positioning is available the hand-written inset pair
     has to be handed back, and not because it stopped being right: the
     insets above are measured against .rst-dropdown's own box, and
     position-area replaces that box with the region beside the anchor,
     so calc(100% + 4px) would be 100% of the free space under the foot
     — the panel launched up the rail. The flip does this case anyway
     and does it by measuring: there is no room below the rail's foot,
     so flip-block turns the menu upward on its own, and it turns back
     down again in a layout where there IS room, which a fixed pair of
     insets cannot. Specificity is why this is written here rather than
     left to the generic rule: .rst-shell__rail-foot .rst-dropdown__menu
     is (0,2,0) and would otherwise outrank it. */
  @supports (position-area: block-end) and (position-try-fallbacks: flip-block) {
    [rst-shell-rail-foot] [rst-dropdown-menu] { inset: auto; margin-block-start: 4px; }
  }
  /* The profile card is a drop-up anchored at the button's inline
     start, so it grows from the rail's edge across the page rather than
     off the side of the window. Written out rather than left to the
     flip above, which turns a menu upward only when below is full: the
     card is meant to open upward from the foot whatever the room, and
     flip-block still turns it down in a window too short for it.
     Without anchor positioning the card is absolute in the rail, which
     scrolls, so it takes the rail's width rather than overhanging it. */
  [rst-shell-rail-foot] [rst-shell-profile] > [rst-dropdown-menu] { inline-size: auto; inset-inline: 0; }
  @supports (position-area: block-end) and (position-try-fallbacks: flip-block) {
    [rst-shell-rail-foot] [rst-shell-profile] > [rst-dropdown-menu] { inline-size: min(17rem, calc(100vw - 1.5rem)); inset: auto; margin-block: 0 4px; position-area: block-start span-inline-end; }
  }
}
/* The Menu summary carries both faces: the icon and its word, and the
   person's avatar, which only the phone index shows (the index block
   below). display: contents keeps the icon and the word flex items of
   the summary, laid out exactly as they were before the span wrapped
   them. */
[rst-shell-menu-label] { display: contents; }
[rst-shell-menu] [rst-shell-avatar] { display: none; }
@keyframes rst-shell-drop { from { opacity: 0; transform: translateY(-4px); } }

/* ── Sidebar and console on a phone: the index and the back control ──
   Below 800px these two shells are two views of every URL, and the page
   says which with the view block the layout writes into the root:
   [rst-shell-sidebar~="index"] is the rail as a full-screen page of
   sections at a real URL; [rst-shell-sidebar~="page"] is the content,
   with a back control at the top inline-start whose href is the page's
   up block. No hamburger. The console is the same for its rail, under
   its bar.

   An old layout's root has no view, so none of these rules match it and
   it keeps its drawer (the legacy rules above). Scoped below 800px, like
   the card: at 800 and up both views are the rail beside the page, the
   back strip and the title are hidden by the rule just below, and
   nothing here needs undoing. ─────────────────────────────────────── */
[rst-shell-back], [rst-shell-title] { display: none; }
/* The up link, the one-row shells' way back: only a content page on a
   phone shows it (each shell's own block). Hidden everywhere else,
   the index included, which writes it all the same. */
[rst-shell-up] { display: none; }
/* The heading's two spans: the brand, then the page's title, which
   shows only when the brand's span rendered nothing, so an app that
   blanks its brand still has a heading. Each elides on its one line.
   The brand link is a line the tap floor's height, centred in the
   header row, so a tap on the heading's line is a tap on it. */
[rst-shell-title] > * { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[rst-shell-title] > :not(:empty) + * { display: none; }
/* A brand drawn from data that has none usually renders whitespace,
   which :empty does not match, and a template cannot trim another
   template's output. So where :has() is known, a brand span with no
   element in it counts as blank: it is hidden and the title shows. The
   cost is a brand written as bare text, with no link or element round
   it, which reads as blank too; every shipped brand is a link. */
[rst-shell-title] > :first-child:not(:has(*)) + * { display: block; }
[rst-shell-title] > :first-child:not(:has(*)) { display: none; }
[rst-shell-title] [rst-shell-brand] { color: inherit; display: block; font-weight: inherit; line-height: 2.75rem; overflow: hidden; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 799.98px) {
  /* The strip's own link only, by the child combinator: anything else
     a page puts in the strip (a menu at its inline end) is not a back
     control, and would otherwise get the accent colour and a chevron. */
  [rst-shell-back] > a { align-items: center; border-radius: var(--rst-radius-sm); color: var(--rst-accent); display: inline-flex; font-size: 1rem; font-weight: 500; gap: 0.5rem; min-block-size: 2.75rem; padding-inline: 0.75rem; text-decoration: none; }
  /* The chevron is drawn, not an icon: there is no left chevron in the
     set and no icon mirroring, and a drawn one stays out of the
     accessible name. Two borders of a small square, turned; physical on
     purpose, like the switch's knob, because it is a drawing, and
     mirrored by the rule after it. */
  [rst-shell-back] > a::before { block-size: 0.55rem; border-left: 2px solid currentColor; border-top: 2px solid currentColor; content: ""; flex: none; inline-size: 0.55rem; transform: rotate(-45deg); }
  [dir="rtl"] [rst-shell-back] > a::before { transform: rotate(135deg); }
  [rst-shell-back] > a:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
}

/* ── The console on one row ─────────────────────────────────────────
   A console whose root holds [rst-shell-up] is the one-row console.
   Below 800px its bar is the phone's one header row: the up link at
   the inline start, the app's name at the centre, the account's avatar
   at the inline end, and nothing else above the page. The back strip,
   the Menu and its tail are gone: the up link is in the bar, and the
   account card holds the person, the scheme, the language and the
   account's links. From 800px it is the 1.3 bar less the language
   menu, which moved into the card: the brand at the start, "Account"
   at the end. Every rule names [rst-shell-up], in the root's :has()
   or as the element itself, so a 1.3 console (Menu, tail, back strip)
   matches none of them and draws as it did. The card is as tall as
   the window less the row, as the 1.3 card was: it holds four kinds
   of thing now, and the Language menu opens inside it.

   The row is a grid of three columns, the two sides equal shares of
   what the name leaves, each at least its own content, so the name is
   on the row's true centre whenever it can be and moves toward the
   shorter side only as far as it must. The name's column shrinks when
   the three do not fit, and the name keeps to one line, cut with an
   ellipsis, so the up link and the avatar never give up any of their
   width to it. The up link's own label is cut with an ellipsis too,
   at the screen's width less the avatar's column, so a long parent
   title never pushes the avatar off the row; its aria-label keeps the
   whole title. A name is shown whole or not at all, never cut: shell.js
   measures it and, where it is cut, marks it hidden, which the [hidden]
   rule takes out of the row, out of reach of a tap and of Tab. Only a
   script can tell that a name is cut, so with scripts off the cut name
   stays, the one place the ellipsis shows: a tap or Tab there lands on
   a name the reader can see, never on an invisible link. */
@media (max-width: 799.98px) {
  [rst-shell-up] > .icon { margin-inline-end: 0.25rem; vertical-align: middle; }
}

/* ── The topbar on one row ──────────────────────────────────────────
   A topbar whose root holds [rst-shell-up] is the one-row topbar, and
   below 800px a topbar app is a tree: /menu, the index, is the nav as
   rows; every other page is a content page one level down from its
   row there. The row is the console's (above): its grid, its up link
   (labelled Menu, or the page's parent), its name and its avatar are
   the console's rules, which name the topbar too. The index rows look
   like the sidebar's and the console's, restated below in rules of
   their own. The nav is in the bar, between the brand and the
   account card: on a content page it is hidden, and on the index it
   hangs from the bar's foot, out of the row's grid, so the row stays
   the strip's height while its nav is the page, and the shell's foot
   is anchored under it. main and its skip link go: the page is
   navigation. The avatar is read after the rows, the order the bar
   writes them in, the second recorded exception to "focus order is
   visual order". Every rule here names [rst-shell-up].

   From 800px the bar is 1.3's: the brand at the start, the nav inline,
   Account at the end. The language menu has moved into the card, and
   the up link and the title are hidden there as everywhere else. A
   1.3 topbar (a bare root, the Menu and its tail) has no
   [rst-shell-up] and no view, so it matches none of these rules nor
   the shared ones, and keeps its Menu card on a phone. */
@keyframes rst-shell-flash { from { background: var(--rst-accent-soft); } }

/* ── Target floors, at every width ──────────────────────────────────
   Every interactive idiom is at least --rst-target on both axes: 32px
   on a desktop with a mouse, --rst-tap (44px) on a small or touch
   screen, where the query above raises the token. One list of idioms
   read through one token, so a control floored on a phone cannot be
   left at 24px on a desktop, and the two floors cannot drift apart.
   The size is measured as the box a tap or click ACTIVATES: the label
   of a label-backed control, the row of a stretched link. Anything
   that is display: inline today becomes inline-flex or flex here,
   because min sizes do nothing on an inline box; a block keeps its
   display and centres its content with align-content. Nothing else
   belongs here: a declaration that changes a desktop control the floor
   leaves alone goes in the touch query above. Every floor but the
   search box's is border-box, so the floor is the whole control: on
   the content box a control's own padding and border landed on top of
   it, and a 33.8px dropdown summary became 44.8 (the topbar 61.8) on a
   desktop where it already cleared 32. Each selector repeats the weight of the rule
   it raises: a floor lighter than the size it raises loses wherever it
   sits (the topbar's Menu summary is (0,2,1)).

   The block is last before the utilities so it wins ties with every
   component above it. ui/sizing_test.go fails when a rule styling an
   a, button, summary or label arrives without a row in the inventory
   this block implements, and ui/sizing_browser_test.go measures every
   control at 390 and 1024 with a coarse pointer and at 600 with a
   mouse against 44px, and at 1280 with a mouse against 32px. ─────── */
:where([rst-shell-nav] a, [rst-shell-brand]) { column-gap: 0.3em; }

[rst-shell-brand] { align-items: center; box-sizing: border-box; display: inline-flex; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
[rst-shell-profile] > summary { box-sizing: border-box; }
/* The back control: its own 2.75rem is already the floor, centred in
   its strip; the link is the target. */
[rst-shell-back] > a { box-sizing: border-box; min-inline-size: var(--rst-target); }

/* Repeated from extras.css by a pin in hack/split, so it comes after the rules above. */
[rst-dropdown-menu] [rst-menu-row] > [rst-dropdown] > summary { font-size: 12.5px; font-weight: inherit; }

/* Repeated from core.css by a pin in hack/split, so it comes after the rules above. */
.rst-sr-only {
  clip-path: inset(50%);
  block-size: 1px;
  inline-size: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

/* Repeated from core.css by a pin in hack/split, so it comes after the rules above. */
.rst-sr-only:focus-visible {
  background: var(--rst-accent);
  border: 0;
  border-radius: var(--rst-radius-sm);
  block-size: auto;
  clip-path: none;
  color: var(--rst-on-accent);
  cursor: pointer;
  font: inherit;
  font-size: var(--rst-fs-sm);
  inline-size: auto;
  overflow: visible;
  padding: 0.3rem 0.6rem;
  position: static;
  white-space: normal;
}

/* ── Shells: the page frames an app's layout template wraps .rst-page
      in — topbar and sidebar. Written in logical properties throughout,
      so a right-to-left locale gets a mirrored shell for free: the rail
      moves to the inline end, the account menu with it, and nothing
      here needs a second rule. ─────────────────────────────────────── */

/* topbar shell — brand, nav and an account menu on one bar, the page
   column beneath it, a footer under that. The account dropdown is
   pushed to the inline end by auto margin, not by order or float. */
[rst-shell-topbar] [rst-shell-bar] { align-items: center; background: var(--rst-surface); border-block-end: 1px solid var(--rst-line); display: flex; flex-wrap: wrap; gap: var(--rst-sp-4); padding-block: 0.5rem; padding-inline: var(--rst-sp-4); }

/* The topbar's narrow layout. Below 800px — the same breakpoint the
   sidebar collapses at, deliberately, because two shells with two
   breakpoints is two systems — the bar's tail (nav, account, locale)
   goes behind one disclosure carrying the `menu` icon. Above it the
   summary is display: none and the tail is display: contents, so nav,
   account and locale are direct flex items of the bar again and the
   inline-end layout is byte-for-byte the one that shipped before this
   existed. No script: a <details>, a media query and a pair of display
   rules.

   Why the tail is a SIBLING of the disclosure rather than its content,
   which is the shape .rst-shell__chrome already uses: a closed
   <details> hides its own content, and no CSS reliably un-hides it
   across engines, so the wide layout could not be recovered from
   inside one. It also keeps the account menu out of the disclosure
   entirely, which matters — see the name below.

   The name is rst-shell-menu and NOT rst-menus. <details name>
   exclusivity is document-wide, not sibling-scoped, so a disclosure
   sharing the menus' group would be closed by the very account menu it
   reveals: the user clicks Account and the navigation they opened it
   from disappears. Same rule this file's rst-menu-group already
   documents ("a nested group MUST name a different one"), met here for
   the first time in the framework's own shells. */
[rst-shell-topbar] [rst-shell-menu] { margin-inline-start: auto; }
[rst-shell-topbar] [rst-shell-menu] > summary { align-items: center; border: 1px solid var(--rst-line); border-radius: var(--rst-radius-sm); cursor: pointer; display: flex; font-size: var(--rst-fs-sm); font-weight: 550; gap: 0.35rem; list-style: none; min-block-size: 24px; padding-block: 0.3rem; padding-inline: 0.55rem; }
[rst-shell-topbar] [rst-shell-menu] > summary::-webkit-details-marker { display: none; }
[rst-shell-topbar] [rst-shell-tail] { display: none; }
/* The account's auto margin has to be undone here, and stretch does not
   do it: in a column flex box the inline axis is the CROSS axis, and an
   item with an auto cross-axis margin is exempt from stretching, so
   margin-inline-start: auto survived and shoved Account to the trailing
   edge of the collapsed stack — the same trailing-edge shove that made
   the wrapped bar look wrong in the first place. The wide query below
   puts it back. */
[rst-shell-topbar] [rst-shell-menu][open] + [rst-shell-tail] { display: flex; flex-basis: 100%; flex-direction: column; gap: var(--rst-sp-3); }
[rst-shell-topbar] [rst-shell-tail] > [rst-shell-account] { margin-inline-start: 0; }
/* flex-start so a nav link's aria-current underline is as wide as its
   own label rather than as wide as the bar, where it reads as a rule
   across the menu instead of as a marker on one item. */
[rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] { align-items: flex-start; flex-direction: column; gap: var(--rst-sp-2); }
/* The nav links pick up the inline padding the two menu summaries below
   them already carry, so the collapsed stack reads as one column of
   labels rather than three components that happen to be above each
   other. Same reason the rail's links carry 0.55rem. */
[rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a { padding-inline: 0.6rem; }
@media (min-width: 800px) {
  [rst-shell-topbar] [rst-shell-menu] { display: none; }
  /* Both selectors, and both at least as specific as the narrow rules
     they undo: a media query adds no specificity, so the open
     disclosure's 0-4-0 rule above would otherwise keep the tail a
     column for anyone who opened the menu and then widened the
     window. */
  [rst-shell-topbar] [rst-shell-tail],
  [rst-shell-topbar] [rst-shell-menu][open] + [rst-shell-tail] { display: contents; }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-account] { margin-inline-start: auto; }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] { align-items: normal; flex-direction: row; gap: var(--rst-sp-4); }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a { padding-inline: 0; }
}

/* The topbar's narrow menu is a floating card: it overlays the page and
   never pushes it down. The open tail is placed against the bar, at its
   inline end (logical insets, so an RTL page anchors it left), scrolling
   itself if a long nav does not fit. The account and language menus
   inside it expand in place: a popover inside a popover has nowhere good
   to go on a phone. It is the menu panels' surface (9px, their border
   and shadow), so every menu reads as one system. The current item is a
   fill and weight, never a border or an inset bar.

   EVERY rule here is scoped below 800px rather than written narrow and
   undone at 800: the wide tail's display: contents removes the tail's
   box and nothing else, so the account panel would stay static, the nav
   would lose its underline, and the layer below would still swallow
   clicks on a desktop someone widened with the menu open. These rules
   come after both shells' narrow rules above and win at equal weight.

   CLOSING ON AN OUTSIDE TAP, with and without scripts: while open, the
   summary grows an invisible ::before over the viewport, under the card
   and over the page. A tap anywhere outside the card lands on it, which
   is a click on the summary, which closes the <details> natively, and
   the tap never reaches the page. It is position: fixed inside the bar,
   so it breaks if an app gives the bar or an ancestor a transform,
   filter or backdrop-filter (each makes a containing block for fixed
   descendants). While the card is open the bar's z-index 45 is above
   the in-page panels (dropdown 30, row menu 40), so a menu left open
   without scripts cannot paint over the card, and below the skip link
   (60). Only while open: lifted for good, the bar painted over a modal's
   scrim (z-index 10), undimmed and still tappable on a phone. Closed, it
   is positioned at z-index auto, which the scrim covers. The card is
   sized from the bar (100%), not the viewport, which counts a classic
   scrollbar's gutter as room and overhung the start edge at 320px.
   rastrillo.js adds Escape.

   The console's bar folds the same way; its nav is in the rail, so its
   card holds the account and language menus only. Only a console whose
   root names its view: an old console layout gates its rail on the
   same [open], and the tap-to-close layer would cover that rail, so a
   tap on any rail link would close the navigation instead of following
   it. An old layout keeps its push-down tail. */
@media (max-width: 799.98px) {
  /* The bar is the phone's header strip, the same height as the back
     strip under it and the sidebar's index row; its padding was what
     set its height before, and with a 44px Menu that made it 61px. */
  [rst-shell-topbar] [rst-shell-bar] { box-sizing: border-box; min-block-size: var(--rst-shell-strip); padding-block: 0; position: relative; }
  [rst-shell-topbar] [rst-shell-bar]:has(> [rst-shell-menu][open]) { z-index: 45; }
  [rst-shell-topbar] [rst-shell-menu][open] > summary { background: var(--rst-accent-soft); border-color: var(--rst-accent); }
  [rst-shell-topbar] [rst-shell-menu][open] > summary::before { content: ""; cursor: default; inset: 0; position: fixed; z-index: 1; }
  [rst-shell-topbar] [rst-shell-menu][open] + [rst-shell-tail] { animation: rst-shell-drop 0.14s ease-out; background: var(--rst-surface); border: 1px solid var(--rst-line); border-radius: 9px; box-shadow: var(--rst-shadow-pop); box-sizing: border-box; flex-basis: auto; gap: 0; inline-size: min(20rem, calc(100% - 1.5rem)); inset-block-start: calc(100% + 6px); inset-inline-end: 0.75rem; max-block-size: calc(100dvh - 5rem); overflow-y: auto; overscroll-behavior: contain; padding: 0.35rem; position: absolute; z-index: 2; }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] { align-items: stretch; gap: 0; }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a { border-block-end: 0; border-radius: var(--rst-radius-sm); color: var(--rst-text); padding-block: 0.55rem; padding-inline: 0.75rem; }
  /* The card's links tint with no depth. The hover is a token of its
     own, transparent unless a theme sets it, because the card had no
     hover before and a flat theme must keep none (A15); the mouse press
     and the tap read the tap tint, transparent likewise. The hover and
     the press sit in the hover query after this block. The current item
     is the rail's token pair with the thumb's three shadow layers,
     transparent in a flat theme, so in day it reads as a thumb on the
     card rather than white on white. */
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a:not([aria-current]):active { background-color: var(--rst-tint-tap, transparent); }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a[aria-current] { background: var(--rst-nav-current-bg, var(--rst-accent-soft)); box-shadow: inset var(--rst-hl-x) 1px 0 var(--rst-depth-hl, transparent), 0 0 0 1px var(--rst-depth-contact, transparent), var(--rst-shadow-x) var(--rst-shadow-y) 2px var(--rst-depth-contact, transparent); color: var(--rst-nav-current-fg, var(--rst-accent)); font-weight: 600; }
  /* Topbar only: the rule separates the account from the nav above it,
     and in the console's card the account is first, under nothing. */
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-account] { border-block-start: 1px solid var(--rst-line); margin-block-start: 0.35rem; padding-block-start: 0.35rem; }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-account] > summary { justify-content: space-between; padding-inline: 0.75rem; }
  [rst-shell-topbar] [rst-shell-tail] [rst-dropdown-menu] { border: 0; box-shadow: none; inset: auto; margin: 0; max-block-size: none; min-width: 0; padding-block: 0; padding-inline: 0.5rem 0; position: static; }
}
/* One query, not a hover query nested in the width query: the motion
   gate's parser counts one level of nesting. */
@media (max-width: 799.98px) and (hover: hover) {
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a:not([aria-current]):hover { background-color: var(--rst-tint-card-hover, transparent); }
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a:not([aria-current]):hover:active { background-color: var(--rst-tint-tap, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  [rst-shell-topbar] [rst-shell-menu][open] + [rst-shell-tail] { animation: none; }
}

/* ── The console on one row ─────────────────────────────────────────
   A console whose root holds [rst-shell-up] is the one-row console.
   Below 800px its bar is the phone's one header row: the up link at
   the inline start, the app's name at the centre, the account's avatar
   at the inline end, and nothing else above the page. The back strip,
   the Menu and its tail are gone: the up link is in the bar, and the
   account card holds the person, the scheme, the language and the
   account's links. From 800px it is the 1.3 bar less the language
   menu, which moved into the card: the brand at the start, "Account"
   at the end. Every rule names [rst-shell-up], in the root's :has()
   or as the element itself, so a 1.3 console (Menu, tail, back strip)
   matches none of them and draws as it did. The card is as tall as
   the window less the row, as the 1.3 card was: it holds four kinds
   of thing now, and the Language menu opens inside it.

   The row is a grid of three columns, the two sides equal shares of
   what the name leaves, each at least its own content, so the name is
   on the row's true centre whenever it can be and moves toward the
   shorter side only as far as it must. The name's column shrinks when
   the three do not fit, and the name keeps to one line, cut with an
   ellipsis, so the up link and the avatar never give up any of their
   width to it. The up link's own label is cut with an ellipsis too,
   at the screen's width less the avatar's column, so a long parent
   title never pushes the avatar off the row; its aria-label keeps the
   whole title. A name is shown whole or not at all, never cut: shell.js
   measures it and, where it is cut, marks it hidden, which the [hidden]
   rule takes out of the row, out of reach of a tap and of Tab. Only a
   script can tell that a name is cut, so with scripts off the cut name
   stays, the one place the ellipsis shows: a tap or Tab there lands on
   a name the reader can see, never on an invisible link. */
[rst-shell-topbar]:has([rst-shell-up]) [rst-shell-account] > [rst-dropdown-menu] { box-sizing: border-box; inline-size: min(17rem, calc(100vw - 1.5rem)); max-block-size: calc(100dvh - 5rem); }
@media (max-width: 799.98px) {
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] { align-items: center; block-size: var(--rst-shell-strip); display: grid; gap: 0 var(--rst-sp-1); grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); padding-inline: var(--rst-sp-1); }
  [rst-shell-topbar~="page"]:has([rst-shell-up]) > [rst-shell-bar] { inset-block-start: 0; position: sticky; z-index: 9; }
  [rst-shell-topbar~="page"] > [rst-shell-bar] > [rst-shell-up] { border-radius: var(--rst-radius-sm); box-sizing: border-box; color: var(--rst-accent); display: block; font-size: 1rem; font-weight: 500; grid-column: 1; grid-row: 1; justify-self: start; line-height: 2.75rem; max-inline-size: calc(100vw - 5rem); min-block-size: 2.75rem; min-inline-size: var(--rst-target); overflow: hidden; padding-inline: 0.25rem 0.5rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
  [dir="rtl"] [rst-shell-topbar~="page"] > [rst-shell-bar] > [rst-shell-up] .icon { transform: scaleX(-1); }
  [rst-shell-topbar~="page"] > [rst-shell-bar] > [rst-shell-up]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-brand],
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-title] { block-size: 2.75rem; color: var(--rst-text); font-size: var(--rst-fs-lg); font-weight: 650; grid-column: 2; grid-row: 1; justify-content: center; letter-spacing: normal; line-height: 2.75rem; margin: 0; min-block-size: 0; min-inline-size: 0; overflow: hidden; padding: 0; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  [rst-shell-topbar~="page"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-brand] { display: block; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-brand][hidden],
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-title][hidden] { display: none; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-account] { grid-column: 3; grid-row: 1; justify-self: end; margin-inline-start: 0; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-account] > summary { border-radius: 50%; box-sizing: border-box; color: var(--rst-text); display: inline-flex; justify-content: center; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); padding: 4px; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar]:has(> [rst-shell-account][open]) > [rst-shell-account] > summary { background: var(--rst-accent-soft); }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-account] > summary:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: 2px; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar]:has(> [rst-shell-account][open]) > [rst-shell-account] > summary::before { content: ""; cursor: default; inset: 0; position: fixed; z-index: 1; }
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar]:has(> [rst-shell-account][open]) { z-index: 45; }
}
@media (max-width: 799.98px) and (hover: hover) {
  [rst-shell-topbar]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-account] > summary:hover { background: var(--rst-accent-soft); }
}
/* ── The topbar on one row ──────────────────────────────────────────
   A topbar whose root holds [rst-shell-up] is the one-row topbar, and
   below 800px a topbar app is a tree: /menu, the index, is the nav as
   rows; every other page is a content page one level down from its
   row there. The row is the console's (above): its grid, its up link
   (labelled Menu, or the page's parent), its name and its avatar are
   the console's rules, which name the topbar too. The index rows look
   like the sidebar's and the console's, restated below in rules of
   their own. The nav is in the bar, between the brand and the
   account card: on a content page it is hidden, and on the index it
   hangs from the bar's foot, out of the row's grid, so the row stays
   the strip's height while its nav is the page, and the shell's foot
   is anchored under it. main and its skip link go: the page is
   navigation. The avatar is read after the rows, the order the bar
   writes them in, the second recorded exception to "focus order is
   visual order". Every rule here names [rst-shell-up].

   From 800px the bar is 1.3's: the brand at the start, the nav inline,
   Account at the end. The language menu has moved into the card, and
   the up link and the title are hidden there as everywhere else. A
   1.3 topbar (a bare root, the Menu and its tail) has no
   [rst-shell-up] and no view, so it matches none of these rules nor
   the shared ones, and keeps its Menu card on a phone. */
@media (max-width: 799.98px) {
  [rst-shell-topbar~="page"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav],
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-brand],
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-skip],
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > main { display: none; }
  /* A content page's row is sticky, so a #fragment lands below it, as
     the sidebar's and the console's do. html, not :root: the grammar
     1.x's new rules are held to has none (check/selectors_test.go). */
  html:has([rst-shell-topbar~="page"] [rst-shell-up]) { scroll-padding-block-start: var(--rst-shell-strip); }
  /* The index's name is its title, which holds the brand; :not([hidden])
     so shell.js can still hide one that does not fit. */
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-title]:not([hidden]) { align-items: center; display: flex; }
  /* The rows hang from the bar's padding edge, so its border stays the
     row's foot, and take the console index rail's padding. The foot is
     anchored under them: it is the app's, and may hold links a reader
     needs. */
  [rst-shell-topbar~="index"]:has([rst-shell-up]) { position: relative; }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] { anchor-name: --rst-topbar-rows; box-sizing: border-box; flex-direction: column; gap: 0; inset-block-start: 100%; inset-inline: 0; padding: var(--rst-sp-5) var(--rst-sp-4); position: absolute; }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-foot] { inset-block-start: anchor(--rst-topbar-rows end); inset-inline: 0; position: absolute; }
  /* The rows are the sidebar's and the console's index rows, in rules
     of their own: theirs are 1.3's, written without :has(), and a
     :has() selector listed beside them would take them down with it
     where :has() is not known. */
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a { align-items: center; background: var(--rst-surface); border: 1px solid var(--rst-line); border-block-start-width: 0; border-radius: 0; color: var(--rst-text); display: flex; font-size: 1rem; font-weight: 450; gap: var(--rst-sp-3); min-block-size: 3rem; padding-block: 0; padding-inline: 1rem 0.75rem; }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:first-child { border-block-start-width: 1px; border-start-end-radius: var(--rst-radius); border-start-start-radius: var(--rst-radius); }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:last-child { border-end-end-radius: var(--rst-radius); border-end-start-radius: var(--rst-radius); }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a::after { block-size: 0.5rem; border-right: 2px solid var(--rst-text-faint); border-top: 2px solid var(--rst-text-faint); content: ""; flex: none; inline-size: 0.5rem; margin-inline-start: auto; transform: rotate(45deg); }
  [dir="rtl"] [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a::after { transform: rotate(-135deg); }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:hover { background: var(--rst-tint-hover, var(--rst-accent-soft)); }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:active { background: var(--rst-tint-press, var(--rst-accent-soft)); }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:target { animation: rst-shell-flash 1.4s ease-out; }
}
/* An engine with no anchor positioning keeps the rows in the bar's
   flow, under the row, and the foot under them: a taller bar, but
   nothing out of reach. */
@media (max-width: 799.98px) {
  @supports not (anchor-name: --rst-topbar-rows) {
    [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] { block-size: auto; grid-template-rows: var(--rst-shell-strip); }
    [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] { grid-column: 1 / -1; position: static; }
    [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-foot] { position: static; }
  }
}
@media (prefers-reduced-motion: reduce) {
  [rst-shell-topbar~="index"]:has([rst-shell-up]) > [rst-shell-bar] > [rst-shell-nav] > a:target { animation: none; }
}

/* ── Tap targets on small or touch screens: what the floor needs
      beyond a size ────────────────────────────────────────────────────
   The touch query raises --rst-target, which every rule in the floor
   block below reads, from the desktop's 32px to --rst-tap (44px). What
   stays here is what a phone needs and a desktop does not: the kebab's
   wider column, a menu cap that fits three 44px rows, the calendar
   docked to the bottom of the screen, and the layout that centres a
   control's text in its 44px. ────────────────────────────── */
@media (pointer: coarse), (max-width: 40rem) {
  [rst-shell-topbar] [rst-shell-nav] a { align-items: center; display: flex; }
}
@media (forced-colors: active) {
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a[aria-current] { background: Highlight; box-shadow: none; color: HighlightText; }
}
@media print {
  [rst-shell-topbar] [rst-shell-tail] > [rst-shell-nav] a[aria-current] { box-shadow: none; }
}

/* ── Target floors, at every width ──────────────────────────────────
   Every interactive idiom is at least --rst-target on both axes: 32px
   on a desktop with a mouse, --rst-tap (44px) on a small or touch
   screen, where the query above raises the token. One list of idioms
   read through one token, so a control floored on a phone cannot be
   left at 24px on a desktop, and the two floors cannot drift apart.
   The size is measured as the box a tap or click ACTIVATES: the label
   of a label-backed control, the row of a stretched link. Anything
   that is display: inline today becomes inline-flex or flex here,
   because min sizes do nothing on an inline box; a block keeps its
   display and centres its content with align-content. Nothing else
   belongs here: a declaration that changes a desktop control the floor
   leaves alone goes in the touch query above. Every floor but the
   search box's is border-box, so the floor is the whole control: on
   the content box a control's own padding and border landed on top of
   it, and a 33.8px dropdown summary became 44.8 (the topbar 61.8) on a
   desktop where it already cleared 32. Each selector repeats the weight of the rule
   it raises: a floor lighter than the size it raises loses wherever it
   sits (the topbar's Menu summary is (0,2,1)).

   The block is last before the utilities so it wins ties with every
   component above it. ui/sizing_test.go fails when a rule styling an
   a, button, summary or label arrives without a row in the inventory
   this block implements, and ui/sizing_browser_test.go measures every
   control at 390 and 1024 with a coarse pointer and at 600 with a
   mouse against 44px, and at 1280 with a mouse against 32px. ─────── */
[rst-shell-topbar] [rst-shell-nav] a { align-content: center; box-sizing: border-box; min-block-size: var(--rst-target); }
/* border-box, here and on the profile's avatar: the floor is the
   whole button. Measured on the content box, the Menu's padding and
   border made it 56px and the avatar 52px, filling the header strip
   they sit in instead of centring a 44px target in it. */
[rst-shell-topbar] [rst-shell-menu] > summary { box-sizing: border-box; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
/* The card's own summaries: the open Menu (its pressed state is a
   (0,3,1) rule) and the account menu inside it. */
[rst-shell-topbar] [rst-shell-menu][open] > summary { box-sizing: border-box; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
[rst-shell-topbar] [rst-shell-tail] > [rst-shell-account] > summary { box-sizing: border-box; min-block-size: var(--rst-target); }

/* Repeated from core.css by a pin in hack/split, so it comes after the rules above. */
.rst-sr-only {
  clip-path: inset(50%);
  block-size: 1px;
  inline-size: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

/* Repeated from core.css by a pin in hack/split, so it comes after the rules above. */
.rst-sr-only:focus-visible {
  background: var(--rst-accent);
  border: 0;
  border-radius: var(--rst-radius-sm);
  block-size: auto;
  clip-path: none;
  color: var(--rst-on-accent);
  cursor: pointer;
  font: inherit;
  font-size: var(--rst-fs-sm);
  inline-size: auto;
  overflow: visible;
  padding: 0.3rem 0.6rem;
  position: static;
  white-space: normal;
}

/* shell.css — the slide between the index and a page on a phone, for
   the sidebar, console and one-row topbar shells (the topbar's index
   is /menu), the only layouts that link it.

   It is a file of its own because the opt-in cannot be scoped: written
   in tokens.css, @view-transition would opt every page of every shell
   into cross-document transitions at narrow widths, the sign-in page
   included. Both documents must opt in, and a stylesheet only these
   three shells link is exactly that set. A 1.3 topbar layout does not
   link it, and keeps navigating without a slide. Delete it (and its <link>) and
   navigation is instant; nothing else changes.

   shell.js types a transition between an index and a page "forward" or
   "back" in pagereveal, and skips any other. Each :active-view-transition-type() selector is a rule of its own: an
   engine that does not know the pseudo-class drops the whole rule, and a
   co-listed selector would take its neighbours with it (the trap the
   console's rules in tokens.css record). The slide is a physical
   translateX, so a right-to-left page has four rules of its own that
   slide the other way. Under reduced motion nothing opts in and
   navigation is instant; the block at the end sets every animation here
   to none as well, which is the form the motion gate reads. */
@media (max-width: 799.98px) and (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  /* No cross-fade: a transition no type names (page to page, or with no
     shell.js) is an instant swap. The typed rules below outweigh these.
     The root group now has no animation for its timing (1.9.0's) to
     time; the slide is its old and new images, which carry their own. */
  ::view-transition-group(*) { animation: none; }
  ::view-transition-old(*) { animation: none; }
  ::view-transition-new(*) { animation: none; }
  ::view-transition-group(root) { animation-duration: 0.32s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  html:active-view-transition-type(forward)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-start; }
  html:active-view-transition-type(forward)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-end; }
  html:active-view-transition-type(back)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-end; z-index: 1; }
  html:active-view-transition-type(back)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-start; }
  html[dir="rtl"]:active-view-transition-type(forward)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-start-rtl; }
  html[dir="rtl"]:active-view-transition-type(forward)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-end-rtl; }
  html[dir="rtl"]:active-view-transition-type(back)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-end-rtl; z-index: 1; }
  html[dir="rtl"]:active-view-transition-type(back)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-start-rtl; }
  /* The console's bar holds still while the page under it slides. */
  [rst-shell-console] > [rst-shell-bar] { view-transition-name: rst-shell-bar; }
}
@keyframes rst-shell-in-end { from { transform: translateX(100%); } }
@keyframes rst-shell-out-start { to { opacity: 0.7; transform: translateX(-25%); } }
@keyframes rst-shell-in-start { from { opacity: 0.7; transform: translateX(-25%); } }
@keyframes rst-shell-out-end { to { transform: translateX(100%); } }
@keyframes rst-shell-in-end-rtl { from { transform: translateX(-100%); } }
@keyframes rst-shell-out-start-rtl { to { opacity: 0.7; transform: translateX(25%); } }
@keyframes rst-shell-in-start-rtl { from { opacity: 0.7; transform: translateX(25%); } }
@keyframes rst-shell-out-end-rtl { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  html:active-view-transition-type(forward)::view-transition-old(root) { animation: none; }
  html:active-view-transition-type(forward)::view-transition-new(root) { animation: none; }
  html:active-view-transition-type(back)::view-transition-old(root) { animation: none; }
  html:active-view-transition-type(back)::view-transition-new(root) { animation: none; }
  html[dir="rtl"]:active-view-transition-type(forward)::view-transition-old(root) { animation: none; }
  html[dir="rtl"]:active-view-transition-type(forward)::view-transition-new(root) { animation: none; }
  html[dir="rtl"]:active-view-transition-type(back)::view-transition-old(root) { animation: none; }
  html[dir="rtl"]:active-view-transition-type(back)::view-transition-new(root) { animation: none; }
}
