html, body {
    font-family: system-ui, sans-serif;
}

/* Native controls and scrollbars follow the active palette (ThemeVariables, #300). */
:root { color-scheme: var(--mud-native-html-color-scheme); }

/* Base elements (#380): the element defaults Bootstrap's reboot set before; MudBlazor's reset zeroes margins and padding. Values as in Bootstrap 5.3 except the headings: one fixed scale for all pages (h1 = page title, same size as the title bar). */
*, ::before, ::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: var(--pn-space-2); font-weight: var(--pn-weight-medium); line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: var(--pn-text-lg); }
@media (max-width: 450px) { h1 { font-size: 1.15rem; } h2 { font-size: 1.1rem; } }
h3 { font-size: 1.125rem; }
h4 { font-size: var(--pn-text-md); }
h5 { font-size: .9375rem; }
h6 { font-size: var(--pn-text-sm); }
/* Dialog frame (#784): brand stripe on top (dark mode only, --pn-dialog-stripe), hairlines under the title and over the actions, one surface; the content is the only scroll area.
   --pn-dialog-divider comes from AppTheme (both modes). Fullscreen dialogs keep MudBlazor's frame. */
:root { --pn-dialog-target-height: min(736px, calc(100dvh - 64px)); }
.mud-dialog:not(.mud-dialog-fullscreen) { position: relative; overflow: hidden; border-radius: var(--pn-radius-md); }
.mud-dialog:not(.mud-dialog-fullscreen)::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
    height: 4px;
    background: var(--pn-dialog-stripe);
    pointer-events: none;
}
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title {
    padding: var(--pn-space-4);
    border-bottom: 1px solid var(--pn-dialog-divider);
}
/* «X» at the end of the title row, centred on it; the title text keeps clear of it. */
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title:has(> .mud-button-close) { position: relative; padding-inline-end: calc(var(--pn-space-2) + 48px); }
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-title > .mud-button-close { top: 50%; right: var(--pn-space-2); transform: translateY(-50%); }
.mud-dialog-title .mud-typography { font-size: var(--pn-text-lg); font-weight: var(--pn-weight-medium); line-height: 1.3; }
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-content:not(.mud-dialog-no-side-padding) { padding: var(--pn-space-4); }
/* Dialog note (DialogNote): the first line of the content, small secondary text; it covers the top padding, so it sits at the top edge while the content scrolls under it. */
.mud-dialog-content .pn-dialog-note {
    position: sticky;
    top: calc(-1 * var(--pn-space-4));
    z-index: 2;
    flex: none;
    margin: calc(-1 * var(--pn-space-4)) 0 0;
    padding: var(--pn-space-4) 0 var(--pn-space-3);
    background: var(--mud-palette-surface);
    font-size: var(--pn-text-sm);
    color: var(--mud-palette-text-secondary);
}
/* Note at the end (DialogNote Bottom): the last line of the content, it covers the bottom padding and stays at the bottom edge. */
.mud-dialog-content .pn-dialog-note.pn-dialog-note-bottom { top: auto; bottom: calc(-1 * var(--pn-space-4)); margin: 0 0 calc(-1 * var(--pn-space-4)); padding: var(--pn-space-3) 0 var(--pn-space-4); }
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions {
    gap: var(--pn-space-2);
    padding: var(--pn-space-3) var(--pn-space-4);
    border-top: 1px solid var(--pn-dialog-divider);
}
/* Action row (#784): buttons 40 px without shadow; one start-zone element (second action, count, Discard) leaves the rest at the end. */
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions .mud-button-root { min-height: 40px; box-shadow: none; }
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions .pn-dialog-actions-start { margin-inline-end: auto; }
/* Full-screen dialogs (phone): labels stay on one line, the start-zone button keeps the rest of the row to its right. */
.mud-dialog-fullscreen .mud-dialog-actions .mud-button-root { min-height: 44px; white-space: nowrap; padding-inline: var(--pn-space-3); }
.mud-dialog-fullscreen .mud-dialog-actions .pn-dialog-actions-start { margin-inline-end: auto; }
/* MudBlazor clears the outline and only tints a focused button; the 2 px ring in the ink colour makes the keyboard position visible. */
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions .mud-button-root:focus-visible { outline: 2px solid var(--pn-primary-ink); outline-offset: 2px; }
/* Selection counter in the start zone: a fixed width, so the buttons next to it never move while the number changes. */
.mud-dialog-actions .pn-dialog-selection-count { min-width: 112px; font-size: var(--pn-text-sm); color: var(--mud-palette-text-secondary); }
/* A button whose label carries a count: equal-width digits and room for two of them, so the buttons next to it never move while the number changes. */
@media (min-width: 600px) { .mud-dialog-actions .pn-dialog-count-action { min-width: 12.5rem; font-variant-numeric: tabular-nums; } }
/* Selection dialogs (#784): notice and search row stand still, the list scrolls in itself under its sticky header and the pager stays at the bottom;
   loading and «no results» fill the list area, so it does not shrink. */
.mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-content:is(:has(.index-page), :has(> .pvp-settings)) { display: flex; flex-direction: column; overflow: hidden; }
.mud-dialog-content > .reference-dialog { display: contents; }
/* Key handler around the tree in the label drawer (LabelTreeHost): fills the drawer, so every click inside lands in it; the focus shows on the controls. */
.label-tree-drawer-body { min-height: 100%; outline: none; }
.mud-dialog-content :is(.index-page, .index-main, .index-table, .index-table .mud-table) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.mud-dialog-content .index-page .index-body { display: contents; }
.mud-dialog-content .index-title:has(> .index-title-actions:empty) { display: none; }
.mud-dialog-content .index-table .mud-table-container { flex: 1 1 auto; min-height: 0; overflow: auto; }
.mud-dialog-content .index-table .mud-table-container thead th { position: sticky; top: 0; z-index: 1; background: var(--mud-palette-surface); }
.mud-dialog-content .index-table .mud-table-container { display: flex; flex-direction: column; }
.mud-dialog-content .index-table .mud-table-container > .mud-drop-container { display: flex; flex-direction: column; flex: 1 1 auto; }
/* Only an empty or loading list stretches the table over the list area; rows with entries keep their height and the free space stays below them. */
.mud-dialog-content .index-table .mud-drop-container > table:has(> tbody > tr > .mud-table-empty-row) { flex: 1 1 auto; }
.mud-dialog-content .index-table .mud-table-container tbody:has(> tr > .mud-table-empty-row) { height: 100%; }
.mud-dialog-content .index-table .mud-table-empty-row { vertical-align: middle; }
.mud-dialog-content .index-table .mud-table-pagination { flex: none; }
.mud-dialog-content .index-page .index-filters { flex: none; }
/* Pokémon dialog (#661): number and image are compact, the types column has a fixed width, so no column moves while searching; the name takes the rest.
   The scroll bar keeps its room, so the columns do not shift when it appears. Phones show neither number nor types. */
.mud-dialog-content .mud-table-cell.choice-col-types { width: 12rem; }
.mud-dialog-content .index-table .mud-table-container { scrollbar-gutter: stable; }
@media (max-width: 599.98px) {
    .mud-dialog-content .index-table .mud-table-cell { padding-inline: var(--pn-space-1); }
    .mud-dialog-content .index-table .mud-table-cell .mud-button-root { min-width: 0; }
    /* Phones: the counter takes its own short line above the buttons, so both buttons keep the full width. */
    .mud-dialog-actions:has(> .pn-dialog-selection-count) { flex-wrap: wrap; row-gap: var(--pn-space-1); }
    .mud-dialog-actions .pn-dialog-selection-count { flex: 1 0 100%; min-width: 0; margin: 0; font-size: var(--pn-text-xs); }
    /* Phones: the buttons share the row equally, long texts wrap, all as high as the highest; a three-way dialog stacks with the main action on top. */
    .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions { align-items: stretch; }
    .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions .mud-button-root { flex: 1 1 0; box-sizing: border-box; min-width: 0; min-height: 44px; padding-inline: var(--pn-space-4); }
    /* The outlined buttons carry a 1 px border; the same transparent border on the filled one keeps the shares equal. */
    .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions .mud-button-filled { border: 1px solid transparent; }
    .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions .mud-button-root .mud-button-label { white-space: normal; text-align: center; }
    .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions:has(> .pn-dialog-actions-stack) { flex-direction: column-reverse; }
    .mud-dialog:not(.mud-dialog-fullscreen) .mud-dialog-actions:has(> .pn-dialog-actions-stack) .mud-button-root { flex: none; margin-inline-end: 0; }
}
/* Snackbars (#784): tonal surface per kind with a 4 px stripe on the left; text, links, the action button and the close button use the kind's own colours
   (--pn-snackbar-<kind>-bg|text|link|stripe from AppTheme, ≥ 4.5:1 on the surface in both modes). Position, width, timing and RequireInteraction stay MudBlazor's. */
