/* ── 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. ─────────────────────────────────────── */
/* box-sizing on the rail, per this file's convention (see .rst-input
   above): set on the component that needs it, never in a `*` reset.
   The rail is the one box in the stylesheet whose height is the
   VIEWPORT'S — block-size: 100dvh in the query below — and it also
   carries padding, so as a content box its border box was 100dvh + 32px.
   Sticky at inset-block-start: 0, the last 32px of it hung under the
   window and clipped whatever sat at its foot; overflow-y: auto could
   not help, because the content fitted the content box and no scrollbar
   was ever owed. Anything sized against the viewport has to be measured
   the way the viewport measures it. */
[rst-shell-sidebar] > [rst-shell-rail] { background: var(--rst-rail-bg, var(--rst-surface)); border-block-end: 1px solid var(--rst-line); box-sizing: border-box; display: none; flex-direction: column; gap: var(--rst-sp-3); padding: var(--rst-sp-4); }
/* LEGACY: the old drawer, see above. */
[rst-shell-sidebar] > [rst-shell-chrome] > summary { align-items: center; border-block-end: 1px solid var(--rst-line); cursor: pointer; display: flex; font-size: var(--rst-fs-sm); font-weight: 550; gap: 0.3rem; list-style: none; padding-block: 0.55rem; padding-inline: var(--rst-sp-4); }
/* LEGACY: the old drawer, see above. */
[rst-shell-sidebar] > [rst-shell-chrome] > summary::-webkit-details-marker { display: none; }
/* LEGACY: the old drawer, see above. */
[rst-shell-sidebar] > [rst-shell-chrome][open] + [rst-shell-rail] { display: flex; }
[rst-shell-sidebar] [rst-shell-nav] { flex-direction: column; gap: 2px; }
/* The current item is a selected thumb, like a segmented control: its
   fill and text are a token pair, so a theme can keep the tinted item
   it has today, and its highlight, ring and contact shadow are depth
   tokens, so a flat theme draws none. Hovering another item is a
   half-raised preview of the thumb; pressed, it sinks.

   The press is two rules (A15): :hover:active inside the hover query
   is a mouse pressing a hovered item and reads the press tint; :active
   outside it is a finger, which hovers nothing, and reads the tap
   tint, transparent wherever a theme never set it, because a touch
   press painted nothing before. The hover excludes the current item so
   the thumb never takes the preview's tint over its own fill. The
   phone's index rows match these rules too; the index block further
   down outweighs them and keeps its rows tint only. The console's
   items below repeat these rules word for word.

   The 0.2s fade is declared on the hover rule, not at rest: a
   transition at rest also ran on a scheme change, and an app's own
   switch, which never calls rastrillo.js's land(), showed the new
   text on the old ground for a fifth of a second (Astra A3). Hover-in
   fades; hover-out, a press and a scheme change land at once. */
