/*
 * The port's own stylesheet (steepbun/subtito_rb#2225). bin/build-assets copies it as it is, under
 * a hashed name, and every layout (src/web/layout.tsx) links it last, after application.css (which
 * carries Rails' vendored quiet.css). The landing's own styles are src/web/styles/home.css.
 *
 * What belongs here: overrides of the vendored Quiet styles. Those sheets load outside
 * Tailwind 4's cascade layers, so a utility loses to them without `!`, and vendor/rails/ is never
 * edited. Override a vendored rule here, with a selector at least as specific as the one it
 * replaces, and a comment naming the ticket and the rule.
 *
 * What doesn't: new components or layout that Tailwind utilities can express. Write those as
 * utilities in the markup. A url here may name only a font in vendor/rails/app/assets/fonts/, by
 * its bare file name, as the vendored sheets do: the build rewrites it to the font's hashed path.
 */

/*
 * steepbun/subtito_rb#2220: the auth card's brand (renderAuthCard in src/web/auth_card.tsx), the
 * mark stacked above a larger wordmark and both centred over the heading. Overrides quiet.css's
 * `.shell-brand` (an inline row: .5rem gap, .9375rem name) and `.shell-brand img` (1.5rem) for
 * the card only; the top bar's, sidebar's and landing nav's brands keep them. 3rem keeps the
 * 96px favicon sharp on a 2x screen.
 */
.shell-brand.q-auth-brand { flex-direction: column; gap: .625rem; font-size: 1.25rem; line-height: 1.5rem; letter-spacing: -.02em; }
.shell-brand.q-auth-brand img { width: 3rem; height: 3rem; }

/*
 * steepbun/subtito_rb#2455: the sign-in pages in the signed-in pages' card design (renderAuthCard in
 * src/web/auth_card.tsx; docs/design.md, "The sign-in pages"). The page is `.port-cards`, so the
 * grey page and white card come from #2425's block below; the card is a `Card` whose h1 sits inside
 * its edge. These override quiet.css's Quiet auth card: `.q-auth` (a 22rem column on the white
 * panel, padded 1.5rem/3.5rem on top), `.q-auth-head` (the centred brand and heading), `.q-auth-body`
 * (1.75rem under the head) and `.q-auth-notices:has(*)` (1.5rem over the notices).
 *
 * - `.q-auth.port-cards`: the column, 25rem wide, the brand centred over the card.
 * - `.q-auth-card`'s head: the page's h1, larger than a card's title on a page of cards, since here
 *   it is the page's only heading. `.q-auth-body`: the description, notices and form, padded like
 *   the head, with no hairline under the head (Configure's Languages lede has none).
 * - `.q-auth-row`: a row of a card whose body is rows (Lite), split by hairlines as `.port-card`'s
 *   are. `.q-auth-row--foot` holds the "Have an account?" links.
 */
.q-auth.port-cards { max-width: 25rem; padding: 1.25rem 0 1rem; }
.q-auth.port-cards > .q-auth-brand { align-self: center; margin: .5rem 0 .25rem; }
@media (min-width: 768px) { .q-auth.port-cards { padding-top: 3rem; } }
/* The page's own 3rem under the card is halved, so the 2FA prompt with a code's error and the
   passkey fits a 1280×800 window rather than scrolling it by 20px (steepbun/subtito_rb#2504): only the
   gap above the footer shrinks, and the card stays where it was. */
#main-content > .shell-page:has(> .q-auth) { padding-bottom: 1.5rem; }
.q-auth-card > .port-card-head { padding: 1.25rem 1.25rem .75rem; }
.q-auth-card .port-card-title { font-size: 1.25rem; line-height: 1.75rem; letter-spacing: -.02em; }
.q-auth-card > .q-auth-body { margin-top: 0; padding: 0 1.25rem 1.25rem; box-shadow: none; }
.q-auth-card .q-auth-desc { margin-top: -.25rem; margin-bottom: 1.25rem; line-height: 1.25rem; }
.q-auth-card .q-auth-body:not(:has(> :not(.q-auth-desc, .q-auth-notices))) .q-auth-desc { margin-bottom: 0; }
.q-auth-card .q-auth-notices:has(*) { margin-top: 0; margin-bottom: 1.25rem; }
.q-auth-card .q-auth-notices + * { margin-top: 0; }
.q-auth-card > .q-auth-rows { box-shadow: none; }
.q-auth-row { box-shadow: inset 0 1px 0 var(--q-line); }
.q-auth-row:not(.cf-row) { padding: 1rem 1.25rem; }
.q-auth-row.cf-row { padding-inline: 1.25rem; }
.q-auth-row .cf-install { margin-top: 0; }
.q-auth-row--foot .q-auth-foot { margin-top: 0; }
.q-auth-row--foot .q-auth-foot + .q-auth-foot { margin-top: .375rem; }

/*
 * steepbun/subtito_rb#2215: the flash's kinds in their own colours, as Rails' DESIGN.md had them
 * ("Flash messages": a wash and a line in the colour of what it says). Quiet's .ui-notice paints
 * every notice the same card and panel line, with only the icon (and an alert's text) apart.
 * These replace its background and box-shadow per kind, its .ui-notice-icon colour, and, for the
 * alert, .ui-notice--alert's text and .ui-notice--alert .ui-notice-icon. A bare .ui-notice outside
 * the flash keeps Quiet's look; .ui-notice--alert takes the wash wherever it is used.
 *
 * Each wash is mixed opaque over the panel, so test/assets/contrast.test.ts measures text on it at
 * 4.5:1 and the line and icon at 3:1. Yolk is too light for a line on a light panel, so the
 * warning's line and icon darken it towards --q-needs-ink there (--port-needs-line).
 */
:root { --port-needs-line: color-mix(in srgb, var(--q-needs) 55%, var(--q-needs-ink)); }
:root[data-theme="dark"] { --port-needs-line: var(--q-needs); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --port-needs-line: var(--q-needs); } }

.ui-notice:is(.ui-notice--notice, .ui-notice--sticky) {
  background: color-mix(in srgb, var(--q-accent) 8%, var(--q-panel));
  box-shadow: inset 0 0 0 1px var(--q-accent);
}
.ui-notice:is(.ui-notice--notice, .ui-notice--sticky) .ui-notice-icon { color: var(--q-accent); }
/* A sticky notice's link (flashLink, steepbun/subtito_rb#2513), in the notice's own ink. */
.ui-notice-link { font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.ui-notice.ui-notice--info {
  background: color-mix(in srgb, var(--q-ink-2) 8%, var(--q-panel));
  box-shadow: inset 0 0 0 1px var(--q-ink-2);
}
.ui-notice.ui-notice--info .ui-notice-icon { color: var(--q-ink-2); }
.ui-notice.ui-notice--warning {
  background: color-mix(in srgb, var(--q-needs) 12%, var(--q-panel));
  box-shadow: inset 0 0 0 1px var(--port-needs-line);
}
.ui-notice.ui-notice--warning .ui-notice-icon { color: var(--port-needs-line); }
.ui-notice.ui-notice--alert {
  background: color-mix(in srgb, var(--q-failed) 8%, var(--q-panel));
  box-shadow: inset 0 0 0 1px var(--q-failed);
  color: var(--q-failed-text);
}
.ui-notice.ui-notice--alert .ui-notice-icon { color: var(--q-failed); }

/*
 * steepbun/subtito_rb#2463: the site banner and the flash in the card design (docs/design.md, "The
 * banner and the flash"). `SiteBanner` and `PageTop` in src/web/shell/notices.tsx draw them.
 *
 * - `.port-site-banner`: the banner. It is the flash's info notice, `.ui-notice--info` from #2215's
 *   block above, with the same icon, wash, line, radius and type in light and dark (Stephen,
 *   2026-11-12: the banner is not a card). This class only places it; it draws nothing.
 * - `.port-page-top`: the banner and the flash under a page's bar, first in its content column.
 *   Each notice's own `mb-4` gives way to the column's gap, and once the last notice is dismissed
 *   (dismissable_controller.js removes it) the wrapper takes no room. The placements below pad it
 *   where its column has no gap of its own: a `.port-cards` column has one.
 * - Above the page, where a page has no bar (a sign-in card, a system page), the banner keeps a
 *   gap below in place of Rails' `mb-4`; the id outranks quiet.css's
 *   `.shell-page:has(> :is(.lib, …), > turbo-frame > .tp) > :is(p.ui-notice, …)` margin. On a
 *   sign-in page it takes the card's 25rem column (`.q-auth.port-cards`), centred over the brand.
 */
.port-page-top { display: flex; flex-direction: column; gap: .75rem; }
.port-page-top > * { margin: 0; }
.port-page-top:not(:has(.ui-notice)) { display: none; }
:is(.q-account-content, .q-topup-content, .q-legal) > .port-page-top { padding-top: 1.25rem; }
/* Under the page bar, above Watching now (steepbun/subtito_rb#2608), with .lib-now's margins and in
   its centred column. .lib is a block, so the .75rem below collapses into Watching now's 1rem
   above, and without the card it keeps the notice off the filter bar's line. */
.lib > .port-page-top { margin: 1rem var(--lib-x, 1rem) .75rem; }
@media (min-width: 768px) { .lib > .port-page-top { width: calc(min(100% - 2 * var(--lib-x), var(--lib-col))); margin-inline: auto; } }
.tool-page > .port-page-top { flex: none; padding-block: .75rem; }
@media (width < 768px) { .tool-page > .port-page-top { padding-inline: 1rem; } }

#main-content > .shell-page > :is(.port-site-banner, .port-legal-notice) { margin-bottom: 1rem; }
/* The legal-change notice (steepbun/subtito_rb#2604) is the banner's info notice with a Dismiss,
   whose one-button form sits at the right as a sticky notice's button does (.ui-notice-dismiss). */
.port-legal-notice .ui-notice-dismiss { flex: none; }
#main-content > .shell-page:has(> .q-auth) > .port-site-banner { max-width: 25rem; margin: 0 auto; }

/*
 * steepbun/subtito_rb#2216: the retime page's player-time input draws one focus ring, its pill's
 * own (quiet.css's `.retime-pill:focus-within`). quiet.css's `.retime-pill-input { outline: none }`
 * loses to its `body.shell :focus-visible` outline, which sits 2px outside the 1.5rem input and
 * cuts across the 1.875rem pill's rounded edge. Only without forced colours: those drop the pill's
 * box-shadow ring, so the input's outline stays as the one ring there.
 */
@media (forced-colors: none) { body.shell .retime-pill-input:focus-visible { outline: none; } }

/*
 * steepbun/subtito_rb#2200: Top up's selected package card (topupPage in src/web/checkout.tsx)
 * shows as chosen without reading its radio, which now sits in the card's corner so the amount
 * centres on the card. Overrides `.ui-card`'s background and its 1px panel-line box-shadow with an
 * accent wash and a 2px accent ring for the card whose radio is checked. Forced colours drop both,
 * and the browser's own radio (quiet.css's forced-colors `.ui-radio`) still marks the choice there.
 */
.q-topup-package.ui-card:has(input:checked) {
  background-color: color-mix(in srgb, var(--q-accent) 8%, var(--q-card));
  box-shadow: inset 0 0 0 2px var(--q-accent), 0 1px 2px rgb(15 16 18 / .04);
}

/*
 * steepbun/subtito_rb#2202: the choose-a-source picker (Picker and ReplaceSkeleton in
 * src/web/source_page.tsx) told apart at first sight. Quiet lays it flat on the panel ("no
 * surfaces of its own"), so the search, the chosen language, the group heads, the picked file and
 * the two panes all read as white. Each override below names the quiet.css rule it replaces.
 *
 * - The search reads as a field: the control surface with an ink-3 edge (3:1 on the panel),
 *   replacing `.source-search`'s bare row and `.source-search input`'s 2.25rem height, which the
 *   edge would overflow. Its focus is the field's own outline, replacing
 *   `.source-picker-head:has(input:focus-visible)`'s focus underline; an outline stays under
 *   forced colours, where `.source-search input:focus-visible` has none.
 * - The list is the card surface beside the panel's preview, replacing `.source-list`'s
 *   transparent background; the rules between the picker's parts take the control line, a step
 *   up from `--q-line` (`.source-picker-head`, `.source-languages`, `.source-preview-lines-bar`,
 *   `.source-picker-foot`). At 40rem the panes' divider moves from `.source-list`'s right edge to
 *   the preview's left, where the list's sticky heads can't paint over it.
 * - A group head is a sticky header on the list's surface, in 600, replacing
 *   `.source-picker .source-group-head`'s static 500. A file scrolled to keeps clear of it,
 *   replacing `.source-option`'s .5rem scroll margin at the top.
 * - The pressed language takes an accent wash and a 1px accent ring, replacing
 *   `.ui-chip[aria-pressed="true"]`'s neutral wash and control-line ring. Only without forced
 *   colours, so quiet.css's forced-colors Highlight keeps it there.
 * - The picked file keeps Quiet's grey selection (#2245), as every other list does:
 *   `.source-option[aria-selected="true"]`'s `--q-wash-strong`, the wash
 *   `.side-link[aria-current]`, `.picker-line` and `.title-row` pick with. Nothing here
 *   overrides it.
 * - A group's files sit inset under its head (#2245), so on a phone, scrolled to the middle of a
 *   long list, a file reads as its language's by position as well as by the sticky head. The
 *   inset puts a file's edge under the head's text, replacing `.source-group-options`' flush
 *   start; the skeleton's files, which have no options list, take it too.
 */
.source-picker .source-search { height: 2.25rem; padding: 0 .625rem; border: 1px solid var(--q-ink-3); border-radius: .5rem; background: var(--q-control); }
.source-picker .source-search input { height: 2.125rem; }
.source-picker .source-search:has(input:focus-visible) { outline: 2px solid var(--q-focus); outline-offset: -1px; }
.source-picker .source-picker-head,
.source-picker .source-picker-head:has(input:focus-visible),
.source-picker .source-languages { box-shadow: inset 0 -1px 0 var(--q-control-line); }
.source-picker .source-picker-foot,
.source-picker .source-preview-lines-bar { box-shadow: inset 0 1px 0 var(--q-control-line); }
.source-picker .source-list { background: var(--q-card); }
@media (min-width: 40rem) {
  .source-picker .source-list { box-shadow: none; }
  .source-picker .source-preview { box-shadow: inset 1px 0 0 var(--q-control-line); }
}
.source-picker .source-group-head { position: sticky; top: 0; z-index: 1; margin: 0 -.375rem; padding-inline: 1rem; background: var(--q-card); font-weight: 600; }
.source-picker .source-option { scroll-margin-top: 2.5rem; }
@media (forced-colors: none) {
  .source-picker .source-languages .ui-chip[aria-pressed="true"] {
    color: var(--q-accent-text);
    background: color-mix(in srgb, var(--q-accent) 10%, var(--q-panel));
    box-shadow: inset 0 0 0 1px var(--q-accent);
  }
  .source-picker .source-languages .ui-chip[aria-pressed="true"] .ui-chip-count { color: var(--q-accent-text); }
}
.source-picker .source-group-options,
.source-picker .source-group > .source-option { margin-inline-start: .625rem; }

/*
 * steepbun/subtito_rb#2203: which language each file is in. No vendored rule is overridden: this
 * is the port's own part of its markup (src/web/source_page.tsx). .source-tag--lang, the tag a
 * Suggested or Your uploads row names its language by, is quiet.css's .source-tag in ink-2, its
 * code set a little apart.
 */
.source-picker .source-tag--lang { color: var(--q-ink-2); letter-spacing: .02em; }

/*
 * steepbun/subtito_rb#2246: the picker's foot drops its keyboard hints for the languages, and a
 * phone's page bar keeps them in view.
 *
 * - The summary ("→ Spanish", then "From French → Spanish · file") takes the hints' place at the
 *   foot's start, replacing quiet.css's `.source-picker-summary { text-align: right }`, which set
 *   it against the switch beside the hints.
 * - On a phone the bar's line under the tool's name (ToolHead in src/web/tool_page.tsx) is the title
 *   and episode, then the languages. quiet.css's `.tool-head-sub` clips the whole line at its end,
 *   so a long title hid the languages; here the title and episode take the ellipsis and the
 *   languages keep their width. The separator keeps its spaces at the start of its flex item.
 *   Only a line split this way: New translation's bar fills its own line as plain text.
 */
.source-picker .source-picker-summary { text-align: left; }
@media (max-width: 767px) {
  .tool-head .tool-head-sub:has(> .tool-head-sub-lang) { display: flex; }
  .tool-head .tool-head-sub-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .tool-head .tool-head-sub-lang { flex: none; }
  .tool-head .tool-head-sub-sep { white-space: pre; }
}

/*
 * steepbun/subtito_rb#2201: a refused start's notice (RefusalNotice in src/web/source_page.tsx)
 * over the foot's actions, the reason beside its Retry and, where waiting isn't the fix, Top up or
 * the own-key link. The notice is port.css's .ui-notice--warning or --alert; this lays it out, and
 * the actions wrap under the reason when the foot is narrow.
 *
 * On a phone, quiet.css hides the list screen's foot unless a file is being added
 * (`.source-picker:not([data-replacement-screen-value="preview"]) .source-picker-foot:not(:has(...))`),
 * so the notice would wait for a tap. The same selector's weight with the notice in it shows the foot
 * there; quiet.css still hides its actions row, so Start stays on the preview screen.
 */
.source-picker .source-refusal { margin-bottom: .5rem; }
.source-picker .source-refusal .ui-notice { flex-wrap: wrap; align-items: center; column-gap: .625rem; row-gap: .5rem; }
.source-picker .source-refusal .ui-notice-icon { margin-top: 0; }
.source-picker .source-refusal-text { flex: 1 1 14rem; min-width: 0; }
.source-picker .source-refusal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-left: auto; }
@media (max-width: 39.9375rem) {
  .source-picker:not([data-replacement-screen-value="preview"]) .source-picker-foot:has(> .source-refusal:not([hidden])) { display: block; }
}

/*
 * steepbun/subtito_rb#2196: the acting-as banner (src/web/shell/impersonation_banner.tsx), first in
 * body.shell and body.landing-body as Rails renders it. It stays in view while the page scrolls,
 * since once it scrolled away nothing showed the session was acting as someone else: sticky, one
 * row of --port-banner (the email truncates, whole in its title), above Quiet's frame
 * (`body.shell::after`, z-index 30) and the top bar (`.shell-top`, 40). What it would cover moves
 * down by its height: the sticky `.shell-top` (`top: 0`), quiet.css's --q-frame-top, which places
 * the panel's frame and every page bar, filter bar and rail pinned under it, the scroll padding
 * that keeps anchors clear of them, and the landing's `.landing-nav` (`top: 0`). On a phone the
 * banner takes the top safe area, so the top bar gives up its own, and like the top bar it never
 * shrinks in the phone shell's 100dvh column. Beside the sidebar it is a strip
 * over the panel's column, a gutter above the panel, rather than running under the sidebar. On a
 * touch phone the panel scrolls inside the window instead (quiet.css's phone shell), its bars pin
 * to the panel's own top, and the banner and top bar simply sit above it.
 */
