﻿/*
    FocusOnNavigate moves focus to the page heading after every navigation, so that a screen
    reader announces which page it landed on instead of leaving the user at the top of the
    document with no signal. Blazor gives the heading tabindex="-1" to make that possible, and
    the browser then paints its focus ring around the title - visibly, on every single page.

    Suppressing the ring here costs keyboard users nothing: tabindex="-1" keeps the heading out
    of the tab order, so it can only ever be focused programmatically. The announcement, which
    is the point of the behaviour, is unaffected.
*/
h1[tabindex="-1"]:focus,
h1[tabindex="-1"]:focus-visible {
    outline: none;
}

/*
   The grid gives every tile a fixed aspect ratio. That is what makes row virtualisation stable:
   every row has the same height, so Virtualize can compute a constant ItemSize
   (Pflichtenheft 8.5, 14.2).
*/
.asset-grid {
    display: grid;

    /*
        Three across, stated rather than derived. auto-fill with a minimum lands on whatever the
        column width happens to divide by, which is how this view ended up with four stamps at one
        width and two large tiles at another. Three is the layout; the breakpoints below give up
        columns rather than let the tiles fall below a usable size.
    */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/*
    Four on a wide screen. Three was decided at 1280-1440 px, where it holds; on a 1920 px monitor -
    what the people choosing pictures mostly sit at - three tiles came out over 400 px wide and a
    screen showed six pictures. Still a stated number per width, for the reason above.
*/
@media (min-width: 1700px) {
    .asset-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .asset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .asset-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.asset-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--mud-palette-background-gray);
    cursor: pointer;
    transition: box-shadow 160ms ease-out;
}

.asset-tile:hover {
    box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.45);
}

/* The picture leans in a little under the pointer, inside its frame - the tile itself does not
   move, so the grid never shifts under the hand that is about to click. */
:not(.asset-grid--list) > .asset-tile:hover .asset-tile__image {
    transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
    .asset-tile:hover .asset-tile__image {
        transform: none !important;
    }
}

/* Visible focus indicator, required for keyboard operation (NFA-402, FA-907). */
.asset-tile:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.asset-tile__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 300ms ease-out;
}

/* Source and status share one row in the top right corner, so neither has to know about the
   other and the top left stays free for the selection circle. */
.asset-tile__corner {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* The remove button sits on the tile itself, opposite the source badge, and only appears for
   somebody who may edit the collection. */
.collection-item {
    position: relative;
}

.collection-item__remove {
    position: absolute;
    top: 6px;
    left: 6px;
}

.collection-item__remove .mud-icon-button {
    background: rgba(0, 0, 0, 0.55);
    color: #FFFFFF;
}

/* The source badge carries the icon and nothing else (FA-401). Without this it keeps the padding
   and the icon margin a chip reserves for a label that is no longer there, and sits on the picture
   as a wide empty lozenge. */
.source-badge {
    min-width: 0;
    padding-inline: 6px;
}

.source-badge .mud-chip-icon {
    margin: 0;
}

.asset-tile__status {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    padding: 2px;
}

/* The AI badge draws a ring around its icon while the analysis is outstanding. A still hourglass
   said only that the work had not finished; the ring says it is under way, which is the difference
   between "stuck" and "wait a moment" to somebody who has just uploaded fifty files.

   The ring is drawn inside the badge rather than around it, so this badge measures the same as the
   availability one beside it and the corner row keeps its rhythm. That is what the icon shrinks
   for - the 20 px it would take leaves the ring nowhere to sit. */
.asset-tile__ai {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.asset-tile__ai::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--mud-palette-info);
    animation: asset-tile-ai-spin 1.4s linear infinite;
}