[rst-shell-sidebar] [rst-shell-nav] a { border-block-end: 0; border-radius: var(--rst-radius-sm); display: block; padding-block: 0.35rem; padding-inline: 0.55rem; -webkit-tap-highlight-color: transparent; }
[rst-shell-sidebar] [rst-shell-nav] a:not([aria-current]):active { background-color: var(--rst-tint-tap, transparent); box-shadow: inset 0 1px 2px var(--rst-depth-ambient, transparent); transition: none; }
@media (hover: hover) {
  [rst-shell-sidebar] [rst-shell-nav] a:not([aria-current]):hover { --rst-hover: 100%; --rst-pressed: 0%; background-color: color-mix(in srgb, var(--rst-tint-press, var(--rst-accent-soft)) var(--rst-pressed), color-mix(in srgb, var(--rst-tint-hover, var(--rst-accent-soft)) var(--rst-hover), transparent)); box-shadow: inset var(--rst-hl-x) 1px 0 color-mix(in srgb, var(--rst-depth-hl, transparent) var(--rst-hover), transparent), 0 0 0 1px color-mix(in srgb, color-mix(in srgb, var(--rst-depth-contact, transparent) 60%, transparent) var(--rst-hover), transparent), var(--rst-shadow-x) var(--rst-shadow-y) 1px color-mix(in srgb, var(--rst-depth-ambient, transparent) var(--rst-hover), transparent); color: var(--rst-text); transition: --rst-hover 0.2s ease, --rst-pressed 0.2s ease; }
  [rst-shell-sidebar] [rst-shell-nav] a:not([aria-current]):hover:active { --rst-pressed: 100%; background-color: var(--rst-tint-press, var(--rst-accent-soft)); box-shadow: inset 0 1px 2px var(--rst-depth-ambient, transparent); transition: none; }
}
[rst-shell-sidebar] [rst-shell-nav] a[aria-current] { background-color: 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; }
@media (min-width: 800px) {
  [rst-shell-sidebar] { display: grid; grid-template-columns: 15rem 1fr; }
  /* LEGACY: the old drawer, see above. */
  [rst-shell-sidebar] > [rst-shell-chrome] { display: none; }
  [rst-shell-sidebar] > [rst-shell-rail] { block-size: 100dvh; border-block-end: 0; border-inline-end: 1px solid var(--rst-line); display: flex; inset-block-start: 0; overflow-y: auto; position: sticky; }
  /* The rail is lifted while the profile menu is open because here it
     is sticky, a stacking context of its own, and the card reaches past
     it over the page, where anything the page positions at z-index 1 or
     more (a row's controls, a pinned bar) would otherwise paint over the
     card and catch the tap. Only while open, as with the topbar's bar:
     lifted for good, the rail would sit over a modal's scrim. Below
     800px the index's rail is no stacking context and needs no lift. */
  [rst-shell-sidebar] > [rst-shell-rail]:has([rst-shell-profile][open]) { z-index: 45; }
}
@media (prefers-reduced-motion: reduce) {
  [rst-shell-sidebar] [rst-shell-nav] a:not([aria-current]):hover { transition: none; }
}

