/* --- Route visibility --------------------------------------------------- */
/* Mirrors guide.css: BingoView toggles body.route-bingo and CSS owns the swap. */
#bingoView { display: none; }
body.route-bingo .table-container,
body.route-bingo #tableFooter { display: none; }
body.route-bingo #bingoView { display: block; }
/* The live-updates strip carries every wording (see LiveUpdatesWarning.js);
   the species one by default, the bingo one on board pages, and a plain one
   on shared boards, whose viewers have nothing to save. A shared page has
   both route classes and the selectors tie, so the shared rules come last. */
.live-warning-bingo, .live-warning-shared,
body.route-bingo .live-warning-species { display: none; }
body.route-bingo .live-warning-bingo { display: inline; }
body.route-bingo-shared .live-warning-bingo { display: none; }
body.route-bingo-shared .live-warning-shared { display: inline; }

.bingo-view { padding: 1rem 16px 3rem; max-width: 72rem; margin: 0 auto; }
.bingo-heading { font-size: 1.4rem; margin: 0 0 1rem; }
.bingo-heading:focus { outline: none; }
.bingo-message { color: var(--surface-8); text-align: center; padding: 2rem 0; }

/* --- Header feature icons ----------------------------------------------- */
/* The header spaces its items apart, which left the icons floating midway
   between the logo and the search box; the auto margin takes the free space
   instead, so the icons sit by the logo and the search stays at the right. */
.header-nav { display: flex; align-items: center; gap: .5rem; margin-right: auto; }
.header-nav-link { font-size: 1.25rem; }

/* --- Creator ------------------------------------------------------------ */
.bingo-creator { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.bingo-creator-name { flex: 1 1 12rem; min-width: 0; }
/* The sex choice (.segmented, css/styles.css) and the + stretch to the
   input's height, so the row reads as one bar of controls. The + keeps the
   global button padding, the same as the input's: stretch only reaches the
   height of its own line, so when the + wraps alone its padding sets it. */
.bingo-creator-sex, .bingo-creator-add { align-self: stretch; }
.bingo-creator .inline-error { flex-basis: 100%; }

/* --- List controls ------------------------------------------------------ */
/* Season filter and "Just one / Multiples", centred as one set of list
   options; on a phone each toggle wraps onto its own centred line. */
.bingo-list-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-bottom: 1rem; }

/* --- List rows ---------------------------------------------------------- */
.bingo-row { border: 1px solid var(--surface-5); border-radius: 8px; margin-bottom: .75rem; background: var(--surface-2); }
.bingo-row-summary { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; cursor: pointer; list-style: none; }
.bingo-row-summary::-webkit-details-marker { display: none; }
.bingo-row-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Normal weight so it reads as a count beside the bold name, not part of it.
   Dimmer while Show mine is off: that number is last-known, not kept current. */
.bingo-row-owned { font-weight: normal; color: var(--surface-8); margin-left: .5rem; }
.bingo-row-owned.is-stale { color: var(--surface-5); }
.bingo-row-count { color: var(--surface-8); font-variant-numeric: tabular-nums; }
/* Fixed width so names line up whichever season icon a row shows. */
.bingo-season { width: 1.1rem; text-align: center; color: var(--surface-8); }
.bingo-row-board { padding: .5rem; }
/* A screen of room while the board loads, so an opened row can always
   scroll to the top (BingoList.onToggle); dvh tracks a phone's toolbar. */
.bingo-row-board.is-loading { min-height: 100vh; min-height: 100dvh; }
/* Native size, like the sprites: capsules are pixel art, and any scaling
   blurs or distorts them. */
.bingo-capsule { image-rendering: pixelated; vertical-align: middle; }
.bingo-capsule-placeholder { font-size: 1.3rem; color: var(--surface-7); }
/* A fixed slot, so season icons and names line up whatever size each
   capsule is: the widest measured (2026-10-27) is 23px, plus room to spare
   so a slightly wider one doesn't need a remeasure. */
.bingo-row-capsule { flex: none; width: 26px; display: flex; justify-content: center; align-items: center; }

/* --- Board -------------------------------------------------------------- */
/* The board scrolls inside itself on very narrow screens, so the page
   itself never scrolls sideways. rtl makes the box open scrolled to the
   far right, so the cells are in view and the headers are a scroll away,
   and keeps it anchored there as sprites load; the table switches back. */
.bingo-scroll { overflow-x: auto; direction: rtl; }
/* The global table rule stretches the species table to 100% (min 600px);
   a board hugs its content, so the spare width stops landing in the
   header columns. */