:root:has(> body > .impersonation-banner) { --port-banner: 2.5rem; }
body > .impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 41;
  flex: none;
  box-sizing: content-box;
  height: var(--port-banner);
  padding-block: env(safe-area-inset-top, 0px) 0;
}
body.shell:has(> .impersonation-banner) > .shell-top { top: calc(var(--port-banner) + env(safe-area-inset-top, 0px)); padding-top: 0; }
:root:has(> body.shell > .impersonation-banner) {
  --q-frame-top: calc(var(--port-banner) + env(safe-area-inset-top, 0px) + var(--q-top));
  scroll-padding-top: calc(var(--q-frame-top) + .5rem);
}
:root:has(> body.shell > .impersonation-banner):not(:has(> body.shell > .shell-top)) {
  --q-frame-top: calc(var(--port-banner) + env(safe-area-inset-top, 0px) + var(--q-gutter));
}
@media (width >= 768px) {
  :root:has(> body.shell > .impersonation-banner):has(> body.shell > .shell-side) {
    --q-frame-top: calc(var(--q-gutter) + var(--port-banner) + var(--q-gutter));
  }
  body.shell:has(> .shell-side) > .impersonation-banner {
    top: var(--q-gutter);
    margin: var(--q-gutter) calc(var(--q-gutter) + env(safe-area-inset-right, 0px)) 0 calc(var(--q-side) + var(--q-gutter));
    padding-block: 0;
    border-radius: var(--q-radius-panel);
  }
}
@media (width < 768px) and (pointer: coarse) {
  :root:has(> body.shell > .shell-tabs):not(:has(.tool-page)):has(> body.shell > .impersonation-banner) { scroll-padding: 0; }
}
body.landing-body:has(> .impersonation-banner) .landing-nav { top: calc(var(--port-banner) + env(safe-area-inset-top, 0px)); }
/*
 * A phone tool page hides the top bar and pins its own bar, quiet.css's `.tool-head.ui-pagebar`, at
 * `top: 0` under the notch rather than at --q-frame-top. Where the document scrolls (a viewport under
 * 38rem tall) it would stick behind the banner, so it pins under it, and gives the banner the safe area.
 * Quiet's other bars pinned at a fixed top stick inside a scroller the banner is outside of (the
 * phone shell's panel, the source list), or are the wide sidebar, which the banner sits beside.
 */
@media (max-width: 767px) {
  body.shell:has(> .impersonation-banner) .tool-head.ui-pagebar {
    top: calc(var(--port-banner) + env(safe-area-inset-top, 0px));
    height: var(--q-pagebar);
    padding-top: 0;
  }
}

/*
 * steepbun/subtito_rb#2233: on /verify (showPage in src/web/verifications.tsx) a long email's
 * full stop no longer wraps onto a line of its own. quiet.css's
 * `.q-auth-lede strong { display: inline-block; max-width: 100%; }` let a long address fill the
 * line, leaving no room for the "." after it. The email and its "." now share a .q-auth-email span
 * that takes that inline-block, so a short email still moves to the next line whole, and the
 * strong inside it is inline again, so a long one breaks anywhere (the lede's overflow-wrap) and
 * the "." follows its last fragment.
 */
.q-auth-lede .q-auth-email { display: inline-block; max-width: 100%; }
.q-auth-lede .q-auth-email strong { display: inline; }
/* A link on a line of its own under the lede ("Wrong email?") is the foot's size, as "Resend" below
   it, not the lede's (#2504). */
.q-auth-lede .q-auth-aside { font-size: .8125rem; }

/*
 * #2260 (port-native): the upload form's row on a desktop, "[English ▾] → [Spanish]  …  [Add to sources]".
 *
 * - quiet.css stretches the Source language select to 20rem. Here it is as wide as the language it
 *   shows, as quiet.css's .cf-lang-add select is: `field-sizing: content`, between a floor that holds
 *   "Select language" and a ceiling for the longest names. A browser without field-sizing sizes a select
 *   to its longest option, which the ceiling caps.
 * - The target is the select's twin, its height, radius and hairline, with no fill, chevron, pointer
 *   or focus: it reads as the other half of the pair, not as a control. The row aligns items to their
 *   bottom edge, under the label's caption, so the arrow and box sit level with the select.
 * - Add to sources goes to the row's end, under Discard file at the file line's end: the actions take
 *   the right edge, the file and its languages the left.
 * A phone keeps quiet.css's stacked form; its page bar names the target, so the box is hidden there.
 */
.source-upload-target { display: none; }
@media (min-width: 40rem) {
  .source-upload-fields label { flex: none; }
  .source-upload-fields .ui-select { width: auto; }
  .source-upload-fields select { width: auto; field-sizing: content; min-width: 9.5rem; max-width: 16rem; }
  .source-upload-target { display: flex; flex: none; align-items: center; gap: .5rem; height: 2.125rem; font-size: .8125rem; color: var(--q-ink-2); }
  .source-upload-target-box {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 .75rem;
    border-radius: .5rem;
    box-shadow: inset 0 0 0 1px var(--q-control-line);
    color: var(--q-ink);
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
    user-select: none;
  }
  .source-upload-fields > .ui-button { margin-left: auto; }
  /* A long pair at the narrowest widths drops Add to sources to its own line, still at the end. */
  .source-upload-fields { flex-wrap: wrap; }
}
/* A touch tablet gets the desktop row, and quiet.css's taller, larger-type select (pointer: coarse). */
@media (min-width: 40rem) and (pointer: coarse) {
  .source-upload-target { height: 2.5rem; font-size: 1rem; }
}

/*
 * steepbun/subtito_rb#2278: the 6-digit code entry (CodeField, src/web/code_field.tsx) as six digit
 * slots, on /verify and the account page's pending email change. It replaces Rails' one centred
 * .ui-field input with a "------" placeholder (quiet.css's `.q-auth-code input` and
 * `.q-account-code`); the markup no longer carries those classes.
 *
 * One real input sits over six empty boxes. It is set in DM Mono, whose digits are all 1ch wide, and
 * its letter-spacing makes each digit's advance one box plus one gap, so the nth digit lands centred
 * in the nth box. The field fills the card or dialog it sits in, and the boxes share its width
 * (container units over .port-code; a browser without them gets fixed 2.75rem boxes). It had a
 * 22rem cap, which left the boxes short of the card's width on a desktop (steepbun/subtito_rb#2496).
 * The input runs one box past the sixth, so the caret after the sixth digit never scrolls the text
 * out of line; the field clips it, keeping a 4px margin for the active box's focus wash.
 *
 * Without JavaScript every box takes the focus line while the field has focus, and the browser's
 * caret shows. code_slots_controller.js sets data-ready on the field, data-active on the box the
 * caret is in and data-filled on each box holding a digit: the active box takes Quiet's field focus
 * ring (.ui-field:focus-within) and, while empty, a drawn caret in place of the browser's.
 */
.port-code {
  --port-code-gap: .5rem;
  --port-code-slot: 2.75rem;
  --port-code-height: 3rem;
  position: relative;
  container-type: inline-size;
  box-sizing: content-box;
  /* Six fixed boxes and five gaps; with container units, the field's width (below). */
  width: calc(6 * var(--port-code-slot) + 5 * var(--port-code-gap));
  height: var(--port-code-height);
  margin: -4px;
  padding: 4px;
  /* clip, not hidden: a hidden box scrolls, and focusing the wider input would scroll the boxes. */
  overflow: hidden;
  overflow: clip;
}
/*
 * The empty boxes' ring. In dark, Quiet's control line (white at 9%) is the same ring the other
 * fields have, but on six small boxes it reads as faint, nearly the card's own colour
 * (steepbun/subtito_rb#2492), so in dark they take a stronger one.
 */
.port-code { --port-code-line: var(--q-control-line); }
:root[data-theme="dark"] .port-code { --port-code-line: rgb(255 255 255 / .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .port-code { --port-code-line: rgb(255 255 255 / .18); } }
@supports (width: 1cqw) {
  .port-code { --port-code-slot: calc((100cqw - 5 * var(--port-code-gap)) / 6); width: 100%; }
}
/* The account page's pending email change: its code field, its error and Verify are one column the
   width the dialogs' code fields have (a 26rem dialog's 24rem of body), not the row's whole width
   (steepbun/subtito_rb#2498). Verify sits under the boxes at the column's right end, as a code
   dialog's submit does, rather than a 34px button beside 48px boxes, and the error is as wide as
   the field it belongs to (steepbun/subtito_rb#2499). */
.q-account-verify { display: grid; gap: .75rem; max-width: 24rem; }
.q-account-verify > .ui-button { justify-self: end; }
.q-account-pending .q-account-errors { max-width: 24rem; margin-bottom: 0; }
/* A sign-in card's refused code, first in its fields (CodeError, #2499): the fields' own 1rem
   spacing sets it off from the label under it. */
.q-auth-fields > .q-account-errors { margin-bottom: 0; }
.port-code-slots {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  grid-template-columns: repeat(6, var(--port-code-slot));
  gap: var(--port-code-gap);
  height: var(--port-code-height);
  pointer-events: none;
}
.port-code-slot {
  position: relative;
  border-radius: .5rem;
  background: var(--q-control);
  box-shadow: inset 0 0 0 1px var(--port-code-line), var(--q-control-shadow);
  transition: box-shadow .15s ease, background-color .15s ease;
}
.port-code input {
  position: relative;
  display: block;
  width: calc(100% + var(--port-code-slot));
  height: 100%;
  padding: 0 0 0 calc((var(--port-code-slot) - 1ch) / 2);
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--q-ink);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: calc(var(--port-code-slot) + var(--port-code-gap) - 1ch);
}
.port-code input:-webkit-autofill { -webkit-text-fill-color: var(--q-ink); transition: background-color 9999s; }
.port-code:focus-within .port-code-slot { background: var(--q-panel); }
/* The boxes show the focus, as Quiet's .ui-field does for its input (`body.shell .ui-field :focus-visible`). */
body.shell .port-code :focus-visible { outline: none; }
.port-code:not([data-ready]):focus-within .port-code-slot { box-shadow: inset 0 0 0 2px var(--q-focus), var(--q-control-shadow); }
.port-code[data-ready] input { caret-color: transparent; }
.port-code-slot[data-active] { box-shadow: inset 0 0 0 2px var(--q-focus), 0 0 0 3px var(--q-accent-wash); }
.port-code-slot[data-active]:not([data-filled])::after {
  content: '';
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: calc(50% - 1px);
  width: 2px;
  border-radius: 1px;
  background: var(--q-ink);
}
@media (prefers-reduced-motion: no-preference) {
  .port-code-slot[data-active]:not([data-filled])::after { animation: port-code-caret 1.1s step-end infinite; }
}
@keyframes port-code-caret { 50% { opacity: 0; } }
/*
 * Forced colours drop box-shadows, so the boxes and the focus ring above vanish there: the boxes
 * take a border, the focused field's boxes (or, with the controller, the active one) a Highlight
 * outline, and the drawn caret is CanvasText.
 */
@media (forced-colors: active) {
  .port-code-slot { border: 1px solid CanvasText; }
  .port-code:not([data-ready]):focus-within .port-code-slot, .port-code-slot[data-active] { outline: 2px solid Highlight; outline-offset: -2px; }
  .port-code-slot[data-active]:not([data-filled])::after { background: CanvasText; }
}
/*
 * A modal dialog's backdrop (Quiet's `dialog.ui-dialog::backdrop`) covers the viewport but not the
 * scrollbar gutter, which the desktop shell keeps (`scrollbar-gutter: stable`), so a strip at the
 * right edge stayed undimmed beside every dialog (steepbun/subtito_rb#2492). The gutter is painted
 * in the root's background colour (not its image), so while a dialog is open the root takes the
 * colour the backdrop makes of the base: Quiet's --q-scrim, solid, at its alpha (rgb(15 16 18 / .32)
 * light, rgb(0 0 0 / .55) dark). The body takes the base, so the page under the backdrop is dimmed once.
 */
:root { --port-scrim-on-base: color-mix(in srgb, var(--q-base), rgb(15 16 18) 32%); }
:root[data-theme="dark"] { --port-scrim-on-base: color-mix(in srgb, var(--q-base), rgb(0 0 0) 55%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --port-scrim-on-base: color-mix(in srgb, var(--q-base), rgb(0 0 0) 55%); } }
@media (width >= 768px) {
  :root:has(> body.shell > .shell-side):has(dialog.ui-dialog:modal) { background: var(--port-scrim-on-base); }
  :root:has(dialog.ui-dialog:modal) > body.shell:has(> .shell-side) { background: var(--q-base); }
}

/*
 * steepbun/subtito_rb#2263: a model's mark is its emoji (modelMark in src/web/helpers/models.tsx),
 * the character Stremio's subtitle menu shows, in place of quiet.css's coloured `.ui-model-dot`
 * (which nothing renders now). The emoji fonts come first so a character with no variation selector
 * (⚪) still draws in colour, as in Stremio's menu. Each rule below takes the place of the dot's
 * own in quiet.css: the Configure row's centred column and its disabled fade. The new translation
 * select has no mark: each option's text starts with its emoji (modelOptionLabel), so the select
 * takes back the left padding quiet.css's
 * `.new-translation-model select` kept for the dot, as `.ui-select select` has it.
 */
.ui-model-mark { flex: none; display: inline-block; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: .875rem; font-weight: 400; line-height: 1; }
.ui-prop > .ui-model-mark { font-size: .75rem; }
.cf-model .ui-model-mark { justify-self: center; }
.cf-model:has(.ui-check:disabled:not(:checked)) .ui-model-mark { opacity: .5; }
.new-translation-model select { padding-left: .625rem; }

/*
 * steepbun/subtito_rb#2425: the signed-in pages' one card (Card in src/web/card.tsx), whose title
 * sits inside its edge (docs/design.md, "Every section is a card"). A named component rather than
 * utilities, because Account, Configure (#2392), a translation's page (#2393), the Translations
 * list (#2394) and Top up (#2315) all build on it and must not drift apart. It overrides no
 * vendored rule: the surface, edge and hairlines are quiet.css's `.cf-card`, and the title is
 * `.cf-sec-h h2`'s, moved inside.
 *
 * - `.port-cards`: a page's column of cards, 1rem apart.
 * - `.port-card`: the card. Its children after the head are its rows, each with a hairline over it.
 * - `.port-card-head`: the title row: `.port-card-title` (an h2) and, at its right end,
 *   `.port-card-meta`, quiet text such as a count.
 * - `.port-card-row`: a plain row of the card (an avatar or mark, text, controls); `.cf-row`
 *   works as a row too.
 */