/* ── 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. ─────────────────────────────────────── */
@media (max-width: 799.98px) {
  /* The content view: a sticky strip of its own at the top, first in
     the reading order after the skip link. Its z-index 9 sits above the
     sticky form bar (5), so a long form scrolled under the strip does
     not paint over Back, and below a modal's scrim (10): above it, Back
     stayed undimmed and live under an open modal on a phone. */
  [rst-shell-sidebar~="page"] > [rst-shell-back] { align-items: center; background: var(--rst-surface); border-block-end: 1px solid var(--rst-line); box-sizing: border-box; display: flex; inset-block-start: 0; min-block-size: var(--rst-shell-strip); padding-inline: var(--rst-sp-1); position: sticky; z-index: 9; }
  /* The strip is sticky, not in the flow a plain scroll-to-fragment
     measures against, so a #fragment link's native landing scroll parks
     the target's top edge at the root's scroll origin — under the
     strip, the one thing on a content page actually sitting there.
     Reserving the strip's own height, border included (it is
     border-box), as scroll padding is what makes that landing spot the
     strip's bottom edge instead. */
  :root:has([rst-shell-sidebar~="page"]) { scroll-padding-block-start: var(--rst-shell-strip); }

  /* The index view: the rail is the page. main and the skip link go with
     it, so the skip link never points at nothing; the brand gives way to
     the title, the one h1 here, which holds the brand itself. Matched as
     the title's next sibling, which is where both layouts write the
     brand block, so the brand inside the heading stays and a console
     layout from before the heading moved into its bar keeps its bar's
     brand. On the index a page has no main landmark, which is the
     point: the page is navigation. */
  [rst-shell-sidebar~="index"] > [rst-shell-main], [rst-shell-sidebar~="index"] > [rst-skip], [rst-shell-sidebar~="index"] [rst-shell-title] + [rst-shell-brand] { display: none; }
  /* position: relative is for the profile menu, lifted from the foot to
     the top of this rail (below). No padding above: the heading is the
     header row, the strip's height from the top of the screen, so the
     header is where a content page's back strip is and does not jump
     as the slide goes between them. */
  [rst-shell-sidebar~="index"] > [rst-shell-rail] { background: var(--rst-bg); border-block-end: 0; display: flex; gap: 0; min-block-size: 100dvh; padding: 0 var(--rst-sp-4) var(--rst-sp-5); position: relative; }
  /* The heading is the app's name in a header row, not a page title:
     one line at about 21px, eliding rather than wrapping, the height of
     the avatar beside it so the two centre on one line. The sidebar's
     is the header row itself, the strip's height, and reserves the
     avatar's room at its inline end, since the avatar is lifted over
     the rail rather than laid out beside it. The console's sits in the
     bar, which is the strip. */
  [rst-shell-sidebar~="index"] [rst-shell-title] { align-items: center; display: flex; font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 var(--rst-sp-2); min-block-size: 2.75rem; min-inline-size: 0; padding-inline: 0.25rem; }
  [rst-shell-sidebar~="index"] [rst-shell-title] { min-block-size: var(--rst-shell-strip); padding-inline-end: calc(2.75rem + var(--rst-sp-3)); }
  /* The rows: every link a full-width row, at least 3rem, 1rem text, a
     chevron at the end. The grouping is the markup apps already write,
     a group label and then its links: a run of rows is rounded at its
     first link (the nav's first, or the one after a label) and its last
     (the nav's last, or the one before a label). The :has() half is a
     rule of its own, so an engine without :has() drops only it and a
     run's last corner is square, which is cosmetic. aria-current is not
     marked here: the index is its own page, where "current" is not
     true. */
  [rst-shell-sidebar~="index"] [rst-shell-nav] { gap: 0; }
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a, [rst-shell-sidebar~="index"] [rst-shell-nav] > a[aria-current] { align-items: center; background: var(--rst-surface); border: 1px solid var(--rst-line); border-block-start-width: 0; border-radius: 0; box-shadow: none; box-sizing: border-box; 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; transition: none; }
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a:first-child, [rst-shell-sidebar~="index"] [rst-shell-nav] > [rst-shell-group] + a { border-block-start-width: 1px; border-start-end-radius: var(--rst-radius); border-start-start-radius: var(--rst-radius); }
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a:last-child { border-end-end-radius: var(--rst-radius); border-end-start-radius: var(--rst-radius); }
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a:has(+ [rst-shell-group]) { border-end-end-radius: var(--rst-radius); border-end-start-radius: var(--rst-radius); }
  [rst-shell-sidebar~="index"] [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-sidebar~="index"] [rst-shell-nav] > a::after { transform: rotate(-135deg); }
  /* A row tints and nothing else. The rail items' state rules above
     match these links too and outweigh a plain index selector, so each
     state here repeats the root's own name to outweigh them (the sm
     button's trick) and sets the shadow off: the thumb's ring doubled a
     row's border. Both rules stay outside the hover query, where
     today's one rule was, and the press reads the press tint, not the
     tap tint: a tapped row painted accent-soft before (a tap hovers
     too), and the tap tint is transparent in every theme but day, which
     would have blanked the tap in plain and signal. The active rule
     follows the hover so the press wins while both hold. */
  [rst-shell-sidebar][rst-shell-sidebar~="index"] [rst-shell-nav] > a:hover { background: var(--rst-tint-hover, var(--rst-accent-soft)); box-shadow: none; }
  [rst-shell-sidebar][rst-shell-sidebar~="index"] [rst-shell-nav] > a:active, [rst-shell-sidebar][rst-shell-sidebar~="index"] [rst-shell-nav] > a:hover:active { background: var(--rst-tint-press, var(--rst-accent-soft)); box-shadow: none; }
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
  /* "You came from here": the back link points at #nav-<section>, and
     that row flashes once as the index comes back. */
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a:target { animation: rst-shell-flash 1.4s ease-out; }
  [rst-shell-sidebar~="index"] [rst-shell-group] { margin-block: var(--rst-sp-5) var(--rst-sp-2); padding-inline: 1rem; }
  /* The foot FOLLOWS the nav on the index, by a fixed gap, never auto:
     the rail has a min-height here, and an auto margin would float the
     foot to the bottom of the screen, where the language menu would open
     off it (the rail-foot comment above has the long version). */
  [rst-shell-sidebar~="index"] [rst-shell-rail-foot] { margin-block-start: var(--rst-sp-6); }
  /* ...unless it is the profile menu, which goes to the top inline-end
     of the index, beside the heading, because the foot of a long index
     is out of reach and the top is where a phone keeps the person. One
     element moved, not a second copy: the blocks inside it are the
     app's markup, ids and all. It stays last in the reading order,
     after the sections, which are what the index is for. Gated on the
     profile being there with :has(), so a layout from before the menu,
     whose foot is two bare blocks, keeps its foot under the nav. Its
     card drops down from the avatar by the anchored-menu rules as they
     are, ending at the avatar's inline end. */
  [rst-shell-sidebar~="index"] [rst-shell-rail-foot]:has(> [rst-shell-profile]) { align-items: center; block-size: var(--rst-shell-strip); flex-direction: row; inset-block-start: 0; inset-inline-end: var(--rst-sp-4); margin: 0; position: absolute; }
}