.bingo-table { direction: ltr; border-collapse: collapse; margin: 0 auto; width: auto; min-width: 0;
    /* Wide enough that an empty grid's columns line up under the headers. */
    --bingo-cell-min: 75px; }
/* The global tr:hover highlight is for the clickable species rows on /. */
.bingo-table tr:hover { background-color: transparent; cursor: auto; }
.bingo-table th, .bingo-table td { border: 1px solid var(--surface-5); padding: 4px; text-align: center; vertical-align: middle; }
/* Thick group lines, as on the reference spreadsheet cards: under the
   header rows, between the row headers and the cell columns (up through the
   header, left of the last locus and its first variant), and on layout A
   between outer-locus groups. Collapsed borders let the wider one win, so
   only these edges need setting. Gap and panel cells are tds and row
   headers are ths, so :first-of-type finds each row's first column. */
.bingo-grid tbody tr:first-child > *,
.bingo-grid .bingo-group-start > * { border-top: 3px solid var(--surface-5); }
.bingo-grid thead tr:first-child > th:last-of-type,
.bingo-grid thead tr:last-child > th:first-of-type,
.bingo-grid tbody td:first-of-type { border-left: 3px solid var(--surface-5); }
/* The global th rule makes headers sticky for the species table. Sticky
   starts a stacking context per header, which would paint the header cells
   over the gear menu and its messages hanging down from the panel. The
   board never scrolls vertically inside itself, so sticky buys nothing. */
.bingo-table th { position: static; }
.bingo-locus { background: var(--surface-3); font-weight: 700; }
/* Locus names sit just above what they head: the row loci their columns of
   row headers, the last locus the variant row below it. Scoped to the table
   so it outranks the board's centre/middle th rule above. */
.bingo-table .bingo-locus { vertical-align: bottom; }
.bingo-variant { background: var(--surface-2); font-weight: 600; }
/* A long variant name wraps instead of widening its column. Table cells
   ignore max-width, so the cap goes on the label. */
.bingo-variant .bingo-label { display: inline-block; min-width: 3.5rem; max-width: 5rem; white-space: normal; vertical-align: middle; }
/* Blank space under the row loci, beside the last locus's variants. */
.bingo-header-gap { background: var(--surface-3); }
.bingo-label { cursor: text; overflow-wrap: anywhere; }
.is-read-only .bingo-label { cursor: default; }

/* The panel is a td (see render()), so it sets the header colour itself.
   overflow-wrap lets a long name or subtitle break inside a narrow panel. */
.bingo-panel { background: var(--surface-1); color: var(--brand-2); text-align: left; overflow-wrap: anywhere; }
/* width 0 + min-width 100% keeps the panel out of column sizing: the cell
   columns are sized only by their cells, and a sparse board gets a taller
   panel instead of wider columns. On a panel too narrow for one line, the
   text wraps onto its own line rather than shrinking to nothing. */
.bingo-panel-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; width: 0; min-width: 100%; }
.bingo-panel-text { flex: 1 1 6rem; min-width: 0; }
/* Capsule pinned top-left and gear bottom-right of the panel; margin-left
   keeps the gear right even when it wraps onto its own line. Storage's
   −/+ sit where the gear does. Relative for the capsule form that floats
   from it; no z-index, so no stacking context (see the static-th note). */