.asset-tile__ai .mud-icon-root {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

@keyframes asset-tile-ai-spin {
    to {
        transform: rotate(1turn);
    }
}

/* The motion is decoration: the icon, the tooltip and the screen-reader text each say what is
   happening on their own, so switching it off costs nothing (NFA-402). The ring stays - it is what
   makes the badge legible as "AI" rather than a second availability mark. */
@media (prefers-reduced-motion: reduce) {
    .asset-tile__ai::before {
        animation: none;
    }
}

.asset-tile__tags {
    position: absolute;
    bottom: 36px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/*
    A shade that fades in from the bottom edge rather than a black bar across it: the name stays
    readable on any picture, and the picture keeps its lower quarter. The gradient is tall and dark
    enough at the text line that white text clears 4.5:1 even over a white sky.
*/
.asset-tile__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 12px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.5) 45%, transparent 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.asset-tile__caption .asset-tile__meta {
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.asset-tile__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layout is fully usable from 1280 px and workable from 768 px (FA-909). */
@media (max-width: 768px) {
    .asset-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* --- Asset detail --------------------------------------------------------- */

.asset-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: 70vh;
    overflow: hidden;
    cursor: zoom-in;
    background: repeating-conic-gradient(#e9e9ec 0% 25%, #f6f6f8 0% 50%) 50% / 24px 24px;
}

.asset-preview__image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.asset-preview__zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
}

.origin-table th,
.metadata-table th {
    width: 34%;
    text-align: left;
    font-weight: 500;
    vertical-align: top;
    white-space: nowrap;
}

.metadata-table td {
    word-break: break-word;
}

.origin-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
}

/* The origin marker is a label, not a colour: it has to survive greyscale (NFA-403, FA-311). */
.metadata-origin {
    margin-left: 8px;
    padding: 1px 6px;
    border: 1px solid currentColor;
    border-radius: 10px;
    font-size: 0.7rem;
    opacity: 0.75;
    white-space: nowrap;
}

.dominant-color {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.keyword-chip--weak {
    opacity: 0.65;
}

.duplicate-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.duplicate-row:first-of-type {
    border-top: 0;
}

.duplicate-row__thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    flex: 0 0 auto;
}

.duplicate-row__body {
    flex: 1 1 auto;
    min-width: 0;
}

.duplicate-row__source {
    font-weight: 600;
    margin-right: 6px;
}

/* --- Lightbox (FA-905) ---------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.lightbox:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.lightbox__image {
    max-width: 96vw;
    max-height: 88vh;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    will-change: transform;
}

.lightbox__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: #fff;
    background: linear-gradient(rgba(0, 0, 0, 0.6), transparent);
}

.lightbox__title {
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox__spacer {
    flex: 1 1 auto;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__nav:hover { background: rgba(255, 255, 255, 0.28); }

.lightbox__nav:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.lightbox__nav--previous { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox__hint {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
}

.lightbox__hint kbd {
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    font-size: 0.75rem;
}

/* Screen-reader-only text, used where a colour swatch needs a name (NFA-403). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Skins ----------------------------------------------------------------
   The interface is themed by MudBlazor, which sets --mud-palette-* at runtime, and almost
   everything below reads those. Sign-in and access denied cannot: they render statically, with no
   theme provider above them, so they would keep the product's colours while the rest of the
   application wore the customer's. These variables give those pages the same switch. The body
   carries data-theme, set from Display:Skin.
   -------------------------------------------------------------------------- */

/*
    The product's own skin, matching CatalogThemes.Default: neutral greys with R = G = B so that no
    tint of the frame shifts the colours of the pictures inside it, and one indigo accent. The two
    brand colours draw the mark (BrandMark.razor); the hero colours the left half of the sign-in.
*/
:root {
    --cmo-page: #f5f5f5;
    --cmo-surface: #fff;
    --cmo-text: #171717;
    --cmo-text-muted: #525252;
    --cmo-border: #949494;
    --cmo-hairline: #e5e5e5;
    --cmo-accent: #4f46e5;
    --cmo-accent-hover: #4338ca;
    --cmo-accent-text: #fff;
    --cmo-focus: #312e81;
    --cmo-danger: #dc2626;
    --cmo-danger-bg: #fef2f2;
    --cmo-danger-text: #7f1d1d;
    --cmo-radius: 16px;
    --cmo-radius-small: 10px;
    --cmo-font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cmo-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.12);
    --cmo-brand-a: #4f46e5;
    --cmo-brand-b: #7c3aed;
    --cmo-hero-bg:
        radial-gradient(120% 80% at 100% 0%, rgba(167, 139, 250, 0.35) 0%, transparent 60%),
        radial-gradient(90% 70% at 0% 100%, rgba(79, 70, 229, 0.45) 0%, transparent 60%),
        linear-gradient(160deg, #1e1b4b 0%, #262262 55%, #2e1065 100%);
    --cmo-hero-text: #fff;
    --cmo-hero-muted: rgba(255, 255, 255, 0.78);
}

/*
    Read off the customer's own site rather than guessed: navy #000066 for anything that leads,
    #0000EE for links, the greys its panels are built from, and square corners throughout. The type
    is Verdana as there, but not the 11px of the original - matching a house style is worth doing,
    matching its accessibility problems is not (NFA-403).
*/
body[data-theme="steeltags"] {
    --cmo-page: #bebebe;
    --cmo-surface: #fff;
    --cmo-border: #999;
    --cmo-accent: #000066;
    --cmo-accent-hover: #000099;
    --cmo-focus: #0000ee;
    --cmo-danger: #c00;
    --cmo-danger-bg: #f7e4e4;
    --cmo-danger-text: #600;
    --cmo-radius: 0;
    --cmo-radius-small: 0;
    --cmo-font: Verdana, Geneva, sans-serif;
    --cmo-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    --cmo-heading: #000066;
    --cmo-text: #000;
    --cmo-text-muted: #4c4c4c;
    --cmo-hairline: #ccc;
    --cmo-brand-a: #000066;
    --cmo-brand-b: #1a1aa6;
    --cmo-hero-bg: linear-gradient(160deg, #000066 0%, #00003d 100%);
}

/*
    Petrol, matching CatalogThemes.Petrol: the colour lives in the navigation column, the page is a
    cool blue-grey, corners are small. The hero is petrol lightening towards the lower right, with
    fine wave lines and two soft swells along the bottom - drawn inline, so the skin ships no image.
*/
body[data-theme="petrol"] {
    --cmo-page: #f1f4f6;
    --cmo-surface: #fff;
    --cmo-text: #37474f;
    --cmo-text-muted: #5f6b73;
    --cmo-border: #7b8a94;
    --cmo-hairline: #d8dee3;
    --cmo-accent: #1f4e5f;
    --cmo-accent-hover: #2e6a82;
    --cmo-accent-text: #fff;
    --cmo-focus: #2e6a82;
    --cmo-radius: 8px;
    --cmo-radius-small: 4px;
    --cmo-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px -12px rgba(31, 78, 95, 0.22);
    --cmo-brand-a: #1f4e5f;
    --cmo-brand-b: #2e6a82;
    --cmo-hero-bg:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 600' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='white' stroke-opacity='.1' stroke-width='1.2'%3E%3Cpath d='M0 120C240 60 480 180 720 130S1200 60 1440 110'/%3E%3Cpath d='M0 170C260 110 500 230 760 180S1220 110 1440 160'/%3E%3Cpath d='M0 330C300 270 560 390 840 330S1260 270 1440 320'/%3E%3Cpath d='M0 380C320 320 580 440 860 380S1280 320 1440 370'/%3E%3C/g%3E%3Cpath fill='white' fill-opacity='.05' d='M0 470C360 420 720 520 1080 470S1440 450 1440 450V600H0Z'/%3E%3Cpath fill='white' fill-opacity='.07' d='M0 525C400 485 800 575 1200 525S1440 515 1440 515V600H0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat,
        radial-gradient(90% 70% at 85% 100%, rgba(91, 138, 160, 0.45) 0%, transparent 60%),
        linear-gradient(160deg, #1b4554 0%, #1f4e5f 45%, #2e6a82 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --cmo-page: #0f0f0f;
        --cmo-surface: #171717;
        --cmo-text: #ededed;
        --cmo-text-muted: #a3a3a3;
        --cmo-border: #737373;
        --cmo-hairline: #2e2e2e;
        --cmo-accent: #818cf8;
        --cmo-accent-hover: #a5b4fc;
        --cmo-accent-text: #111;
        --cmo-focus: #c7d2fe;
        --cmo-danger: #f87171;
        --cmo-danger-bg: #2a1414;
        --cmo-danger-text: #fecaca;
        --cmo-card-shadow: 0 0 0 1px #2e2e2e;
    }

    body[data-theme="steeltags"] {
        --cmo-page: #101018;
        --cmo-surface: #1c1c24;
        --cmo-text: #e8e8ea;
        --cmo-border: #3a3a48;
        --cmo-text-muted: #b0b0b8;
        --cmo-hairline: #2a2a36;
        --cmo-accent: #2b2b8f;
        --cmo-accent-hover: #3a3ab0;
        --cmo-accent-text: #fff;
        --cmo-focus: #8f9ce0;
        --cmo-heading: #cfd4f5;
        --cmo-danger: #ff6b6b;
        --cmo-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    }

    body[data-theme="petrol"] {
        --cmo-page: #0f1518;
        --cmo-surface: #182024;
        --cmo-text: #e3e9ec;
        --cmo-text-muted: #a3b1b8;
        --cmo-border: #6f8189;
        --cmo-hairline: #2a363c;
        --cmo-accent: #7fb6c9;
        --cmo-accent-hover: #a7c7d4;
        --cmo-accent-text: #0b1d24;
        --cmo-focus: #a7c7d4;
        --cmo-card-shadow: 0 0 0 1px #2a363c;
    }
}

/*
    The one thing a palette cannot express: on the original every panel is a box with a hairline
    border and no shadow, which is what gives that site its squared-off, technical feel. Scoped to
    the content area so the app bar, menus and dialogs keep their own treatment.
*/
body[data-theme="steeltags"] .mud-main-content .mud-paper,
body[data-theme="steeltags"] .mud-main-content .mud-card {
    border: 1px solid var(--cmo-border);
    box-shadow: none;
}

/*
    On that site the grey is only ever the gap between boxes - fields are white, panels are white,
    nothing floats on the background. Our own palette needs none of this: against a near-white page
    an outlined field reads perfectly well unfilled. On grey it becomes a line drawing, and a search
    box the whole catalogue is built around disappears into the page. These are surfaces the skin
    puts back, not layout it moves.
*/

/* Fields. Outlined inputs are transparent by default - this covers every page at once. */
body[data-theme="steeltags"] .mud-input.mud-input-outlined,
body[data-theme="steeltags"] .mud-input.mud-input-filled {
    background-color: var(--cmo-surface);
}

/*
    The search, which is the one control the catalogue is arranged around. Only the colours: the
    geometry, and the sticky behaviour that depends on it, belong to the layout and are the same in
    every skin.
*/
body[data-theme="steeltags"] .catalog-search {
    background: var(--cmo-surface);
}

/* A dashed outline on grey reads as a gap in the page rather than as a target for a file. */
body[data-theme="steeltags"] .upload-drop {
    background: var(--cmo-surface);
}

/*
    Page titles carry the skin's colour but no box. A bar was tried - it is what the template puts
    above every panel - and it read as heavy above a page that is already a stack of boxes.
*/
body[data-theme="steeltags"] .mud-main-content h1.mud-typography {
    color: var(--cmo-heading);
}

/*
    Every alert in the application is the text variant, which draws itself from a 6%-opaque tint of
    its severity colour. Against white that is a readable wash; against this skin's grey it is
    nothing at all, and a paragraph of explanation sits on the page like stray text. The surface
    goes underneath it; severity keeps saying what it says, through the icon and the text colour.
*/
body[data-theme="steeltags"] .mud-alert {
    border: 1px solid var(--cmo-border);
    background-color: var(--cmo-surface);
}

/* The result count, the sort and the density switch, which otherwise sit on the page itself. */
body[data-theme="steeltags"] .catalog-toolbar {
    background: var(--cmo-surface);
    border: 1px solid var(--cmo-border);
    padding: 8px 12px;
}

/*
    Petrol turns the frame round: a white bar with a hairline and a petrol column, where the other
    skins have a dark bar over a light column. Everything below is that one difference - the bar's
    controls go back to their light-surface colours, and the navigation's go to white on petrol.
*/
body[data-theme="petrol"] .app-bar.mud-appbar {
    background: var(--mud-palette-appbar-background);
    box-shadow: 0 1px 0 var(--mud-palette-lines-default), 0 2px 8px -4px rgba(31, 78, 95, 0.18);
}

body[data-theme="petrol"] .app-avatar {
    box-shadow: none;
}

body[data-theme="petrol"] .app-avatar:focus-visible {
    outline-color: color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
}

body[data-theme="petrol"] .quick-search-trigger {
    border-color: var(--mud-palette-lines-default);
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-secondary);
}

body[data-theme="petrol"] .quick-search-trigger:hover {
    border-color: var(--mud-palette-lines-inputs);
    background: var(--mud-palette-background);
}

body[data-theme="petrol"] .quick-search-trigger:focus-visible {
    outline-color: color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
    border-color: var(--mud-palette-primary);
}

body[data-theme="petrol"] .quick-search-trigger__key {
    border-color: var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

body[data-theme="petrol"] .app-drawer.mud-drawer {
    border-right: 0;
}

body[data-theme="petrol"] .app-nav.mud-navmenu .mud-nav-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

body[data-theme="petrol"] .app-nav.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

body[data-theme="petrol"] .app-nav.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon {
    color: #fff;
}

body[data-theme="petrol"] .app-nav .mud-nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: -2px;
}

body[data-theme="petrol"] .app-nav__heading {
    color: rgba(255, 255, 255, 0.68);
}

body[data-theme="petrol"] .app-nav__divider.mud-divider {
    border-color: rgba(255, 255, 255, 0.16);
}

body[data-theme="petrol"] .mud-drawer .app-version {
    color: rgba(255, 255, 255, 0.6);
    border-top-color: rgba(255, 255, 255, 0.12);
}

/*
    No contact sheet in this skin: the wave lines are its picture, and the tilted frames on top of
    them made the hero busy - a pattern of diamonds over a pattern of lines.
*/
body[data-theme="petrol"] .hero-sheet {
    display: none;
}

/* --- Sign-in and access denied -------------------------------------------- */
/* Statically rendered pages, so they carry their own styling rather than relying on MudBlazor. */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cmo-page);
    color: var(--cmo-text);
    font-family: var(--cmo-font);
}

