@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(../lib/inter/files/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(../lib/inter/files/inter-latin-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Height of a full preview pane. A dialog that lays its previews out in a .document-dialog-fill box replaces it.
   The brand colours mirror Theming/BrandColors.cs for the parts that look the same in both modes. */
:root {
    --document-preview-height: calc(100vh - 230px);
    --brand-navy: #0B2545;
    --brand-ocean: #0E6BA8;
    --brand-sky: #E6F4FF;
    --brand-accent: #00AEE6;
    --brand-shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 4px 16px rgba(11, 37, 69, .06);
}

html, body {
    height: 100%;
}

body {
    font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100%;
}

/* The mark and the name, leading home from the drawer or the app bar. */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    color: inherit;
    text-decoration: none;
}

.brand-logo-mark {
    width: 2rem;
    height: 2rem;
    flex: none;
}

.brand-logo-name {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: nowrap;
}

/* Landing page: the navy hero with the brand, then what the product does. */
.landing-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 26rem;
    padding: 3rem clamp(1.5rem, 5vw, 4rem);
    border-radius: 1rem;
    color: #FFFFFF;
    background: var(--brand-navy) url(../img/hero-sea.svg) right bottom / auto 100% no-repeat;
    box-shadow: var(--brand-shadow);
}

.landing-hero-content {
    position: relative;
    max-width: 40rem;
}

.landing-title {
    margin: 0 0 2rem;
    line-height: 0;
}

    .landing-title img {
        width: min(36rem, 100%);
        height: auto;
    }

.landing-lead {
    max-width: 30rem;
    margin: 0 0 2rem;
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--brand-sky);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

    .landing-actions .mud-button-root {
        padding: .625rem 1.5rem;
        font-size: 1rem;
    }

.landing-primary.mud-button-root {
    background-color: var(--brand-accent);
    color: var(--brand-navy);
}

    .landing-primary.mud-button-root:hover {
        background-color: #33C2F0;
    }

.landing-secondary.mud-button-root {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, .8);
}

    .landing-secondary.mud-button-root:hover {
        background-color: rgba(255, 255, 255, .1);
    }

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    scroll-margin-top: 4rem;
}

.landing-feature {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.5rem;
}

.landing-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: .25rem;
    border-radius: .75rem;
    color: var(--mud-palette-primary);
    background-color: var(--mud-palette-background-gray);
}

@media (max-width: 599.98px) {
    /* Too narrow for the text and the tanker side by side, so the illustration gives way. */
    .landing-hero {
        padding: 2rem 1.25rem;
        min-height: 0;
        background: linear-gradient(160deg, var(--brand-navy) 55%, var(--brand-ocean));
    }
}

.document-preview {
    width: 100%;
    height: var(--document-preview-height);
    min-height: 400px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: .25rem;
}