/* ── 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) {
  /* The sidebar's card only on a phone: from 800px it is the rail
     foot's drop-up, as wide as the rail where it cannot escape it. */
  [rst-shell-sidebar]:has([rst-shell-up]) [rst-shell-profile] > [rst-dropdown-menu] { box-sizing: border-box; inline-size: min(17rem, calc(100vw - 1.5rem)); max-block-size: calc(100dvh - 5rem); }
  [rst-shell-sidebar~="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-sidebar~="page"] > [rst-shell-bar] > [rst-shell-up] .icon { transform: scaleX(-1); }
  [rst-shell-sidebar~="page"] > [rst-shell-bar] > [rst-shell-up]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-brand],
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [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-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-brand][hidden],
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-title][hidden] { display: none; }
}
/* ── The sidebar on one row ─────────────────────────────────────────
   A sidebar whose root holds [rst-shell-up] is the one-row sidebar.
   Below 800px it draws the console's row (above) without a bar of its
   own to hold it: its <header rst-shell-bar> holds only the up link,
   and the brand (the title on the index) and the rail foot's profile
   menu are placed into the row by layout. The root is a grid of the
   row's three columns over the page; the rail is display: contents, so
   its children are the root's grid items; the bar spans the row as a
   subgrid, so the up link sizes the first column as if it were one of
   them. Nothing is copied: app blocks can carry ids.

   On a content page the nav is hidden and the page is the grid's
   second row; on the index the nav rows are, and the avatar is read
   after them, the one recorded exception to "focus order is visual
   order" (the rail foot is last in the rail, and moving it in the DOM
   would change the desktop's order too). main and the index's nav span
   all three columns, and the sides' max-content minimum would take
   their content's least width too, so a wide table in the page would
   widen the row past the screen: contain: inline-size leaves them no
   width of their own to lend, and they take the row's. The up link,
   the name's face and the hidden-name rule are the console's, above,
   which name the sidebar too.

   A content page's row stays at the top as the back strip did, and
   since a grid item sticks only inside its grid area, each of the
   row's three items spans every row of the grid, starts at the top
   and is sticky there, at the strip's z-index. From 800px the bar is
   hidden and the rail and its drop-up are 1.3's. Every rule names
   [rst-shell-up], so a 1.3 sidebar (back strip, lifted profile) or a
   pre-index one (drawer) matches none of them. */