/*
    The sign-in proper: the product's half and the form's half side by side. The form half is
    slightly wider, because it is the one with work to do, and the hero never grows past what its
    three sentences need.
*/
.login-page--split {
    display: grid;
    grid-template-columns: minmax(380px, 5fr) 6fr;
    align-items: stretch;
}

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 40px 56px;
    overflow: hidden;
    background: var(--cmo-hero-bg);
    color: var(--cmo-hero-text, #fff);
}

.login-hero__brand,
.login-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.login-hero__body {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin-block: auto;
    padding-bottom: 12vh;
}

.login-hero__title {
    margin: 0 0 24px;
    font-size: clamp(1.9rem, 2.6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.login-hero__points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
    color: var(--cmo-hero-muted, rgba(255, 255, 255, 0.8));
    font-size: 0.98rem;
    line-height: 1.5;
}

/* A tick drawn in CSS rather than an icon font: this page has no MudBlazor to draw one with. */
.login-hero__points li {
    position: relative;
    padding-left: 30px;
}

.login-hero__points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.login-hero__points li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/*
    Six frames of a contact sheet, tilted and half-transparent behind the lower corner. Gradients
    rather than photographs: a stock picture on a product's own sign-in reads as a template, and a
    customer's picture here would be shown to anyone who opens the address. Shared with the
    dashboard's welcome band and, small, with the empty states (ContactSheet.razor).
*/
.hero-sheet {
    position: absolute;
    right: -70px;
    bottom: -50px;
    display: grid;
    grid-template-columns: repeat(3, 150px);
    gap: 14px;
    transform: rotate(-12deg);
    opacity: 0.55;
    pointer-events: none;
}

.hero-sheet span {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
}

.hero-sheet span:nth-child(2) { background: linear-gradient(135deg, #f59e0b55, #ef444433); }
.hero-sheet span:nth-child(4) { background: linear-gradient(135deg, #22d3ee55, #4f46e533); }
.hero-sheet span:nth-child(6) { background: linear-gradient(135deg, #a3e63555, #15803d33); }

/* The form's own copy of the mark, for when the hero is gone. */
.login-card__brand {
    display: none;
    margin-bottom: 28px;
}

@media (max-width: 899px) {
    .login-page--split {
        display: flex;
    }

    .login-hero {
        display: none;
    }

    .login-card__brand {
        display: flex;
    }
}

.login-card {
    width: min(400px, calc(100vw - 32px));
    padding: 36px;
    background: var(--cmo-surface);
    color: var(--cmo-text);
    border-radius: var(--cmo-radius);
    box-shadow: var(--cmo-card-shadow);
}

/*
    Sign-out and access denied are a lone card. They sit on the sign-in's hero, so the last and
    the refusing page of a visit wear the same skin as the first one.
*/
.login-page:not(.login-page--split) {
    background: var(--cmo-hero-bg);
}

/*
    The sign-out page is bare HTML without MudBlazor's reset, and the browser's own margin framed
    the hero in white.
*/
body:has(> .login-page) {
    margin: 0;
}

.login-card a {
    color: var(--cmo-accent);
}

/* Beside the hero the card needs no box of its own: the half of the page is the box. */
.login-page--split .login-card {
    box-shadow: none;
    background: transparent;
}

.login-page--split .login-main {
    background: var(--cmo-surface);
}

.login-title {
    margin: 0 0 24px;
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.login-page--split .login-title {
    margin-bottom: 6px;
}

.login-subtitle {
    margin: 0 0 24px;
    color: var(--cmo-text-muted);
    font-size: 0.95rem;
}

.login-label {
    display: block;
    margin: 16px 0 6px;
    font-size: 0.875rem;
    font-weight: 550;
}

.login-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--cmo-border);
    border-radius: var(--cmo-radius-small);
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--cmo-surface);
    color: var(--cmo-text);
    font-family: inherit;
}

.login-input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cmo-accent) 30%, transparent);
    outline-offset: 0;
    border-color: var(--cmo-accent);
}

.login-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    font-size: 0.875rem;
}

.login-button {
    width: 100%;
    min-height: 44px;
    padding: 11px;
    margin-top: 8px;
    border: 0;
    border-radius: var(--cmo-radius-small);
    background: var(--cmo-accent);
    color: var(--cmo-accent-text);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 120ms ease-out;
}

.login-button:hover,
.login-button:active {
    background: var(--cmo-accent-hover);
    color: var(--cmo-accent-text);
}

.login-button:focus-visible {
    outline: 3px solid var(--cmo-focus);
    outline-offset: 2px;
}

/* Never colour alone: the message carries the meaning (NFA-403). */
.login-error {
    padding: 12px;
    margin-bottom: 16px;
    border-left: 4px solid var(--cmo-danger);
    background: var(--cmo-danger-bg);
    color: var(--cmo-danger-text);
    font-size: 0.9rem;
}

.validation-message {
    display: block;
    margin-top: 4px;
    color: var(--cmo-danger);
    font-size: 0.8rem;
}

/* --- Upload (FA-1302) ----------------------------------------------------- */

.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    border: 2px dashed var(--mud-palette-lines-inputs);
    border-radius: 12px;
    background: var(--mud-palette-surface);
    text-align: center;
    transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.upload-drop--active {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-action-default-hover);
}