.document-preview-text {
    overflow: auto;
    padding: .75rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

    .document-preview-text mark {
        color: inherit;
        background-color: rgba(255, 193, 7, .35);
        outline: 1px solid var(--mud-palette-warning);
        border-radius: .125rem;
    }

/* Two previews stacked in one column share its height. */
.document-preview-half {
    height: calc(var(--document-preview-height) / 2 - .5rem);
    min-height: 200px;
}

/* A pane with something above its preview: the preview takes what is left of the column. */
.document-preview-column {
    display: flex;
    flex-direction: column;
    height: var(--document-preview-height);
    min-height: 400px;
}

    .document-preview-column > .document-preview {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

/* The tabs take whatever height the dialog's header leaves, however tall that header turns out. */
.document-dialog-content {
    display: flex;
    flex-direction: column;
}

    .document-dialog-content > .mud-tabs,
    .document-dialog-content .mud-tabs-panels {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

/* Previews inside size themselves to this box rather than to the window. */
.document-dialog-fill {
    flex: 1 1 auto;
    min-height: 0;
    container-type: size;
    --document-preview-height: 100cqh;
}

/* Options and the comparison table sit above the previews, so the pane scrolls and the previews take less. */
.document-evaluation {
    height: 100%;
    overflow: auto;
    --document-preview-height: 70vh;
}

.document-preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background-color: var(--mud-palette-background-gray);
}

    .document-preview-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

/* Toolbar and viewer share one preview's height, so the column ends level with its neighbours. */
.document-viewer-frame {
    display: flex;
    flex-direction: column;
    height: var(--document-preview-height);
    min-height: 400px;
}

.document-viewer {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: .25rem;
    background-color: var(--mud-palette-background-gray);
}

/* The pdf.js viewer refuses a container that is not absolutely positioned. */
.document-viewer-container {
    position: absolute;
    inset: 0;
    overflow: auto;
}

/* Placed inside the viewer's page box, so the match's page fractions become percentages of it at any zoom. */
.document-page-highlight {
    position: absolute;
    z-index: 3;
    border: 2px solid var(--mud-palette-warning);
    background-color: rgba(255, 193, 7, .25);
    border-radius: .125rem;
    pointer-events: none;
}

/* The two pipelines' readings side by side: regex in the info colour, the model in the tertiary colour. */
.document-page-highlight-regex,
.document-preview-text mark.mark-regex {
    border-color: var(--mud-palette-info);
    outline-color: var(--mud-palette-info);
    background-color: rgba(59, 130, 246, .22);
}

.document-page-highlight-llm,
.document-preview-text mark.mark-llm {
    border-color: var(--mud-palette-tertiary);
    outline-color: var(--mud-palette-tertiary);
    background-color: rgba(20, 184, 166, .22);
}

.highlight-legend {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: .125rem;
    border: 2px solid var(--mud-palette-warning);
    background-color: rgba(255, 193, 7, .35);
}

.highlight-legend-regex {
    border-color: var(--mud-palette-info);
    background-color: rgba(59, 130, 246, .3);
}

.highlight-legend-llm {
    border-color: var(--mud-palette-tertiary);
    background-color: rgba(20, 184, 166, .3);
}

.table-row-selectable {
    cursor: pointer;
}

.table-row-active {
    background-color: var(--mud-palette-action-default-hover);
}

.authentication-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    min-height: 100vh;
    padding: 1rem;
    color: var(--mud-palette-text-secondary);
}

.authentication-logo {
    width: min(24rem, 90vw);
    height: auto;
}

.loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: .25rem solid #0E6BA8;
    border-right-color: transparent;
    border-radius: 50%;
    animation: loading-spin .75s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

#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;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ni42MDYgNTIuMjY1OEwyOTAuMTI2IDc1LjMzMzFDMjkxLjcxIDc2Ljg5NDgzIDI5MS43MTQgNzkuNTg0MyAyOTAuMTI2IDgxLjE0NzVMMjkwLjEyNiA4MS4xNDc1TDI2Ni42MDYgMTA0LjIxNUMyNjUuODEzIDEwNC45OTcgMjY0LjcxNyAxMDUuNDggMjYzLjUwNiAxMDUuNDhMMjYzLjUwNiAxMDUuNDhMMjM3LjA2IDEwNS40OEMyMzQuNzU3IDEwNS40OCAyMzUuMzMgMTA1LjEwNiAyMzUuMzMgMTAxLjc1MkwyMzUuMzMgMTAxLjc1MkwyMzUuMzMgNTQuNzI5OUMyMzUuMzMgNTIuNzc3NCAyMzYuNzM1IDUxIDIzOC42NzMgNTFMMjM4LjY3MyA1MUwyNjMuNTA2IDUxWiIgZmlsbD0iIzRmZjY4ZSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9nPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Primary blue as text misses 4.5:1 on light surfaces, so in-table links use the text-safe shade the palette
   exposes as primary-darken. */
.mud-table .mud-link {
    color: var(--mud-palette-primary-darken);
}

/* App bar: a plain strip above the page, separated by a hairline instead of a shadow. */
.app-bar.mud-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Drawer: navy in both modes, the brand on top, the current page as a filled ocean pill. */
.app-drawer-header.mud-drawer-header {
    display: flex;
    align-items: center;
    min-height: 4rem;
    padding: .75rem 1.25rem;
    color: #FFFFFF;
}

/* MudBlazor paints hover, focus and press with the action hover colour, which is a dark tint meant for light
   surfaces; on navy it needs to be a light one. */
.app-drawer {
    --mud-palette-action-default-hover: rgba(230, 244, 255, .1);
    --mud-ripple-color: #FFFFFF;
}

.app-drawer .mud-navmenu .mud-nav-link {
    width: calc(100% - 1.5rem);
    margin: 2px .75rem;
    padding: .625rem .875rem;
    border-radius: .5rem;
    color: var(--mud-palette-drawer-text);
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}

    .app-drawer .mud-nav-link .mud-nav-link-icon {
        transition: color .15s ease;
    }

    .app-drawer .mud-nav-link:hover:not(.mud-nav-link-disabled),
    .app-drawer .mud-nav-link:focus-visible:not(.mud-nav-link-disabled) {
        color: #FFFFFF;
    }

        .app-drawer .mud-nav-link:hover:not(.mud-nav-link-disabled) .mud-nav-link-icon,
        .app-drawer .mud-nav-link:focus-visible:not(.mud-nav-link-disabled) .mud-nav-link-icon {
            color: #FFFFFF;
        }

    /* The current page stays a filled pill whatever the pointer or keyboard does. These selectors outrank
       MudBlazor's .mud-navmenu-default active, hover and focus rules. */
    .app-drawer .mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled),
    .app-drawer .mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled):focus-visible,
    .app-drawer .mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled):active {
        background-color: var(--brand-ocean);
        color: #FFFFFF;
        font-weight: 600;
    }

    @media (hover: hover) and (pointer: fine) {
        .app-drawer .mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled):hover {
            background-color: #1279BD;
        }
    }

        .app-drawer .mud-nav-link.active .mud-nav-link-icon,
        .app-drawer .mud-nav-link.active .mud-nav-link-text {
            color: #FFFFFF;
        }