.port-cards { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.25rem; }
.port-card { overflow: hidden; border-radius: .75rem; background: var(--q-card); box-shadow: inset 0 0 0 1px var(--q-panel-line), 0 1px 2px rgb(15 16 18 / .04); }
.port-card > * + * { box-shadow: inset 0 1px 0 var(--q-line); }
.port-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .875rem 1rem .625rem; }
.port-card-title { min-width: 0; font-size: .9375rem; font-weight: 600; line-height: 1.375rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.port-card-meta { flex: none; font-size: .8125rem; color: var(--q-ink-2); font-variant-numeric: tabular-nums; }
.port-card-row { display: flex; align-items: center; gap: .75rem; min-height: 3.5rem; padding: .625rem .75rem .625rem 1rem; }

/*
 * steepbun/subtito_rb#2425: Account's Profiles card (ProfilesCard in src/web/account_profiles.tsx).
 * A rename turns the row into its name field with Save and Cancel, as `.cf-rename` does Configure's
 * head: the row's name, summary and buttons give way while the form shows. `.q-account-rename`
 * restates `.hidden`, which a utility can't win against an unlayered rule. New profile is the whole
 * row, a button whose focus ring sits inside the card's clipped edge; at the limit it is text.
 */
.q-account-profile-text { flex: 1 1 auto; min-width: 0; }
.q-account-profile-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.q-account-profile-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.q-account-profile-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-account-profile-actions { display: flex; flex: none; gap: .125rem; }
.q-account-rename { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.q-account-rename.hidden { display: none; }
.q-account-rename .ui-field { flex: 1 1 8rem; min-width: 0; }
.q-account-rename .ui-field input { width: 100%; }
.q-account-profile:has(> .q-account-rename:not(.hidden)) > :is(.q-account-profile-text, .q-account-profile-actions) { display: none; }
.q-account-rename-status:empty { display: none; }
.q-account-rename-status { flex-basis: 100%; font-size: .8125rem; color: var(--q-failed-text); }
/* Account's passkeys (steepbun/subtito_rb#2481): each line sits under the Passkeys row's label, its
   text where the label's is (the row's padding, its icon and its gap), as the mockups group them. */
.q-account-passkey-list { margin: -.5rem 0 0; padding: 0 0 .25rem; list-style: none; }
.q-account-passkey { min-height: 3rem; padding-left: 2.75rem; }
/* A passkey's line ("Added Nov 12 · Last used today") wraps on a phone rather than losing its end. */
.q-account-passkey .q-account-profile-sub { white-space: normal; }
/* Past the first few passkeys, "Show all N passkeys" under the list, in the passkeys' column; its
   chevron turns up while the rest show (steepbun/subtito_rb#2607). */
/* `.port-card-row { display: flex }` outranks the browser's own [hidden] rule, as quiet.css's
   `.cf-note` did (#2462), so a folded passkey says so itself. */
.q-account-passkey[hidden] { display: none; }
.q-account-passkey-more { padding: 0 1rem .75rem 2.75rem; }
.q-account-passkey-toggle { display: inline-flex; align-items: center; gap: .25rem; min-height: 2rem; font-size: .875rem; }
.q-account-passkey-chevron { width: 1rem; height: 1rem; }
.q-account-passkey-toggle[aria-expanded="true"] .q-account-passkey-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) { .q-account-passkey-chevron { transition: transform .15s; } }
/* A failed Add's message goes under the Passkeys row (steepbun/subtito_rb#2518). The ceremony's box
   was the row's third column, so a sentence there widened it and squeezed the label to a letter a
   line on a phone. Shown, the box lays out nothing itself: Add stays the third column, and the
   status takes a line of its own under the label, in its column. Hidden, it stays hidden. */
.q-account-passkey-add:not([hidden]) { display: contents; }
.q-account-passkey-add > .q-auth-passkey-status { grid-column: 2 / -1; text-align: left; }
/* The sign-in page's passkey button: the mockups' half-rem above GitHub's. Its status line shows
   only when the controller has something to say. */
.q-auth-passkey { margin-bottom: .5rem; }
.q-auth-passkey-status { margin-top: .5rem; font-size: .8125rem; color: var(--q-ink-2); text-align: center; }
.q-auth-passkey-status:empty { display: none; }
/* The 2FA prompt's "Use a passkey" (steepbun/subtito_rb#2510): under the code form, after "or", a
   full-width outlined button, the accent's border and text and its key icon on the card's own
   background, so it is seen without being a second primary beside Continue. --q-accent-text on
   the card: 5.9:1 in light, 9:1 in dark. */
.q-auth-passkey-prompt { margin-top: .25rem; }
.ui-button.q-auth-passkey-outline { background: transparent; color: var(--q-accent-text); box-shadow: inset 0 0 0 1px var(--q-accent-text); font-weight: 600; }
.ui-button.q-auth-passkey-outline svg { color: currentColor; }
.ui-button.q-auth-passkey-outline:hover { background: var(--q-accent-wash); }
.q-account-profile-errors { margin: .75rem 1rem; }
.q-account-new-form { display: block; }
/* Naming a new profile in the row (steepbun/subtito_rb#2513): New profile gives way to its name
   field, laid out as a rename's, the dashed mark staying where it was. */
.q-account-add:has(> .q-account-create:not([hidden])) > .q-account-new-form { display: none; }
.q-account-create[hidden] { display: none; }
.q-account-create { flex-wrap: wrap; gap: .5rem .75rem; }
.q-account-create .ui-field { flex: 1 1 5rem; min-width: 0; }
/* On a phone the dashed mark gives its width to the field, so Create and Cancel stay on its line. */
@media (max-width: 479px) { .q-account-create > .q-account-new-mark { display: none; } }
.q-account-create .ui-field input { width: 100%; }
.q-account-new { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; }
button.q-account-new { cursor: pointer; }
button.q-account-new:focus-visible { outline-offset: -3px; }
@media (hover: hover) { button.q-account-new:hover { background: var(--q-wash); } }
.q-account-new-mark { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border: 1.5px dashed var(--q-ink-3); border-radius: 9999px; color: var(--q-ink-2); }
.q-account-new-mark svg { width: 1rem; height: 1rem; }
.q-account-new--full .q-account-new-mark { opacity: .5; }

/*
 * steepbun/subtito_rb#2392: Configure as one column of cards ("Configure D", docs/design.md), each a
 * `Card` (#2425's block above, untouched): Languages, Models, More settings (folded) and Install in
 * Stremio last, its buttons beside the dark Stremio menu. These rules take back quiet.css's
 * Configure grid (`.cf`'s head and rail areas, which the page no longer has) and restyle what moved
 * into a card; quiet.css's `.cf-*` row, chip, model and dual rules still draw the rows.
 *
 * - `.cf-form` generates no box, so the form's cards are the column's own, 1rem apart.
 * - `.cf-block`: a card's controller wrapper (language-picker, selection-limit, fold).
 * - `.cf-card-body` / `.cf-card-foot`: a card's padded text under its head or its rows.
 * - `.cf-fold`: More settings. Its title is the toggle, whose hit area covers the closed card or the
 *   open card's head; `.cf-pills` say what is set while it is closed. The two `.cf-fold-group`s
 *   are split by a rule. Dual subtitles' On top and In italics sit side by side in a tinted box.
 * - `.cf-install-card`: the actions and the menu side by side from 768px, stacked on a phone.
 */
.cf { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "bar" "main" "install"; }
.cf-main.port-cards { padding-bottom: 2rem; }
.cf-form { display: contents; }
.cf-main #configure_errors:empty { display: none; }
.cf-main #configure_errors:has(> *) { padding-top: 0; }
.cf-main #configure_errors > .flash { margin: 0; }
@media (min-width: 768px) {
  .cf { grid-template-columns: minmax(1.5rem, 1fr) minmax(0, 42rem) minmax(1.5rem, 1fr); grid-template-areas: "bar bar bar" ". main ."; }
  .cf-main.port-cards { padding-top: 2rem; padding-bottom: 3rem; }
}

.cf-card-body { padding: 0 1rem 1rem; }
.port-card > .cf-card-body { box-shadow: none; }
.cf-card-lede { margin-top: -.25rem; font-size: .8125rem; line-height: 1.125rem; color: var(--q-ink-2); }
.cf-card-foot { padding: .125rem 1rem 1rem; }
.cf-block:has(#language-picker-select:disabled) .cf-note--limit,
.cf-block:has(.cf-model .ui-check:not(:checked):disabled) .cf-note--limit { display: flex; }
/* quiet.css's `.cf-note { display: flex }` outranks the browser's own [hidden] rule, so New
   translation's free-runs note stayed on show with another model chosen (steepbun/subtito_rb#2462). */
.cf-note[hidden] { display: none; }
/* The same for quiet.css's `.q-account-actions { display: flex }`: the OpenRouter key card hides
   its Save row until a field changes (steepbun/subtito_rb#2600). */
.q-account-actions[hidden] { display: none; }
/* The OpenRouter key card with a key saved shows it read-only, the masked key and the model as
   text, with Edit and Remove beside them, as a profile row has Rename and Delete; the fields open
   on Edit (steepbun/subtito_rb#2616). On a phone the buttons go under the values, right-aligned
   like Save and Cancel; beside them on a wider screen, their bottom edge sits on the Model row's
   (Stephen, 2026-11-16). Edit, Save and the
   saved view hide with the hidden attribute, which `.ui-button`'s and these rules' display outrank. */
.q-account-byok-saved { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; }
.q-account-byok-saved[hidden], .q-account-byok-saved .ui-button[hidden], .q-account-save[hidden] { display: none; }
/* First setup's actions row holds only Save, so while Save hides the row takes no room either. */
.q-account-actions:not(:has(> :not([hidden]))) { display: none; }
.q-account-byok-values { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .375rem 1rem; align-items: baseline; flex: 1 1 14rem; min-width: 0; margin: 0; }
.q-account-byok-values > div { display: contents; }
.q-account-byok-values .q-account-label { margin: 0; color: var(--q-ink-2); }
.q-account-byok-values dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .875rem; }
.q-account-byok-status { order: 3; flex: 1 0 100%; margin: 0; }
.q-account-byok-saved-actions { display: flex; flex: none; gap: .5rem; margin-left: auto; }
.q-account-byok-saved-actions form { display: contents; }
.q-account-byok-saved .ui-button svg { width: 1rem; height: 1rem; }

/*
 * steepbun/subtito_rb#2456: New translation (renderNew in src/web/new_translation.tsx) as the grey
 * page with two cards under the tool bar: Find a title (the type switch at its head's right end,
 * the search field, then the results or the hint, a picked show's season and episode inside its
 * row) and Translation (the pick, with a show's season and episode as one line, Translate into,
 * Model and its notes, and Choose source, the page's one teal button, at its foot). Side by side
 * where the page is wide enough, Find a title wide and Translation narrow and sticky; stacked under
 * that, in the same order, and on a phone Translation is sticky at the screen's foot while the
 * results run past it, as the old pinned foot was, so Choose source stays in reach. The replace
 * question is one card. quiet.css's `.new-translation-*` rules still draw the hint, the result
 * rows, the pick and the selects; these take back its palette (a fixed-height panel whose results
 * scrolled inside it) so the page scrolls as the other card pages do.
 */
.new-translation-layout { flex: none; gap: 0; container: nt / inline-size; }
body.shell:has(.nt-cards) .shell-page { max-width: none; }
/* The page scrolls, not a panel inside it, so the tool frame's one-screen body grows with it. */
@media (min-height: 38rem) { body.shell:has(.nt-cards) { height: auto; min-height: 100dvh; } }
.nt-cards { padding: 1rem 1rem 2rem; }
.q-tool > .nt-cards--confirm { max-width: 34rem; }
.new-translation-error { margin: 1rem 1rem 0; }
@media (min-width: 768px) {
  .nt-cards { padding: 0 0 2rem; }
  .new-translation-error { margin: 0 0 1rem; }
}
@media (max-width: 767px) {
  body.shell:has(.nt-cards) { background: var(--port-page); }
  .q-tool > .nt-cards--confirm { margin: 0; }
}

/* Find a title: its title, then the switch at the head's right end, wrapping under it when narrow. */
.nt-find > .port-card-head { flex-wrap: wrap; align-items: center; row-gap: .5rem; padding-block: .625rem; }
.nt-find > .port-card-head > .port-card-meta { font-size: inherit; color: inherit; }
.nt-search { padding: .75rem 1rem; }
.port-card > .nt-search { box-shadow: none; padding-top: 0; }
.nt-field { height: 2.5rem; }
.nt-field input { font-size: .9375rem; }
.nt-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.nt-field input::placeholder { color: var(--q-ink-2); }
/* iPhone Safari zooms the page into a field whose type is under 16px when it takes focus (#2644). Quiet gives
   .ui-field and .ui-select fields 16px on a touch screen; these page rules are more specific than that and win,
   so on a touch screen they take 16px too: Find a title, the new translation's settings, and the language
   pickers in .cf-pick (a profile's source languages and dual-subtitle settings, and Lite's language). The admin's
   monospace textareas keep their 13px (docs/design.md, "On a phone"). */
@media (pointer: coarse) {
  .nt-field input, .new-translation-setting .ui-select select, .cf-pick .ui-select select { font-size: 1rem; }
}
.nt-results { min-width: 0; }
.nt-results .new-translation-list { padding: .25rem .5rem .5rem; }
.new-translation .nt-results .source-group-head { position: static; background: none; }
/* A picked show's season and episode open inside its row at every width (Stephen, 2026-11-12):
   quiet.css draws this under 768px only. Wide, the pair keeps a select's width, not the row's. */
.nt-results .title-row:has(+ .new-translation-episode.is-in-row) { border-radius: .4375rem .4375rem 0 0; }
.nt-results .new-translation-episode.is-in-row { padding: 0 .625rem .75rem 2.375rem; border-radius: 0 0 .4375rem .4375rem; background: var(--q-wash-strong); }
.nt-results .new-translation-episode.is-in-row > .new-translation-pair { max-width: 28rem; }
/* Under a mouse the picked row keeps the picker's wash, where quiet.css's hover would lighten it. */
@media (hover: hover) { .nt-results .title-row:has(+ .new-translation-episode.is-in-row):hover { background: var(--q-wash-strong); } }

/* Translation: the pick, the season and episode, the settings and the notes, then Choose source. */
.nt-settings-body { display: grid; gap: 1rem; padding: .25rem 1rem 1rem; }
.port-card > .nt-settings-body { box-shadow: none; }
.nt-settings .new-translation-pick .ui-poster { width: 3.5rem; }
.nt-settings:not(:has(#new-translation-llm option[data-paid]:checked)) .new-translation-pay-note { display: none; }
.nt-foot .new-translation-submit { width: 100%; }

@container nt (min-width: 42rem) {
  .nt-cards:not(.nt-cards--confirm) { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .nt-settings { position: sticky; top: 1rem; }
}
/* Stacked, the switch takes the head's full width under the title. */
@container nt (max-width: calc(42rem - 1px)) {
  .nt-find > .port-card-head > .port-card-meta { flex-basis: 100%; }
  .nt-find .new-translation-type { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
}
/* A phone: Translation is sticky at the foot of the screen while the results run under it, so
   Choose source stays in reach, and the page keeps room under a focused row to scroll it clear of
   the card. The pick shows in the page bar and its row here (quiet.css shows the bar's line under
   768px only), so the card holds the language and model side by side, their notes and the button. */
@media (max-width: 767px) {
  :root:has(.nt-settings) { scroll-padding-bottom: 18rem; }
  .nt-settings { position: sticky; bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); box-shadow: inset 0 0 0 1px var(--q-panel-line), 0 4px 16px rgb(15 16 18 / .12); }
  .nt-settings > .nt-settings-body { gap: .625rem; }
  .nt-settings .new-translation-pick { display: none; }
  .nt-settings .new-translation-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3125rem .5rem; }
  .nt-settings .new-translation-settings > .new-translation-setting { display: contents; }
  .nt-settings .new-translation-settings > .new-translation-setting:first-child > label { grid-area: 1 / 1; }
  .nt-settings .new-translation-settings > .new-translation-setting:first-child > .ui-select { grid-area: 2 / 1; }
  .nt-settings .new-translation-settings > .new-translation-setting:last-child > label { grid-area: 1 / 2; }
  .nt-settings .new-translation-settings > .new-translation-setting:last-child > .ui-select { grid-area: 2 / 2; }
  .nt-settings .new-translation-model-line { grid-area: 3 / 1 / 4 / -1; }
  .nt-settings .new-translation-free-note { grid-area: 4 / 1 / 5 / -1; }
  .nt-settings .new-translation-settings .ui-select-lead { display: none; }
  .nt-settings .new-translation-settings .ui-select:has(> .ui-select-lead) select { padding-left: .625rem; }
}

/* The replace question: the pick and the warning, then Cancel and Retranslate at the card's foot. */
.nt-confirm > .new-translation-confirm-body { padding: .25rem 1rem 1rem; box-shadow: none; }
.nt-confirm > .new-translation-confirm-actions { padding: .75rem 1rem; }

/* Languages: quiet.css's chips, in the card's body rather than a card of their own. */
.cf-langs { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .75rem; }
.cf-langs > .cf-lang-add {
  position: relative; display: inline-flex; align-items: center; height: 1.875rem; border-radius: .5rem;
  outline: 1px dashed color-mix(in oklab, var(--q-ink-3) 70%, transparent); outline-offset: -1px; color: var(--q-ink-2);
  transition: background-color .12s ease, color .12s ease;
}
@media (pointer: coarse) { .cf-langs > .cf-lang-add { height: 2.25rem; } }

/* Models: a hairline between rows, as `.cf-card`'s rows have. */
.cf-models > * + * { box-shadow: inset 0 1px 0 var(--q-line); }
/*
 * steepbun/subtito_rb#2521: a model's input / output prices at its row's right end, in place of
 * quiet.css's `.cf-price` tier, with the free model's free runs a week under them, so the row
 * keeps its width on a phone. Faded with the row's text when its box is disabled.
 */
.cf-cost { display: grid; justify-items: end; text-align: right; white-space: nowrap; }
.cf-cost-prices { font-size: .8125rem; font-weight: 500; line-height: 1.125rem; color: var(--q-ink-2); font-variant-numeric: tabular-nums; }
.cf-cost-sep { color: var(--q-ink-3); }
.cf-free-runs { font-size: .75rem; line-height: 1rem; color: var(--q-ink-2); }
.cf-model:has(.ui-check:disabled:not(:checked)) .cf-cost { opacity: .5; }

/* More settings. */
.cf-fold { position: relative; }
.cf-fold .port-card-head { align-items: center; }
.cf-fold-toggle { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cf-fold-toggle::after { content: ""; position: absolute; inset: 0; }
.cf-fold-toggle:focus-visible { outline: none; }
.cf-fold-toggle:focus-visible::after { border-radius: inherit; outline: 2px solid var(--q-focus); outline-offset: -2px; }
.cf-fold:has(.cf-fold-toggle[aria-expanded="true"]) > .port-card-head { position: relative; }
@media (hover: hover) { .cf-fold-toggle:hover::after { background: var(--q-wash); } }
.cf-fold .port-card-meta { display: flex; }
.cf-fold-chevron { width: 1rem; height: 1rem; color: var(--q-ink-3); transition: transform .15s ease; }
.cf-fold:has(.cf-fold-toggle[aria-expanded="true"]) .cf-fold-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .cf-fold-chevron { transition: none; } }
.cf-fold-summary { padding: 0 1rem .875rem; }
.port-card > .cf-fold-summary { box-shadow: none; }
:is(.cf-fold-summary, .cf-fold-panel)[hidden] { display: none; }
.cf-pills { display: flex; flex-wrap: wrap; gap: .375rem; }
.cf-pill { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .125rem .625rem; border-radius: 999px; background: var(--q-wash-strong); font-size: .75rem; font-weight: 500; line-height: 1rem; color: var(--q-ink-2); }
.cf-fold-group { padding: .25rem 0; }
.cf-fold-group + .cf-fold-group { box-shadow: inset 0 1px 0 var(--q-line); }
.cf-fold .cf-dual { grid-template-columns: minmax(0, 1fr); gap: .75rem; margin: 0 1rem 1rem 2.75rem; padding: .75rem; border-radius: .625rem; background: var(--q-wash); }
.cf-fold .cf-dual-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (width < 768px) { .cf-fold .cf-dual { margin-left: 1rem; } }

/* Install in Stremio: the actions, then the dark menu Stremio shows. */
.cf-install-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem; }
.cf-install-body .cf-install { margin-top: 0; }
.cf-install-side .cf-rail-note { margin-top: .75rem; }
@media (min-width: 768px) { .cf-install-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 1.25rem; } }
.cf-stremio[data-theme="dark"] {
  --cf-menu-ink: rgb(255 255 255 / .92); --cf-menu-muted: rgb(255 255 255 / .55); --cf-menu-line: rgb(255 255 255 / .1);
  background: #191a1e; color: var(--cf-menu-ink); box-shadow: 0 0 0 1px rgb(0 0 0 / .2), 0 1px 2px rgb(15 16 18 / .08);
}
.cf-stremio[data-theme="dark"] .cf-stremio-head { box-shadow: inset 0 -1px 0 var(--cf-menu-line); }
.cf-stremio-head h3 { margin-right: auto; font-size: .875rem; font-weight: 600; }
.cf-stremio[data-theme="dark"] :is(.cf-stremio-head svg, .cf-menu li small, .cf-stremio-foot) { color: var(--cf-menu-muted); }
.cf-stremio[data-theme="dark"] :is(.cf-stremio-empty, .cf-menu li.is-regular > span) { color: var(--cf-menu-muted); }
.cf-stremio[data-theme="dark"] .cf-count { background: rgb(255 255 255 / .1); color: var(--cf-menu-ink); }
.cf-stremio[data-theme="dark"] .cf-stremio-foot { box-shadow: inset 0 1px 0 var(--cf-menu-line); }
.cf-stremio[data-theme="dark"] .cf-stremio-warn { color: var(--cf-menu-ink); }
.cf .cf-menu { max-height: 20rem; overflow-y: auto; overscroll-behavior: contain; }
/* A text code's language (#2517): the part of the code that is the language is tinted, and the key
   under the list, which Stremio's own menu does not have, names it once. The tint is quiet.css's
   dark accent, since this card is dark in either theme. */
.cf-stremio[data-theme="dark"] { --cf-menu-code: #5ec0c9; }
.cf-menu-key { display: flex; flex-wrap: wrap; gap: .125rem 1rem; margin: 0; padding: .5rem 1rem; list-style: none; box-shadow: inset 0 1px 0 var(--cf-menu-line); font-size: .75rem; line-height: 1.125rem; color: var(--cf-menu-muted); }
:is(.cf-menu li > span, .cf-menu-key) b { font-weight: 600; color: var(--cf-menu-code); }
/* Auto's two menus (#653): both at once, each under the clients it is for. */
.cf-menu-view + .cf-menu-view { box-shadow: inset 0 1px 0 var(--cf-menu-line); }
.cf-menu-for { margin: 0; padding: .625rem 1rem 0; font-size: .75rem; font-weight: 600; color: var(--cf-menu-muted); }
/* Reset link is the install body's last item (#653, Stephen's option D). On a phone, and beside a
   menu card no taller than the buttons, it runs the card's whole width under a rule, and the menu
   card stretches to the buttons' height with its foot at the bottom. Beside a tall card (.cf-stremio.is-tall,
   menuTall in src/web/configure/install.tsx) it sits under the buttons and the card spans both rows. */
.cf-install-body > .cf-reset { margin: 0 -1rem -1rem; padding: 1rem; }
@media (min-width: 768px) {
  .cf-install-body { align-items: stretch; }
  .cf-install-body > .cf-reset { grid-column: 1 / -1; margin-top: -.25rem; }
  .cf-install-body > .cf-stremio { display: flex; flex-direction: column; }
  .cf-install-body .cf-stremio-foot { margin-top: auto; }
  .cf-install-body:has(> .cf-stremio.is-tall) { grid-template-rows: auto 1fr; align-items: start; }
  .cf-install-body > .cf-stremio.is-tall { grid-column: 2; grid-row: 1 / span 2; }
  .cf-install-body:has(> .cf-stremio.is-tall) > .cf-reset { grid-column: 1; grid-row: 2; margin: 0; padding: 1rem 0 0; }
}
/* Label style (#2631, Stephen's option A): the Automatic label style switch as the other switch
   rows; off, the three styles open under it with the chosen style's line. */
.cf-label-style:has(#settings-label-style-auto:checked) .cf-label-style-manual { display: none; }
.cf-label-style-manual .ui-seg { display: flex; }
.cf-label-style-manual .ui-seg label { flex: 1 1 auto; min-width: 0; padding: 0 .5rem; }
.cf-label-style-manual .ui-seg label span { overflow: hidden; text-overflow: ellipsis; }
.cf-label-style-desc { margin-top: .5rem; }

/*
 * steepbun/subtito_rb#2393: a translation's page, "Translation A2" (DetailFrame in
 * src/web/translation_page.tsx, the Lines card in src/web/reader.tsx). The page bar holds the
 * breadcrumb; under it a column of cards: the poster-coloured hero (`.tp-hero`, the one card that
 * isn't plain: `.port-card` with the poster blurred behind it), then Lines (wide) and Activity
 * (narrow) side by side, stacked on a phone with Activity first, each folding under a caret. The page's root keeps quiet.css's
 * `.tp`, which the shell's page reads to drop its padding (`.shell-page:has(> turbo-frame > .tp)`),
 * but `.tp.tp-page` replaces its grid of areas with a block; the vendored `tp-` rules this block
 * still leans on (the title, status, steps, lines, charges, search) are restated here only where a
 * card changes them.
 */
.tp.tp-page { --tp-x: 1rem; display: block; container: tp-page / inline-size; }
.tp-trail { display: flex; align-items: center; min-width: 0; margin-right: auto; font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }
.tp-body { max-width: 72rem; margin-inline: auto; padding: 1rem 1rem 2rem; }

/*
 * steepbun/subtito_rb#2457: a translation's tools, Choose source, Change source and Fix timing,
 * in the card design (docs/design.md, "A translation's tools"). Under the white page bar
 * (ToolHead in src/web/tool_page.tsx), the grey page and white cards, at every width, in place
 * of Quiet's one hairline panel. `.tool-cards` is the tools' root, so New translation, which
 * shares `.q-tool`, keeps its own look. The quiet.css rules it replaces are named below.
 *
 * - The page: `--port-page` behind, `--port-page-card` for the cards, as `.port-cards` gives the
 *   signed-in pages, replacing `body.shell:has(.q-tool)`'s panel (and base-100 on a phone).
 * - The picker (Picker in src/web/source_page.tsx) is two cards, Files (its title, the search
 *   and Upload, the languages, then the list under a hairline) and the picked file (its name as
 *   the title, its lines, then the confirm at its foot, the one teal button), side by side from
 *   40rem, replacing `.q-tool .source-picker`'s single panel. On a phone the replacement
 *   controller's screens still show one card at a time; the foot stays in the file's card, so
 *   while a file is added on the list screen that card shows the foot alone.
 * - Fix timing (RetimeEditor in src/web/translations.tsx): the reel is a Lines card, its title
 *   (`.retime-lines-head`) over the reel and its search, at the head's right end where there is
 *   room and at the card's foot on a phone; The change is a card with its title inside at every
 *   width, Save its teal button, replacing quiet.css's bars on the panel at a phone's width.
 */
.tool-cards { --q-card: var(--port-page-card); }
body.shell:has(.tool-cards) { background: var(--port-page); }
body.shell:has(.tool-cards)::before { background: var(--port-page); }
.tool-cards .ui-card { background: var(--q-card); }

/* The picker: two cards, not a panel. */
.tool-cards .source-picker.port-cards {
  display: flex; flex-direction: column; gap: 1rem; flex: 1; min-height: 0; padding-top: 0;
  background: none; border-radius: 0; box-shadow: none;
}
.tool-cards .source-card { display: flex; flex-direction: column; min-height: 0; }
.tool-cards .source-card > * { box-shadow: none; }
.tool-cards .source-files > .port-card-head { flex: none; }
.tool-cards .source-picker .source-picker-head,
.tool-cards .source-picker .source-picker-head:has(input:focus-visible) { min-height: 0; padding: 0 1rem .75rem; box-shadow: none; }
.tool-cards .source-picker .source-languages { padding: 0 1rem .75rem; box-shadow: none; }
.tool-cards .source-picker .source-list { box-shadow: inset 0 1px 0 var(--q-line); }
.tool-cards .source-file > .source-preview { flex: 1; min-height: 0; }
.tool-cards .source-picker .source-picker-foot { flex: none; padding: .75rem 1rem; box-shadow: inset 0 1px 0 var(--q-line); }
.tool-cards .source-picker .source-preview-bar { padding-top: .875rem; }
.tool-cards .source-picker .source-preview-title { font-size: .9375rem; line-height: 1.375rem; }
.tool-cards .source-picker .source-lines .tp-line-list { padding-inline: .5rem; }
/* The summary takes the foot's first line, so it never truncates beside the switch and Start. */
.tool-cards .source-picker .source-picker-actions { flex-wrap: wrap; row-gap: .5rem; }
.tool-cards .source-picker .source-picker-summary { flex-basis: 100%; }
.tool-cards .source-picker .source-picker-dual { margin-left: auto; }
/* Without the switch (a profile with dual subtitles off, #2519), Start keeps the foot's end. */
.tool-cards .source-picker .source-picker-summary + .source-picker-submit { margin-left: auto; }
@media (min-width: 40rem) {
  .tool-cards .source-picker.port-cards { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: stretch; }
  .tool-cards .source-picker .source-list { width: auto; flex: 1; }
  .tool-cards .source-picker .source-preview { box-shadow: none; }
}
@media (min-width: 768px) {
  .tool-cards .source-picker.port-cards { margin-bottom: .25rem; }
}
@media (max-width: 767px) {
  body.shell:has(.tool-cards) { background: var(--port-page); }
  .tool-cards .source-picker.port-cards { padding: .75rem; }
  .tool-cards .source-picker .source-picker-foot { padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 39.9375rem) {
  .tool-cards .source-card { flex: 1; }
  /* The list screen hides the file's card unless its foot is showing (a file being added, a refusal). */
  .tool-cards .source-picker:not([data-replacement-screen-value="preview"]) .source-files { flex: 1; }
  .tool-cards .source-picker:not([data-replacement-screen-value="preview"]) .source-file { flex: none; }
  .tool-cards .source-picker:not([data-replacement-screen-value="preview"]) .source-file:not(:has(> .source-picker-foot > .source-upload:not(.hidden), > .source-picker-foot > .source-refusal:not([hidden]))) { display: none; }
  .tool-cards .source-picker[data-replacement-screen-value="preview"] .source-files { display: none; }
  .tool-cards .source-picker .source-preview-bar { padding: .5rem var(--tp-x) .75rem .25rem; }
}

/* Fix timing: a Lines card and The change. */
.tool-cards .retime-tool { background: none; }
.tool-cards .retime-lines-head { grid-area: head; border-radius: .75rem .75rem 0 0; background: var(--q-card); box-shadow: inset 1px 0 0 var(--q-panel-line), inset -1px 0 0 var(--q-panel-line), inset 0 1px 0 var(--q-panel-line); }
.tool-cards .retime-reel-wrap { --retime-reel-bg: var(--q-card); box-shadow: inset 1px 0 0 var(--q-panel-line), inset -1px 0 0 var(--q-panel-line), inset 0 1px 0 var(--q-line); }
.tool-cards .retime-ro.ui-card { margin-top: .75rem; border-radius: .75rem; box-shadow: inset 0 0 0 1px var(--q-panel-line), 0 1px 2px rgb(15 16 18 / .04); }
.tool-cards .retime-ro-head { display: flex; align-items: center; font-size: .9375rem; font-weight: 600; line-height: 1.375rem; letter-spacing: -.01em; }
@media (max-width: 767px) {
  .tool-cards .retime-body { grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "strip" "head" "reel" "find" "ro"; padding: .75rem .75rem calc(.75rem + env(safe-area-inset-bottom, 0px)); }
  .tool-cards :is(.retime-strip, .retime-legacy) { margin-bottom: .75rem; border-radius: .75rem; }
  .tool-cards .retime-find { padding: .625rem .75rem .75rem; border-radius: 0 0 .75rem .75rem; background: var(--q-card); box-shadow: inset 1px 0 0 var(--q-panel-line), inset -1px 0 0 var(--q-panel-line), inset 0 -1px 0 var(--q-panel-line), inset 0 1px 0 var(--q-line); }
  .tool-cards .retime-ro.ui-card { flex-wrap: wrap; gap: .5rem; padding: 0 1rem 1rem; }
  .tool-cards .retime-ro-head { width: calc(100% + 2rem); margin: 0 -1rem; padding: .875rem 1rem .25rem; }
  .tool-cards .retime-ro-text { flex-basis: 100%; }
  .tool-cards .retime-save { flex: 1; }
  .tool-cards .retime-after { background: var(--port-page); }
  /* After Save the points take the screen, so the Lines title goes with the reel it heads. */
  .tool-cards .retime-body.has-after .retime-lines-head { display: none; }
}
@media (min-width: 768px) {
  .tool-cards .retime-tool { --retime-reel-bg: var(--q-card); }
  .tool-cards .retime-body { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "head side" "reel side"; row-gap: 0; }
  .tool-cards .retime-lines-head { min-height: 3.25rem; align-items: center; padding-block: .625rem; }
  .tool-cards .retime-find { grid-area: head; align-self: center; justify-self: end; width: min(20rem, 55%); margin-right: .625rem; z-index: 6; }
  .tool-cards .retime-reel-wrap { border-radius: 0 0 .75rem .75rem; }
  .tool-cards .retime-reel-wrap::after { border-radius: inherit; box-shadow: inset 0 -1px 0 var(--q-panel-line), inset 1px 0 0 var(--q-panel-line), inset -1px 0 0 var(--q-panel-line); }
  .tool-cards .retime-ro.ui-card { margin-top: 0; }
  .tool-cards .retime-ro-head { margin-bottom: 0; padding-block: .875rem .25rem; }
}

/* The hero: the poster's colours as a wash under the card's content, the poster, then the text. */
.port-card.tp-hero { position: relative; isolation: isolate; }
.port-card.tp-hero > .tp-hero-in { box-shadow: none; }
.tp-hero-wash { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.tp-hero-wash > img { position: absolute; inset: -30%; width: 160%; max-width: none; height: 160%; object-fit: cover; filter: blur(48px) saturate(1.5); opacity: .4; }
.tp-hero-in { display: grid; gap: 1rem; padding: 1rem; }
.tp-hero-main { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; align-items: start; }
.tp-hero-main > .ui-poster { width: 4.5rem; border-radius: .5rem; font-size: 1.5rem; box-shadow: 0 4px 16px rgb(15 16 18 / .16); }
.tp-hero-text { min-width: 0; display: grid; gap: .25rem; justify-items: start; }
/* The status as a pill on the wash: "Ready · 2 d ago", "Translating · 3 min". */
.tp-hero .tp-pill { margin: 0 0 .25rem; padding: .125rem .5rem .125rem .375rem; border-radius: 9999px; background: color-mix(in srgb, var(--q-panel) 80%, transparent); box-shadow: inset 0 0 0 1px var(--q-panel-line); font-size: .8125rem; line-height: 1.25rem; }
.tp-hero .tp-pill .ui-status { width: .875rem; height: .875rem; }
.tp-hero-what { display: flex; flex-wrap: wrap; align-items: center; column-gap: .25rem; font-size: .875rem; color: var(--q-ink); overflow-wrap: anywhere; }
.tp-hero-what svg { display: inline; width: .875rem; height: .875rem; vertical-align: -.125rem; color: var(--q-ink-2); }
.tp-hero-model .ui-model-mark { margin-right: .3125rem; }
.tp-hero-setting { white-space: nowrap; }
/* One quiet line of facts, each an icon and its value, with no words before the value (Stephen,
   2026-11-11): money, clock, tokens up and down, calendar. The icons are the terms. */
.tp-details { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .25rem 0 0; font-size: .8125rem; line-height: 1.25rem; color: var(--q-ink-2); font-variant-numeric: tabular-nums; }
.tp-detail { display: inline-flex; align-items: center; gap: .3125rem; white-space: nowrap; }
.tp-detail dt { display: inline-flex; color: var(--q-ink-2); }
.tp-detail-icon { flex: none; width: .875rem; height: .875rem; }
/* Tokens go up to the right and come back down to the left (Stephen, 2026-11-11). */
.tp-detail-icon--up { transform: rotate(-45deg); }
.tp-detail-icon--down { transform: rotate(135deg); }
/* The duration's stopwatch: clock-micro, smaller, at the box's foot, under a crown and a button at
   one o'clock (the icon set has no stopwatch, and the clock is Fix timing's). */
.tp-stopwatch { position: relative; display: inline-block; }
.tp-stopwatch > svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 86%; }
.tp-stopwatch::before { content: ""; position: absolute; top: 0; left: 50%; width: 30%; height: 12%; border-radius: 1px; background: currentColor; transform: translateX(-50%); }
.tp-stopwatch::after { content: ""; position: absolute; top: 14%; right: 6%; width: 18%; height: 12%; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.tp-detail dd { margin: 0; color: var(--q-ink); }
.tp-detail .tp-fact-aside { color: var(--q-ink-2); }
.tp-detail :is(.font-mono, .free-tag, .empty-value) { font: inherit; color: inherit; background: none; padding: 0; border: 0; border-radius: 0; }
.tp-hero .tp-note { margin: 0; overflow-wrap: anywhere; }
/* Download is the page's one teal button (Retry on a failed one, #638); Archive is under ⋯. */
.tp-hero-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.tp-hero-acts .tp-archive { display: block; }
.tp-hero-acts .tp-archive button { width: 100%; }
@supports (anchor-name: --a) {
  .tp-hero-acts .tp-download { anchor-name: --tp-download; }
  .tp-hero-acts .tp-menu { position-anchor: --tp-download; inset: auto; top: anchor(bottom); left: anchor(left); right: auto; margin: .375rem 0 0; position-try-fallbacks: flip-block; }
  .tp-more { anchor-name: --tp-more; }
  .tp-more-menu { position-anchor: --tp-more; inset: auto; top: anchor(bottom); right: anchor(right); margin: .375rem 0 0; position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline; }
}
.tp-more { width: 1.875rem; padding: 0; justify-content: center; }

/* On a phone the hero is laid out for the phone (Stephen, 2026-11-11): the poster is a thumbnail
   beside the status, title and languages only, and the details line, the notice and the actions take
   the card's full width under it, so no empty band sits under the poster. The actions are a planned
   grid, never a wrap: the teal button full width, the rest one even row under it, ⋯ at its end. */
@container tp-page (width < 40rem) {
  .tp-hero-main { grid-template-columns: 4rem minmax(0, 1fr); column-gap: .875rem; row-gap: .125rem; }
  .tp-hero-main > .ui-poster { grid-column: 1; grid-row: 1 / span 3; width: 4rem; align-self: start; }
  .tp-hero-text { display: contents; }
  .tp-hero-text > * { grid-column: 2; min-width: 0; }
  .tp-hero-text > .tp-pill { justify-self: start; }
  .tp-hero-text > .tp-details { grid-column: 1 / -1; margin-top: .75rem; }
  .tp-hero .tp-title { font-size: 1.1875rem; line-height: 1.5rem; }
  .tp-hero-acts { flex-wrap: wrap; gap: .5rem; }
  .tp-hero-acts > :is(a, button).ui-button { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; }
  .tp-hero-acts > .ui-button:is(.tp-download, .tp-retry) { flex-basis: 100%; }
  .tp-hero-acts > .ui-button.tp-more { flex: none; width: 2.25rem; }
}
/* On the narrowest phones (320px) a row of three leaves Change source too little room: ⋯ moves up
   beside Download, and Fix timing and Change source share the row under it, without their icons. */
@container tp-page (width < 22rem) {
  .tp-hero-acts > .ui-button:is(.tp-download, .tp-retry) { order: -2; flex-basis: calc(100% - 2.75rem); }
  .tp-hero-acts > .ui-button.tp-more { order: -1; }
  .tp-hero-acts:has(> .tp-download) > :is(#retime-trigger, #replace-trigger) > svg { display: none; }
}

/* Lines and Activity: one column, Activity first (Stephen, 2026-11-11: on a phone it would sit under
   every line); side by side where the page has the room, Lines on the left. */
.tp-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
/* quiet.css places .tp-lines in .tp's "lines" area, which this grid doesn't name. */
.tp-cols > .tp-lines { grid-area: auto; min-width: 0; }
@container tp-page (width >= 56rem) {
  .tp-cols { grid-template-columns: minmax(0, 1fr) 20rem; }
  .tp-cols > .tp-lines { grid-column: 1; grid-row: 1; }
  .tp-cols > .tp-activity-card { grid-column: 2; grid-row: 1; }
  .tp-hero-in { padding: 1.25rem; }
  .tp-hero-main { column-gap: 1.25rem; }
  .tp-hero-main > .ui-poster { width: 6rem; border-radius: .625rem; }
  .tp-hero .tp-title { font-size: 1.5rem; line-height: 2rem; }
}

/* Lines and Activity fold where they stack (FoldCard): the card's head, then a <details> of its
   rows whose <summary> is a toggle laid over the head, the caret at its right end, and while closed a
   quiet line of what's inside beside the caret. Where they sit side by side the rows show and the
   toggle is gone (display: none takes it out of the tab order and the accessibility tree), once the
   browser can show a closed <details>' content (::details-content); one that can't keeps the toggle,
   so nothing is stuck shut. */
.port-card.tp-fold-card { position: relative; }
.tp-fold > * + * { box-shadow: inset 0 1px 0 var(--q-line); }
.tp-fold > .tp-fold-toggle + * { box-shadow: none; }
.tp-fold-toggle { position: absolute; inset: 0 0 auto; height: 2.875rem; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .25rem 1rem 0 7rem; border-radius: .75rem .75rem 0 0; list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.tp-fold-toggle::-webkit-details-marker { display: none; }
.tp-fold-toggle:focus-visible { outline: 2px solid var(--q-focus); outline-offset: -2px; }
.tp-fold-summary { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; color: var(--q-ink-2); font-variant-numeric: tabular-nums; }
.tp-fold:not([open]) .tp-fold-summary { display: block; }
.tp-fold-caret { flex: none; width: 1rem; height: 1rem; color: var(--q-ink-3); transition: transform .15s; }
.tp-fold:not([open]) .tp-fold-caret { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .tp-fold-caret { transition: none; } }
@supports selector(::details-content) {
  @container tp-page (width >= 56rem) {
    .tp-fold::details-content { content-visibility: visible; }
    .tp-fold > .tp-fold-toggle { display: none; }
  }
}

/* The Lines card: the title and its count with the search in the head's row, then the source's name
   under them; where the cards sit side by side, the search at the card's top right. */
.tp-lines-card .tp-lines-bar, .tp-lines-card > .tp-fold { box-shadow: none; }
.tp-lines-card .tp-lines-h { display: inline; margin: 0; font: inherit; }
.tp-lines-card .tp-count { margin-left: .25rem; }
.tp-lines-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-height: .75rem; padding: .125rem 1rem .75rem; }
.tp-lines-source { display: flex; align-items: center; gap: .375rem; min-width: 0; margin-right: auto; font-size: .8125rem; color: var(--q-ink-2); }
.tp-lines-source svg { flex: none; width: .875rem; height: .875rem; color: var(--q-ink-3); }
.tp-lines-source > span { min-width: 0; overflow-wrap: anywhere; }
.tp-lines-source .tp-fact-aside { color: var(--q-ink-3); }
/* Over the toggle, which comes after the head and is laid over it while it shows. */
.tp-lines-card .tp-search { z-index: 1; flex: none; width: 14rem; max-width: none; }
@container tp-page (width >= 56rem) {
  /* Open, the head runs into the source's bar; the toggle covers only the head. */
  .tp-lines-card:not(:has(> .tp-fold:not([open]))) > .port-card-head { padding-bottom: 0; }
  .tp-lines-card > .tp-fold[open] > .tp-fold-toggle { height: 2.25rem; padding-top: .875rem; }
  .tp-lines-card .tp-search { position: absolute; top: .625rem; right: 1rem; }
  .tp-lines-card :is(.port-card-head, .tp-lines-bar) { padding-right: 16rem; }
}
/* Where the cards stack, the head is one row as tall as Activity's, open or closed (2.875rem): the
   title, then the search ending .5rem before the caret (the toggle's, 1rem wide at 1rem from the
   edge), centred on the title's row as the caret is. Closed, the search goes with the rows it
   searches. The source's name follows the head, and with no source the bar takes no room
   (subtito_rb#2445: in the bar the search made the head a row taller). */
@container tp-page (width < 56rem) {
  .tp-lines-card > .port-card-head { flex-wrap: wrap; row-gap: .625rem; }
  /* The count's smaller type set on the title's baseline grew the row a pixel past Activity's. */
  .tp-lines-card .tp-count { line-height: 1; }
  .tp-lines-card > .port-card-head > .tp-search { position: absolute; top: .625rem; right: 2.5rem; }
  .tp-lines-card > .port-card-head:has(> .tp-search) > .port-card-title { padding-right: 16rem; }
  .tp-lines-card:has(> .tp-fold:not([open])) > .port-card-head > .tp-search { display: none; }
  .tp-lines-card .tp-lines-bar { padding-top: 0; }
  .tp-lines-card .tp-lines-bar:empty { min-height: 0; padding: 0; }
  @media (pointer: coarse) {
    .tp-lines-card > .port-card-head > .tp-search { top: .4375rem; }
    .tp-lines-card .tp-search-field { height: 2.25rem; }
  }
}
.tp-lines-body { min-width: 0; }
/* The notices over the lines (partial, no original beside it) in the card's inset under the body's
   hairline: padding, since a first child's margin ran out of the body and over the hairline. */
.tp-lines-notes { display: grid; gap: .75rem; padding: 1rem 1rem 0; }
.tp-lines-notes > .tp-reader-notice { margin: 0; }
/* Every line: its number and start, then the translation over its original, at every width. */
.tp-lines-body .tp-line-list { margin: 0; padding: .375rem .5rem .5rem; }
.tp-lines-body .tp-line { grid-template-columns: 1.5rem 3.5rem minmax(0, 1fr); }
.tp-lines-body .tp-line-translated { font-weight: 500; color: var(--q-ink); }
.tp-lines-body .tp-line-original { grid-column: 3; margin: .125rem 0 0; color: var(--q-ink-2); }
.tp-lines-body .tp-line-none { color: var(--q-ink-3); }
.tp-lines-body .tp-line-translated.tp-line-none { font-weight: 400; }
/* On a phone each line's number and start are a small meta row over its text, which takes the full
   width (Stephen, 2026-11-11: the left column pushed the text right). A desktop keeps the columns. */
@media (width < 768px) {
  .tp-lines-body .tp-line { grid-template-columns: auto minmax(0, 1fr); column-gap: .5rem; row-gap: .125rem; }
  .tp-lines-body .tp-line-n { justify-self: start; }
  .tp-lines-body .tp-line-text { grid-column: 1 / -1; }
  .tp-lines-body .tp-line-original { grid-column: 1 / -1; }
}
/* The pages bar: Prev and Next in equal side columns, so the count sits at the bar's true centre. */
.tp-lines-body .tp-pages { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .5rem; }
.tp-lines-body .tp-pages > :first-child { justify-self: end; }
.tp-lines-body .tp-pages > :last-child { justify-self: start; }
/* On a phone the search folds to its glass beside the caret, as quiet.css folds it below 768px, a
   square as big as a small icon button (.ui-button--sm.ui-button--icon), until it's used; then the
   field takes a row of its own under the title's, the head's full width. */
@media (width < 768px) {
  .tp-lines-card > .port-card-head:has(> .tp-search) > .port-card-title { padding-right: 4.25rem; }
  .tp-lines-card .tp-search { width: auto; }
  .tp-lines-card .tp-search-field { width: 1.875rem; height: 1.875rem; padding: 0 .4375rem; }
  .tp-lines-card .tp-search:is(.tp-search--active, :focus-within, :has(input[type="search"]:not(:placeholder-shown))) { position: static; flex: 1 1 100%; }
  .tp-lines-card .tp-search:is(.tp-search--active, :focus-within, :has(input[type="search"]:not(:placeholder-shown))) .tp-search-field { width: auto; padding: 0 .625rem; }
}
@media (width < 768px) and (pointer: coarse) {
  .tp-lines-card .tp-search-field { width: 2.25rem; height: 2.25rem; padding: 0 .625rem; }
}

/* The Activity card: its steps, then the itemised charges folded under them. */
.tp-activity-body { padding: 1rem; }
.tp-activity-body .tp-feed { padding: 0; }
.tp-charges-fold { margin-top: 1.25rem; padding-top: .75rem; box-shadow: inset 0 1px 0 var(--q-line); }
.tp-charges-h { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 500; color: var(--q-ink-2); list-style: none; cursor: pointer; }
.tp-charges-h::-webkit-details-marker { display: none; }
.tp-charges-fold[open] .tp-sec-chevron { transform: rotate(90deg); }
.tp-charges-fold .tp-charges { margin-top: .75rem; padding-top: 0; box-shadow: none; }

/*
 * steepbun/subtito_rb#2394: the Translations list in the shared card. Each date band is a `Card`
 * (`.lib-sec` > `.port-card`) whose head is the band's name and count, over its rows (`.lib-card`,
 * the <ul> the polls and pagination append into). The bands stack as `.port-cards` do.
 *
 * - Every row shares one grid, so the chips and ages line up across every band's card: once the
 *   list has the room for one-line rows (quiet.css's `@container lib (min-width: 34rem)`), the
 *   column of bands holds the row's tracks and each level down to the row is a subgrid. The edge
 *   tracks plus the gap make the row's 1rem inset, which a subgrid's padding can't (it would eat
 *   the fixed status track). The tracks are quiet.css's row columns between those edges.
 * - The card is the band's surface, so the rows' list loses `.lib-card`'s own corners at its top,
 *   where the head sits. The hairline under the head goes on the first row, not on the list (as
 *   `.port-card > * + *` would draw it), so the row's hover wash doesn't paint over it.
 * - While the bands may not name the days the rows' labels do, the card heads stand down, as
 *   quiet.css's `.lib-sec-h` did (date_bands_controller).
 * - A failed row's status sub-line (libraryRowSub) is in the failed colour, as Watching now's
 *   line is (`.lib-now-line`).
 * - A band with no rows stays out of sight (quiet.css's `.lib-sec:not(:has(li))`), so the subgrid
 *   only takes bands that have one.
 */
.lib-groups.port-cards { padding-top: 1.25rem; }
.lib-groups .lib-sec { padding-top: 0; }
.lib-groups .lib-card > li:first-child > .lib-row { border-top-left-radius: 0; border-top-right-radius: 0; }
.lib-groups[data-bands-unsure] .port-card-head { display: none; }
.lib-groups .port-card > .lib-card { box-shadow: none; }
.lib-groups .lib-card > li:first-child > .lib-row { box-shadow: inset 0 1px 0 var(--q-line); }
.lib-groups[data-bands-unsure] .lib-card > li:first-child > .lib-row { box-shadow: none; }
.lib-row:has(.ui-status--failed) .lib-sub--status { color: var(--q-failed-text); }
@container lib (min-width: 34rem) {
  .lib-groups.port-cards {
    display: grid;
    grid-template-columns: .125rem 1rem auto minmax(0, 1fr) auto 5.5rem .125rem;
    column-gap: .875rem;
    row-gap: 1rem;
  }
  .lib-groups :is(.lib-sec:has(li), .port-card, .lib-card, .lib-card > li) { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
  .lib-groups .port-card-head { grid-column: 1 / -1; }
  .lib-groups .lib-card .lib-row { grid-column: 1 / -1; grid-template-columns: subgrid; grid-template-areas: ". state poster text props when ."; padding-inline: 0; }
}

/*
 * steepbun/subtito_rb#2458: Help (src/web/help.tsx) and the legal pages (src/web/legal.tsx) as
 * cards on the grey page (docs/design.md, "Help and the legal pages"), signed in and out: both
 * shells are `body.shell`, so the grey page below (`body.shell:has(.port-cards)`) covers them. Each
 * is a `Card` (#2425's block above, untouched); these rules take back quiet.css's Help and legal
 * rules that would restyle the card's title or draw rules between the sections, which the cards'
 * edges now do.
 *
 * - `.help-body.port-cards`: the intro, then a card per topic. `.help-article` is one of a card's
 *   rows (an article's heading, the help-topics controller's anchor, and its text), and
 *   `.help-card-foot` its last, Back to topics. The statuses lose their box inside the card and
 *   keep their hairlines.
 * - `.q-help-topics.port-card`: the Topics rail is a card where it shows in the page (at 1200px and
 *   up, or before the controller connects), its title inside. As the phone's popover (`[popover]`,
 *   which the controller sets) it keeps quiet.css's overlay, which outranks the card's surface.
 * - `.legal-prose.port-cards`: one card per section of a policy, its text in `.legal-body` under the
 *   title with no hairline, as Configure's `.cf-card-body`. The chips and date stay above them.
 */
.q-help .help-body.port-cards { padding-top: 0; }
.q-help .help-body > .q-help-intro { margin: 0 0 .25rem; }
.q-help .help-body > .help-card { margin: 0; padding: 0; border-top: 0; }
:is(.q-help .help-body, .q-legal .legal-prose) .port-card-title { margin: 0; font-size: .9375rem; line-height: 1.375rem; letter-spacing: -.01em; }
.help-article { padding: 1rem; }
/* An article's heading sits a step under its card's title, at the body's size in ink. */
.q-help .help-article > h3 { margin: 0 0 .5rem; font-size: .875rem; line-height: 1.375rem; }
:is(.q-help .help-article, .q-legal .legal-body) > :last-child { margin-bottom: 0; }
.help-card-foot { padding: .25rem 1rem; }
.q-help .help-card-foot > .help-back { margin-top: 0; }
.q-help .help-body .help-statuses { border: 0; border-block: 1px solid var(--q-line); border-radius: 0; background: none; }
.q-help .help-body .help-statuses > div { padding-inline: 0; }

.q-help-topics.port-card { --q-card: var(--port-page-card); }
.q-help-topics.port-card:not([popover]) { margin-bottom: 1rem; padding: 0; }
.q-help-topics:not([popover]) .port-card-title { margin: 0; padding: 0; font-size: .9375rem; font-weight: 600; line-height: 1.375rem; letter-spacing: -.01em; color: var(--q-ink); }
.q-help-topics:not([popover]) > .q-help-outline { padding: .5rem; }
.q-help-topics[popover] > .port-card-head { padding: 0; }
.q-help-topics[popover] > * + * { box-shadow: none; }
@media (width >= 1200px) {
  .q-help > .q-help-content { grid-template-columns: minmax(0, 40rem) 16rem; gap: 1.5rem; max-width: 60.5rem; }
  /* quiet.css scrolls the sticky rail when it is taller than the window; `.port-card` would clip it. */
  .q-help-topics.port-card { margin-bottom: 0; padding: 0; border-left: 0; overflow-y: auto; }
}

.q-legal .q-legal-head { padding-bottom: 1.25rem; }
.q-legal .legal-prose.port-cards { padding-top: 0; }
.port-card > .legal-body { padding: 0 1rem 1rem; box-shadow: none; }

/*
 * steepbun/subtito_rb#2464: the dialogs in the card look (src/web/dialog.tsx; docs/design.md,
 * "Dialogs"): Account's Change email, Change password and Delete account, Configure's Install in
 * Stremio, and the confirm dialog every page asks with (ConfirmDialog in src/web/confirm_dialog.tsx,
 * #2214). quiet.css's `dialog.ui-dialog` still centres it, scrolls it and lays the scrim.
 *
 * - `.port-dialog`: the dialog. A page card's surface (white in light, `--port-page-card`), corners
 *   and edge, with the overlay's shadow, since it floats over the page. A centred card at every
 *   width, 1rem in from a phone's edges, in place of quiet.css's bottom sheet on a phone, rising in
 *   as it does on a desktop.
 * - `.port-dialog-head`: a page card's head, the title inside the card's top-left edge at a card
 *   title's size and with the hairline under it, as Account's cards behind it have, and Close at
 *   its right end.
 * - The body, `.q-account-dialog-body` or `.port-dialog-body`, lines up with the title, and its
 *   actions (`.q-account-actions`) close the card at its right; on a phone the buttons share the
 *   card's width.
 * - `.q-confirm-dialog`: the confirm, a step narrower, with no visible head (unless its question
 *   has a title, #2498), so its body takes the head's top padding. The question is its subject, in ink at the body size, not the muted
 *   description, and keeps its line breaks (Archive's readable confirm has one). quiet.css's
 *   `.ui-button` display beats the hidden attribute, so an alert's hidden Cancel is hidden here.
 */
dialog.ui-dialog.port-dialog {
  width: min(26rem, calc(100vw - 2rem));
  max-height: min(40rem, calc(100dvh - 2rem));
  border-radius: .75rem;
  background: var(--port-page-card);
  box-shadow: inset 0 0 0 1px var(--q-panel-line), var(--q-overlay-shadow);
}
@media (max-width: 767px) {
  dialog.ui-dialog.port-dialog { margin: auto; width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); border-radius: .75rem; padding-bottom: 0; }
  @media (prefers-reduced-motion: no-preference) {
    dialog.ui-dialog.port-dialog[open] { animation: q-rise .18s ease-out; }
  }
}
.port-dialog-head { align-items: center; padding: .5rem .5rem .5rem 1rem; box-shadow: inset 0 -1px 0 var(--q-line); }
.port-dialog .q-account-dialog-body, .port-dialog .port-dialog-body { padding: 1rem; }
@media (max-width: 767px) { .port-dialog .q-account-actions > .ui-button { flex: 1 1 0; } }
dialog.ui-dialog.q-confirm-dialog { width: min(22rem, calc(100vw - 3rem)); }
.q-confirm-dialog .q-account-dialog-body { padding-top: 1.25rem; }
/* A confirm with a title (turboConfirm's title, steepbun/subtito_rb#2498) shows the head the other
   dialogs have, and its body takes their padding; without one the head stays hidden. */
.q-confirm-dialog .port-dialog-head[hidden] { display: none; }
.q-confirm-dialog .port-dialog-head:not([hidden]) + .q-account-dialog-body { padding-top: 1rem; }
.port-dialog .q-account-actions { margin-top: 1rem; }
.q-confirm-dialog .q-account-dialog-desc { margin-bottom: 0; font-size: .9375rem; color: var(--q-ink); white-space: pre-line; overflow-wrap: anywhere; }
.q-confirm-dialog .ui-button[hidden] { display: none; }
/* The passkey offer after a password sign-in (steepbun/subtito_rb#2510, src/web/passkey_offer.tsx):
   Account's dialog with its small print under the line, at the foot's size, and the ceremony's
   status line, which the dialog closes before it could say anything, kept out of the layout. */
.q-passkey-offer .q-account-dialog-desc { margin-bottom: .5rem; }
.q-passkey-offer-note { font-size: .8125rem; line-height: 1.5; color: var(--q-ink-2); }

/*
 * steepbun/subtito_rb#2387: the shell's profiles and account as direction D (src/web/shell/
 * account_menu.tsx and chrome.tsx, docs/design.md "Profiles").
 *
 * - `.pswitch`: the profile switcher, one component in the sidebar's white card at its top
 *   (`.pswitch--side`) and at the top of the phone menu (`.pswitch--menu`): every profile's avatar in
 *   a row (five at most, with "+" after them under the limit), the active one ringed, then its name
 *   and Manage. Five faces exactly fill its inner width (a face is a fifth of it less the gaps), so it
 *   has no dead space. A free account at its limit gets the "+" greyed (`.shell-face-topup`), a link
 *   to the top-up page. Pointing at an avatar shows its name in the active name's place: each avatar
 *   carries its name (`.pswitch-name`), placed over the line from the switcher, its containing block.
 * - `.side-foot`'s rows are `.side-link`s (Account, Admin, Log out), the Log out form a plain
 *   wrapper; `.side-legal` is the Terms · Privacy footer under them.
 * - `.shell-menu`: the phone's one menu, which drops down under the top bar's avatar
 *   (`.shell-menu-button`), anchored as quiet.css anchors its `.acct-menu`, which nothing renders
 *   now. A desktop never shows it: its sidebar holds all of it.
 * - The grey page: a page made of cards (`.port-cards`) sits on a grey panel with white cards
 *   (docs/design.md, "One page language"), its page bar staying white. Dark keeps quiet.css's
 *   panel and card, where the card is already the lighter of the two.
 */
/* The profile switcher (.pswitch), the same in the sidebar's card and the phone menu (Stephen, #2387).
   Its inset (--pswitch-inset) is its container's own: the sidebar card's .5rem, where the nav rows'
   icons sit in theirs, and the menu's .625rem, where its rows' icons sit. The name line starts at the
   inset, and so does the active avatar's ring (--pswitch-ring outside the avatar), on top and left
   alike, so the avatars sit a ring's width further in. That leaves 197px inside at 1280 in both
   places (the menu is sized to match), and five faces exactly fill it: a face is a fifth of the width
   less the four gaps. The gap is .5rem, which makes a face about 33px (Stephen, 2026-11-13,
   steepbun/subtito_rb#2513: at .75rem and 30px they "look a little tiny" as tap targets, and at
   .375rem and 35px he asked for "a little smaller") and clears the active face's ring. */
.pswitch { --pswitch-bg: var(--q-panel); --pswitch-gap: .5rem; --pswitch-inset: .5rem; --pswitch-ring: 3.5px; position: relative;
  padding: calc(var(--pswitch-inset) + var(--pswitch-ring)) calc(var(--pswitch-inset) + var(--pswitch-ring)) calc(var(--pswitch-inset) - 1px); }
.pswitch--side { margin: 0 0 .875rem; border-radius: .75rem; background: var(--pswitch-bg); box-shadow: inset 0 0 0 1px var(--q-panel-line), 0 1px 2px rgb(15 16 18 / .04); }
.pswitch--menu { --pswitch-bg: var(--q-overlay); --pswitch-inset: .625rem; }
.pswitch-faces { display: flex; gap: var(--pswitch-gap); }
.pswitch-faces .shell-face-form { display: contents; }
.pswitch .pswitch-face { display: grid; place-items: center; flex: none; width: calc((100% - 4 * var(--pswitch-gap)) / 5); height: auto; aspect-ratio: 1; padding: 0; border: 0; border-radius: 999px; background: none; font: inherit; color: var(--q-ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pswitch .pswitch-face:is(:hover, :focus-visible) { background: none; }
.pswitch-face .ui-avatar { width: 100%; height: 100%; font-size: .875rem; }
/* The menu (quiet.css .ui-menu) drops the outline for a background wash; an avatar keeps the outline. */
.pswitch .pswitch-face:focus-visible { outline: 2px solid var(--q-focus); outline-offset: 0; }
.pswitch-face[aria-current] .ui-avatar { box-shadow: 0 0 0 2px var(--pswitch-bg), 0 0 0 var(--pswitch-ring) var(--q-accent); }
@media (hover: hover) { .pswitch-face:not([aria-current]):hover .ui-avatar { box-shadow: 0 0 0 2px var(--pswitch-bg), 0 0 0 var(--pswitch-ring) var(--q-line); } }
.pswitch-add-mark { display: grid; place-items: center; box-sizing: border-box; width: 100%; height: 100%; border: 1.5px dashed var(--q-ink-3); border-radius: 999px; }
.pswitch .pswitch-add-mark > svg { width: 40%; height: 40%; color: currentColor; }
@media (hover: hover) { .pswitch-add:not(.shell-face-topup):hover { color: var(--q-ink); } .pswitch-add:not(.shell-face-topup):hover .pswitch-add-mark { border-color: var(--q-ink-2); } }
.pswitch-add.shell-face-topup .pswitch-add-mark { opacity: .45; }
.pswitch-line { display: flex; align-items: baseline; gap: .5rem; margin: .375rem calc(-1 * var(--pswitch-ring)) 0; padding: 0; font-size: .8125rem; line-height: 1.25rem; }
.pswitch-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--q-ink); }
.pswitch .pswitch-manage { display: inline; flex: none; width: auto; height: auto; padding: 0; font-size: .8125rem; font-weight: 500; color: var(--q-accent-text); background: none; border-radius: .25rem; }
@media (hover: hover) { .pswitch .pswitch-manage:hover { background: none; text-decoration: underline; text-underline-offset: 3px; } }
.pswitch-name { position: absolute; left: var(--pswitch-inset); right: calc(var(--pswitch-inset) + 3.75rem); bottom: calc(var(--pswitch-inset) - 1px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 600; line-height: 1.25rem; text-align: left; color: var(--q-ink); background: var(--pswitch-bg); visibility: hidden; pointer-events: none; }
.pswitch-face:is(:hover, :focus-visible) .pswitch-name { visibility: visible; }
.pswitch-add.shell-face-topup .pswitch-name { right: var(--pswitch-inset); font-weight: 500; color: var(--q-ink-2); }
/* "+" opens the name field (NewProfileForm, steepbun/subtito_rb#2513) where the name line was: the
   line and the pointed-at names give way to it. Its rules outweigh the phone menu's, which lays its
   forms out as their rows (`.shell-menu form`) and its buttons as menu items. */
.pswitch .pswitch-create { display: flex; align-items: center; gap: .25rem; margin: .375rem calc(-1 * var(--pswitch-ring)) 1px; }
.pswitch .pswitch-create[hidden] { display: none; }
.pswitch:has(> .pswitch-create:not([hidden])) :is(.pswitch-line, .pswitch-name) { display: none; }
.pswitch-create .ui-field { flex: 1 1 auto; min-width: 0; }
.pswitch-create .ui-field input { width: 100%; min-width: 0; }
.pswitch .pswitch-create .ui-button { flex: none; width: auto; }
/* Cancel's X is the same small target in both places, its mark at the card's inset: the menu's item
   padding would take the width from the field (Stephen, 2026-11-13: "the input is tiny there"). */
.pswitch .pswitch-create .ui-button--icon { justify-content: center; width: 1.5rem; height: 1.875rem; margin-right: -.25rem; padding: 0; }
.pswitch-add[aria-expanded="true"] { color: var(--q-ink); }
.pswitch-add[aria-expanded="true"] .pswitch-add-mark { border-color: var(--q-ink-2); }

.side-foot form { display: contents; }
.side-foot button.side-link { border: 0; background: none; font: inherit; font-size: .8125rem; font-weight: 500; }
.side-legal { display: flex; align-items: baseline; gap: .25rem; margin-top: .375rem; padding: 0 .5rem; font-size: .75rem; line-height: 1.25rem; color: var(--q-ink-3); }
.side-legal a { color: var(--q-ink-2); border-radius: .25rem; }
@media (hover: hover) { .side-legal a:hover { color: var(--q-ink); text-decoration: underline; text-underline-offset: 3px; } }

.shell-menu-button { display: inline-flex; gap: .125rem; width: auto; padding: 0 .25rem 0 .125rem; border-radius: 999px; color: var(--q-ink-3); }
.shell-menu-chevron { width: .875rem; height: .875rem; flex: none; }
body:has(#account-menu:popover-open) .shell-menu-button .ui-avatar { box-shadow: 0 0 0 3px var(--q-wash-strong); }
.shell-menu { width: min(14.625rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 4rem); overflow-y: auto; overscroll-behavior: contain; inset: auto; margin: 0; }
.shell-menu form { display: contents; }
.shell-menu-sep { height: 1px; margin: .3125rem -.3125rem; border: 0; background: var(--q-line); }
.shell-menu-legal { display: flex; align-items: baseline; gap: .25rem; margin: .3125rem -.3125rem -.3125rem; padding: .5rem .9375rem .625rem; font-size: .75rem; line-height: 1.25rem; color: var(--q-ink-3); box-shadow: inset 0 1px 0 var(--q-line); }
/* The app's version (#2579): pushed to the row's right end, never wrapping or squeezing the links; ink-2
   like the links, since ink-3 small text fails WCAG AA contrast. */
.legal-version { flex: none; color: var(--q-ink-2); margin-left: auto; padding-left: .5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shell-menu .shell-menu-legal a { display: inline; width: auto; height: auto; padding: 0; font-size: .75rem; color: var(--q-ink-2); background: none; }
@media (pointer: coarse) { .shell-menu > :is(a, button), .shell-menu > form > button { height: 2.75rem; } }
@supports (anchor-name: --a) {
  .shell-menu-button { anchor-name: --shell-menu; }
  .shell-menu { position-anchor: --shell-menu; top: anchor(bottom); right: anchor(right); margin-top: .375rem; }
}
@supports not (anchor-name: --a) {
  .shell-menu { top: calc(env(safe-area-inset-top, 0px) + (var(--q-top) + 2rem) / 2 + .375rem); right: calc(var(--q-gutter) + .625rem + env(safe-area-inset-right, 0px)); }
}
@media (width >= 768px) { .shell-menu { display: none; } }

:root { --port-page: #f4f4f6; --port-page-card: var(--q-panel); }
:root[data-theme="dark"] { --port-page: var(--q-panel); --port-page-card: var(--q-card); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --port-page: var(--q-panel); --port-page-card: var(--q-card); } }
body.shell:has(.port-cards)::before { background: var(--port-page); }
.port-cards { --q-card: var(--port-page-card); }

/* Account's New profile row, greyed for a free account at its limit, leads to the top-up page. */
a.q-account-new--full { text-decoration: none; }
a.q-account-new--full:focus-visible { outline-offset: -3px; }
a.q-account-new--full .cf-row-label { color: var(--q-ink-3); }
.q-account-new-go { flex: none; width: 1rem; height: 1rem; margin-left: auto; color: var(--q-ink-3); }
@media (hover: hover) { a.q-account-new--full:hover { background: var(--q-wash); } }

/*
 * steepbun/subtito_rb#2315: Top up's ways to pay (topupPage in src/web/checkout.tsx; no Free card
 * since #2617), each a `Card`. The first row is the way's line and its feature rows
 * (src/web/way_features.tsx), the same rows on every card, or the line alone once the account has
 * paid, with no row min-height under it; `.port-way-body` holds what you do with it (the packages, the
 * unlock's button); `.port-way-note`, under the cards on the grey page, is the one note the
 * asterisks point to. Account's key card before the unlock is its head alone, its meta the link to
 * Top up.
 */
.port-ways { padding-top: 1rem; }
.port-way-lede { align-items: flex-start; min-height: 0; padding-top: .125rem; padding-bottom: .875rem; }
.port-card > .port-way-lede { box-shadow: none; }
.port-way-text { min-width: 0; }
.port-way-line { margin: 0; color: var(--q-ink); }
.port-way-details { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .375rem 0 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--q-ink-2); }
.port-way-details li { display: flex; align-items: flex-start; gap: .375rem; }
.port-way-details .way-mark { flex: none; width: .875rem; height: .875rem; margin-top: .1875rem; color: var(--q-accent); }
.port-way-details .way-mark--no { color: var(--q-ink-3); }
.port-ways .way-star { margin-left: .0625rem; color: var(--q-ink-2); }
.port-way-body { padding: 1rem; }
.port-way-body .q-topup-actions { margin-top: .75rem; }
.port-way-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.port-way-help { font-size: .8125rem; }
/* #2596: the key's unlock, before it is bought, is a full-width primary button like Continue to
   payment, How it works quiet under it; Quiet's auth "or" (quiet.css .q-auth-or) sits between Pay as
   you go and the key, in the cards' column gap, so the two read as alternatives. */
.port-way-buy { display: flex; flex-direction: column; gap: .625rem; }
.port-way-buy > .port-way-help { align-self: flex-start; }
.port-way-or { margin: 0; }
/* The note keeps clear of the last card (Stephen, 2026-11-12): the column's 1rem gap and .5rem
   more, so it is further from the cards than they are from each other, and reads as the page's. */
.port-way-note { margin: .5rem 0 0; padding: .75rem 1rem; border-radius: .625rem; background: var(--q-wash); font-size: .8125rem; color: var(--q-ink-2); }
.port-way-meta-link { color: var(--q-accent-text); font-weight: 500; text-decoration: none; }
@media (hover: hover) { .port-way-meta-link:hover { text-decoration: underline; } }
/*
 * The amounts on Pay as you go's card, as tiles (Stephen, 2026-11-12: the grey cards in the grey
 * card, the radio in a corner and the amount centred, looked unfinished). Each is a control, on
 * the control surface and edge Quiet's fields and chips use: the amount large at its top left, the
 * radio on the amount's line at the right, the payment fee under them. Three equal tiles in a row
 * (quiet.css's `.q-topup-package-set`), one column under 22.5rem, where the amount and its radio no
 * longer fit a third. Chosen: the 2px accent ring and an 8% accent tint over the control surface,
 * replacing #2200's tint over the card surface (`.q-topup-package.ui-card:has(input:checked)`),
 * which this card's own surface hid; hovered, the edge darkens, over quiet.css's wash. Focus is
 * quiet.css's ring around the tile (`.q-topup-package:has(input:focus-visible)`), and disabled
 * its dimming. Forced colours drop the shadows, so the tile keeps a border there, Highlight when
 * chosen, beside the browser's own radio.
 */
.port-way .q-topup-package { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "amount radio" "fee fee"; align-content: start; justify-items: start; gap: .125rem .5rem; padding: .75rem .875rem .8125rem; border-radius: .625rem; background-color: var(--q-control); box-shadow: inset 0 0 0 1px var(--q-control-line), var(--q-control-shadow); transition: background-color .12s ease, box-shadow .12s ease; }
.port-way .q-topup-package > input { grid-area: radio; align-self: center; }
.port-way .q-topup-package > strong { grid-area: amount; font-size: 1.5rem; font-weight: 600; line-height: 2rem; letter-spacing: -.03em; color: var(--q-ink); }
.port-way .q-topup-package > small { grid-area: fee; display: flex; flex-wrap: wrap; column-gap: .25rem; }
.port-way .q-topup-package > small > span { white-space: nowrap; }
.port-way .q-topup-package.ui-card:has(input:checked) { background-color: color-mix(in srgb, var(--q-accent) 8%, var(--q-control)); box-shadow: inset 0 0 0 2px var(--q-accent), var(--q-control-shadow); }
@media (hover: hover) {
  .port-way .q-topup-package:not(:has(input:checked, input:disabled)):hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--q-ink-3) 70%, transparent), var(--q-control-shadow); }
}
@media (width < 22.5rem) { .port-way .q-topup-package-set { grid-template-columns: minmax(0, 1fr); } }
@media (forced-colors: active) {
  .port-way .q-topup-package { border: 1px solid CanvasText; }
  .port-way .q-topup-package:has(input:checked) { border-color: Highlight; }
}

/* Admin frame (#2474) */
/*
 * steepbun/subtito_rb#2474: admin's frame in the card design (src/web/admin/layout.tsx and
 * shared.tsx; docs/design.md, "Admin", "The frame"). Admin's body is `body.shell` as the customer
 * pages' is, so quiet.css draws its sidebar, phone top bar, panel and page bar; these rules add
 * only what admin has and the shell doesn't.
 *
 * - `.admin-side`: admin's own sidebar (Stephen, 2026-11-12, #2453) in `.shell-side`'s look: the
 *   brand, the token search, Dashboard, then each group under a quiet heading
 *   (`.admin-side-group`), with Back to app and the admin's email (`.admin-side-email`) at its foot.
 * - `.admin-top`: the phone's `.shell-top`: the brand, the token search, and the button of the one
 *   drop-down menu, `.admin-menu` (a `.shell-menu`, anchored the same way), which lists every
 *   section under the same headings.
 * - `.admin-search`: the token search, a `.ui-field` the width of its slot.
 * - `.admin-page`: the grey page (`.port-cards`): the page bar edge to edge across the panel, then
 *   a column of cards no wider than 80rem. `.admin-bar` is the bar (breadcrumb, the h1, a page-wide
 *   action); `.admin-head` is a record page's token, subtitle and actions under it, on the record
 *   pages not yet moved to `RecordHead`'s card ("Admin records (#2480)" below; #2482, #2483).
 * - `.admin-card`: a `Panel` (a `Card`) or a framed `DataTable`. `.admin-card-body` pads its
 *   content; `.admin-card-flush` runs a table to the card's edges, its first and last cells in line
 *   with the card's title.
 * - `.admin-stats`: the dashboard's tiles, each a small `.port-card` (`.admin-stat`): two to a row
 *   on a phone, four from 768px, all seven in a row from 1200px.
 */
.admin-brand { white-space: nowrap; }
.admin-brand-suffix { font-weight: 500; color: var(--q-ink-2); }

.admin-search { display: block; min-width: 0; }
.admin-search-field { width: 100%; height: 1.875rem; }
.admin-search-field input { min-width: 0; }

/* The sidebar scrolls when the window is shorter than it (it has overflow-y: auto), rather than
   squeezing its head and search box: squeezed, they sat up to 12px higher in a short window than a
   tall one, which read as the sidebar shifting when a dialog's shot was set beside a page's
   (steepbun/subtito_rb#2498). */
.admin-side > * { flex-shrink: 0; }
/* Its foot, Back to app and the admin's email, stays at the sidebar's bottom edge: where the window
   is shorter than the sidebar (1280×800 is, by about 50px), the groups scroll under it rather than
   the foot being cut off at the window's edge (steepbun/subtito_rb#2499). Where it fits, nothing
   changes: the foot's auto margin already puts it last at the bottom. The sidebar's bottom padding
   moves into the foot, so the scrolled rows don't show beneath it. */
.admin-side { padding-bottom: 0; }
.admin-side > .side-foot { position: sticky; bottom: 0; padding-bottom: .75rem; background: var(--q-base); }
/* A rule above the foot, and a fade into it, so a row cut off above it reads as the list going on
   under it, not as a stray sliver (Stephen's review, steepbun/subtito_rb#2504). The fade sits over
   the rows' side of the rule and takes no pointer, so the row under it still opens. */
.admin-side > .side-foot { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--q-line); }
.admin-side > .side-foot::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 1.5rem; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--q-base));
}
.admin-side-search { margin: 0 0 .75rem; }
.admin-side-group { padding: .875rem .5rem .25rem; font-size: .75rem; font-weight: 500; line-height: 1rem; color: var(--q-ink-3); }
.admin-side-email { margin: .375rem 0 0; padding: 0 .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; line-height: 1.25rem; color: var(--q-ink-3); }

.admin-top-tools { flex: 1; min-width: 0; justify-content: flex-end; }
.admin-top .admin-search { flex: 0 1 14rem; }
.admin-menu-button { display: grid; place-items: center; flex: none; width: 1.875rem; height: 1.875rem; padding: 0; border-radius: .5rem; color: var(--q-ink-2); background: var(--q-control); box-shadow: inset 0 0 0 1px var(--q-control-line), var(--q-control-shadow); cursor: pointer; }
.admin-menu-button svg { width: 1rem; height: 1rem; }
@media (hover: hover) { .admin-menu-button:hover { color: var(--q-ink); background: var(--q-control-hover); } }
body:has(#admin-menu:popover-open) .admin-menu-button { color: var(--q-ink); background: var(--q-wash-strong); }
.admin-menu-group { padding: .5rem .625rem .25rem; font-size: .75rem; font-weight: 500; line-height: 1rem; color: var(--q-ink-3); }
.admin-menu-group:first-child { padding-top: .25rem; }
.admin-menu a[aria-current] { font-weight: 500; background: var(--q-wash); }
.admin-menu-email { padding: .25rem .625rem .375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: var(--q-ink-3); }

.shell-page.admin-page { --admin-x: 1rem; max-width: none; padding: 0 var(--admin-x) 2rem; }
.admin-page.port-cards { padding-top: 0; }
.admin-page > :not(.ui-pagebar) { width: 100%; max-width: 80rem; margin-inline: auto; }
.admin-page > .ui-pagebar { margin: 0 calc(-1 * var(--admin-x)) .25rem; }
@media (width >= 768px) { .shell-page.admin-page { --admin-x: 1.5rem; } }

.admin-bar { gap: 0; }
.admin-bar-h { display: block; flex: 0 1 auto; margin-right: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-bar > .admin-bar-h:last-child, .admin-bar > .admin-bar-h:has(+ .admin-bar-actions) { margin-right: auto; }
.admin-trail { flex: none; max-width: 50%; min-width: 0; font-size: .9375rem; letter-spacing: -.01em; }
.admin-trail ol { display: flex; align-items: center; min-width: 0; margin: 0; padding: 0; list-style: none; }
.admin-trail li { display: flex; align-items: center; min-width: 0; }
.admin-trail .tp-crumb { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-trail-sep { flex: none; width: .875rem; height: .875rem; margin: 0 .4375rem 0 .0625rem; color: var(--q-ink-3); }
.admin-bar-actions { display: flex; flex: none; align-items: center; gap: .5rem; margin-left: .75rem; }

.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.admin-head-text { min-width: 0; }
.admin-head-sub { margin: .125rem 0 0; font-size: .8125rem; color: var(--q-ink-2); overflow-wrap: anywhere; }
.admin-head-actions { display: flex; min-width: 0; align-items: center; gap: .5rem; }

.admin-page > .port-page-top { padding: 0; }
.admin-page > .port-page-top:empty { display: none; }

.admin-card-body { padding: .75rem 1rem 1rem; }
.port-card > .admin-card-flush { padding-bottom: .25rem; }
.admin-card :is(th, td):first-child { padding-left: 1rem; }
.admin-card :is(th, td):last-child { padding-right: 1rem; }
.admin-card .table thead tr { border-color: var(--q-line); }
.admin-card .table tbody tr:last-child { border-bottom: 0; }

.admin-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (width >= 768px) { .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (width >= 1200px) { .admin-stats { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.admin-stat { display: block; padding: .75rem .875rem .8125rem; color: var(--q-ink); }
.admin-stat > * + * { box-shadow: none; }
.admin-stat-label { margin: 0; font-size: .8125rem; font-weight: 500; line-height: 1.25rem; color: var(--q-ink-2); }
.admin-stat-value { margin: .125rem 0 0; font-size: 1.5rem; font-weight: 600; line-height: 2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.admin-stat-value--warning { color: var(--yolk-ink); }
.admin-stat-value--error { color: var(--q-failed-text); }
.admin-stat-sub { margin: 0; font-size: .75rem; line-height: 1rem; color: var(--q-ink-3); }
.admin-stat--link { transition: background-color .12s ease; }
@media (hover: hover) { .admin-stat--link:hover { background: color-mix(in oklab, var(--q-card), var(--q-ink) 3%); } }

/*
 * The frame's controls are Quiet's (#2474, Stephen 2026-11-12: "Are we making sure to follow the
 * design system?"): the token search and the filters are `.ui-field`/`.ui-select`, buttons
 * `.ui-button`, links `.q-link`, secondary text `.q-muted`. No admin page carries a DaisyUI control
 * or colour class any more, so the bridge that mapped DaisyUI's colour tokens onto Quiet's on
 * `body.admin-shell` is gone (#2482).
 */
.admin-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.admin-filter-field { flex: 1 1 14rem; min-width: 0; }
.admin-filter-select { flex: 0 1 16rem; min-width: 0; }
.admin-filter-select select { width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (width < 768px) { .admin-filter-select { flex-basis: 100%; } }
.ui-button.admin-button--danger { color: var(--q-failed-text); }
@media (hover: hover) { .ui-button.admin-button--danger:hover { color: var(--q-failed-text); background: color-mix(in srgb, var(--q-failed) 10%, transparent); } }
.admin-actions-rule { width: 1px; height: 1.5rem; margin: 0 .25rem; background: var(--q-line); }
.ui-button.admin-copy { width: 1.5rem; height: 1.5rem; flex: none; color: var(--q-ink-3); }
.ui-button.admin-copy svg { width: .875rem; height: .875rem; color: currentColor; }
.admin-dt { font-size: .75rem; font-weight: 500; line-height: 1rem; color: var(--q-ink-2); }
.admin-shell .admin-table { font-size: .8125rem; color: var(--q-ink); }
.admin-shell .admin-table th { font-size: .75rem; font-weight: 500; color: var(--q-ink-2); white-space: nowrap; }
.admin-shell .admin-table :is(thead tr, tbody tr) { border-color: var(--q-line); }
@media (hover: hover) { .admin-shell .admin-table tbody tr:hover { background: var(--q-wash); } }

/* Admin index (#2478) */
/*
 * steepbun/subtito_rb#2478: an admin index is one card (Stephen, 2026-11-12, #2453), drawn by a
 * framed `DataTable` (src/web/admin/shared.tsx; docs/design.md, "Admin", "Index pages"): the
 * filters at its top (no title: the page bar names the page), then a note, the table to the
 * card's edges, and the count and pagination at its foot.
 *
 * - `.admin-index-filters`: the `FilterBar` (or Abuse Clusters' status chips), at the card's top,
 *   or under its head where it has a title (Cron Jobs' Runs).
 * - `.admin-index-note`: a quiet line above the table (Subtitle Providers' access hint).
 * - `.admin-table-scroll`: a wide table scrolls sideways inside its card, never the page.
 * - `.admin-row-menu`: a row's actions as a ⋯ menu (Stephen, 2026-11-12: "consistent menus"), the
 *   customer pages' `.ui-menu` on the native popover, placed by the admin-row-menu controller;
 *   a destructive item (`.admin-menu-danger`) in tomato after a rule (`.admin-menu-rule`).
 * - `.admin-empty`: the empty message where the rows would be.
 * - `.admin-index-foot`: "88 in all · Page 2 of 5" and the pages, as Top up's history foot has
 *   them.
 * - `.admin-import`: Email Block Rules' import form, a card of its own above the rules.
 * - `.admin-table--list`: below 768px each row is a list row, as the customer Translations list's
 *   are (Stephen, 2026-11-12, #2453: no scrolling a table's width on a phone). A cell's `data-m`
 *   places it: `main` (the record's name, `PhoneName`; the token only where it has none) with `status` and `act` (the ⋯) at the line's right end, then
 *   the `sub` cells as one grey line joined by dots, then `line` (a run's error) on its own; `hide`
 *   is left out. The column headings are kept for screen readers only.
 * - `.admin-access`: Subtitle Providers' access editor (its health page), in Quiet's radios and
 *   checks.
 * - `.status-pill` on an admin page (`StatusBadge`, and every helper still calling statusPill):
 *   a status, health, access or role is a small circle and its word, the customer pages' way
 *   (`.ui-status` beside the word on Translations), never a filled, bordered pill (Stephen,
 *   2026-11-12: "They look like buttons right now"). The accent's fill and a button's shape
 *   belong to buttons. Teal is the good state, yolk a warning, tomato a failure (its word in
 *   tomato), a grey ring off or waiting.
 * - Below 768px (Stephen, 2026-11-12: "cramped and overflowing" at 390): nothing is wider than
 *   the card. A list row's main line is the record's name (Stephen, 2026-11-13: never the token
 *   where it has an email, a title or a name), truncating, then the status and the ⋯; the
 *   whole row opens the record (the name's link stretched over it, as a customer Translations row
 *   is one link); a link in the grey line sits above it and opens its own page. The grey line
 *   holds at most two facts, each truncating, the second wrapping under the first when both
 *   don't fit; state that must stay whole (Integrations' access) is a `line` of its own, which
 *   wraps.
 *   A `PhoneLabel` names a fact the headings named. The filters stack at full width, 44px tall;
 *   more than two sit behind one "Filters" disclosure (`.admin-filter-more`), which is only a
 *   wrapper from 768px. Email Block Rules' import stacks the same way.
 */
.admin-index-filters { padding: .875rem 1rem; }
.port-card > .port-card-head + .admin-index-filters { padding-top: 0; box-shadow: none; }
.admin-index-filters > .admin-chips { margin: 0 -1rem; padding-inline: 1rem; }
/* Chips over a filter bar (the LLMs index, #784): a gap between the two rows. */
.admin-index-filters > .admin-chips + .admin-filters { margin-top: .75rem; }
.admin-index-note { padding: .625rem 1rem; font-size: .8125rem; line-height: 1.25rem; color: var(--q-ink-2); }
.admin-index-note p { margin: 0; }
.admin-table-scroll { overflow-x: auto; }
.admin-shell .admin-table .ui-button { white-space: nowrap; }
.admin-row-menu { display: flex; justify-content: flex-end; }
.ui-button.admin-row-menu-button { width: 1.875rem; color: var(--q-ink-2); }
.admin-row-menu-list form { display: block; }
.ui-menu .admin-menu-danger { color: var(--q-failed-text); }
.admin-menu-rule { margin: .3125rem .25rem; border: 0; border-top: 1px solid var(--q-line); }
.admin-empty { margin: 0; padding: 2rem 1rem; text-align: center; font-size: .875rem; color: var(--q-ink-2); }
.admin-index-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .625rem 1rem; font-size: .75rem; color: var(--q-ink-2); }
.admin-index-page { font-variant-numeric: tabular-nums; }
.admin-card-flush > .admin-index-foot { box-shadow: inset 0 1px 0 var(--q-line); }

.admin-import { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.admin-import-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.admin-import-file { flex: 1 1 14rem; }
.admin-file { max-width: 100%; font-size: .8125rem; color: var(--q-ink-2); }
.admin-file::file-selector-button { height: 2.125rem; margin-right: .625rem; padding: 0 .75rem; border: 0; border-radius: .5rem; font: inherit; font-weight: 500; color: var(--q-ink); background: var(--q-control); box-shadow: inset 0 0 0 1px var(--q-control-line), var(--q-control-shadow); cursor: pointer; }
@media (hover: hover) { .admin-file::file-selector-button:hover { background: var(--q-control-hover); } }
.admin-import-help { margin: .625rem 0 0; font-size: .75rem; line-height: 1rem; color: var(--q-ink-2); }

.admin-access { display: grid; justify-items: start; gap: .5rem; }
.admin-access-choices { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem 1rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.admin-choice { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; cursor: pointer; }
.admin-access-note { margin: 0; font-size: .75rem; line-height: 1rem; color: var(--q-ink-2); }

.admin-m-label { display: none; }
.admin-m-name { display: none; }

.admin-filter-more { display: contents; }
.admin-filter-summary { list-style: none; gap: .375rem; }
.admin-filter-summary::-webkit-details-marker { display: none; }
.admin-filter-summary svg { width: 1rem; height: 1rem; color: var(--q-ink-3); }
.admin-filter-count { min-width: 1.125rem; padding: 0 .3125rem; border-radius: 999px; font-size: .75rem; line-height: 1.125rem; font-variant-numeric: tabular-nums; color: var(--q-ink-2); background: var(--q-wash-strong); }
@supports selector(::details-content) {
  @media (width >= 768px) {
    .admin-filter-more > .admin-filter-summary { display: none; }
    .admin-filter-more::details-content { display: contents; content-visibility: visible; }
  }
}
@supports not selector(::details-content) {
  .admin-filter-more { display: block; flex-basis: 100%; }
  .admin-filter-more[open] > .admin-filter-summary { margin-bottom: .5rem; }
  .admin-filter-more > :not(summary) { margin-top: .5rem; }
}

.admin-shell .status-pill {
  display: inline-flex; align-items: center; gap: .375rem; max-width: 100%; padding: 0; border: 0; border-radius: 0;
  font-size: .8125rem; font-weight: 500; line-height: 1.25rem; color: var(--q-ink); background: none; opacity: 1;
}
.admin-shell .status-pill::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--admin-dot, var(--q-accent)); box-shadow: inset 0 0 0 1.5px var(--admin-dot-edge, transparent); }
.admin-shell :is(.status-pill-success, .status-pill-chosen, .status-pill-primary, .status-pill-secondary) { --admin-dot: var(--q-accent); }
.admin-shell .status-pill-info { --admin-dot: transparent; --admin-dot-edge: var(--q-accent); }
.admin-shell .status-pill-warning { --admin-dot: var(--q-needs); }
.admin-shell .status-pill-error { --admin-dot: var(--q-failed); color: var(--q-failed-text); }
.admin-shell :is(.status-pill-neutral, .status-pill-outline) { --admin-dot: transparent; --admin-dot-edge: var(--q-ink-3); color: var(--q-ink-2); }

@media (width < 768px) {
  .admin-filters { flex-direction: column; align-items: stretch; }
  .admin-filters > *, .admin-filter-more > :not(summary) { flex: none; width: 100%; }
  .admin-filters :is(.ui-field, .ui-select, .ui-button) { height: 2.75rem; }
  .admin-filter-more:not([open]) { display: block; }
  .admin-filter-more[open] { display: flex; flex-direction: column; gap: .5rem; }
  .admin-filter-summary { width: 100%; }
  .admin-import > * { flex: none; width: 100%; }
  .admin-import .ui-button { height: 2.75rem; }
  .admin-index-filters > .admin-chips { flex-wrap: wrap; margin: 0; padding-inline: 0; overflow: visible; }

  .admin-table-scroll:has(> .admin-table--list) { overflow: visible; }
  .admin-table--list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .admin-table--list, .admin-table--list tbody { display: block; width: 100%; }
  .admin-shell .admin-table--list { font-size: .875rem; }
  .admin-shell .admin-table--list tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: .5rem; min-height: 3.75rem; padding: .6875rem 1rem; }
  .admin-table--list tr + tr { border-top: 1px solid var(--q-line); }
  .admin-table--list tr::before { content: ""; order: 3; flex-basis: 100%; }
  .admin-table--list tr::after { content: ""; order: 5; flex-basis: 100%; }
  .admin-card .admin-table--list :is(th, td), .admin-table--list :is(th, td) { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; }
  .admin-table--list td[data-m="main"] { order: 1; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.375rem; }
  .admin-table--list td[data-m="main"] > span { display: flex; }
  .admin-table--list td[data-m="main"] :is(a, [data-clipboard-target="source"]) { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; overflow-wrap: normal; }
  .admin-table--list td[data-m="main"] a::after { content: ""; position: absolute; inset: 0; }
  .admin-table--list td[data-m="main"] > .admin-m-token { display: none; }
  .admin-table--list td[data-m="main"] > .admin-m-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--q-ink); text-decoration: none; }
  .admin-table--list :is(.admin-copy, [data-clipboard-target="flash"]) { display: none; }
  .admin-table--list td[data-m="status"] { order: 2; flex: 0 1 auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-table--list td[data-m="status"] > * { max-width: 100%; }
  .admin-table--list td[data-m="status"] .status-pill { display: flex; overflow: hidden; text-overflow: ellipsis; }
  .admin-table--list td[data-m="act"] { position: relative; z-index: 1; order: 2; flex: none; margin-right: -.375rem; }
  .admin-table--list .admin-row-menu-button::after { content: ""; position: absolute; inset: -.4375rem; }
  .admin-table--list td[data-m="sub"] { order: 4; flex: 0 1 auto; max-width: 100%; margin-top: .125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; line-height: 1.25rem; color: var(--q-ink-2); }
  .admin-table--list td[data-m="sub"]:has(~ td[data-m="sub"])::after { content: "·"; margin-left: .5rem; color: var(--q-ink-3); }
  .admin-table--list td[data-m="sub"] :is(a, .status-pill, span) { display: inline; }
  .admin-table--list td[data-m="sub"] a, .admin-table--list td[data-m="line"] a { position: relative; z-index: 1; }
  .admin-table--list td[data-m="sub"] .status-pill { font-size: inherit; font-weight: 400; color: inherit; }
  .admin-table--list td[data-m="sub"] .status-pill::before { display: inline-block; margin-right: .3125rem; vertical-align: .0625rem; }
  .admin-table--list td[data-m="sub"] .flex { display: inline; }
  .admin-table--list td[data-m="sub"] .flex > * + * { margin-left: .5rem; }
  .admin-table--list .admin-m-label::before { content: attr(data-label) " "; color: var(--q-ink-3); }
  .admin-table--list .admin-m-label { display: inline; }
  .admin-table--list td[data-m="line"] { order: 6; flex-basis: 100%; max-width: none; margin-top: .25rem; overflow: visible; font-size: .8125rem; line-height: 1.25rem; color: var(--q-ink-2); overflow-wrap: anywhere; white-space: normal; }
  .admin-table--list td[data-m="line"] .flex { flex-wrap: wrap; column-gap: .75rem; }
  /* A token in a fact (a charge's preview) keeps its copy button and "Copied" flash hidden: the sub
     cell's inline spans would otherwise show the flash beside it (#2637). */
  .admin-table--list td[data-m] :is(.admin-copy, [data-clipboard-target="flash"]) { display: none; }
  .admin-table--list td[data-m="hide"] { display: none; }
}

/*
 * 2FA's setup dialogs (src/web/two_factor_card.tsx, #2475, the mockups Stephen picked on #2473).
 * The QR code sits on white in either theme, so a camera reads it, in a square centred under the
 * description, with the key as text under it in DM Mono beside its Copy. "Open in authenticator
 * app" is for a phone, which can't scan its own screen: it shows only where hover is coarse and the
 * screen narrow. The recovery codes are a two-column grid of mono codes on the wash, then Copy and
 * Download, then the warning that they show only once. A copy's "Copied" replaces the button's
 * label for two seconds (the vendored clipboard controller's flash target).
 */
.q-2fa-open { display: none; margin: -.25rem 0 1rem; }
@media (max-width: 767px) and (pointer: coarse) { .q-2fa-open { display: block; } }
.q-2fa-qr { display: flex; justify-content: center; margin: 0 0 1rem; }
.q-2fa-qr > svg { width: 11.5rem; height: 11.5rem; padding: .25rem; border-radius: .625rem; background: #fff; box-shadow: inset 0 0 0 1px var(--q-line); }
.q-2fa-key-lede { margin-bottom: .5rem; }
.q-2fa-key { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; padding: .375rem .375rem .375rem .75rem; border-radius: .5rem; background: var(--q-wash); }
.q-2fa-key > code { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: .875rem; letter-spacing: .02em; color: var(--q-ink); overflow-wrap: anywhere; }
/* Each half moves to its own line whole, and wraps inside only on a screen too narrow for it. */
.q-2fa-key-half { display: inline-block; }
.q-2fa-copy { position: relative; flex: none; }
.q-2fa-copied { position: absolute; inset: 0; align-items: center; justify-content: center; gap: .25rem; border-radius: inherit; background: inherit; }
.q-2fa-notice { margin-bottom: 1rem; }
.q-2fa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .375rem 1rem; margin: 0 0 .75rem; padding: .875rem 1rem; border-radius: .625rem; background: var(--q-wash); font-family: var(--font-mono); font-size: .9375rem; letter-spacing: .04em; color: var(--q-ink); list-style: none; }
.q-2fa-codes > li { text-align: center; }
.q-2fa-codes-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
/* The code-or-recovery-code field's swap link, under its field (#2477), and the row's New recovery codes. */
.q-account-field + .q-2fa-field { margin-top: 1rem; }
.q-2fa-alt { margin-top: .5rem; font-size: .8125rem; }
.q-2fa-warn { font-size: .8125rem; font-weight: 500; color: var(--q-ink-2); }
@media (forced-colors: active) { .q-2fa-qr > svg { forced-color-adjust: none; } }

/* Admin forms (#2483) */
/*
 * steepbun/subtito_rb#2483: admin's new and edit forms and Settings in the card design
 * (src/web/admin/catalog.tsx's form kit; docs/design.md, "Admin", "Forms"). The controls are the
 * customer pages': `.ui-field`, `.ui-select`, `.ui-check`, `.ui-button`, labels `.q-label`.
 *
 * - `.admin-form`: the form, a column of `FormCard`s (`.admin-form-card`, a `.port-card`) as far
 *   apart as the page's cards.
 * - `.admin-form-body`: a card's content under its head; `.admin-form-grid` lays its fields out in
 *   one column on a phone and two from 768px (`--3`: three, for Pricing), `.admin-field--wide`
 *   taking the full width.
 * - `.admin-field`: the label over the control, then `.admin-hint` under it.
 * - `.admin-textarea`: a textarea in `.ui-field`'s look, which Quiet doesn't draw.
 * - `.admin-check`: a `.ui-check` and its label, its hint lined up with the label's text.
 * - `.admin-form-actions`: the last card's foot, under a hairline: Cancel quiet, then the teal
 *   submit, at its right end (the submit is first in the markup, so the row is reversed).
 * - Below 768px (#2483's phone fit, Stephen 2026-11-12): the buttons stack at the full width, the
 *   submit on top, and every control, button and checkbox row is at least 44px tall, whatever the
 *   pointer, with 16px type in the fields (a mono textarea, such as a provider's JSON, keeps its
 *   13px so code wraps less). Nothing here sets a width wider than
 *   its column: fields and controls shrink (`min-width: 0`) and a long value scrolls inside its
 *   own input, or wraps in a textarea. test/web/admin/form_phone_fit.test.tsx pins it.
 */
.admin-form { display: flex; flex-direction: column; gap: 1rem; }
.admin-form-body { display: grid; gap: .875rem; padding: .875rem 1rem 1rem; }
.admin-form-errors { margin: 0; }
.admin-form-errors ul { margin: 0; padding: 0; list-style: none; min-width: 0; overflow-wrap: anywhere; }
.admin-form-desc { margin: 0; font-size: .8125rem; line-height: 1.25rem; color: var(--q-ink-2); }
.admin-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .875rem 1rem; }
@media (width >= 768px) {
  .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.admin-field { display: grid; gap: .375rem; min-width: 0; align-content: start; }
.admin-field--wide { grid-column: 1 / -1; }
.admin-form-gap { display: none; }
@media (width >= 768px) { .admin-form-gap { display: block; } }
.admin-hint { margin: 0; font-size: .75rem; line-height: 1rem; color: var(--q-ink-2); }
.admin-input { width: 100%; }
.admin-input--mono, .admin-input--mono input { font-family: var(--font-mono, ui-monospace, monospace); }
.admin-select { display: flex; width: 100%; }
.admin-select select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.admin-textarea {
  display: block; width: 100%; min-width: 0; padding: .4375rem .625rem; border: 0; outline: 0; resize: vertical;
  border-radius: .5rem; background: var(--q-control); box-shadow: inset 0 0 0 1px var(--q-control-line), var(--q-control-shadow);
  color: var(--q-ink); font: inherit; font-size: .875rem; line-height: 1.25rem;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.admin-textarea.admin-input--mono { font-family: var(--font-mono, ui-monospace, monospace); font-size: .8125rem; }
.admin-textarea::placeholder { color: var(--q-ink-3); opacity: 1; }
.admin-textarea:focus-visible { background: var(--q-panel); box-shadow: inset 0 0 0 2px var(--q-focus), 0 0 0 3px var(--q-accent-wash); }
@media (pointer: coarse) { .admin-textarea { font-size: 1rem; } }
@media (forced-colors: active) { .admin-textarea { border: 1px solid CanvasText; } .admin-textarea:focus-visible { outline: 2px solid Highlight; } }
.admin-check { display: inline-flex; align-items: center; gap: .625rem; min-height: 1.5rem; font-size: .875rem; font-weight: 500; color: var(--q-ink); cursor: pointer; }
.admin-check-hint { padding-left: 1.625rem; }
.admin-form-actions { display: flex; flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: .5rem; padding: .75rem 1rem; }
@media (width < 768px) {
  .admin-form-actions { flex-direction: column; align-items: stretch; padding: 1rem; }
  .admin-form-actions > * { width: 100%; min-height: 2.75rem; justify-content: center; }
  .admin-form-card .ui-field, .admin-form-card .ui-select { height: 2.75rem; }
  .admin-form-card .ui-field input, .admin-form-card .ui-select select, .admin-textarea { font-size: 1rem; }
  .admin-textarea { min-height: 2.75rem; padding: .625rem .75rem; line-height: 1.5rem; }
  .admin-check { display: flex; min-height: 2.75rem; }
  /* The 44px row carries its own air: the grid's gap around it, and its hint's, close up. */
  .admin-field:has(> .admin-check) { gap: 0; margin-block: -.4375rem; }
}

/* Admin records (#2480) */
/*
 * steepbun/subtito_rb#2480: a record page in the card design (Stephen, 2026-11-12, #2453; docs/design.md
 * "Admin", "Record pages"): `RecordHead` and the section pieces in src/web/admin/shared.tsx, first used
 * by the user and profile pages (users.tsx, profiles.tsx).
 *
 * - `.admin-trail--record`: the bar's breadcrumb with the record's name as its last crumb
 *   (`.admin-trail-here`, ink, not a heading), taking the whole bar.
 * - `.admin-record`: the record's head, the page's first card: its name (`.admin-record-title`, the
 *   page's h1, a step over a card title), the token with its copy button, the status pills
 *   (`.admin-record-pills`), an optional quiet line, then the actions (`.admin-record-acts`) at the
 *   card's foot, over the card's hairline.
 * - `.admin-attrs`: AttributeList, a card's facts: label over value, 2/3/4 to a row.
 * - `.admin-card-foot`: a card's foot link ("View all payments"), right-aligned over a hairline.
 * - `.admin-form-row`: a short form in a card (Gift promo balance): Quiet's labelled fields
 *   (`.cf-pick`) and its button on one row, wrapping on a phone.
 * - `.admin-note`, `.admin-quiet`, `.admin-list`: a card's explanatory line and secondary text.
 */
.admin-trail--record { flex: 1 1 auto; max-width: none; }
.admin-trail--record li:not(.admin-trail-here) { flex: 0 1 auto; max-width: 45%; }
/* The first crumb is an index's short name ("Users"): the owner's email between it and the record shrinks first. */
.admin-trail--record li:first-child:not(.admin-trail-here) { flex-shrink: 0; }
.admin-trail-here { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--q-ink); }

.admin-record-main { display: grid; justify-items: start; gap: .375rem; min-width: 0; padding: 1rem 1rem .875rem; }
.admin-record-title { margin: 0; max-width: 100%; font-size: 1.25rem; font-weight: 600; line-height: 1.75rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.admin-record-token { max-width: 100%; color: var(--q-ink-2); }
.admin-record-pills { display: flex; flex-wrap: wrap; gap: .375rem; }
.admin-record-sub { margin: 0; font-size: .8125rem; color: var(--q-ink-2); overflow-wrap: anywhere; }
.admin-record-acts { padding: .75rem 1rem; }
/* #2637: an episode's code after a translation's title, its video ID under it, and the record's
   summary (a user's balance and usage, a translation's charge, price, time and tokens) between the
   head and the actions, over the card's hairline. */
.admin-record-title-aside { font-weight: 500; color: var(--q-ink-2); }
.admin-record-under { margin: -.25rem 0 0; max-width: 100%; font-family: var(--font-mono); font-size: .8125rem; color: var(--q-ink-2); overflow-wrap: anywhere; }
.admin-record-facts { padding: .875rem 1rem 1rem; box-shadow: inset 0 1px 0 var(--q-line); }
@media (width >= 1024px) { .admin-record-facts .admin-attrs { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.admin-record-facts .admin-dd { font-size: .9375rem; font-weight: 500; }
.admin-record-facts .admin-dd :is(.text-desc, .status-pill) { font-weight: 400; }
/* A section with nothing in it is its head alone (Panel's empty): the message where a count sits. */
.admin-card--empty > .port-card-head { padding-bottom: .875rem; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.admin-attrs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem 1rem; margin: 0; }
@media (width >= 768px) { .admin-attrs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (width >= 1024px) { .admin-attrs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.admin-attr { min-width: 0; }
.admin-dd { margin: .125rem 0 0; font-size: .875rem; line-height: 1.25rem; color: var(--q-ink); overflow-wrap: anywhere; }
.admin-dd.font-mono { font-size: .8125rem; }

.admin-card-foot { display: flex; justify-content: flex-end; padding: .5rem 1rem .625rem; font-size: .8125rem; box-shadow: inset 0 1px 0 var(--q-line); }
.port-card > .admin-card-flush:has(> .admin-card-foot) { padding-bottom: 0; }

.admin-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.admin-form-row .ui-field { width: 100%; }
.admin-form-row .ui-field input { width: 100%; min-width: 0; }
.admin-gift-amount { flex: 0 0 8rem; }
.admin-gift-memo { flex: 1 1 14rem; max-width: 28rem; }

.admin-note { margin: 0 0 .5rem; font-size: .8125rem; line-height: 1.25rem; color: var(--q-ink-2); }
.admin-note--after { margin: .75rem 0 0; }
.admin-quiet { font-size: .8125rem; color: var(--q-ink-2); }
.admin-list { display: grid; gap: .375rem; margin: 0; padding: 0; list-style: none; font-size: .875rem; }

/*
 * On a phone (Stephen, 2026-11-12, #2453: "the layout on mobile is extremely cramped and
 * overflowing"), a record page takes the customer pages' measure: the head's actions stack, each
 * the card's width and 44px tall, the destructive ones after a hairline; the gift form's fields and
 * button stack the same way; and the small controls (the breadcrumb's crumbs, a token's copy
 * button, a card's foot link) reach 44px to the touch without growing the page.
 */
@media (width < 768px) {
  .admin-record-acts .admin-actions { flex-direction: column; align-items: stretch; }
  .admin-record-acts .admin-actions > form, .admin-record-acts .admin-actions .ui-button { width: 100%; }
  .admin-record-acts .admin-actions .ui-button { justify-content: center; height: 2.75rem; }
  .admin-record-acts .admin-actions-rule { width: auto; height: 1px; margin: .125rem 0; }

  .admin-form-row { flex-direction: column; align-items: stretch; }
  .admin-form-row > .cf-pick { flex: none; max-width: none; }
  .admin-form-row .ui-field { height: 2.75rem; }
  .admin-form-row > .ui-button { justify-content: center; height: 2.75rem; }

  /* Quiet sets .tp-crumb's height (1.875rem), so the reach is the height; the margins keep the bar its size. */
  .admin-trail--record .tp-crumb { display: block; height: 2.75rem; margin-block: -.4375rem; line-height: 2.75rem; }
  :is(.admin-record, .admin-attrs) .admin-copy { position: relative; }
  :is(.admin-record, .admin-attrs) .admin-copy::after { content: ""; position: absolute; inset: -.625rem -.25rem; }
  .admin-card-foot { padding-block: 0; }
  .admin-card-foot > a { display: flex; align-items: center; min-height: 2.75rem; }

  /* A list row's main value with no page of its own to read it on (an email change's new address)
     wraps whole rather than ending in an ellipsis. */
  .admin-table--list td[data-m="main"].admin-m-whole { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
}

/* Admin tools (#2484) */
/*
 * steepbun/subtito_rb#2484: admin's two tool pages in the card design (docs/design.md, "Admin",
 * "Tool pages"): the Stremio simulator (src/web/admin/simulator.tsx) and a subtitle provider's
 * health page (src/web/admin/providers.tsx, providerHealthShow). Their cards are `Card`s, their
 * tables `DataTable`s with phone list rows, their search form the form kit's `FormCard`.
 *
 * - `.admin-health-rows`: a card of named states, one `.admin-health-row` each: the name, its
 *   dot and word, and a quiet line of detail; on a phone the name and the word share a line and
 *   the detail wraps under them. The health page's Provider card and the simulator's Results.
 * - `.admin-health-stats`: the health page's last 24 hours, the dashboard's tiles (`.admin-stats`).
 * - `.admin-health-access`: the Access card's hint and editor; on a phone each choice and Save is
 *   44px tall.
 * - `.admin-sim-*`: the simulator's pieces: `-code` an inline id in mono on the wash; `-main` a
 *   list row's main line, truncating on a phone; `-title` a subtitle's title, which wraps whole
 *   at every width (#2500: it has no other place to read it in full), as an offer's label and
 *   suppression reason do on their own `data-m="line"`; `-json` the client response, which
 *   wraps rather than scrolling sideways;
 *   `-sources` the source subtitles in groups by language; `-extras` the folded Stremio Extras.
 */
.admin-health-rows { margin: 0; }
.admin-health-row { display: grid; grid-template-columns: 10rem minmax(0, 1fr); column-gap: 1rem; align-items: baseline; padding: .625rem 1rem; font-size: .875rem; line-height: 1.25rem; }
.admin-health-row + .admin-health-row { box-shadow: inset 0 1px 0 var(--q-line); }
.admin-health-label { font-size: .8125rem; font-weight: 500; color: var(--q-ink-2); }
.admin-health-value { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.admin-health-desc { grid-column: 2; min-width: 0; margin: .125rem 0 0; font-size: .8125rem; color: var(--q-ink-2); overflow-wrap: anywhere; }
.admin-health-access { display: grid; gap: .75rem; }

.admin-sim-code { padding: .0625rem .3125rem; border-radius: .25rem; font-family: var(--font-mono, ui-monospace, monospace); font-size: .8125em; color: var(--q-ink); background: var(--q-wash); overflow-wrap: anywhere; }
.admin-sim-quiet { color: var(--q-ink-2); }
.admin-sim-native { font-style: italic; }
.admin-sim-mark { margin-left: .25rem; }
.admin-sim-suppressed { color: var(--q-ink-2); }
@media (width >= 768px) { .admin-sim-title { max-width: 20rem; white-space: normal; overflow-wrap: anywhere; } }
.admin-sim-status { color: var(--q-ink); }
.admin-sim-json {
  max-height: 28rem; margin: 0; padding: .75rem; overflow: auto; border-radius: .5rem; background: var(--q-wash);
  font-family: var(--font-mono, ui-monospace, monospace); font-size: .75rem; line-height: 1.125rem; color: var(--q-ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.admin-sim-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .75rem; }
.admin-sim-group { min-width: 0; padding: .625rem .75rem .75rem; border-radius: .5rem; background: var(--q-wash); }
.admin-sim-group-h { margin: 0 0 .375rem; font-size: .8125rem; font-weight: 600; line-height: 1.25rem; color: var(--q-ink); }
.admin-sim-group-list { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; font-size: .8125rem; line-height: 1.25rem; overflow-wrap: anywhere; }
.admin-sim-group-list .status-pill { display: inline-flex; margin-right: .25rem; vertical-align: top; }
.admin-sim-extras-summary { display: inline-flex; align-items: center; gap: .375rem; min-height: 1.75rem; font-size: .8125rem; font-weight: 500; color: var(--q-ink-2); cursor: pointer; list-style: none; }
.admin-sim-extras-summary::-webkit-details-marker { display: none; }
.admin-sim-extras-summary svg { width: 1rem; height: 1rem; color: var(--q-ink-3); transition: transform .15s ease; }
.admin-sim-extras[open] > .admin-sim-extras-summary svg { transform: rotate(90deg); }
.admin-sim-extras[open] > .admin-form-grid { margin-top: .5rem; }

@media (width < 768px) {
  .admin-health-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 2.75rem; align-items: center; }
  .admin-health-value { text-align: right; }
  .admin-health-desc { grid-column: 1 / -1; }
  .admin-health-access .admin-choice { min-height: 2.75rem; }
  .admin-health-access .ui-button, .ui-button.admin-health-toggle { min-height: 2.75rem; }
  .admin-health-access .ui-button { width: 100%; justify-content: center; }
  .admin-table--list td[data-m="main"] > .admin-sim-main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-table--list td[data-m="main"].admin-sim-title, .admin-table--list td[data-m="main"].admin-sim-title > .admin-sim-main { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
  .admin-sim-extras-summary { min-height: 2.75rem; }
}

/* Admin records II (#2482) */
/*
 * steepbun/subtito_rb#2482: the translation, payment, abuse cluster and audit entry pages in the
 * record pattern ("Admin records (#2480)" above; docs/design.md "Admin", "Record pages").
 *
 * - `.admin-code`: a block of JSON on the wash (a translation's options snapshot, an event's
 *   metadata), wrapping rather than scrolling sideways.
 * - `.admin-event-message`: an event's message, which has no other page, so it wraps whole at every
 *   width (#2500); `.admin-event-meta` its folded metadata.
 * - `.admin-restore-amount`, `.admin-restore-reason`: the Restore clawed balance form's fields, in
 *   the gift form's row (`.admin-form-row`).
 * - `.admin-wrap`: a long link or list (the parent translation, a cluster's extensions) that wraps.
 * - `.admin-policy`: an LLM row's Free model or Retired label, a `StatusBadge` after its name.
 */
.admin-code {
  max-height: 28rem; margin: 0; padding: .75rem; overflow: auto; border-radius: .5rem; background: var(--q-wash);
  font-family: var(--font-mono, ui-monospace, monospace); font-size: .75rem; line-height: 1.125rem; color: var(--q-ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* A record's last crumb is a block, so it ends in an ellipsis: `.admin-trail li`'s flex outranked
   `.admin-trail-here`'s block, and the name ran past the bar on a phone (the profile and translation
   pages' three crumbs did, #2482). */
.admin-trail--record li.admin-trail-here { display: block; }
.admin-event-message { max-width: 20rem; white-space: normal; overflow-wrap: anywhere; }
.admin-event-meta > summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; font-size: .8125rem; }
.admin-event-meta > summary::-webkit-details-marker { display: none; }
.admin-event-meta > .admin-code { min-width: 14rem; margin-top: .375rem; }
.admin-wrap { overflow-wrap: anywhere; }
.admin-restore-amount { flex: 0 0 10rem; }
.admin-restore-reason { flex: 1 1 14rem; max-width: 28rem; }
.admin-policy { display: inline-flex; margin-left: .375rem; vertical-align: middle; }

@media (width < 768px) {
  .admin-event-message { max-width: none; }
  .admin-event-meta > summary { min-height: 2.75rem; }
  .admin-event-meta > .admin-code { min-width: 0; margin-top: 0; }
  a.q-link.admin-wrap { display: flex; align-items: center; min-height: 2.75rem; }
}