.bingo-panel-capsule { align-self: flex-start; position: relative; }
.bingo-panel-menu, .bingo-storage-actions { align-self: flex-end; margin-left: auto; }
.bingo-panel-name { font-size: 1.1rem; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
/* Sex and the x/27 count sit at the right of the name line. */
.bingo-panel-sex { margin-left: auto; }
/* Added by sexIconHtml only. The creator's sex toggle builds its icons
   without it, so it keeps the segmented colours with no override. */
.bingo-sex-neutral { color: var(--sex-neutral); }
.bingo-sex-female { color: var(--sex-female); }
.bingo-sex-male { color: var(--sex-male); }
.bingo-panel-count { font-size: .85rem; color: var(--surface-8); font-weight: 400; }
.bingo-subtitle { font-size: .85rem; color: var(--surface-8); }
.bingo-placeholder { font-style: italic; opacity: .7; }

.bingo-cell { min-width: var(--bingo-cell-min); height: 42px; }
.bingo-cell.is-empty { width: var(--bingo-cell-min); }
/* An inset, rounded cell tint. It's a ::before layer because border-radius
   is ignored on collapsed table cells, so the td's own background can't be
   rounded. isolation keeps the z-index: -1 layer above the cell's background
   and below its content; the stacking context it starts sits at z-index 0,
   so the open gear menu (20) and board messages (15) still cover it. */
.bingo-tint { position: relative; isolation: isolate; }
.bingo-tint::before { content: ""; position: absolute; inset: 4px; border-radius: .5rem;
    z-index: -1; background: var(--bingo-tint); }
/* The tints use only the -bg values: the amber and red flag icons use the
   matching -text values, which are built to read on these, so a flag never
   vanishes into a highlighted cell. Later rules win: red beats amber when a
   cell matches on both, and green ("Show mine") beats both, since a user
   can turn Show mine off to see the duplicates again. */
.bingo-cell.is-dup-juv { --bingo-tint: var(--warning-bg); }
.bingo-cell.is-dup-adult { --bingo-tint: var(--error-bg); }
.bingo-cell.is-mine { --bingo-tint: var(--approval-bg); }
.bingo-sprites { display: flex; gap: 4px; justify-content: center; align-items: center; }
/* A juvenile stands on the same ground line as its taller adult. */
.bingo-sprite-juv { align-self: flex-end; }
/* Native size: TFO sprites are pixel art, and any scaling blurs or
   distorts them. pixelated still guards against browser zoom. */
.bingo-sprite { width: auto; height: auto; image-rendering: pixelated; }
/* A missing sprite takes the same slot as the hourglass, so a cell with
   one sprite lines up the same way whatever fills the other side. */
.bingo-sprite-empty { display: inline-block; width: 1.75rem; }
.bingo-meta { display: flex; justify-content: center; align-items: center; gap: .3rem; font-size: .8rem; }
.bingo-code { font-family: monospace; }
.bingo-gone { color: var(--error-inline); }
.bingo-stunted { color: var(--brand-3); }
/* A fixed slot: the hourglass and the amber ! have different glyph widths,
   so without it the cell resizes each time they swap. */
.bingo-hourglass { display: inline-block; width: 1.75rem; flex: none; padding: 0; text-align: center;
    color: var(--surface-8); font-size: 1.1rem; }
/* Locked while its check runs (or the still-growing flash plays); a pointer
   cursor would promise a click that does nothing. Read-only, the hourglass
   is a plain status icon with no .icon-btn, so it never gets a pointer. */
.bingo-hourglass[aria-disabled="true"] { cursor: default; }
.bingo-add { width: 100%; height: 100%; min-height: 34px; color: var(--surface-6); }
/* Unlike the other icon buttons, the + keeps a fill: the whole empty cell
   is its target, and the cell tints are modelled on this rounded fill. */
.bingo-add:hover, .bingo-add:focus-visible { background: var(--brand-1); }
.bingo-back { display: inline-block; margin-bottom: .75rem; }

/* --- Storage ------------------------------------------------------------ */
/* A second .bingo-table, so it centres and its cells match the grid's.
   The panel stays out of column sizing (see .bingo-panel-inner), so with no
   rows nothing would give the table a width; the floor is three cells wide
   (each cell's 4px padding a side plus its border), whatever the row count. */
.bingo-storage { margin-top: 1rem; min-width: calc(3 * (var(--bingo-cell-min) + 9px)); }
/* Three filled cells outgrow a phone, so storage scrolls inside itself like
   the board. Left to right, unlike .bingo-scroll: it has no row headers to
   scroll past, and its first cell is where a reader starts. */
.bingo-storage-scroll { overflow-x: auto; }
.bingo-storage-actions { display: flex; gap: .25rem; }

/* --- Editing ------------------------------------------------------------ */
.bingo-code-form { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; justify-content: center; }
.bingo-code-form input { width: 6.5em; text-align: center; }
.bingo-cell-error { flex-basis: 100%; font-size: .75rem; color: var(--error-inline); }
/* In the capsule slot the form floats over the board from where the
   capsule was, top-left, so the panel doesn't reflow around it
   (openCapsuleEditor holds the slot at the vial's size), and its error
   reads down from there. It sits at the board messages' level; it never
   meets the gear menu (20), since opening the menu closes the form.
   inline-size containment stops a long
   error widening the form: it wraps to the input + ✔ width instead. */
.bingo-capsule-form { justify-content: flex-start; position: absolute; left: 0; top: 0; z-index: 15;
    width: max-content; padding: .25rem; }
.bingo-capsule-form .bingo-cell-error { contain: inline-size; text-align: left; }
.bingo-inline-input { width: 100%; min-width: 4em; }
/* A rename floats over its header cell. position: relative without a
   z-index doesn't start the stacking context the static-th note warns
   about. inlineEdit() sets top to the label's centre, so the input covers
   the name it replaces and stays one line in a tall rowspan header. */
.bingo-table th.is-editing { position: relative; }
.bingo-inline-input.bingo-th-input { position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
    width: calc(100% - 4px); min-width: 0; box-sizing: border-box;
    /* The global input padding makes it taller than a one-line header. */
    padding: 2px 4px; }
/* Board messages hang under the gear, where the action was taken, and share
   the gear menu's dropdown surface (see the Gear menu block). Below the open
   menu (z-index 20) so a reopened menu still covers a lingering one. */
.bingo-panel-menu { position: relative; }
.bingo-flash { position: absolute; right: 0; top: 100%; z-index: 15; margin: .25rem 0 0; width: max-content; }
/* Board messages are sized like the shared hover tip (.tip in css/tip.css),
   so a message and a hover read as the same kind of note. */
.bingo-flash { max-width: 16rem; padding: .35rem .6rem; font-size: .85rem; font-weight: 400;
    text-align: left; overflow-wrap: anywhere; }
/* Tones reuse the site's colour trios, as the tip's do: approval (as on the
   changelog's Approve button) for confirmations, warning (as on the warning
   banner) for heads-ups. */
.bingo-flash.is-success { background: var(--approval-bg); border-color: var(--approval-border); color: var(--approval-text); }
.bingo-flash.is-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
/* A board-wide change in flight: dim the grid and keep pointers off cells
   that are about to be replaced. */
.bingo-board.is-busy { cursor: progress; }
.bingo-board.is-busy tbody { opacity: .55; pointer-events: none; }
/* Amber "still growing" flag, using the warning token so it reads in both themes. */
.bingo-still-growing { color: var(--warning-text); }
/* Red "check failed" mark, using the error token so it reads in both themes. */
.bingo-check-failed { color: var(--error-text); }
/* The vial sets its own resting colour, so it takes the button's hover
   colour from here instead. */
.bingo-capsule-btn { padding: 0; color: var(--surface-7); }
.bingo-capsule-btn .bingo-capsule-placeholder { color: inherit; }

/* --- Gear menu ---------------------------------------------------------- */
.bingo-menu { position: relative; }
.bingo-gear, .bingo-storage-btn, .bingo-link-btn { color: inherit; font-size: 1.2rem; }
.bingo-gear i { transition: transform .25s ease; }
.bingo-menu.is-open .bingo-gear i { transform: rotate(90deg); }
/* The dropdown surface, shared by the menu, the board messages under it and
   the floating capsule form. The shared tip (css/tip.css) uses the same
   fill but a stronger border, and this drops in with its keyframe. */
.bingo-menu-list, .bingo-flash, .bingo-capsule-form { background: var(--surface-2); border: 1px solid var(--surface-5); border-radius: 8px;
    animation: tip-drop .15s ease-out; }
.bingo-menu-list { position: absolute; right: 0; top: 100%; z-index: 20; display: flex; flex-direction: column;
    min-width: 12rem; padding: .25rem; }
/* The display:flex above would otherwise beat the UA's [hidden] rule and keep the menu open. */
.bingo-menu-list[hidden] { display: none; }
.bingo-menu-list button { text-align: left; background: none; border: 0; color: inherit; padding: .4rem .6rem; border-radius: 4px; cursor: pointer; }
.bingo-menu-list button:hover, .bingo-menu-list button:focus-visible { background: var(--surface-4); }
/* Thumb-sized items on touch screens (44px is the usual minimum target);
   a mouse keeps the compact menu. */
@media (pointer: coarse) { .bingo-menu-list button { min-height: 44px; } }
.bingo-menu-list button:disabled, .bingo-storage-btn:disabled,
.bingo-menu-list button[aria-disabled="true"],
.bingo-storage-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.bingo-menu-list [aria-checked="true"]::before { content: "✓ "; }
.bingo-menu-list .is-danger { color: var(--error-inline); }

/* --- Drag & move -------------------------------------------------------- */
.bingo-handle { color: var(--surface-7); cursor: grab; padding: 0 2px;
    /* The grip is the touch drag start, so the browser must not pan from it. */
    touch-action: none; opacity: 0; }
.bingo-table th:hover .bingo-handle, .bingo-cell:hover .bingo-handle,
.bingo-handle:focus-visible { opacity: 1; }
/* A header's grip floats at the cell's right edge, out of the name's line,
   so the name stays centred even when a squeezed column wraps it.
   position: relative without a z-index starts no stacking context (see the
   static-th note). */
.bingo-table th:has(> .bingo-handle) { position: relative; }
.bingo-table th > .bingo-handle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
/* Locus names sit on the bottom edge, so their grip does too, raised to
   line up with the name's last line rather than the cell's border. */
.bingo-table .bingo-locus > .bingo-handle { top: auto; bottom: 9px; transform: none; }
/* A cell's code line keeps its grip inline, after the code and sex icon
   one flex gap away, so matching left padding centres the code. */
.bingo-meta:has(> .bingo-handle) { padding-left: calc(12px + .3rem); }
/* No hover on touch screens: show the grips all the time there. */
@media (pointer: coarse) { .bingo-handle { opacity: 1; } }
.drag-ghost { position: fixed; left: 0; top: 0; pointer-events: none; opacity: .85; z-index: 1001;
    background: var(--surface-3); border: 1px solid var(--brand-3); border-radius: 6px; }
.is-drag-source { opacity: .4; }
.is-drop-target, .is-move-target { outline: 2px dashed var(--brand-3); outline-offset: -2px; }
.is-move-target:focus { outline-style: solid; }
/* In Move… the picked item's grip is the ✕ that cancels, so it stays
   undimmed and its ✕ shows without hover (touch has no Escape). */
.is-drag-source.is-move-source { opacity: 1; outline: 2px solid var(--brand-3); outline-offset: -2px; }
.is-move-source .bingo-handle { opacity: 1; }

/* The spritesheet is ~850x1700 and its small text only reads at 1:1, so the
   image keeps its real size and the frame pans in both directions; this also
   stops a tall image pushing the dialog's buttons off a short screen. */
.spritesheet-preview {
    /* Without min-width: 0 the 1:1 image's width props the card open past a
       phone's width; the frame must scroll sideways instead. */
    min-width: 0;
    max-width: 100%;
    max-height: 50vh;
    /* overflow: auto lets a flex item shrink to nothing on a short screen;
       this keeps a readable slice, and the card scrolls past it instead. */
    min-height: 150px;
    overflow: auto;
    border: 1px solid var(--surface-6);
    border-radius: .5rem;
    background: var(--surface-5);
}

.spritesheet-preview img {
    display: block;
    max-width: none;
    image-rendering: pixelated;
}

/* The display rules above and the spinner's flex would otherwise override the
   hidden attribute that swaps spinner and image. */
.spritesheet-preview [hidden] {
    display: none;
}

/* The spritesheet dialog only. The card is a flex item of the overlay, so
   min-width: 0 lets it shrink below its widest content on a phone; the
   max-height keeps Save and the links reachable, with the preview frame (a
   direct child, overflow: auto) giving up the height. */
.spritesheet-card {
    min-width: 0;
    max-height: 90vh;
    /* Last resort: once the preview frame has shrunk to nothing the rest of
       the content still overflows the cap, and must scroll rather than
       strand Save/Close off-screen. */
    overflow-y: auto;
    /* Tighter than .auth-card's 1rem so the preview keeps its height on phones. */
    gap: .5rem;
}

/* A label and its Light/Dark switch share a row, centred; the row wraps
   rather than overflow at 320px. Also stops the column stretching the
   switch across the card. */
.spritesheet-card div:has(> .segmented) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
}