.app-drawer .mud-navmenu .mud-nav-link-expand-icon,
.app-drawer .mud-navmenu .mud-nav-link-expand-icon.mud-transform {
    fill: currentColor;
}

.app-drawer .mud-navmenu .mud-nav-group .mud-nav-group-items .mud-nav-link {
    padding-left: 2.5rem;
}

/* Cards and grids: white panels with a soft navy-tinted shadow and an even radius. */
.mud-paper.mud-elevation-1 {
    box-shadow: var(--brand-shadow);
}

.mud-card.mud-paper,
.mud-data-grid.mud-paper,
.mud-table.mud-paper {
    border-radius: .75rem;
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background-color: var(--mud-palette-background);
}

.mud-chip {
    font-weight: 500;
}

/* Page header: the title, and the page's buttons on the right. The minimum height keeps titles level on pages
   without buttons. */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    min-height: 2.5rem;
    margin-bottom: 1.25rem;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

/* Filter bar above a grid: inputs keep one width on every page instead of stretching to fill the row. */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

    .filter-bar > * {
        flex: 0 1 13rem;
        min-width: 10rem;
    }

    .filter-bar > .filter-bar-search {
        flex-basis: 30rem;
    }

    /* A select with FitContent sizes itself to its longest item, so a fixed basis would cut that short. */
    .filter-bar > .mud-width-content {
        flex-basis: auto;
    }

    .filter-bar .mud-input-control {
        margin-top: 0;
    }