[rst-shell-sidebar] > [rst-shell-bar]:has(> [rst-shell-up]) { display: none; }
@media (max-width: 799.98px) {
  [rst-shell-sidebar]:has([rst-shell-up]) { column-gap: var(--rst-sp-1); display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); grid-template-rows: var(--rst-shell-strip) auto; }
  [rst-shell-sidebar] > [rst-shell-bar]:has(> [rst-shell-up]) { align-items: center; background: var(--rst-surface); block-size: var(--rst-shell-strip); border-block-end: 1px solid var(--rst-line); box-sizing: border-box; column-gap: var(--rst-sp-1); display: grid; grid-column: 1 / -1; grid-row: 1; grid-template-columns: subgrid; padding-inline: var(--rst-sp-1); }
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] { display: contents; }
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-brand],
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-title] { align-self: center; grid-column: 2; grid-row: 1; }
  [rst-shell-sidebar~="page"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-brand] { display: block; }
  /* The avatar at the inline end, as far in as the up link is. */
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-rail-foot] { align-items: center; align-self: center; block-size: auto; flex-direction: row; grid-column: 3; grid-row: 1; justify-self: end; margin: 0; margin-inline-end: var(--rst-sp-1); position: static; }
  [rst-shell-sidebar]:has([rst-shell-up]) > [rst-shell-main],
  [rst-shell-sidebar~="index"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-nav] { contain: inline-size; grid-column: 1 / -1; grid-row: 2; min-inline-size: 0; }
  /* The index's rows, where 1.3's rail padding and heading gap put
     them. */
  [rst-shell-sidebar~="index"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-nav] { margin: var(--rst-sp-2) var(--rst-sp-4) var(--rst-sp-5); }
  [rst-shell-sidebar~="page"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-nav] { display: none; }
  /* Sticky on a content page, above the sticky form bar (5) and below
     a modal's scrim (10). The name and the avatar sit 6px down the
     strip, centred in it, and stick there. */
  [rst-shell-sidebar~="page"] > [rst-shell-bar]:has(> [rst-shell-up]) { align-self: start; grid-row: 1 / -1; inset-block-start: 0; position: sticky; z-index: 9; }
  [rst-shell-sidebar~="page"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-brand],
  [rst-shell-sidebar~="page"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-rail-foot] { align-self: start; grid-row: 1 / -1; inset-block-start: calc((var(--rst-shell-strip) - 2.75rem) / 2); margin-block-start: calc((var(--rst-shell-strip) - 2.75rem) / 2); position: sticky; z-index: 9; }
  /* Lifted while the card is open, as the console's bar is. */
  [rst-shell-sidebar~="page"]:has([rst-shell-up]) > [rst-shell-rail] > [rst-shell-rail-foot]:has([rst-shell-profile][open]) { z-index: 45; }
}

/* ── 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 (prefers-reduced-motion: reduce) {
  [rst-shell-sidebar~="index"] [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-sidebar] [rst-shell-nav] a { align-items: center; display: flex; }
}
@media (forced-colors: active) {
  [rst-shell-sidebar] [rst-shell-nav] a[aria-current] { background: Highlight; box-shadow: none; color: HighlightText; }
  [rst-shell-sidebar][rst-shell-sidebar~="index"] [rst-shell-nav] > a[aria-current]:hover, [rst-shell-sidebar][rst-shell-sidebar~="index"] [rst-shell-nav] > a[aria-current]:active { background: Highlight; color: HighlightText; }
}
@media print {
  [rst-shell-sidebar] [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-sidebar] [rst-shell-nav] a { align-content: center; box-sizing: border-box; min-block-size: var(--rst-target); }
/* LEGACY: the old drawer's summary. */
[rst-shell-sidebar] > [rst-shell-chrome] > summary { box-sizing: border-box; min-block-size: var(--rst-target); }
/* The index rows are 3rem: the nav-link floor above weighs the same as
   the index's row rule and comes later, so without this it would
   shrink the rows to the floor on exactly the screens the index is
   for. In the index's own query, because above 800px a rail is not an
   index and its rows are the floor's 32px. */
@media (max-width: 799.98px) {
  [rst-shell-sidebar~="index"] [rst-shell-nav] > a { min-block-size: 3rem; }
}

/* 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; }
}