/* The base styles only grey a disabled submit button, so Cancel, Close, Copy
   and the switch looked live mid-save. Same dimming as the submit buttons. */
.spritesheet-card button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Download PNG and View on My spritesheets are <a>s, which have no :disabled,
   so setBusy marks them aria-disabled; the same dimming, and no clicks while
   the save runs. */
.spritesheet-card a[aria-disabled="true"] {
    opacity: .4;
    pointer-events: none;
}
/* Buttons take the UA's line-height: normal, so they sat shorter than
   Download PNG, which inherits the body's 1.6. Every dialog button gets the
   anchor's taller height (Copy link already matched by stretching beside it).
   My spritesheets stacks the pair, where nothing stretches it, so it needs this too. */
.spritesheet-card .lab-link-actions button,
.spritesheet-row .lab-link-actions button {
    line-height: 1.6;
}

/* The divider between the Current pair and the replace section. The margin
   adds to the card's .5rem gap so the two sections read as separate. */
.spritesheet-card hr {
    width: 100%;
    margin: .5rem 0;
    border: 0;
    border-top: 1px solid var(--surface-6);
}

/* Download PNG is an <a> (it needs href), but should look like its
   neighbour, the Copy link button, and share the row's width equally.
   13.3333px is the UA button font size the buttons render at. My
   spritesheets shares it, so its buttons match the dialog's. */