.mud-snackbar.mud-alert-filled-error { --pn-sb-bg: var(--pn-snackbar-error-bg); --pn-sb-text: var(--pn-snackbar-error-text); --pn-sb-link: var(--pn-snackbar-error-link); --pn-sb-stripe: var(--pn-snackbar-error-stripe); }
.mud-snackbar.mud-alert-filled-info { --pn-sb-bg: var(--pn-snackbar-info-bg); --pn-sb-text: var(--pn-snackbar-info-text); --pn-sb-link: var(--pn-snackbar-info-link); --pn-sb-stripe: var(--pn-snackbar-info-stripe); }
.mud-snackbar.mud-alert-filled-success { --pn-sb-bg: var(--pn-snackbar-success-bg); --pn-sb-text: var(--pn-snackbar-success-text); --pn-sb-link: var(--pn-snackbar-success-link); --pn-sb-stripe: var(--pn-snackbar-success-stripe); }
.mud-snackbar.mud-alert-filled-warning { --pn-sb-bg: var(--pn-snackbar-warning-bg); --pn-sb-text: var(--pn-snackbar-warning-text); --pn-sb-link: var(--pn-snackbar-warning-link); --pn-sb-stripe: var(--pn-snackbar-warning-stripe); }
.mud-snackbar.mud-alert-filled-normal { --pn-sb-bg: var(--pn-snackbar-normal-bg); --pn-sb-text: var(--pn-snackbar-normal-text); --pn-sb-link: var(--pn-snackbar-normal-link); --pn-sb-stripe: var(--pn-snackbar-normal-stripe); }
.mud-snackbar:is(.mud-alert-filled-error, .mud-alert-filled-info, .mud-alert-filled-success, .mud-alert-filled-warning, .mud-alert-filled-normal) {
    background-color: var(--pn-sb-bg);
    color: var(--pn-sb-text);
    border-inline-start: 4px solid var(--pn-sb-stripe);
}
.mud-snackbar:is(.mud-alert-filled-error, .mud-alert-filled-info, .mud-alert-filled-success, .mud-alert-filled-warning, .mud-alert-filled-normal) :is(.mud-snackbar-icon, .mud-icon-root.mud-svg-icon) { color: var(--pn-sb-link); }
.mud-snackbar a { color: var(--pn-sb-link); font-weight: var(--pn-weight-medium); text-decoration: underline; text-underline-offset: 2px; }
.mud-snackbar .mud-snackbar-content-action > .mud-snackbar-action-button,
.mud-snackbar .mud-button-root.mud-button-outlined {
    min-height: 40px;
    border: 1px solid var(--pn-sb-link);
    background: transparent;
    box-shadow: none;
    color: var(--pn-sb-link);
}
.mud-snackbar .mud-snackbar-content-action > .mud-snackbar-action-button:hover,
.mud-snackbar .mud-button-root.mud-button-outlined:hover { background: color-mix(in srgb, var(--pn-sb-link) 12%, transparent); }
.mud-snackbar .mud-snackbar-close-button { width: 40px; height: 40px; color: var(--pn-sb-text); }
.mud-snackbar :is(a, button):focus-visible { outline: 2px solid var(--pn-sb-text); outline-offset: 2px; }
@media (max-width: 599.98px) {
    .mud-snackbar { flex-wrap: wrap; }
    .mud-snackbar .mud-snackbar-content-message { flex: 1 1 0; min-width: 0; }
    .mud-snackbar .mud-snackbar-close-button, .mud-snackbar .mud-snackbar-content-action > .mud-snackbar-action-button, .mud-snackbar .mud-button-root.mud-button-outlined { min-height: 44px; }
    .mud-snackbar .mud-snackbar-close-button { width: 44px; height: 44px; }
    /* The action button gets its own row under the text, flush with the text; the close button stays at the top right. */
    .mud-snackbar .mud-snackbar-content-action:has(> .mud-snackbar-action-button) { order: 3; flex: 1 1 100%; margin: 0; padding: 0 0 var(--pn-space-2); padding-inline-start: var(--pn-space-6); }
    .mud-snackbar:has(> .mud-snackbar-content-action > .mud-snackbar-action-button) { position: relative; }
    .mud-snackbar:has(> .mud-snackbar-content-action > .mud-snackbar-action-button) .mud-snackbar-content-message { padding-inline-end: calc(var(--pn-space-6) + var(--pn-space-4)); }
    .mud-snackbar .mud-snackbar-content-action > .mud-snackbar-action-button ~ .mud-snackbar-close-button { position: absolute; top: var(--pn-space-1); inset-inline-end: var(--pn-space-1); margin: 0; }
}
/* Fixed height while open (#784): dialogs that load, expand, switch tabs/steps or add rows declare pn-dialog-target-height (target height from the first frame);
   all others keep the height of their first render (dialog-height.js). A smaller or keyboard-covered viewport caps it temporarily (#645). */