@media (max-width: 599.98px) {
    .filter-bar > *,
    .filter-bar > .filter-bar-search {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* Data grids: rows a little tighter than MudBlazor's default, so a screen holds more of them, and columns
   closer together so wide grids fit without scrolling sideways. */
.mud-data-grid .mud-table-cell {
    padding: .625rem .75rem;
}

    .mud-data-grid .mud-table-cell:first-child {
        padding-left: 1rem;
    }

    .mud-data-grid .mud-table-cell:last-child {
        padding-right: 1rem;
    }

/* Row buttons in the last column, kept together at its right edge. */
.grid-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.grid-row-actions {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.grid-row-actions .mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

    .grid-row-actions .mud-icon-button:hover {
        color: var(--mud-palette-primary-darken);
    }

/* Field page: the version bar above the tabs, and the try panel that stays in view while the rules scroll. */
.field-version-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

    .field-version-bar > .mud-select {
        flex: 0 1 24rem;
    }

.field-try-panel {
    position: sticky;
    top: 4rem;
}

/* The model a prompt is tried with, on one line, with its settings folded away until asked for. */
.field-try-model {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}

.rule-pattern {
    word-break: break-all;
}

/* A long free-text value stays on one line; its full text is in the cell's title. */
.grid-cell-truncate {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Text for assistive technology only, such as the name of an icon-only column. */
.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;
}

/* The permission matrix: a feature row in the primary colour, its permissions indented beneath it, one column per
   verb. Only the page scrolls; on a phone the table scrolls sideways inside its box. */
.permission-matrix {
    overflow-x: auto;
}

    .permission-matrix .mud-table-container {
        overflow: visible;
    }

    .permission-matrix table {
        min-width: 560px;
    }

    .permission-matrix thead th {
        font-weight: 600;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    .permission-matrix th,
    .permission-matrix td {
        padding-top: .375rem;
        padding-bottom: .375rem;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    .permission-matrix .permission-matrix-name {
        min-width: 200px;
        text-align: left;
        white-space: nowrap;
    }

    .permission-matrix tbody td.permission-matrix-name {
        padding-left: 2rem;
    }

    .permission-matrix .permission-matrix-verb {
        width: 90px;
        min-width: 90px;
        text-align: center;
    }

        .permission-matrix .permission-matrix-verb .mud-checkbox,
        .permission-matrix .permission-matrix-verb .mud-chip {
            margin: 0;
        }

    .permission-matrix .permission-matrix-section th,
    .permission-matrix .permission-matrix-section td {
        background-color: var(--mud-palette-primary-hover);
    }

    .permission-matrix .permission-matrix-section th {
        color: var(--mud-palette-primary-darken);
        font-weight: 500;
        padding-top: .625rem;
        padding-bottom: .625rem;
    }

.permission-matrix-na {
    color: var(--mud-palette-text-disabled);
}

/* The tenant-wide overview: the table takes only the width it needs, lined up with the page title. */
.permission-overview {
    width: fit-content;
    max-width: 100%;
}

    .permission-overview .permission-matrix table {
        width: auto;
    }

    .permission-overview .permission-matrix th,
    .permission-overview .permission-matrix td {
        padding: .875rem 1.25rem;
    }

    .permission-overview .permission-matrix .permission-matrix-section th {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .permission-overview .permission-matrix tbody td.permission-matrix-name {
        padding-left: 3rem;
        padding-right: 4rem;
    }

    .permission-overview .permission-matrix .permission-matrix-verb {
        width: 50%;
        min-width: 120px;
    }

/* The member and role lists inside the administration dialogs: plain rows, the remove button at the far right. */
.admin-dialog-table td {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.admin-dialog-table .admin-dialog-table-action {
    width: 1%;
    text-align: right;
}
.document-filename {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tenant switcher in the top bar: a tenant name reads as a name, not as a shouted label. */
.tenant-switcher {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
}

.tenant-switcher-list {
    min-width: 260px;
    padding-bottom: 4px;
}

.tenant-switcher-heading {
    display: block;
    padding: 6px 16px 2px;
    color: var(--mud-palette-text-secondary);
}

.tenant-switcher-item .mud-menu-item-text,
.tenant-switcher-item .mud-list-item-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tenant-switcher-mark {
    display: inline-flex;
    justify-content: center;
    width: 1rem;
    flex: none;
}

.tenant-switcher-item-active {
    background-color: var(--mud-palette-primary-hover);
}

/* Account menu in the top bar: an avatar opens the user's details and the sign-out. */
.account-menu-trigger {
    min-width: 0;
    padding: 2px;
    border-radius: 50%;
}

.account-menu-list {
    min-width: 280px;
    max-width: 360px;
    padding-bottom: 4px;
}

.account-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 10px;
}

.account-menu-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
}

.account-menu-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-menu-row > .mud-icon-root {
    width: 1rem;
    flex: none;
    color: var(--mud-palette-text-secondary);
}