.spritesheet-card .link-btn,
.spritesheet-card .link-btn:hover,
.spritesheet-row .link-btn,
.spritesheet-row .link-btn:hover {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: .5rem 1rem;
    border-radius: .5rem;
    background: var(--brand-2);
    color: var(--surface-9);
    font-size: 13.3333px;
    font-weight: bold;
    text-decoration: none;
}

.spritesheet-card .link-btn:hover,
.spritesheet-row .link-btn:hover {
    background: var(--brand-1);
}

/* The UA's paragraph/heading margins and .banner's 20px stack on the gap. */
.spritesheet-card h3,
.spritesheet-card p,
.spritesheet-card .banner {
    margin: 0;
}

.spritesheet-card form {
    gap: .5rem;
}

/* --- My spritesheets ---------------------------------------------------- */
/* Only the row and the thumbnail have classes. Everything else is styled by
   position in SpritesheetsView.rowHtml/imageHtml: the head comes first and
   the images last, and in each image block the thumbnail comes before its
   column. Reordering that markup breaks these rules, so change both together. */

/* A .bingo-row with no <summary> to pad it, so the row pads itself. */
.spritesheet-row {
    padding: .5rem;
}

/* An orphan's note is a caution, not part of the name, so it drops the
   name's weight and takes the warning amber. */