.mud-dialog-container:has(> .mud-dialog[data-pn-dialog-height]:not(.mud-dialog-fullscreen)) {
    top: var(--pn-dialog-viewport-top);
    height: var(--pn-dialog-viewport-size);
}
.mud-dialog[data-pn-dialog-height]:not(.mud-dialog-fullscreen) {
    height: min(var(--pn-dialog-height), calc(100dvh - var(--mud-appbar-height)), var(--pn-dialog-viewport-height));
    max-height: min(calc(100dvh - var(--mud-appbar-height)), var(--pn-dialog-viewport-height));
}
/* Content-rich dialogs (pickers with a table, the search-term builder, the PvP card settings) take the window height up to 1080 px instead of 736 px. */
.mud-dialog.pn-dialog-target-height.pn-dialog-tall { --pn-dialog-target-height: min(1080px, calc(100dvh - 64px)); }
.mud-dialog.pn-dialog-target-height:not(.mud-dialog-fullscreen) { --pn-dialog-height: var(--pn-dialog-target-height); }
.mud-dialog.pn-dialog-target-height:not(.mud-dialog-fullscreen):not([data-pn-dialog-height]) { height: var(--pn-dialog-target-height); }
/* Scrolling inside a dialog never hands over to the page behind it (touch flick at the end of the list). */
.mud-dialog .mud-dialog-content { overscroll-behavior: contain; }
/* Content that changes between short and scrolling (tabs) keeps the room of its scrollbar, so the width never shifts. */
.pn-dialog-stable-gutter { scrollbar-gutter: stable; }
p { margin-top: 0; margin-bottom: var(--pn-space-4); }
hr { margin: var(--pn-space-4) 0; color: inherit; border: 0; border-top: 1px solid; opacity: .25; }
abbr[title] { text-decoration-skip-ink: none; }
ol, ul { padding-left: var(--pn-space-6); }
dl, ol, ul { margin-top: 0; margin-bottom: var(--pn-space-4); }
ol ol, ol ul, ul ol, ul ul { margin-bottom: 0; }
dt { font-weight: var(--pn-weight-bold); }
dd { margin-bottom: var(--pn-space-2); margin-left: 0; }
blockquote { margin: 0 0 var(--pn-space-4); }
small { font-size: .875em; }
code, kbd, pre, samp { font-family: var(--pn-font-mono); font-size: 1em; }
pre { display: block; margin-top: 0; margin-bottom: var(--pn-space-4); overflow: auto; font-size: .875em; }
pre code { font-size: inherit; color: inherit; word-break: normal; }
code { font-size: .875em; overflow-wrap: break-word; }
kbd { padding: var(--pn-space-1) var(--pn-space-2); font-size: .875em; color: var(--mud-palette-background); background-color: var(--mud-palette-text-primary); border-radius: var(--pn-radius-sm); }
img, svg { vertical-align: middle; }
table { caption-side: bottom; border-collapse: collapse; }
th { text-align: inherit; text-align: -webkit-match-parent; }
tbody, td, tfoot, th, thead, tr { border-color: inherit; border-style: solid; border-width: 0; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
textarea { resize: vertical; }
[hidden] { display: none !important; }

/* The last breadcrumb is the current page (aria-current), not a disabled link: MudBlazor's 26 % disabled colour is 1.9:1 on white. */
.mud-breadcrumb-item.mud-disabled > a[aria-current="page"] { color: var(--mud-palette-text-secondary); }

/* Four kinds of text link, all painted in --pn-link-ink (AppTheme.LinkInk: 4.5:1 on every link surface) and never in the raw brand colour (docs/ui/rules.md «Links»):
   running text (every anchor without a marker): link ink, underlined 1 px, because the ink alone is no 3:1 contrast to the surrounding text;
   action (.pn-action-link, a link that stands on its own line): link ink, no line at rest;
   cell (a class-less anchor in a table cell, .pn-cell-link): the cell's text colour, no line at rest, so a grid is not a wall of links;
   hover and keyboard focus (all kinds): link ink and a 2 px underline.
   :where() keeps the hover rule from beating anchors that carry their own class (navigation, tiles, buttons, header): they keep their colours. */
a {
    color: var(--pn-link-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
a:where(:hover, :focus-visible) { color: var(--pn-link-ink); text-decoration: underline; text-decoration-thickness: 2px; }
.pn-action-link { text-decoration: none; }
.pn-action-link:is(:hover, :focus-visible) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
/* MudBlazor relied on its own global a { text-decoration: none; color: inherit } for these anchors: navigation, menu rows and the icon link of a view card are not text links. */
.mud-nav-link, .mud-breadcrumb-item > a, .view-filter-link, a.mud-menu-item, a.mud-list-item { color: inherit; text-decoration: none; }

/* Cell links (row names of index grids and rankings, link columns): the text colour at rest; the link ink and an underline come with hover and keyboard focus,
   with the 2 px focus ring in the link ink (docs/ui/rules.md «Tables»). No weight change and no box change, so the row never shifts.
   ExternalLink is a MudLink with Color.Inherit (.mud-inherit-text is !important), hence the !important hover rule. */
:is(td, th, .mud-table-cell) a:not([class]), .pn-cell-link, .pn-cell-link.mud-link { color: inherit; text-decoration: none; }
:is(td, th, .mud-table-cell) a:not([class]):is(:hover, :focus-visible), .pn-cell-link:is(:hover, :focus-visible) { color: var(--pn-link-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mud-link.pn-cell-link:is(:hover, :focus-visible) { color: var(--pn-link-ink) !important; text-decoration-thickness: 2px; }
:is(td, th, .mud-table-cell) a:not([class]):focus-visible, .pn-cell-link:focus-visible { outline: 2px solid var(--pn-link-ink); outline-offset: 2px; }

/* Brand colour (#338): MudBlazor paints coloured text, outlines and focus in --mud-palette-primary, which light brand colours
   keep below 4.5:1 on white. They use the darker --pn-primary-ink (AppTheme); fills stay --mud-palette-primary. */
.mud-primary-text { color: var(--pn-primary-ink) !important; --mud-ripple-color: var(--pn-primary-ink) !important; }
/* MudLink defaults to Color.Primary: it is a text link of the kinds above, so it takes the link ink and its hover-only underline becomes the global one (cell and action links keep theirs). */
.mud-link.mud-primary-text { color: var(--pn-link-ink) !important; }
.mud-link.mud-link-underline-hover:not(.pn-cell-link):not(.pn-action-link):not(.mud-link-disabled) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.mud-link.mud-link-underline-hover:not(.pn-cell-link):not(.pn-action-link):not(.mud-link-disabled):is(:hover, :focus-visible) { text-decoration-thickness: 2px; }
.mud-link.pn-action-link.mud-link-underline-hover { text-decoration: none; }
.mud-link.pn-action-link.mud-link-underline-hover:is(:hover, :focus-visible) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.mud-border-primary { border-color: var(--pn-primary-ink) !important; }
.mud-button-text.mud-button-text-primary, .mud-button-outlined.mud-button-outlined-primary,
.mud-button-group-text.mud-button-group-override-styles.mud-button-group-text-primary .mud-button-root,
.mud-button-group-outlined.mud-button-group-override-styles.mud-button-group-outlined-primary .mud-button-root,
.mud-chip-outlined.mud-chip-color-primary, .mud-chip-text.mud-chip-color-primary,
.mud-fab-text.mud-fab-text-primary, .mud-fab-outlined.mud-fab-outlined-primary,
.mud-alert-text-primary .mud-alert-icon, .mud-alert-outlined-primary .mud-alert-icon,
.mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled),
.mud-navmenu.mud-navmenu-primary .mud-nav-link.active:not(.mud-nav-link-disabled),
.mud-navmenu.mud-navmenu-primary .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon,
.mud-tab.mud-tab-active { color: var(--pn-primary-ink); --mud-ripple-color: var(--pn-primary-ink); }
.mud-button-outlined.mud-button-outlined-primary,
.mud-button-group-outlined.mud-button-group-override-styles.mud-button-group-outlined-primary .mud-button-root,
.mud-chip-outlined.mud-chip-color-primary, .mud-fab-outlined.mud-fab-outlined-primary { border-color: color-mix(in srgb, var(--pn-primary-ink) 50%, transparent); }
/* Neutral outlines the same way, as `.pn-btn-outlined`: MudBlazor draws them in the full text colour (border opacity 1), in dark mode brighter than the label. */
.mud-button-outlined.mud-button-outlined-default:not(:disabled):not(.mud-disabled) { border-color: color-mix(in srgb, var(--mud-palette-text-primary) 50%, transparent); }
.mud-button-outlined.mud-button-outlined-default:not(:disabled):not(.mud-disabled):hover { border-color: var(--mud-palette-text-primary); }
.mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border,
.mud-input.mud-input-outlined:focus-within .mud-shrink > .mud-input-outlined-border { border-color: var(--pn-primary-ink); }
.mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol { color: var(--pn-primary-ink); }

/* The one scroll room below every page (article.content of MainLayout): the last element never sits on the screen edge or under the reload button. Pages add no bottom space of their own; change the value here only. */
:root { --pn-page-end-space: 40vh; }
.content {
    padding-top: var(--pn-space-4);
    padding-bottom: var(--pn-page-end-space);
}

/* Spacing scale (#381): margin, padding and gap take only these six steps (or 0/auto); NoHardcodedSpacingTests enforces it. Widths, heights and offsets are not part of the scale. */
:root {
    --pn-space-1: .25rem;
    --pn-space-2: .5rem;
    --pn-space-3: .75rem;
    --pn-space-4: 1rem;
    --pn-space-5: 1.5rem;
    --pn-space-6: 2rem;
}

/* Header height (#522): top bar, sidebar brand row, sticky title bar offset and reconnect indicator read this one token. */
:root { --pn-header-height: 3rem; }
/* Editor bars (add bar, block toolbar of the filter editor): a brand-tinted surface with a frame, so they stand apart from the blocks that scroll under them, in light and dark mode. */
:root { --pn-editor-bar-bg: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface)); --pn-editor-bar-border: color-mix(in srgb, var(--mud-palette-primary) 35%, var(--mud-palette-divider));
    /* While a bar sticks, a ring in the page colour covers what scrolls under its rounded corners and edges (block frames); then the shadow. */
    --pn-editor-bar-stuck-shadow: 0 0 0 var(--pn-space-1) var(--mud-palette-background), var(--mud-elevation-2); }

/* Deviation marks of «Optionen» (#813): the dot (button, switches, reset entry) and the count pill of the button read these two tokens. */
:root { --pn-dot-size: .5rem; --pn-count-size: 1.125rem; }

/* Orange of the PvP-team card (#523, #870): shared weaknesses and top counters, the gap column of the weakness grid and the reading help; the one colour literal of the card. */
:root { --pvp-glow-two: #fb8c00; }

/* Radius scale (#436): border-radius takes only these five steps (or 0); NoHardcodedRadiusTests enforces it. sm is the MudBlazor default radius, set in AppTheme. */
/* Type scale (#435): font-size and font-weight take only these tokens (or 1em/inherit); xs badges and extras, sm secondary text and tables, md text, lg dialog titles and h2. --pn-font-mono is the one monospace stack for code. NoHardcodedTypographyTests enforces both. */
:root {
    --pn-radius-sm: var(--mud-default-borderradius);
    --pn-radius-md: .5rem;
    --pn-radius-lg: .75rem;
    --pn-radius-pill: 999px;
    --pn-radius-circle: 50%;
    --pn-text-xs: .75rem;
    --pn-text-sm: .875rem;
    --pn-text-md: 1rem;
    --pn-text-lg: 1.25rem;
    --pn-weight-regular: 400;
    --pn-weight-medium: 500;
    --pn-weight-semibold: 600;
    --pn-weight-bold: 700;
    --pn-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Per-user page width (#268): MainLayout sets data-page-width-overview|content on .page, the toggle marks the page type with data-page-width-kind. Phones always use the full width. */
:root { --pn-page-width-narrow: 76rem; --pn-label-tree-width: 240px; }
@media (min-width: 600px) {
    .page[data-page-width-content="narrow"] article.content:has([data-page-width-kind="content"]),
    .page[data-page-width-overview="narrow"] article.content:has([data-page-width-kind="overview"]) {
        max-width: calc(var(--pn-page-width-narrow) + 3rem);
        margin-inline: auto;
    }
}

/* Label tree of an index page: with the narrow page width and room beside the column, the grid of the index body (IndexGrid.razor.css) moves into the free left margin:
   the panel stands in the margin level with the table, search and table keep the full column width and the table does not jump when the panel is switched.
   Needed room: column 79rem (76rem + padding) + 2 × (240 px panel + 12 px gap − 24 px padding); thresholds include the sidebar (250 px, 0 when collapsed) and a scrollbar.
   Without that room the search spans the width and the panel stands below it, beside the table. */
@media (min-width: 1985px) {
    .page[data-page-width-overview="narrow"]:not(:has(> .sidebar-toggle:checked)) .index-body:has(> .label-tree-side) { margin-inline-start: calc(-1 * (var(--pn-label-tree-width) + var(--pn-space-3))); }
    .page[data-page-width-overview="narrow"]:not(:has(> .sidebar-toggle:checked)) .index-body:has(> .label-tree-side) > .index-main > * { grid-column: 2; }
}
@media (min-width: 1735px) {
    .page[data-page-width-overview="narrow"]:has(> .sidebar-toggle:checked) .index-body:has(> .label-tree-side) { margin-inline-start: calc(-1 * (var(--pn-label-tree-width) + var(--pn-space-3))); }
    .page[data-page-width-overview="narrow"]:has(> .sidebar-toggle:checked) .index-body:has(> .label-tree-side) > .index-main > * { grid-column: 2; }
}

/* The reader of a view lets the header scroll away on wide screens (#547); beats the scoped sticky rule in MainLayout.razor.css. */
@media (min-width: 960px) {
    .page:has([data-header-scroll]) .top-row { position: static; }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--mud-palette-error);
    padding: var(--pn-space-4) var(--pn-space-4) var(--pn-space-4) 3.7rem;
    color: var(--mud-palette-error-text);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Pokémon pictures sit in a fixed box of their own; the server-cropped image is centred and never stretched (#595). */
.pokemon-sprite { object-fit: contain; object-position: center; }

/* View reading is server-rendered; layout and copy do not require a circuit. */
.view-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--pn-space-4); margin-top: var(--pn-space-4); }
.view-card { grid-column: span 12; min-width: 0; overflow-wrap: anywhere; }
.view-output-box { display: flex; align-items: flex-start; gap: var(--pn-space-2); background: color-mix(in srgb, var(--mud-palette-text-primary) 10%, transparent); border-radius: var(--pn-radius-sm); padding: var(--pn-space-2); min-width: 0; }
.view-output { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--pn-space-1) 0; }
.view-output-compact { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-output-box-compact { align-items: center; }
.view-output-box-compact .view-output { margin: 0; }
.view-card-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--pn-space-2); }
.view-card-final-actions { display: flex; margin-left: auto; }
.view-card-copy { display: inline-flex; align-items: center; }
.view-card-final-actions button, .view-card-collapse { min-height: 44px; min-width: 44px; }
.view-card-title { white-space: pre-wrap; }
.view-card-header { display: flex; align-items: flex-start; gap: var(--pn-space-2); }
.view-card-header .view-card-title { flex: 1; min-width: 0; margin: 0; }
.view-card-header-actions { margin-left: auto; flex: 0 0 auto; }
.view-filter-link { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: var(--pn-radius-sm); color: inherit; }
.view-filter-link:hover { background: color-mix(in srgb, currentColor 13%, transparent); }
.view-filter-link svg { width: 1rem; height: 1rem; fill: currentColor; }
/* The filter link is a desktop affordance; below 600 px (the copy button's touch-target breakpoint) it is hidden. */
@media (max-width: 599.98px) {
    .view-filter-link, .view-card-header-actions { display: none; }
}
.view-description { overflow-wrap: anywhere; }
.view-markdown { overflow-x: auto; }
.view-markdown img { max-width: 100%; height: auto; }
.view-markdown pre { overflow-x: auto; }
.view-markdown table { border-collapse: collapse; }
.view-markdown td, .view-markdown th { border: 1px solid var(--mud-palette-lines-inputs); padding: var(--pn-space-2); }
/* Page width and side gap come from MainLayout and the per-user page width rule above; editors only guard against overflow. */
.pn-editor { min-width: 0; }
.view-card-editor { margin: var(--pn-space-4) 0; min-width: 0; grid-column: span 12; }
/* Editor with "apply card width": cards use the reader grid; placement bar and insertion targets span the full row. */
.view-grid > .view-card-editor { margin: 0; }
.view-grid > .filter-insertion-target { grid-column: 1 / -1; }
/* Each card sits in a sortable-list cell; width classes below override the full-row default (same specificity, later rule). */
.view-card-cell { grid-column: span 12; min-width: 0; }
.view-grid > .view-card-cell > .view-card-editor { margin: 0; }
/* Sortable lists (SortableList): drag handle, dragged item, insertion marker and the floating card with the new position. */
[data-sortable] { position: relative; }
/* While an item is dragged, an empty connected list needs room to be hit. */
.pn-sort-dragging [data-sort-group]:not(:has(> [data-sort-item])) { min-height: 2.5rem; }
.pn-sort-handle { display: inline-flex; cursor: grab; user-select: none; }
.pn-sort-handle:active { cursor: grabbing; }
[data-sort-disabled="true"] .pn-sort-handle { cursor: default; opacity: .38; }
.pn-sort-source { opacity: .4; outline: 1px dashed var(--mud-palette-primary); outline-offset: 2px; border-radius: var(--pn-radius-md); }
.pn-sort-marker { position: absolute; z-index: 5; height: 4px; transform: translateY(-50%); pointer-events: none; border-radius: var(--pn-radius-pill);
    background: var(--mud-palette-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-primary) 25%, transparent); }
.pn-sort-marker.pn-sort-marker-vertical { width: 4px; height: auto; transform: translateX(-50%); }
.pn-sort-marker-pill { position: absolute; top: 50%; left: var(--pn-space-2); transform: translateY(-50%); padding: var(--pn-space-1) var(--pn-space-3); white-space: nowrap;
    border-radius: var(--pn-radius-pill); background: var(--mud-palette-primary); color: var(--mud-palette-primary-text);
    font-size: var(--pn-text-sm); font-weight: var(--pn-weight-bold); box-shadow: var(--mud-elevation-4); }
.pn-sort-marker-vertical .pn-sort-marker-pill { left: 50%; transform: translate(-50%, -50%); }
.pn-sort-marker-pill small { margin-left: var(--pn-space-1); font-weight: var(--pn-weight-regular); opacity: .85; }
.pn-sort-float { position: fixed; left: 0; top: 0; z-index: 2000; width: 15rem; display: flex; align-items: center; gap: var(--pn-space-2); padding: var(--pn-space-2) var(--pn-space-3) var(--pn-space-2) var(--pn-space-2);
    pointer-events: none; will-change: transform; opacity: .88; color: var(--mud-palette-text-primary); background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-primary); border-radius: var(--pn-radius-sm); box-shadow: var(--mud-elevation-8); }
