#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.mud-appbar {
    border-radius: 0 !important;
}

.mud-main-content {
    padding-top: calc(var(--mud-appbar-height) + 24px);
    padding-right: 24px;
    padding-bottom: 24px;
    padding-left: 24px;
}

/* ══════════════════════════════════════════════════════════════════
   Public site (landing / login) presentation layer.
   Every colour resolves through the MudBlazor palette so uploaded
   themes keep driving the look — no brand literals below.
   ══════════════════════════════════════════════════════════════════ */

:root {
    --lw-display-font: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --lw-hero-band: 460px;
}

.lw-display {
    font-family: var(--lw-display-font);
    font-weight: 600;
    letter-spacing: .01em;
}

.lw-display-caps {
    font-family: var(--lw-display-font);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── App bar ──────────────────────────────────────────────────── */

.lw-appbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lw-appbar-brand img {
    height: 46px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
}

.lw-appbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.lw-appbar-title {
    font-family: var(--lw-display-font);
    font-size: 1.375rem;
    font-weight: 600;
}

.lw-appbar-subtitle {
    font-size: .75rem;
    opacity: .8;
}

.lw-appbar-nav {
    display: flex;
    align-items: center;
}

.lw-appbar-divider {
    width: 1px;
    height: 26px;
    background: currentColor;
    opacity: .35;
    margin: 0 6px;
}

.lw-appbar-nav-compact {
    display: none;
}

/* PU-11: phones get one menu button, and a long name shrinks instead of widening the page. */
@media (max-width: 759px) {
    .lw-appbar-nav { display: none; }
    .lw-appbar-nav-compact { display: flex; }
    .lw-appbar-brand { min-width: 0; flex: 1 1 auto; margin-left: 0 !important; }
    .lw-appbar-brand-text { min-width: 0; }
    .lw-appbar-title { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lw-appbar-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lw-appbar-brand img { height: 36px; }

    /* Public detail pages: the 180px label column plus a long email was wider than a phone. */
    .lw-hero-content .d-flex > .mud-typography[style*="min-width:180px"] { min-width: 110px !important; }
}

/* A long email address wraps instead of widening its card. */
.lw-hero-content a[href^="mailto:"] {
    overflow-wrap: anywhere;
    min-width: 0;
}

/* ── Hero band ────────────────────────────────────────────────────
   The configured Login-slot background covers a fixed band at the top
   of the page rather than the whole content area; the page background
   shows through beneath it. With no image uploaded the band is simply
   the configured Login background colour. */

.lw-hero-region {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-background);
    margin: calc(-1 * (var(--mud-appbar-height) + 24px)) -24px -24px -24px;
    padding-top: calc(var(--mud-appbar-height) + 24px);
}

.lw-hero-band {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--mud-appbar-height) + var(--lw-hero-band));
    border-bottom: 1px solid rgba(var(--mud-palette-primary-rgb), .18);
    z-index: 0;
}

/* Pages other than the landing hero have no panel to straddle, so the slot's
   background covers the whole content area rather than stopping mid-page. */
.lw-hero-band.lw-hero-band-full {
    height: auto;
    bottom: 0;
    border-bottom: 0;
}

.lw-hero-content {
    position: relative;
    z-index: 1;
}

/* Public search text colours (#77), set in Theme Customisation. The heading and "Back to home"
   link sit on the page background; the table colour applies inside the search and results panels
   by overriding the palette's text colours there, so inputs, cells, sort labels and the pager follow. */
.lw-hero-content.lw-heading-colour > .mud-typography-h5,
.lw-hero-content.lw-heading-colour > .mud-button-root.mud-button-text {
    color: var(--lw-page-heading);
}

.lw-hero-content.lw-table-colour .mud-paper,
.lw-hero-content.lw-table-colour .mud-table {
    --mud-palette-text-primary: var(--lw-page-table-text);
    --mud-palette-text-secondary: var(--lw-page-table-text);
    --mud-palette-action-default: var(--lw-page-table-text);
    color: var(--lw-page-table-text);
}

.lw-hero-panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 48px;
    text-align: center;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

/* Theme option: no fill, so the page background (colour or image) shows through. */
.lw-hero-panel.lw-hero-panel--transparent {
    background: transparent;
    color: var(--mud-palette-text-primary);
}

.lw-hero-rule {
    width: 360px;
    max-width: 70%;
    height: 1px;
    margin: 14px auto 18px;
    border: 0;
    background: currentColor;
    opacity: .4;
}

/* ── Feature cards ────────────────────────────────────────────────
   Both cards stretch to the taller one. Rather than leaving the slack as
   dead space under the shorter card, let its list distribute into it. */

.lw-feature-card {
    display: flex;
    flex-direction: column;
}

.lw-feature-card .mud-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lw-feature-card .mud-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

/* ── Login card fields ────────────────────────────────────────────
   Static label above a tinted input. The label lives outside the
   MudTextField, so the field carries aria-label for accessibility
   (and for getByLabel in the UI tests). */

.lw-field-label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--mud-palette-text-secondary);
}

.lw-login-form .mud-input.mud-input-filled {
    background-color: rgba(var(--mud-palette-primary-rgb), .10);
    border: 1px solid rgba(var(--mud-palette-primary-rgb), .24);
    /* MudBlazor hard-codes a 4px top-only radius on filled inputs, which
       reads oddly against a full border — follow the theme radius instead. */
    border-radius: var(--mud-default-borderradius);
}

.lw-login-form .mud-input.mud-input-filled:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), .14);
}

/* Entered text sits above MudBlazor's 16px default so credentials are easy to
   read back while typing. Scoped to the login card only.
   Set on the .mud-input container, not the input itself: MudBlazor's
   `.mud-input > input.mud-input-root { font-size: inherit }` is more specific
   than any two-class rule here, so the input takes its size from the parent. */
.lw-login-form .mud-input {
    font-size: 1.125rem;
    line-height: 1.4;
}

/* Drop the resting underline only. The ::after underline is kept: it is
   MudBlazor's focus and validation-error indicator. */
.lw-login-form .mud-input.mud-input-filled::before {
    display: none;
}

.lw-signin-button {
    letter-spacing: .08em;
    font-weight: 600;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ── Quick links strip ────────────────────────────────────────── */

.lw-quicklinks {
    display: flex;
    align-items: stretch;
}

.lw-quicklink {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px 28px;
    cursor: pointer;
    transition: background-color .2s;
}

.lw-quicklink:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.lw-quicklink + .lw-quicklink {
    border-left: 1px solid var(--mud-palette-lines-default);
}

/* ── Footer ───────────────────────────────────────────────────── */

.lw-footer-logo {
    max-height: 90px;
    max-width: 160px;
    object-fit: contain;
}

/* ── Narrow viewports ─────────────────────────────────────────── */

@media (max-width: 959px) {
    :root {
        --lw-hero-band: 300px;
    }

    .lw-hero-panel {
        padding: 28px 24px;
    }

    .lw-quicklinks {
        flex-direction: column;
    }

    .lw-quicklink + .lw-quicklink {
        border-left: 0;
        border-top: 1px solid var(--mud-palette-lines-default);
    }
}

/* Dashboard stat tiles open the matching list. */
.lw-dashboard-tile {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: var(--mud-default-borderradius);
}

.lw-dashboard-tile .lw-dashboard-tile-paper {
    transition: box-shadow .15s ease, transform .15s ease;
}

.lw-dashboard-tile:hover .lw-dashboard-tile-paper {
    box-shadow: var(--mud-elevation-4);
}

.lw-dashboard-tile:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .lw-dashboard-tile .lw-dashboard-tile-paper { transition: none; }
}