/* The inputs are driven from JavaScript; the buttons above them are what the user sees. */
.upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.upload-row:first-of-type { border-top: 0; }

.upload-row__body {
    flex: 1 1 auto;
    min-width: 0;
}

.upload-row__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Dashboard ------------------------------------------------------------ */

.dashboard-tile {
    height: 100%;
    transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

/* A tile that leads somewhere says so under the pointer; one that does not stays still. */
a:hover > .dashboard-tile {
    border-color: var(--mud-palette-lines-inputs);
    box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.3);
}

.dashboard-tile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.dashboard-tile__label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    font-weight: 550;
}

.dashboard-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--tile-color);
    background: color-mix(in srgb, var(--tile-color) 13%, transparent);
}

.dashboard-tile__value {
    color: var(--mud-palette-text-primary);
    font-size: 2rem;
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.dashboard-tile__caption {
    margin-top: 2px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
}

.distribution-row { margin-bottom: 12px; }

.distribution-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--mud-palette-action-default-hover);
    overflow: hidden;
}

.distribution-bar__fill {
    height: 100%;
    border-radius: 4px;
}

/* --- Sources -------------------------------------------------------------- */

.source-card { height: 100%; }

.source-card__failed { color: var(--mud-palette-error); }

.source-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    align-self: center;
}