.pn-sort-float-number { flex: none; display: flex; align-items: center; justify-content: center; min-width: 2.625rem; height: 2.625rem; padding-inline: var(--pn-space-2); border-radius: var(--pn-radius-pill);
    background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); font-size: var(--pn-text-lg); font-weight: var(--pn-weight-bold); transition: transform .12s; }
.pn-sort-float-number.pn-sort-bump { transform: scale(1.18); }
.pn-sort-float-text { min-width: 0; }
.pn-sort-float-title { font-size: var(--pn-text-xs); font-weight: var(--pn-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-sort-float-hint { font-size: var(--pn-text-xs); color: var(--mud-palette-text-secondary); }
.pn-sort-float.pn-sort-cancel { border-color: var(--mud-palette-text-secondary); opacity: .6; }
.pn-sort-float.pn-sort-cancel .pn-sort-float-number { background: var(--mud-palette-text-secondary); font-size: var(--pn-text-md); }
/* Touch devices drag with pointer events (SortableList.razor.js): the handle must not start a page scroll and gets a larger touch box. */
@media (pointer: coarse) {
    .pn-sort-handle { touch-action: none; min-width: 32px; min-height: 32px; align-items: center; justify-content: center; }
}
.view-card-actions { margin-block: var(--pn-space-3); }
.view-card-icons { display: flex; align-items: center; flex-wrap: wrap; gap: var(--pn-space-1); }
.view-card-icons button { min-height: 44px; }
.view-card-remark { margin-top: var(--pn-space-4); }
.view-card-description { overflow-wrap: anywhere; }
/* Cards hidden from readers (Off) or shown as an empty slot (Placeholder) stay visible in the editor, dimmed. */
.view-card-editor[data-card-state="off"], .view-card-editor[data-card-state="placeholder"] { border-style: dashed; }
.view-card-editor[data-card-state="off"] > :not(.view-card-toolbar), .view-card-editor[data-card-state="placeholder"] > :not(.view-card-toolbar) { opacity: 0.6; }
/* Cards ticked for the multi edit stand out with a primary frame; an Off or placeholder card keeps its dashed line. */
.view-card-editor[data-selected="true"] { border-color: var(--mud-palette-primary); box-shadow: inset 0 0 0 1px var(--mud-palette-primary); }
/* Multi-edit mode: the card is locked and a click anywhere on it selects it, so its body lets clicks through to the card. */
.view-card-editor[data-multi-edit="true"] { cursor: pointer; }
.view-card-editor[data-multi-edit="true"] > :not(.view-card-toolbar) { pointer-events: none; }
.view-card-own-click { display: inline-flex; cursor: default; }
/* Multi-edit panel (MultiEditPanel): a tinted card frame, so it never reads as a card of the page; it stays at the top while scrolling on wide screens only, on a phone it would cover half the screen. */
.multi-edit-panel { border: 1px solid var(--mud-palette-primary); border-radius: var(--pn-radius-md); background: color-mix(in srgb, var(--mud-palette-primary) 7%, var(--mud-palette-surface)); padding: 0 var(--pn-space-4) var(--pn-space-3); margin-block: var(--pn-space-2) var(--pn-space-3); }
.multi-edit-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pn-space-1) var(--pn-space-3); min-height: 56px; }
.multi-edit-count, .multi-edit-note { color: var(--mud-palette-text-secondary); font-size: var(--pn-text-sm); }
.multi-edit-head .multi-edit-clear { margin-inline-start: auto; }
.multi-edit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pn-space-3); margin-top: var(--pn-space-2); }
.multi-edit-note { flex: 1 1 16rem; min-width: 0; }
@media (min-width: 960px) {
    .multi-edit-panel { position: sticky; top: var(--pn-header-height); z-index: var(--mud-zindex-appbar); }
}
@media (max-width: 599.98px) {
    .multi-edit-foot .mud-button-root { width: 100%; }
}
/* Field frame (MultiEditFieldFrame): the page's control, below it «Ändern» and the hint; compact frames stack a symbol over its box. */
.multi-edit-field { display: flex; flex-direction: column; min-width: 0; }
.multi-edit-field .multi-edit-change { margin-inline-start: calc(-1 * var(--pn-space-2)); }
/* A compact frame is exactly as wide as its symbol in the card (narrow box, 44 px tall), so the symbols in the panel and in the cards line up. */
.multi-edit-icons .view-card-icons { flex-wrap: nowrap; align-items: flex-start; }
.multi-edit-field-compact { align-items: center; }
.multi-edit-field-compact > :first-child { min-height: 44px; display: flex; align-items: center; }
.multi-edit-field-compact .multi-edit-change { margin-inline-start: 0; }
.multi-edit-field-compact .multi-edit-change .mud-icon-button { padding: 0; width: 26px; height: 44px; }
.multi-edit-hint { font-size: var(--pn-text-xs); color: var(--mud-palette-text-secondary); }
.multi-edit-hint-error { color: var(--mud-palette-error); }
.view-output-heading { display: flex; align-items: center; gap: var(--pn-space-2); flex-wrap: wrap; }
/* A placeholder keeps its slot in the grid; below 960 px all cards stack, so it is dropped there. */
@media (max-width: 959.98px) {
    .view-card-placeholder { display: none; }
    .view-compact-desktop { display: none; }
    .view-grid > .view-compact-mobile { grid-column: 1 / -1; }
}
/* Compact displays exist only below 960 px; from there the desktop cards sit in the grid as if the wrapper were absent. */
@media (min-width: 960px) {
    .view-compact-mobile { display: none; }
    .view-compact-desktop { display: contents; }
}
@media (min-width: 960px) {
    .view-span-1 { grid-column: span 1; }
    .view-span-2 { grid-column: span 2; }
    .view-span-3 { grid-column: span 3; }
    .view-span-4 { grid-column: span 4; }
    .view-span-5 { grid-column: span 5; }
    .view-span-6 { grid-column: span 6; }
    .view-span-7 { grid-column: span 7; }
    .view-span-8 { grid-column: span 8; }
    .view-span-9 { grid-column: span 9; }
    .view-span-10 { grid-column: span 10; }
    .view-span-11 { grid-column: span 11; }
    .view-span-12 { grid-column: span 12; }
}

/* Placement in the filter editor (#661): the controls of the blocks are disabled; the parts that are no controls (number, preview with its copy button,
   remark) step back alike, so the whole block looks inactive and nothing is dimmed twice. */
.manual-block.block-placing :is(.enh-number, .block-preview, .block-remark-inline, .enh-remark) { opacity: .5; }
/* A disabled switch that is on keeps the track of an enabled one (MudBlazor dims it to .12), so «Aktiviert» still reads as on. */
.manual-block.block-placing .mud-switch-base.mud-checked.mud-switch-disabled + .mud-switch-track { opacity: .5 !important; }
/* The list of the editor add bar on phones (EditorAddBar) stands at the bottom of the viewport, not of the page. */
.mud-drawer.editor-add-sheet { position: fixed; inset: auto 0 0; max-height: 100dvh; overflow-y: auto; }
/* ⋮ menu of EditorNodeHeader: the entries for the icon actions (active, code, replace, duplicate, delete) exist only below 600 px, where the row has no icons;
   the popover is outside the component, so the rule is global. «not all and (max-width: 599.98px)» is the exact complement of the phone media query. */