.spritesheet-orphan {
    font-weight: normal;
    color: var(--warning-text);
}

/* Copy both links' result, under the head and lined up with its buttons
   on the right. Copy link's own result sits under that image's buttons. */
.spritesheet-row > .lab-link-text {
    margin-top: .5rem;
    text-align: right;
}

/* Head: the name on the left; the sex, date and Delete group on the right. */
.spritesheet-row > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
}

/* The name keeps its words whole. Without .bingo-row-name's flex: 1 and
   overflow-wrap: anywhere, a narrow screen wraps the right-hand group onto
   its own line instead of breaking the name letter by letter. break-word
   only splits a single word too long for the line. */
.spritesheet-row > div:first-child > :first-child {
    font-weight: 600;
    min-width: 0;
    overflow-wrap: break-word;
}

/* margin-left keeps the group on the right when it wraps under the name.
   The group wraps too, from the right, since two buttons beside the sex
   and date don't fit across 320px. */
.spritesheet-row > div:first-child > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem .6rem;
    margin-left: auto;
}

/* Light and Dark side by side, stacking once two blocks don't fit across
   (a phone, a narrow window). min() lets one block shrink below 18rem at 320px. */
.spritesheet-row > div:last-child {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: .75rem 1.5rem;
    margin-top: .5rem;
}

/* An image block: the thumbnail, then its column, sitting at the bottom of
   the thumbnail's height. */
.spritesheet-row > div:last-child > div {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
}

/* The label above the stacked buttons. Capped so the buttons stay button
   sized on a wide screen, rather than stretching across half the page. */
.spritesheet-row > div:last-child > div > div {
    flex: 1;
    min-width: 0;
    max-width: 14rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* Download PNG over Copy link, each the column's full width. */
.spritesheet-row .lab-link-actions {
    flex-direction: column;
    gap: .5rem;
    margin-top: 0;
}

/* The copy fallback's field. An input's intrinsic width would otherwise
   push the column wider than a phone allows. */
.spritesheet-row input {
    min-width: 0;
}

/* Scaled down, unlike the dialog's 1:1 preview: the row only has to show
   which spritesheet it is, and the full image is a Download away. The img's
   width/height attributes give it its ratio before it loads. A spritesheet
   widens with its columns, sprites and title, so a fixed height alone would
   push a wide one past a phone's width. With both sizes auto, the two caps
   scale it down whole, keeping its ratio: a tall one stops at 12rem high, a
   wide one at half its block, leaving the buttons the other half. */
.spritesheet-thumb {
    display: block;
    flex: none;
    width: auto;
    height: auto;
    max-width: 50%;
    max-height: 12rem;
    border: 1px solid var(--surface-6);
    border-radius: .5rem;
    background: var(--surface-5);
}