.ingest-current {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
}

/* --- Duplicates ----------------------------------------------------------- */

.duplicate-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.duplicate-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    overflow: hidden;
}

.duplicate-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.duplicate-card__body { padding: 8px; }

.duplicate-card__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duplicates-slider { max-width: 320px; }

/* --- Keyword review and rights -------------------------------------------- */

.review-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
    flex-wrap: wrap;
}

.review-row:first-of-type { border-top: 0; }

.review-row__body { flex: 1 1 240px; }

.review-row__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.review-row__merge { min-width: 220px; }

.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0 12px;
}

.contrast-bad { color: var(--mud-palette-error); font-weight: 600; }
.contrast-good { color: var(--mud-palette-success); }

/* --- Colour quick pick (FA-702) ------------------------------------------- */

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-palette__swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

.color-palette__swatch--selected {
    border-color: var(--mud-palette-text-primary);
    border-width: 2px;
}

/*
    The swatches carry no text, so the focus ring is the whole of what a keyboard user has to go on.
    Drawn outside the box because inside it vanishes against the darker half of the palette.
*/
.color-palette__swatch:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.audit-details {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* --- Catalogue density (FA-902) ------------------------------------------- */

/*
    The list density is a row, not a tile with a picture in it. Everything on the tile is absolutely
    positioned over a 4:3 image, which is right for the grid and wrong here: the thumbnail shrinks
    to a corner while the dark caption bar and the badges stay stretched across the full width of
    the row, over empty background. Each part is put back into the flow and laid out left to right.
*/
.asset-grid--list {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.asset-grid--list .asset-tile {
    aspect-ratio: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

.asset-grid--list .asset-tile:hover {
    background: var(--mud-palette-action-default-hover);
}

.asset-grid--list .asset-tile__image {
    width: 128px;
    height: 84px;
    border-radius: 4px;
    flex: none;
    order: 1;
}

/* Out of the overlay and onto the surface: dark-on-image is unreadable off the image. */
.asset-grid--list .asset-tile__caption {
    position: static;
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 0;
    background: none;
    color: inherit;
    font-size: 0.875rem;
}

.asset-grid--list .asset-tile__name {
    font-weight: 500;
    max-width: 100%;
}

.asset-grid--list .asset-tile__meta {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

.asset-grid--list .asset-tile__tags {
    position: static;
    order: 3;
    flex: 0 1 auto;
    width: auto;
    justify-content: flex-end;
}

.asset-grid--list .asset-tile__status {
    position: static;
    order: 4;
    flex: none;
    padding: 0;
    background: none;
    border-radius: 0;
    display: flex;
}

.asset-grid--list .asset-tile__corner {
    position: static;
    order: 5;
    flex: none;
}

.asset-grid--list .asset-tile__select {
    position: static;
    order: 0;
    flex: none;
    background: none;
}

/* The frame sits inside the tile, so a selected image keeps its place in the grid instead of
   nudging its neighbours. */
.asset-tile--selected {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: -3px;
}

/* Out of the way until wanted: on hover, while selected, and whenever anything inside the tile has
   keyboard focus - without that last one the circle would be unreachable by keyboard. */
.asset-tile__select {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 120ms ease-in-out;
}

.asset-tile:hover .asset-tile__select,
.asset-tile:focus-within .asset-tile__select,
.asset-tile--selected .asset-tile__select {
    opacity: 1;
}

/* A pointer that never rests, on a touch screen, would leave the circle invisible for good. */
@media (hover: none) {
    .asset-tile__select {
        opacity: 1;
    }
}

/* --- Saved searches (FA-808) ---------------------------------------------- */

.saved-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

/* --- Similar images (FA-811) ---------------------------------------------- */

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.similar-card {
    display: block;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.similar-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.similar-card__caption {
    display: block;
    padding: 4px 6px;
    font-size: 0.75rem;
}

.similar-card__name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.similar-card__meta {
    display: block;
    opacity: 0.7;
}

/* --- Age distribution (FA-407) -------------------------------------------- */

.age-row { margin-bottom: 12px; }

.age-bar {
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--mud-palette-action-default-hover);
}

.age-bar__part { height: 100%; }

.age-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8rem;
    opacity: 0.85;
}

.age-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: -1px;
}

/* Four steps of one hue: the order is the message, not the colour itself (NFA-403). */
.age-swatch--month { background: #1A73E8; }
.age-swatch--year { background: #5B9BF0; }
.age-swatch--three { background: #9DC2F7; }
.age-swatch--older { background: #D6E4FB; }

/* --- Passkey sign-in (FA-1203) -------------------------------------------- */

.login-passkey { margin-top: 4px; }

.login-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.login-separator::before,
.login-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.3;
}

.login-button--secondary {
    background: transparent;
    color: inherit;
    border: 1px solid currentColor;
}

/*
    The outlined button keeps its own text colour, so it must not take the filled button's hover:
    dark text on the accent was unreadable the moment it was pointed at or pressed. A tint of the
    accent instead, which the text stays legible on in every skin.
*/
.login-button--secondary:hover,
.login-button--secondary:active {
    background: color-mix(in srgb, var(--cmo-accent) 10%, transparent);
    color: inherit;
}

.passkey-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.passkey-row:last-child { border-bottom: none; }

/* --- Circuit failure banner (NFA-405) ------------------------------------- */

/* Blazor toggles display on this element itself, so the layout lives on the children. */
#blazor-error-ui {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: #B3261E;
    color: #FFFFFF;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.blazor-error-ui__text { flex: 1; }

#blazor-error-ui a {
    color: #FFFFFF;
    text-decoration: underline;
    white-space: nowrap;
}

/* --- Provider model editor (FA-1204) -------------------------------------- */

.provider-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.provider-row:last-child { border-bottom: none; }

.provider-row__head {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

/* Two columns where a region applies, one where it does not. */
.provider-row__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

/* --- Account (FA-1202, FA-1203) ------------------------------------------- */

/*
    A form column rather than the full card width. Names and paths want the room; a password does
    not, and a field a metre wide makes the caret hard to find.
*/
.account-form {
    max-width: 420px;
}

/* --- Catalogue search (FA-801, FA-813) ------------------------------------ */

/*
    Above everything else, on its own panel. It is the control every visit to this page starts
    with; sitting in the filter column it carried the same weight as a checkbox.
*/
.catalog-search {
    /*
        A panel, not a bar: as wide as the two columns beneath it and no wider. Out to the edge of
        the window it read as a second application bar; centred at a fixed width it floated free of
        the grid it belongs to. Aligned with the content, it is part of the page.

        The width comes from the container rather than from a number here - no max-width, no auto
        margins - so it lines up with the filter column on the left and the tiles on the right at
        every window size, and keeps the same distance from the edge as everything else.
    */
    margin: 0 0 20px;
    padding: 12px 16px 10px;
    border-radius: var(--mud-default-borderradius);

    /*
        The surface colour, not the page colour: white in the light theme, and correspondingly dark
        in the dark one. A literal white would be a bright slab across a dark page at night.

        The shadow falls downward only - a negative spread pulls it back off the sides, so the panel
        casts onto what scrolls underneath it rather than outlining itself on all four edges.
    */
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
}

/*
    The shadow belongs to the pinned state only, where the panel really does sit over something:
    at rest a downward shadow made the search look as if it were already floating above a page
    that had not yet scrolled.
*/
.catalog-search--sticky {
    box-shadow: 0 10px 18px -14px rgba(0, 0, 0, 0.45);
}

/*
    Pinned, when the user asks for it. Being at the top of the page is not the same as being
    reachable: two screens into a result set the search was gone, and the way back to it was to
    scroll up past everything one had just scrolled through.

    Off by default, because it costs a strip of every screen on a page made of pictures. The pin
    beside the hint turns it on and the choice is remembered per user.

    top is the application bar's own height - MudMainContent is padded down by that much, so top: 0
    would park this behind the bar rather than beneath it. And that height is not one number:
    MudBlazor shortens the bar on small screens and shortens it again in landscape, with exactly the
    two breakpoints mirrored below. Getting it wrong is quiet either way - too small hides the field
    behind the bar, too large leaves a slit through which the page scrolls.
*/
.catalog-search--sticky {
    position: sticky;
    top: calc(var(--mud-appbar-height, 64px) - var(--mud-appbar-height, 64px) / 8);

    /* Above the tiles that scroll underneath, far below MudBlazor's overlays and popovers. */
    z-index: 3;
}

@media (min-width: 0px) and (orientation: landscape) {
    .catalog-search--sticky {
        top: calc(var(--mud-appbar-height, 64px) - var(--mud-appbar-height, 64px) / 4);
    }
}

@media (min-width: 600px) {
    .catalog-search--sticky {
        top: var(--mud-appbar-height, 64px);
    }
}

/*
    Above the field, not below it. Underneath, the hint sat between the search and the results and
    read as a caption on the wrong thing; the pin was two hundred pixels from the panel edge it
    controls. Above, both belong to the search they describe.
*/
.catalog-search__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* Taller and larger than a form field, because this one is the point of the page. */
/* The box and the AI button side by side; the box takes whatever the button leaves. */
.catalog-search__row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.catalog-search__row > .mud-input-control {
    flex: 1 1 auto;
    min-width: 0;
}

.catalog-search .mud-input.mud-input-outlined {
    font-size: 1.15rem;
}

.catalog-search .mud-input.mud-input-outlined > input {
    padding-top: 16px;
    padding-bottom: 16px;
}

.catalog-search .mud-input-outlined .mud-input-outlined-border {
    border-width: 1.5px;
    border-radius: 12px;
}

.catalog-search__hint {
    display: block;
    flex: 1 1 auto;
    color: var(--mud-palette-text-secondary);
    line-height: 1.4;
}

.catalog-search__hint kbd,
.catalog-toolbar kbd {
    padding: 0 5px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 5px;
    background: var(--mud-palette-background);
    font-family: inherit;
    font-size: 0.85em;
}

/* A tag's colour beside its name in the filter picker, so the list reads like the chips do. */
.tag-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: none;
}

/* --- Application frame ----------------------------------------------------

    The bar carries the dark half of the sign-in page across the top - its gradient, in SteelTags
    the customer's navy. The navigation stays the surface colour with a hairline where it meets
    the page: a dark column beside every picture was more colour than the frame should have.
    Petrol turns this round on purpose (see its block under Skins).
*/

.app-bar.mud-appbar {
    background: var(--cmo-hero-bg);
}

.app-drawer.mud-drawer {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.app-bar .mud-toolbar {
    gap: 4px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 6px;
    color: inherit;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.app-brand:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 6px;
}

.app-brand__owner {
    font-weight: 500;
    opacity: 0.6;
}

.app-bar__center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: 0 16px;
}

/* The name gives way before the search does: the mark alone still says whose application this is. */
@media (max-width: 959px) {
    .app-brand__name {
        display: none;
    }
}

/* A button, so the menu opens from the keyboard as well as from the pointer. */
.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cmo-brand-a), var(--cmo-brand-b));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.app-avatar:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}

.app-account {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
    padding: 10px 16px 10px;
}

.app-account__caption {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

.app-account__name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*
    Entries as rounded rows with an inset, the current one tinted with the accent. MudBlazor's own
    active state is a full-width band in the hover colour, which on a white column was hard to tell
    from the pointer simply resting there.
*/
.app-nav {
    padding: 8px 10px;
}

.app-nav .mud-nav-link {
    min-height: 38px;
    margin: 1px 0;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

/*
    Two classes on the menu on purpose: MudBlazor's own active rule names .mud-navmenu twice over,
    and with one class fewer its band won over the tint.
*/
.app-nav.mud-navmenu .mud-nav-link:hover:not(.active) {
    background: var(--mud-palette-action-default-hover);
}

.app-nav.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: color-mix(in srgb, var(--mud-palette-primary) 11%, transparent);
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.app-nav.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon {
    color: var(--mud-palette-primary);
}

.app-nav__heading {
    padding: 18px 10px 6px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-nav__heading:first-child {
    padding-top: 8px;
}

.app-nav__divider {
    margin: 10px 4px;
}

/*
    Room around the page. Every page puts its content in a MudContainer with pa-4, and 16 px from
    the navigation edge reads as cramped next to a 248 px column; from a laptop up it is 24 and 32.
*/
@media (min-width: 960px) {
    .mud-main-content > .mud-container.pa-4 {
        padding: 24px 32px !important;
    }
}

/*
    Page titles in the type of the sign-in page's statement: heavier and set tighter than
    MudBlazor's h5, so a page opens with its name the way the sign-in opens with its claim.
*/
.mud-main-content h1.mud-typography-h5 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

/* --- Welcome band ---------------------------------------------------------

    The top of the dashboard, the first screen after the sign-in: the hero's gradient, its large
    type and its contact sheet, with the search as the one thing to do. The field follows the
    reader's light or dark mode; the band around it is dark in both, as the frame is.
*/
.welcome-band {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 36px 40px 40px;
    border-radius: var(--cmo-radius);
    background: var(--cmo-hero-bg);
    color: var(--cmo-hero-text);
}

.welcome-band__body {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.welcome-band__title {
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 2.4vw, 2.3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.welcome-band__lead {
    margin: 0 0 24px;
    color: var(--cmo-hero-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.welcome-band__search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(560px, 100%);
    height: 52px;
    padding: 0 12px 0 16px;
    border: 0;
    border-radius: var(--cmo-radius-small);
    background: var(--mud-palette-surface);
    box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.45);
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: box-shadow 120ms ease-out, transform 120ms ease-out;
}

.welcome-band__search .mud-icon-root {
    color: var(--mud-palette-primary);
}

.welcome-band__search:hover {
    box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
}

.welcome-band__search:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}

.welcome-band__search-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.welcome-band__search-key {
    flex: none;
    padding: 2px 7px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-background);
    font-family: inherit;
    font-size: 0.75rem;
}

/* In the band the sheet sits lower and further out: the band is shorter than the hero. */
.welcome-band .hero-sheet {
    right: -40px;
    bottom: -110px;
}

@media (max-width: 899px) {
    .welcome-band .hero-sheet {
        display: none;
    }
}

@media (max-width: 599px) {
    .welcome-band {
        padding: 24px 20px 28px;
    }

    .welcome-band__search-key {
        display: none;
    }
}

/* --- Empty states ---------------------------------------------------------

    "Nothing found" as a state of the page rather than as an alert: the small contact sheet of the
    sign-in, a sentence of what happened and one of what to try.
*/
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 16px;
    text-align: center;
}

.empty-state__title {
    margin: 22px 0 6px;
    color: var(--mud-palette-text-primary);
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.empty-state__text {
    max-width: 440px;
    margin: 0;
    color: var(--mud-palette-text-secondary);
}

/* The small sheet stands in the flow, upright enough to read as frames, in the accent on light. */
.hero-sheet--small {
    position: static;
    grid-template-columns: repeat(3, 44px);
    gap: 6px;
    transform: rotate(-8deg);
    opacity: 1;
}

.hero-sheet--small span {
    border-radius: calc(var(--cmo-radius-small) * 0.6);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 30%, transparent);
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.quick-search__section > .hero-sheet--small {
    margin: 12px 0 18px 8px;
}

/*
    Panels are separated by a hairline, not lifted off the page by a shadow. Expansion panels are
    excluded because they sit inside a panel already and would draw a box within a box.
*/
body[data-theme="default"] .mud-main-content .mud-paper:not(.mud-paper-outlined):not(.mud-expand-panel):not(.mud-skeleton) {
    border: 1px solid var(--mud-palette-lines-default);
}

body[data-theme="default"] .mud-main-content .mud-paper-outlined {
    border-color: var(--mud-palette-lines-default);
}

body[data-theme="default"] .mud-main-content .mud-paper {
    border-radius: 12px;
}

/*
    The build number at the foot of the navigation column, as a footer below the menu: the drawer
    content becomes a column, the menu takes the height that is left and scrolls inside it, and the
    label stays put underneath. An absolute label was tried first and sat over the last entry on a
    menu longer than the window.
*/
.mud-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mud-drawer .mud-navmenu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.mud-drawer .app-version {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    color: var(--mud-palette-text-disabled);
    border-top: 1px solid var(--mud-palette-divider);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The example CSV of the keyword import, shown as it has to be written. */
.import-example {
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 4px;
    background: var(--mud-palette-background-gray);
    overflow-x: auto;
    white-space: pre;
}

/* --- Quick search ----------------------------------------------------------

    The panel a new user sees first and anyone can bring back with the Search button or Ctrl+K.
    Everything takes its colours from the theme palette, so it is right in both modes and in every
    skin without a line of its own.
*/

/*
    The trigger looks like a field, sits in the middle of the bar, and is a button: it opens the
    panel, where the typing happens. A lighter shade of the bar itself, so it reads as a well in
    the bar, not as another outlined button beside the icons.
*/
.quick-search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(560px, 100%);
    height: 40px;
    padding: 0 8px 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.quick-search-trigger:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.14);
}

.quick-search-trigger:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.45);
    outline-offset: 0;
    border-color: #fff;
}

.quick-search-trigger__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-search-trigger__key {
    flex: none;
    padding: 1px 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 0.72rem;
    line-height: 1.5;
}

/* On a phone the bar has room for the magnifier and no more. */
@media (max-width: 599px) {
    .quick-search-trigger {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .quick-search-trigger__label,
    .quick-search-trigger__key {
        display: none;
    }
}

/* As much room above the field as beside it. Scoped under .mud-dialog because MudBlazor's own
   ".mud-dialog .mud-dialog-content { padding: 8px 24px }" is more specific than a lone class and
   quietly left the field 8 px under the edge. */
.mud-dialog .quick-search-dialog__content {
    padding-top: 24px;
}

.quick-search__hint {
    display: block;
    margin: 6px 2px 0;
    color: var(--mud-palette-text-secondary);
}

.quick-search__hint kbd {
    padding: 0 5px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9em;
}

.quick-search__section {
    margin-top: 18px;
}

.quick-search__heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.quick-search__total {
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
}

.quick-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.quick-search__count {
    margin-left: 6px;
    font-size: 0.85em;
    color: var(--mud-palette-text-secondary);
}

/* The tag's own colour as border, icon and a light wash - the wash mixed into the surface, so
   it reads in the dark theme as well as in the light one. */
.quick-search__tag.mud-chip {
    --tag-color: var(--mud-palette-primary);
    border-color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 14%, var(--mud-palette-surface));
}

.quick-search__tag .mud-chip-icon {
    color: var(--tag-color);
}

/*
    Four across, so a row is one glance; two on a phone. The tiles are the catalogue's own, which
    is the point - what is clicked here looks exactly like what it leads to.
*/
.quick-search__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 760px) {
    .quick-search__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* On a laptop screen two rows push the foot of the panel out of sight; one row is enough to
   show what is there, and the button below leads to the rest. */
@media (max-height: 820px) and (min-width: 761px) {
    .quick-search__grid > :nth-child(n + 5) {
        display: none;
    }
}

.quick-search__skeleton {
    aspect-ratio: 4 / 3;
    height: auto !important;
    border-radius: 6px;
}

.quick-search__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Pinned to the bottom of the dialog, so Close and the sign-in choice are never scrolled away. */
.quick-search__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

/* --- Not found (Pages/NotFound.razor) ----------------------------------------

    A lone card on the hero of the skin, like sign-in: a pile of pictures, the top one says 404.
    Every colour from the --cmo-* tokens, so it wears the installation's skin in light and in dark.
    The motion stays for whoever asked their system for less: it only answers a click, and without
    it the easter egg is a button that does nothing.
*/
.not-found__card {
    width: min(460px, calc(100vw - 32px));
    text-align: center;
}

.not-found__art {
    display: block;
    margin: 0 auto 22px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.not-found__art:focus-visible {
    outline: 3px solid var(--cmo-focus);
    outline-offset: 8px;
    border-radius: 8px;
}

.not-found__pile {
    position: relative;
    display: block;
    width: 150px;
    height: 150px;
}

.not-found__photo {
    position: absolute;
    inset: 6px 14px;
    display: flex;
    flex-direction: column;
    padding: 8px 8px 0;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 10px 22px -12px rgba(0, 0, 0, 0.5);
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.not-found__photo--back {
    transform: rotate(-9deg);
    background: color-mix(in srgb, var(--cmo-accent) 12%, #fff);
}

.not-found__photo--middle {
    transform: rotate(6deg);
    background: color-mix(in srgb, var(--cmo-accent) 6%, #fff);
}

.not-found__photo--top {
    transform: rotate(-2deg);
}

.not-found__picture {
    position: relative;
    flex: 1;
    overflow: hidden;
    border-radius: 2px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--cmo-accent) 35%, #fff), color-mix(in srgb, var(--cmo-accent) 15%, #fff));
}

.not-found__sun {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd166;
}

.not-found__hill {
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: -38px;
    height: 70px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cmo-accent) 80%, #000);
}

.not-found__caption {
    padding: 6px 0 8px;
    color: #333;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* Every leaf moves the top picture aside and back; the fifth finds the missing one. */
.not-found__art--leaf-a .not-found__photo--top {
    animation: not-found-leaf 420ms ease-out;
}

.not-found__art--leaf-b .not-found__photo--top {
    animation: not-found-leaf-again 420ms ease-out;
}

.not-found__art--found .not-found__photo--back {
    transform: rotate(-16deg) translateX(-14px);
}

.not-found__art--found .not-found__photo--middle {
    transform: rotate(14deg) translateX(14px);
}

@keyframes not-found-leaf {
    0%, 100% { transform: rotate(-2deg); }
    45% { transform: translateX(46px) rotate(14deg); }
}

@keyframes not-found-leaf-again {
    0%, 100% { transform: rotate(-2deg); }
    45% { transform: translateX(-46px) rotate(-16deg); }
}

/* The find, as the catalogue shows a picture: name, details, keywords. */
.not-found__hit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    margin: 0 auto 18px;
    padding: 10px 14px;
    border-left: 4px solid var(--cmo-accent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--cmo-accent) 10%, var(--cmo-surface));
    text-align: left;
    font-size: 0.875rem;
    animation: not-found-found 520ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.not-found__hit-file {
    font-weight: 650;
}

.not-found__hit-where {
    color: var(--cmo-text-muted);
    font-size: 0.78rem;
}

.not-found__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.not-found__chip {
    padding: 1px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cmo-accent) 18%, var(--cmo-surface));
    color: var(--cmo-text);
    font-size: 0.75rem;
}

.not-found__hit-note {
    margin-top: 4px;
    color: var(--cmo-text-muted);
    font-style: italic;
}

@keyframes not-found-found {
    from { opacity: 0; transform: translateY(-24px) scale(0.92); }
    to { opacity: 1; transform: none; }
}

.not-found__title {
    margin-bottom: 8px;
}

.not-found__text {
    margin: 0 0 22px;
    color: var(--cmo-text-muted);
    line-height: 1.5;
}

.not-found__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.not-found__button {
    padding: 9px 16px;
    border: 1px solid var(--cmo-border);
    border-radius: var(--cmo-radius-small);
    font-weight: 600;
    text-decoration: none;
}

.login-card a.not-found__button {
    color: var(--cmo-text);
}

.login-card a.not-found__button--primary {
    border-color: var(--cmo-accent);
    background: var(--cmo-accent);
    color: var(--cmo-accent-text);
}

.not-found__button:hover {
    border-color: var(--cmo-accent);
}

.login-card a.not-found__button--primary:hover {
    background: var(--cmo-accent-hover);
}

.not-found__hint {
    margin: 18px 0 0;
    color: var(--cmo-text-muted);
    font-size: 0.8rem;
    font-style: italic;
}