@media not all and (max-width: 599.98px) {
    .mud-menu-item.enh-menu-narrow, .mud-divider.enh-menu-narrow { display: none; }
}
/* «Löschen» is red in text and icon (the danger entry at the end of the menu). */
.mud-menu-item.enh-menu-delete:not(.mud-disabled) { color: var(--mud-palette-error); }
/* On a phone the ⋮ menu is a sheet in the bottom right corner of the viewport: next to its button the room above or below is less than the list (up to 11 rows of 48 px)
   and the last entry, «Löschen», would need an inner scroll. The rule overrides the position MudBlazor writes inline. */
@media (max-width: 599.98px) {
    .mud-popover.enh-menu-popover { position: fixed !important; inset: auto var(--pn-space-2) var(--pn-space-2) auto !important; translate: none !important; transform: none !important; max-height: calc(100dvh - 2 * var(--pn-space-2)) !important; overflow-y: auto; }
}

/* Column panel of an index grid (#580): every page column is hideable, so a column with a disabled switch is the chevron column of a phone table or the tool column of the grid; it is not listed. */
.mud-data-grid-columns-panel .mud-drop-item:has(.mud-switch-input:disabled) { display: none; }
/* The panel opens where the «Optionen» popover was (index-columns-panel.js right-aligns it with the button by this width). */
.mud-data-grid-columns-panel { min-width: 320px; }
/* Link inside a snackbar text (EditPageBase.NotifyInfoLink): a 44px touch target on phones. */
@media (max-width: 599.98px) {
    .pn-snackbar-link { display: inline-flex; align-items: center; min-height: 44px; }
}
/* Suggestions of a tag field (GameTagAutocomplete): at least wide enough for a 15-character name with its count and the free-text row, never wider than the viewport;
   at most 40 % of the viewport high (MudBlazor sets 300px inline), so on a short screen or above a phone keyboard the list fits beside the field instead of covering it. */
.mud-popover.game-tag-popover { min-width: min(16rem, calc(100vw - 2 * var(--pn-space-4))) !important; max-width: calc(100vw - 2 * var(--pn-space-4)); max-height: min(300px, 40vh) !important; }
/* Opened upwards (no room below), the list would end on the field's top border and cover half of the floating label; it keeps a gap instead. */
.mud-popover.game-tag-popover[data-mudpopover-flip^="top"] { translate: 0 calc(-1 * var(--pn-space-2)); }
/* Column filter panel of an index grid (DataGridFilterMode.Simple, #996): MudBlazor sets width 700px inline (hence !important) and opens it at
   the clicked funnel; it flips to the left only when there is more room there, so a 700px panel from a middle column runs off the right edge.
   At most half the viewport wide, it always fits on the side MudBlazor picks. Below 960px it spans the viewport with a margin instead. */
.mud-popover.filters-panel { width: min(700px, calc(50vw - 2 * var(--pn-space-4))) !important; max-width: none !important; }
@media (max-width: 959.98px) {
    .mud-popover.filters-panel { left: var(--pn-space-2) !important; right: var(--pn-space-2); width: auto !important; }
}
/* Phones: per filter row the remove button and the field «Spalte» share the first line; operator and value (or a filter template) follow
   on the second line, indented under «Spalte». The remove button and the links below the rows are 44 px touch targets. */
@media (max-width: 599.98px) {
    .mud-popover.filters-panel { --filters-panel-remove: 44px; }
    .mud-popover.filters-panel .mud-grid > .mud-grid-item { max-width: none; }
    .mud-popover.filters-panel .mud-grid > .mud-grid-item:nth-child(1) { flex: 0 0 var(--filters-panel-remove); justify-content: center; }
    .mud-popover.filters-panel .mud-grid > .mud-grid-item:nth-child(1) .remove-filter-button { min-width: 44px; min-height: 44px; }
    .mud-popover.filters-panel .mud-grid > .mud-grid-item:nth-child(2) { flex: 0 0 calc(100% - var(--filters-panel-remove)); min-width: 0; }
    .mud-popover.filters-panel .mud-grid > .mud-grid-item:nth-child(n+3) { flex: 1 1 calc(50% - var(--filters-panel-remove) / 2); min-width: 0; }
    .mud-popover.filters-panel .mud-grid > .mud-grid-item:nth-child(3) { margin-left: var(--filters-panel-remove); }
    .mud-popover.filters-panel .mud-button-text { min-height: 44px; }
}
/* Tab titles in normal case (MudBlazor sets uppercase). */
.mud-tab { text-transform: none; letter-spacing: normal; }
/* Phones: tabs are as wide as their label. MudTabs sets min-width 160px inline (MinimumTabWidth), hence !important; the row scrolls when it is too wide. */
@media (max-width: 599.98px) {
    .mud-tab { min-width: 0 !important; width: auto; }
}

/* Button sizes: MudBlazor sets the small and large font sizes fixed in its CSS, not through the theme (#435). */
.mud-button-text-size-small, .mud-button-outlined-size-small, .mud-button-filled-size-small { font-size: var(--pn-text-sm); }
.mud-button-text-size-large, .mud-button-outlined-size-large, .mud-button-filled-size-large { font-size: var(--pn-text-md); }

/* Flat buttons: no shadows (docs/ui/patterns.md «Containers and shadows»). */
.mud-button-filled, .mud-button-filled:hover, .mud-button-filled:focus-visible, .mud-button-filled:active { box-shadow: none; }

/* Containers: panel (groups), card (single entries); docs/ui/patterns.md «Containers and shadows». */
.pn-panel { padding: var(--pn-space-5); border: 1px solid var(--mud-palette-lines-default); border-radius: var(--pn-radius-lg); background: var(--mud-palette-surface); }
@media (max-width: 599.98px) {
    .pn-panel { padding: var(--pn-space-4); }
}
.pn-panel.pn-panel-flush { padding: 0; }
.pn-card { padding: var(--pn-space-4); border: 1px solid var(--mud-palette-lines-default); border-radius: var(--pn-radius-md); background: var(--mud-palette-surface); }
.pn-card-accent { border-top: 3px solid var(--pokemon-accent); }

/* Fold sections: whatever folds shows or hides its content at once; only the chevron turns (docs/ui/patterns.md «Fold sections»).
   The turn rule hangs on the chevron alone, so every title bar look (pn-fold-toggle, PvP head button, label tree, native details) inherits it. */
.pn-fold-chevron, .pn-fold-icon-toggle .mud-icon-root { transition: transform .15s; }
[aria-expanded="false"] .pn-fold-chevron, .pn-fold-icon-toggle[aria-expanded="false"] .mud-icon-root, details:not([open]) > summary .pn-fold-chevron { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) {
    .pn-fold-chevron, .pn-fold-icon-toggle .mud-icon-root { transition: none; }
}
.pn-fold-icon-toggle { transition: none; }
/* Title bar of a fold section: a flat full-width button with a light hover and a focus ring inside the bar. */
.pn-fold-toggle { justify-content: flex-start; min-height: 44px; padding: var(--pn-space-1) var(--pn-space-4); border-radius: 0; transition: none; text-transform: none; text-align: start; letter-spacing: normal; color: inherit; font-size: inherit; }
.pn-fold-toggle:hover { background: color-mix(in srgb, var(--mud-palette-text-primary) 6%, transparent); }
.pn-fold-toggle:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }
.pn-fold-toggle .mud-button-label { display: flex; align-items: center; gap: var(--pn-space-2) var(--pn-space-4); width: 100%; }
.pn-fold-title { font-weight: var(--pn-weight-semibold); text-align: start; }
.pn-fold-meta { margin-left: auto; font-size: var(--pn-text-sm); font-weight: var(--pn-weight-regular); color: var(--mud-palette-text-secondary); white-space: nowrap; }
.pn-fold-toggle .pn-fold-chevron { flex: none; margin-left: auto; color: var(--mud-palette-text-secondary); }
.pn-fold-toggle .pn-fold-meta + .pn-fold-chevron { margin-left: 0; }
/* Group of fold sections: one frame, a line between the sections. */
.pn-fold-group { border: 1px solid var(--mud-palette-lines-default); border-radius: var(--pn-radius-md); background: var(--mud-palette-surface); overflow: hidden; }
.pn-fold-group > .pn-fold + .pn-fold { border-top: 1px solid var(--mud-palette-lines-default); }
.pn-fold-body { padding: var(--pn-space-2) var(--pn-space-4) var(--pn-space-4); }
/* Native details: the summary shows the chevron instead of the browser triangle. */
.pn-fold-summary { display: flex; align-items: center; gap: var(--pn-space-2); list-style: none; cursor: pointer; }
.pn-fold-summary::-webkit-details-marker { display: none; }
.pn-fold-summary > .pn-fold-chevron { flex: none; width: 1.25rem; height: 1.25rem; fill: currentColor; }
@media (max-width: 959.95px) { .pn-fold-summary { min-height: 44px; } }

/* Tooltip reveal delay: hover and focus show a tooltip only after this delay, hiding is immediate. MudTooltip opens at once, so the delay goes on its popover transition (the closed popover has none); the static .pn-tooltip delays its reveal animation. HelpIcon opts out (.pn-tooltip-instant). */
:root { --pn-tooltip-delay: 500ms; }
.mud-popover.mud-tooltip.mud-popover-open { transition-delay: var(--pn-tooltip-delay) !important; }
.mud-popover.mud-tooltip.pn-tooltip-instant.mud-popover-open { transition-delay: 0ms !important; }
/* Long tooltips wrap at 20 rem (never wider than the viewport) instead of forming one wide line; the popover sets its own max-width inline. Every MudTooltip shows its arrow (Arrow="true", TooltipConventionTests). */
/* width: max-content keeps a short tooltip on one line at the right page edge, where tooltip-arrow.js moves it inside the viewport. */
.mud-tooltip { width: max-content; max-width: min(20rem, calc(100vw - 2 * var(--pn-space-4))) !important; white-space: normal; overflow-wrap: break-word; }
/* A tooltip moved into the viewport keeps its arrow on the element: tooltip-arrow.js sets the shift (translate composes with MudBlazor's rotate). */
.mud-tooltip.mud-tooltip-arrow::after { translate: var(--pn-tooltip-arrow-shift, 0) 0; }

/* Static SSR controls: native look of the MudBlazor counterparts, no circuit or MudBlazor JS. */
/* Tooltip of ActionIconButton on static pages: MudTooltip look (default colours, below the button), shown on hover and keyboard focus. */
.pn-tooltip-host { position: relative; }
.pn-tooltip { display: none; position: absolute; top: 100%; left: 50%; transform: translate(-50%, 10px); z-index: var(--mud-zindex-tooltip);
    padding: var(--pn-space-1) var(--pn-space-2); border-radius: var(--pn-radius-sm); background-color: var(--mud-palette-gray-darker); color: var(--mud-palette-dark-text);
    font-family: var(--mud-typography-default-family); font-weight: var(--pn-weight-medium); font-size: var(--pn-text-xs); line-height: 1.4em; text-align: center; white-space: nowrap; pointer-events: none; }
.pn-tooltip-host:hover > .pn-tooltip, .pn-tooltip-host > :focus-visible + .pn-tooltip { display: block; animation: pn-tooltip-reveal 0s var(--pn-tooltip-delay) both; }
/* Long texts wrap at 20 rem like MudTooltip; only tooltips in a host (the type chart's own tooltip has its own width). */
.pn-tooltip-host > .pn-tooltip { width: max-content; max-width: min(20rem, calc(100vw - 2 * var(--pn-space-4))); white-space: normal; overflow-wrap: break-word; }
/* The arrow of MudTooltip (6 px, tooltip colour, in the 10 px gap) as a pseudo-element of the host: always centred on the element, also when the tooltip
   aligns right (last icon) or is shifted at the viewport edge; it overlaps the tooltip by 1 px against hairline seams. */
.pn-tooltip-host:has(> .pn-tooltip)::before { content: ""; display: none; position: absolute; top: calc(100% - 1px); left: calc(50% - 6px); z-index: var(--mud-zindex-tooltip);
    border: 6px solid transparent; border-bottom-color: var(--mud-palette-gray-darker); pointer-events: none; }
.pn-tooltip-host:has(> .pn-tooltip):hover::before, .pn-tooltip-host:has(> :focus-visible + .pn-tooltip)::before { display: block; animation: pn-tooltip-reveal 0s var(--pn-tooltip-delay) both; }
@keyframes pn-tooltip-reveal { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }
/* The shared tooltip of the type chart and the PvP card (type-chart-tip.js fills it) is a .pn-tooltip placed by the script: fixed to the viewport, shown after the tooltip delay with the reveal of .pn-tooltip and hidden at once; a tap shows it at once. The script creates the type icons of the sentence, so the rules are global. */
.type-chart-tip { position: fixed; max-width: min(24rem, calc(100vw - 2 * var(--pn-space-2))); transform: none; text-align: left; white-space: normal; }
.type-chart-tip[data-open] { display: block; animation: pn-tooltip-reveal 0s var(--pn-tooltip-delay) both; }
.type-chart-tip[data-open][data-instant] { animation: none; }
/* The sentence stays on one line where it fits (desktop); a type with its icon and glued word («-Attacke») never breaks. */
@media (min-width: 600px) {
    .type-chart-tip { max-width: calc(100vw - 2 * var(--pn-space-2)); white-space: nowrap; }
}
.type-chart-tip-type { white-space: nowrap; }
.type-chart-tip-type img { display: inline-block; width: 1rem; height: 1rem; margin-right: var(--pn-space-1); vertical-align: -3px; }
/* A row whose ⋮ menu is open stays marked until the menu closes (docs/ui/patterns.md «Buttons»): label tree rows by class, table rows by the open menu button. */
.label-editor-row.label-menu-open { background-color: var(--mud-palette-primary-hover); box-shadow: inset 0 0 0 1px var(--pn-primary-ink); }
/* Tables (docs/ui/design-system.md «Tables»): every table body, whatever renders it. Zebra stripes, hover and selection paint the cells (`> td`) so MudBlazor's own row hover cannot
   outrank them; the specificity of the stripe and hover rules is held at the minimum (:where) so the order stripe < hover < selected / open menu is the cascade order below. */
/* With stripes the cells carry the hover colour, so MudBlazor's row hover (a translucent tint under the cells) is switched off; `html:root` outranks the dark palette declarations. */
html:root[data-table-stripes] { --mud-palette-table-hover: transparent; }
:is(.mud-table-body, .pn-table tbody, .mud-simple-table tbody, .view-markdown tbody) { --mud-palette-text-secondary: var(--pn-table-text-secondary); }
:where(:root[data-table-stripes] :is(.mud-table-body, .pn-table tbody, .mud-simple-table tbody, .view-markdown tbody) > :nth-child(even of tr:not(:has(> .mud-table-child-content)))) > td,
:where(:root[data-table-stripes] :is(.mud-table-body, .pn-table tbody, .mud-simple-table tbody, .view-markdown tbody) > :nth-child(even of tr:not(:has(> .mud-table-child-content))) + tr:has(> .mud-table-child-content)) > td { background-color: var(--pn-table-stripe); }
:where(:root[data-table-stripes] .mud-table-hover :is(.mud-table-body, .pn-table tbody, .mud-simple-table tbody, .view-markdown tbody)) > tr:hover > td,
:where(:root[data-table-stripes] .mud-table-hover :is(.mud-table-body, .pn-table tbody, .mud-simple-table tbody, .view-markdown tbody)) > tr:hover + tr:has(> .mud-table-child-content) > td { background-color: var(--pn-table-stripe-hover); }
.mud-table-row:has([data-action-menu] > [aria-expanded="true"]), .index-row-selected { box-shadow: inset 0 0 0 1px var(--pn-primary-ink); }
:root :is(.mud-table-row:has([data-action-menu] > [aria-expanded="true"]), .index-row-selected) > td { background-color: var(--mud-palette-primary-hover); }
/* A switch that is on (PageAction.Pressed) in the ⋮ menu: its icon takes the primary colour. */
.mud-menu-item[aria-pressed="true"] .mud-icon-root { color: var(--pn-primary-ink); }
/* Element whose removal waits for confirmation (dialog open): error frame and tint (patterns.md «Buttons»). html:root outranks scoped component styles. */
html:root .pn-pending-removal { border-color: var(--mud-palette-error); background: var(--mud-palette-error-hover); box-shadow: 0 0 0 1px var(--mud-palette-error); }
/* Table row whose danger row action runs (ActionBar marks itself while its confirmation is open): the same look drawn on the row, frame and ring as a 2 px inset line. */
html:root .mud-table-row:has(.action-bar-row[data-pending-removal]) { box-shadow: inset 0 0 0 2px var(--mud-palette-error); }
html:root .mud-table-row:has(.action-bar-row[data-pending-removal]) > td { background-color: var(--mud-palette-error-hover); }
/* With stripes the row dividers go: the stripes alone separate the rows. The dividers keep their width (transparent line colour), so row heights stay the same;
   the head line stays. Markdown tables keep their grid (their own border colour), which is part of the content. */
:root[data-table-stripes] :is(.mud-table-body, .pn-table tbody, .mud-simple-table tbody) { --mud-palette-table-lines: transparent; }
/* The one vertical divider between groups of icons (#813): ActionBar zones and the breadcrumb tools before the page width switch. */
.pn-divider-v { flex: none; height: 1.5rem; border-left: 1px solid var(--mud-palette-divider); margin-inline: var(--pn-space-3); }
@media (max-width: 600px) { .pn-divider-v { margin-inline: var(--pn-space-2); } }
/* The one deviation dot (#813): «Optionen» button, OptionMark after a switch or the reset entry; pn-dot-after spaces it from the text before. */
.pn-dot { display: inline-block; flex: 0 0 auto; width: var(--pn-dot-size); height: var(--pn-dot-size); border-radius: var(--pn-radius-circle); background-color: var(--mud-palette-primary); vertical-align: middle; }
.pn-dot-after { margin-inline-start: var(--pn-space-2); }

/* MudTooltip moves into the viewport by JS; the last icon of a row (page edge) aligns its tooltip right instead. */
.pn-tooltip-host:last-child > .pn-tooltip { left: auto; right: 0; transform: translateY(10px); }

/* Buttons and links as buttons: `pn-btn` + optional colour (`-primary`, `-success`, `-danger`) filled, or `-outlined` / `-text` for the outline and text variants. */
.pn-btn { --pn-c: var(--mud-palette-text-primary); --pn-c-text: var(--mud-palette-surface);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--pn-space-2); min-height: 36px; padding: var(--pn-space-2) var(--pn-space-4); box-sizing: border-box;
    border: 1px solid var(--pn-c); border-radius: var(--pn-radius-sm); background-color: var(--pn-c); color: var(--pn-c-text);
    font-family: var(--mud-typography-button-family, var(--mud-typography-default-family)); font-size: var(--pn-text-sm); font-weight: var(--pn-weight-medium); line-height: 1.75;
    letter-spacing: .02857em; text-transform: none; text-decoration: none; cursor: pointer; transition: background-color 250ms; }
.pn-btn:hover { background-color: color-mix(in srgb, var(--pn-c) 85%, black); color: var(--pn-c-text); text-decoration: none; }
.pn-btn:focus-visible, .pn-input:focus-visible, .pn-select:focus-visible, .pn-switch:focus-visible { outline: 2px solid var(--pn-primary-ink); outline-offset: 2px; }
.pn-btn:disabled { opacity: .5; cursor: not-allowed; }
.pn-btn-primary { --pn-c: var(--mud-palette-primary); --pn-c-text: var(--mud-palette-primary-text); }
.pn-btn-success { --pn-c: var(--mud-palette-success); --pn-c-text: var(--mud-palette-success-text); }
.pn-btn-danger { --pn-c: var(--mud-palette-error); --pn-c-text: var(--mud-palette-error-text); }
/* Icon-only button (label in aria-label and title). */
.pn-btn-icon { min-width: 36px; padding: var(--pn-space-1); }
.pn-btn-outlined { border-color: color-mix(in srgb, var(--pn-c) 50%, transparent); background-color: transparent; color: var(--pn-c); }
.pn-btn-outlined:hover { border-color: var(--pn-c); background-color: color-mix(in srgb, var(--pn-c) 8%, transparent); color: var(--pn-c); }
.pn-btn-outlined.pn-btn-primary { --pn-c: var(--pn-primary-ink); }
.pn-btn-text { border-color: transparent; background-color: transparent; color: var(--pn-c); }
.pn-btn-text:hover { background-color: color-mix(in srgb, var(--pn-c) 8%, transparent); color: var(--pn-c); }
.pn-btn-text.pn-btn-primary { --pn-c: var(--pn-primary-ink); }

/* Static SSR form (account pages): one column of fields, messages and actions. */
.pn-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pn-space-4); max-width: 30rem; }

/* One account field with its live hint (FieldRequirements): the hint sits directly below the input. */
.pn-field { display: grid; gap: var(--pn-space-1); min-width: 0; }
.pn-requirements { font-size: var(--pn-text-sm); color: var(--mud-palette-text-secondary); }
.pn-requirements p, .pn-requirements ul { margin: 0; padding: 0 var(--pn-space-3); list-style: none; }
.pn-requirements[data-state="idle"] .pn-requirements-list, .pn-requirements[data-state="typing"] .pn-requirements-idle, .pn-requirements[data-state="ok"] .pn-requirements-idle, .pn-requirements[data-state="missing"] .pn-requirements-idle { display: none; }
.pn-requirements[data-state="idle"] .pn-requirements-line:empty { display: none; }
.pn-requirements [data-state]::before { display: inline-block; width: 1.25em; }
.pn-requirements [data-state="ok"]::before { content: "\2713"; }
.pn-requirements [data-state="missing"]::before { content: "\2022"; }
.pn-requirements [data-state="missing"] { color: var(--mud-palette-error); }

/* The live hint explains a rule violation; MudBlazor's own message for the same field would repeat it. Server-only errors (name taken, wrong password) have no hint and stay. */
.pn-field:has(.pn-requirements[data-state="missing"], .pn-requirements[data-state="typing"] li[data-state="missing"]) .mud-input-helper-text.mud-input-error { display: none !important; } /* Mud utility .d-flex is !important */
.pn-field:has(.mud-input-helper-text.mud-input-error) .pn-requirements-line[data-state="ok"] { display: none; }

/* Read-only user name that password managers pair with a new/current password field (reset and change forms); out of the form grid, not focusable, not seen. */
.pn-credential-username { position: absolute; width: 0; height: 0; margin: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; pointer-events: none; }

/* Text fields and selects (MudTextField / MudSelect, outlined, dense). */
.pn-input, .pn-select { width: 100%; min-height: 40px; box-sizing: border-box; padding: var(--pn-space-2) var(--pn-space-4); border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--pn-radius-sm); background-color: transparent; color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family); font-size: var(--pn-text-md); line-height: 1.5; }
.pn-input:hover, .pn-select:hover { border-color: var(--mud-palette-text-primary); }
.pn-input:focus, .pn-select:focus { border-color: var(--pn-primary-ink); outline: none; box-shadow: 0 0 0 1px var(--pn-primary-ink); }
.pn-input.invalid, .pn-select.invalid { border-color: var(--mud-palette-error); }
.pn-input:disabled, .pn-select:disabled { color: var(--mud-palette-text-disabled); cursor: not-allowed; }
.pn-select option { background-color: var(--mud-palette-surface); color: var(--mud-palette-text-primary); }

/* Switch: native checkbox with role="switch" inside `pn-switch-label`. */
.pn-switch-label { display: inline-flex; align-items: center; gap: var(--pn-space-2); cursor: pointer; }
.pn-switch { appearance: none; flex: none; width: 2.4rem; height: 1.4rem; margin: 0; border-radius: var(--pn-radius-pill); cursor: pointer;
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 38%, transparent);
    background-image: radial-gradient(circle closest-side, var(--mud-palette-white) calc(100% - 1px), transparent 100%);
    background-repeat: no-repeat; background-size: 1.1rem 1.1rem; background-position: left .15rem center; transition: background-color 150ms; }
.pn-switch:checked { background-color: var(--mud-palette-primary); background-position: right .15rem center; }
.pn-switch:disabled { opacity: .5; cursor: not-allowed; }

/* Tables. */
.pn-table { width: 100%; border-collapse: collapse; }
.pn-table th, .pn-table td { padding: var(--pn-space-2) var(--pn-space-3); border-bottom: 1px solid var(--mud-palette-table-lines, var(--mud-palette-lines-default)); text-align: left; }
.pn-table th { color: var(--mud-palette-text-secondary); font-weight: var(--pn-weight-medium); }

.pn-table-scroll { overflow-x: auto; }
.pn-nowrap { white-space: nowrap; }

/* Notices (MudAlert, outlined look). */
.pn-notice { --pn-c: var(--mud-palette-info); padding: var(--pn-space-2) var(--pn-space-4); border: 1px solid var(--pn-c); border-radius: var(--pn-radius-sm);
    background-color: color-mix(in srgb, var(--pn-c) 12%, transparent); color: var(--mud-palette-text-primary); }
.pn-notice-success { --pn-c: var(--mud-palette-success); }
.pn-notice-info { --pn-c: var(--mud-palette-info); }
.pn-notice-warning { --pn-c: var(--mud-palette-warning); }
.pn-notice-error { --pn-c: var(--mud-palette-error); }

@media (max-width: 599.98px) {
    .pn-btn, .pn-input, .pn-select { min-height: 44px; }
    .pn-btn-icon { min-width: 44px; }
    .pn-switch-label { min-height: 44px; }
}

/* One fixed accent per Pokémon type (detail page, type badge and any .pn-type-accent with data-type, e.g. the coloured move chip); everything else derives from it, per colour mode. */
.pokemon-details, .pokemon-type, .pn-type-accent { --pokemon-accent: #58828a; }
.pokemon-details[data-type="normal"], .pokemon-type[data-type="normal"], .pn-type-accent[data-type="normal"] { --pokemon-accent: #89929c; }
.pokemon-details[data-type="fire"], .pokemon-type[data-type="fire"], .pn-type-accent[data-type="fire"] { --pokemon-accent: #db6429; }
.pokemon-details[data-type="water"], .pokemon-type[data-type="water"], .pn-type-accent[data-type="water"] { --pokemon-accent: #3885c4; }
.pokemon-details[data-type="electric"], .pokemon-type[data-type="electric"], .pn-type-accent[data-type="electric"] { --pokemon-accent: #b89518; }
.pokemon-details[data-type="grass"], .pokemon-type[data-type="grass"], .pn-type-accent[data-type="grass"] { --pokemon-accent: #548e37; }
.pokemon-details[data-type="ice"], .pokemon-type[data-type="ice"], .pn-type-accent[data-type="ice"] { --pokemon-accent: #398f9c; }
.pokemon-details[data-type="fighting"], .pokemon-type[data-type="fighting"], .pn-type-accent[data-type="fighting"] { --pokemon-accent: #b14d51; }
.pokemon-details[data-type="poison"], .pokemon-type[data-type="poison"], .pn-type-accent[data-type="poison"] { --pokemon-accent: #9856b0; }
.pokemon-details[data-type="ground"], .pokemon-type[data-type="ground"], .pn-type-accent[data-type="ground"] { --pokemon-accent: #a67942; }
.pokemon-details[data-type="flying"], .pokemon-type[data-type="flying"], .pn-type-accent[data-type="flying"] { --pokemon-accent: #738cbe; }
.pokemon-details[data-type="psychic"], .pokemon-type[data-type="psychic"], .pn-type-accent[data-type="psychic"] { --pokemon-accent: #ce537a; }
.pokemon-details[data-type="bug"], .pokemon-type[data-type="bug"], .pn-type-accent[data-type="bug"] { --pokemon-accent: #7b922d; }
.pokemon-details[data-type="rock"], .pokemon-type[data-type="rock"], .pn-type-accent[data-type="rock"] { --pokemon-accent: #95865b; }
.pokemon-details[data-type="ghost"], .pokemon-type[data-type="ghost"], .pn-type-accent[data-type="ghost"] { --pokemon-accent: #6661a1; }
.pokemon-details[data-type="dragon"], .pokemon-type[data-type="dragon"], .pn-type-accent[data-type="dragon"] { --pokemon-accent: #5860b9; }
.pokemon-details[data-type="dark"], .pokemon-type[data-type="dark"], .pn-type-accent[data-type="dark"] { --pokemon-accent: #575263; }
.pokemon-details[data-type="steel"], .pokemon-type[data-type="steel"], .pn-type-accent[data-type="steel"] { --pokemon-accent: #58828a; }
.pokemon-details[data-type="fairy"], .pokemon-type[data-type="fairy"], .pn-type-accent[data-type="fairy"] { --pokemon-accent: #b764a6; }

/* Type chart colours (docs/ui/rules.md «Type chart»), one source for matrix, ranking and the home overview: data-perspective says whether more damage is good or bad
   for the user (pos/neg = more/less damage); data-e maps an exponent to the pale area of a lit head (--exp-tint), the tile of one step and the
   solid tile of two steps or more (--exp-cell) with its text (--exp-cell-ink), and the ranking bar (--exp-bar: of one step its own colour, which
   stands off the dark card). The values themselves come from AppTheme (--pn-type-chart-*). */
.type-chart-palette[data-perspective="attack"] {
    --pos-tint: var(--pn-type-chart-good-tint); --pos-cell: var(--pn-type-chart-good-tint-strong); --pos-solid: var(--pn-type-chart-good-pill); --pos-solid-ink: var(--pn-type-chart-good-pill-ink); --pos-bar: var(--pn-type-chart-good-bar);
    --neg-tint: var(--pn-type-chart-bad-tint); --neg-cell: var(--pn-type-chart-bad-tint-strong); --neg-solid: var(--pn-type-chart-bad-pill); --neg-solid-ink: var(--pn-type-chart-bad-pill-ink); --neg-bar: var(--pn-type-chart-bad-bar);
}
.type-chart-palette[data-perspective="defense"] {
    --pos-tint: var(--pn-type-chart-bad-tint); --pos-cell: var(--pn-type-chart-bad-tint-strong); --pos-solid: var(--pn-type-chart-bad-pill); --pos-solid-ink: var(--pn-type-chart-bad-pill-ink); --pos-bar: var(--pn-type-chart-bad-bar);
    --neg-tint: var(--pn-type-chart-good-tint); --neg-cell: var(--pn-type-chart-good-tint-strong); --neg-solid: var(--pn-type-chart-good-pill); --neg-solid-ink: var(--pn-type-chart-good-pill-ink); --neg-bar: var(--pn-type-chart-good-bar);
}
.type-chart-palette [data-e="1"] { --exp-tint: var(--pos-tint); --exp-cell: var(--pos-cell); --exp-cell-ink: var(--mud-palette-text-primary); --exp-bar: var(--pos-bar); }
.type-chart-palette [data-e="2"] { --exp-tint: var(--pos-tint); --exp-cell: var(--pos-solid); --exp-cell-ink: var(--pos-solid-ink); --exp-bar: var(--pos-solid); }
.type-chart-palette [data-e="-1"] { --exp-tint: var(--neg-tint); --exp-cell: var(--neg-cell); --exp-cell-ink: var(--mud-palette-text-primary); --exp-bar: var(--neg-bar); }
.type-chart-palette :is([data-e="-2"], [data-e="-3"]) { --exp-tint: var(--neg-tint); --exp-cell: var(--neg-solid); --exp-cell-ink: var(--neg-solid-ink); --exp-bar: var(--neg-solid); }

/* The type chart gear is a breadcrumb tool of the phone layout only; from md the divider before the page width switch would stand alone. */
@media (min-width: 960px) {
    .page-breadcrumbs-trailing:has(.type-chart-gear) .page-width-divider { display: none; }
}

/* The narrow width of the type chart still holds the matrix (70.5 rem with its panel) and the answer column (27.5 rem) side by side; the answer
   column moves below only when the screen is narrower. The page width switch hides while the content area (sidebar 250 px, none when collapsed)
   is not wider than that column (99.25 rem + 3 rem padding), because then it changes nothing. */
article.content:has(.type-chart-layout) { --pn-page-width-narrow: 99.25rem; }
@media (max-width: calc(102.25rem + 250px)) {
    .page:not(:has(> .sidebar-toggle:checked)) .page-breadcrumbs-trailing:has(.type-chart-gear) .page-width-toggle[data-page-width-kind] { display: none; }
}
@media (max-width: 102.25rem) {
    .page:has(> .sidebar-toggle:checked) .page-breadcrumbs-trailing:has(.type-chart-gear) .page-width-toggle[data-page-width-kind] { display: none; }
}

/* Type icon for a shortcode such as :fire: in names and Markdown; a Markdown image rule must not stretch it. */
img.pn-type-icon, .view-markdown img.pn-type-icon { height: 1.25em; width: auto; vertical-align: -0.25em; }

/* Label tree button with an active label filter (#629): a filled circle; its name says «Labelfilter aktiv». */
.mud-icon-button[data-label-filter="active"],
.mud-icon-button[data-label-filter="active"]:hover,
.mud-icon-button[data-filter-state="active"],
.mud-icon-button[data-filter-state="active"]:hover { border-radius: var(--pn-radius-circle); background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
/* Multi edit below 1280 px: the tree is in the drawer, the primary colour shows where to click to assign labels. */
@media (max-width: 1279.98px) {
    .mud-icon-button[data-multi-edit="on"]:not([data-label-filter="active"]) { color: var(--mud-palette-primary); }
}

/* Pull-to-refresh (pull-to-refresh.js): the script adds the indicator while a pull is in progress; no native pull or bounce competes with it. */
html { overscroll-behavior-y: none; }
.pn-pull-refresh {
    position: fixed; top: calc(env(safe-area-inset-top) + var(--pn-header-height)); left: 50%; z-index: var(--mud-zindex-appbar);
    display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: var(--pn-radius-circle);
    background: var(--mud-palette-surface); color: var(--pn-primary-ink); box-shadow: var(--mud-elevation-4); pointer-events: none;
    opacity: var(--pn-pull-progress, 0); transform: translate(-50%, calc(var(--pn-pull-offset, 0px) - 100%));
}
.pn-pull-refresh[data-released] { transition: transform .2s ease-out, opacity .2s ease-out; }
.pn-pull-refresh svg { transform: rotate(calc(var(--pn-pull-progress, 0) * 180deg)); }
.pn-pull-refresh[data-state="locked"] svg { transform: none; }
.pn-pull-refresh[data-state="refreshing"] svg { transform: none; animation: pn-pull-refresh-spin 1s linear infinite; }
@keyframes pn-pull-refresh-spin { to { transform: rotate(360deg); } }
/* Below the drawer backdrop (1099), so the open mobile menu covers it. Phones only; the page end room of .content keeps it clear.
   A stuck editor add bar sets --pn-bottom-bar-height (EditorAddBar.razor.js), so the button stays above the bar. */
:root { --pn-refresh-button-size: 3rem; }
.pn-refresh-button {
    position: fixed; right: calc(env(safe-area-inset-right) + var(--pn-space-4)); bottom: calc(env(safe-area-inset-bottom) + var(--pn-bottom-bar-height, 0px) + var(--pn-space-4)); z-index: 1000;
    display: none; align-items: center; justify-content: center; width: var(--pn-refresh-button-size); height: var(--pn-refresh-button-size); padding: 0; border: 0; border-radius: var(--pn-radius-circle);
    background: var(--mud-palette-surface); color: var(--pn-primary-ink); box-shadow: var(--mud-elevation-4); cursor: pointer;
}
@media (max-width: 959.98px) {
    .pn-refresh-button[data-visible] { display: flex; }
}
.pn-refresh-button[data-fading] { opacity: 0; transition: opacity 1s linear; }
.pn-refresh-button:focus-visible { outline: 2px solid var(--pn-primary-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .pn-pull-refresh[data-released] { transition: none; }
    .pn-refresh-button[data-fading] { opacity: 1; transition: none; }
    .pn-pull-refresh svg, .pn-pull-refresh[data-state="refreshing"] svg { transform: none; animation: none; }
}
.view-card-toolbar .mud-checkbox { margin-block: calc(-1 * var(--pn-space-2)); }

/* Changed row blink (shared by the label tree and the sort dialog): two alternating classes, so a second change of the same row restarts the animation. */
@media (prefers-reduced-motion: no-preference) {
    .pn-row-changed-even { animation: pn-row-changed-even 1.2s ease-out; }
    .pn-row-changed-odd { animation: pn-row-changed-odd 1.2s ease-out; }
}
@keyframes pn-row-changed-even { from { background-color: var(--mud-palette-primary-hover); outline: 2px solid var(--pn-primary-ink); } to { background-color: transparent; outline: 2px solid transparent; } }
@keyframes pn-row-changed-odd { from { background-color: var(--mud-palette-primary-hover); outline: 2px solid var(--pn-primary-ink); } to { background-color: transparent; outline: 2px solid transparent; } }

/* Header menus (language, colour, account): the base of the HeaderMenu component. The summary is 2.75rem wide and the panel ends at its right edge, so the arrow sits on the icon centre; 7px = half the arrow plus the panel border. */
.header-menu {
    position: relative;
    flex-shrink: 0;
}

.header-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--pn-radius-sm);
    cursor: pointer;
    list-style: none;
}

.header-menu > summary::-webkit-details-marker { display: none; }
.header-menu > summary:hover { background: var(--mud-palette-action-default-hover); }
/* The summary sits on the filled header, the options on the panel surface. */
.header-menu > summary:focus-visible { outline: 2px solid var(--mud-palette-appbar-text); outline-offset: 2px; }

.header-menu-panel {
    position: absolute;
    top: calc(100% + .75rem);
    right: 0;
    z-index: 1100;
    max-width: calc(100vw - 1rem);
    padding: var(--pn-space-2);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--pn-radius-sm);
    box-shadow: var(--mud-elevation-8);
}

.header-menu-panel::before {
    content: "";
    position: absolute;
    top: -7px;
    right: calc(1.375rem - 7px);
    width: 12px;
    height: 12px;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    border-left: 1px solid var(--mud-palette-lines-default);
    transform: rotate(45deg);
}

.header-menu-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 2.75rem;
    padding: var(--pn-space-2) var(--pn-space-3);
    margin: 0;
    border: 0;
    border-radius: var(--pn-radius-sm);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    line-height: normal;
    cursor: pointer;
}

.header-menu-option:hover { background: var(--mud-palette-action-default-hover); }
.header-menu-option:focus-visible { outline: 2px solid var(--pn-primary-ink); outline-offset: 2px; }
.header-menu-option[aria-current="true"] { font-weight: var(--pn-weight-semibold); color: var(--pn-primary-ink); }

/* Per-menu widths and spacing: the details and the panel come from HeaderMenu, so scoped component CSS cannot reach them. */
.header-menu.language-menu > .header-menu-panel { min-width: 7rem; }
.header-menu.brand-color-menu > .header-menu-panel { width: 13rem; }
.header-menu.account-menu > .header-menu-panel { width: 15rem; }
.header-menu.brand-color-menu,
.header-menu.account-menu { margin-left: var(--pn-space-2); }
