:root {
    --brand-green: #86bc25;
    --brand-green-ink: #4f7314;
    --brand-bg-light: #f5f5f5;
    --brand-black: #282728;
    --theme-header-bg: #f5f5f5;
    --theme-sidebar-bg: #f5f5f5;
    --theme-main-bg: #f5f5f5;
    --theme-shell-border: #e6e6e6;
    --theme-shell-surface: #f5f5f5;
    --theme-shell-surface-hover: #e8e8ec;
    --theme-shell-text-primary: #18181b;
    --theme-shell-text-secondary: #52525b;
    --theme-shell-text-muted: #71717a;
    --accent: var(--brand-green);
    --badge-warn-color: #b45309;
    --badge-warn-bg: #FBF1DC;
    --badge-ok-color: #0e5a3a;
    --badge-danger-color: #dc2626;
    --font-display: "Open Sans", sans-serif;
    --font-mono: monospace, monospace;
    --app-footer-height: 2.5rem;
}

.no-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

html {
    font-size: 13px;
}

@media (min-width: 1200px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1300px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 1400px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 1500px) {
    html {
        font-size: 17px;
    }
}

@media (min-width: 1600px) {
    html {
        font-size: 18px;
    }
}

@media (min-width: 1700px) {
    html {
        font-size: 19px;
    }
}

@media (min-width: 1800px) {
    html {
        font-size: 20px;
    }
}

@media (min-width: 1900px) {
    html {
        font-size: 20.5px;
    }
}

@media (min-width: 2000px) {
    html {
        font-size: 21px;
    }
}

@media (min-width: 2100px) {
    html {
        font-size: 21.5px;
    }
}

@media (min-width: 2200px) {
    html {
        font-size: 22px;
    }
}

@media (min-width: 2300px) {
    html {
        font-size: 22.5px;
    }
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: "Open Sans", sans-serif;
    color: #0f0b0b;
}

h1:focus {
    outline: none;
}

.fs-edit-menu-popover,
.fs-edit-menu-popover > .mud-list {
    border-radius: 0.8rem !important;
}

/*Overwrrites default values of min-width: 56px*/
.mud-list-item-icon {
    min-width: 2rem !important;
}

.fs-edit-menu-popover {
    border: 2px solid gray;
}

#blazor-error-ui {
    background: lightyellow;
    color: black;
    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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=)
            no-repeat 1rem/1.8rem,
        #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: rgb(240, 240, 240);
}

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

.app-top-header {
    background-color: var(--theme-header-bg) !important;
    color: var(--theme-shell-text-primary) !important;
    position: relative !important;
    border-top: 4px solid var(--brand-green) !important;
    border-bottom: 1px solid var(--theme-shell-border) !important;
    height: var(--mud-appbar-height) !important;
    min-height: var(--mud-appbar-height) !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* Deloitte wordmark letters (DeloitteLogo.razor). The body class is set from the saved theme before Blazor
   starts, so the logo always matches the header behind it. */
.deloitte-logo {
    color: #18181B;
    flex-shrink: 0;
}

body.mud-dark-mode .deloitte-logo {
    color: #FFFFFF;
}

/* The portal and cover-page layouts keep the app bar fixed and pad their content by its height. */
.mud-appbar.app-top-header.app-top-header--fixed {
    position: fixed !important;
}

.mud-tooltip-root.mud-tooltip-inline {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.mud-tooltip {
    z-index: 1500 !important;
}

.mud-layout {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    background-color: var(--mud-palette-background) !important;
    display: flex !important;
    flex-direction: column !important;
}

.mud-main-content {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto;
    padding: 0 !important;
}

.mud-main-content.portal-main-content {
    padding-top: var(--mud-appbar-height) !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    height: calc(100vh - var(--app-footer-height, 2.5rem)) !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

/* The project cover page starts below the fixed app header and fills the rest of the window. */
.mud-main-content.project-hero-main-content {
    padding-top: var(--mud-appbar-height) !important;
    height: 100vh !important;
    box-sizing: border-box !important;
}

/* The portal's navigation drawer stops above the full-width footer. */
.mud-drawer.portal-nav-drawer {
    height: calc(
        100% - var(--mud-appbar-height) - var(--app-footer-height, 2.5rem)
    ) !important;
}

.mud-popover.company-switcher-popover {
    width: 260px;
    margin-top: 4px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
    background: var(--mud-palette-surface);
}

.portal-container {
    padding: 2rem 2.5rem !important;
    max-width: 90rem !important;
    margin: 0 auto !important;
}

/* Companies, All Projects and a company's projects page (.ap-page) start right next to the sidebar
   instead of in the centred column, and stop at 1200px, which leaves open space on the right. */
.portal-container:has(.ap-page) {
    max-width: none !important;
}

.ap-page {
    position: relative;
    max-width: 1200px;
    color: var(--app-widget-text-primary);
}

/* Back link */
.ap-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--app-widget-text-secondary);
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.15s;
}

.ap-back-link:hover {
    color: var(--app-widget-text-primary);
}

/* Page heading and filter bar, shared by the .ap-page pages */
/* Title area */
.ap-title-area {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.ap-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 4px;
}

.ap-subtitle {
    font-size: 14px;
    color: var(--app-widget-text-secondary);
    margin: 0;
}

/* "New ..." button: the Lucide plus icon sits next to the label */
.ap-new-button .mud-button-label {
    gap: 8px;
}

/* Filter bar */
.ap-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ap-filter-input {
    flex: 0 1 260px;
    margin: 0;
}

.ap-filter-input .mud-input {
    border-radius: 6px;
    background: var(--app-admin-input-bg);
    color: var(--app-widget-text-primary);
    font-size: 14px;
}

.ap-filter-input .mud-input-outlined-border {
    border-color: var(--app-admin-input-border);
}

/* A link at the right end of the filter bar, e.g. "All projects" on the Companies page */
.ap-filter-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 14px;
    color: var(--app-admin-accent-ink);
    text-decoration: none;
}

.ap-filter-link:hover {
    text-decoration: underline;
}

/* Fills the window below the page heading so the table scrolls inside with a fixed header.
   Each page sets --ap-table-offset to the height of what sits above and below the table. */
.ap-table-scroll {
    height: calc(100vh - var(--ap-table-offset, 16rem));
    display: grid;
    grid-template-rows: minmax(0, 1fr);
}

/* Table card, shared by the Companies, All Projects and company projects tables:
   bordered card, light header band, dashed row dividers, always-visible actions. */
.mud-table.ap-table-card {
    border: 1px solid var(--app-admin-border) !important;
    border-radius: 6px !important;
    overflow: hidden;
    background: var(--app-admin-card-bg) !important;
    box-shadow: none !important;
}

.ap-table-card .mud-table-container {
    box-shadow: none !important;
    overflow-x: auto;
    /* lets the empty message size itself to the card */
    container-type: inline-size;
}

/* Below this width the table scrolls sideways instead of squeezing the columns */
.ap-table-card table {
    table-layout: fixed;
    width: 100%;
    min-width: 860px;
}

/* Header row: 13px semibold, normal case, gray band */
.ap-table-card .table-header {
    background-color: var(--app-admin-main-bg) !important;
    color: var(--app-widget-text-secondary) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    border-bottom: 1px solid var(--app-admin-border) !important;
    padding: 12px 8px !important;
}

.ap-table-card .table-header--right {
    text-align: right !important;
}

/* MudTable draws the loading bar and the empty message in cells with colspan="1000". With the fixed
   layout those cells add hundreds of empty columns, which squeeze the flexible first column to 0px so
   the next header lands on top of it. Neither cell may take part in the column grid. */

/* Loading bar: out of the table flow, along the bottom of the header. The header sticks to the top
   of the scrolling table (FixedHeader), so the bar stays in view when the rows are scrolled. */
.ap-table-card thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* MudBlazor gives the loading cell no class of its own, only its progress bar (mud-table-loading-progress) */
/* !important: with FixedHeader, MudBlazor makes this cell position: sticky, which puts it back in the column grid */
.ap-table-card th:has(> .mud-table-loading-progress) {
    position: absolute !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2;
    padding: 0 !important;
    border: 0 !important;
}

/* Empty message: a block (not a table cell) whose content is as wide as the card (100cqw, see .mud-table-container).
   MudBlazor puts the mud-table-empty-row class on the cell itself (<tr><th class="mud-table-empty-row">). */
.ap-table-card .mud-table-empty-row {
    display: block;
    /* MudBlazor's surface colour would only fill the first column's width here */
    background: transparent !important;
    padding: 0 !important;
    border: 0 !important;
}

.ap-table-card .mud-table-empty-row > * {
    width: 100cqw;
}

/* Cells: 16px outer gutter, 16px between columns, dashed row dividers */
.ap-table-card .mud-table-body .mud-table-cell {
    font-size: 14px !important;
    border-bottom: 1px dashed var(--app-admin-border-dashed) !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    padding: 12px 8px !important;
    min-width: 0;
}

.ap-table-card .mud-table-cell:first-child {
    padding-left: 16px !important;
}

.ap-table-card .mud-table-cell:last-child {
    padding-right: 16px !important;
}

.ap-table-card .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: 0 !important;
}

.ap-table-card .mud-table-body .mud-table-row {
    background-color: transparent !important;
    transition: background-color 0.15s;
}

.ap-table-card .mud-table-body .mud-table-row:hover {
    background-color: var(--app-admin-surface-hover) !important;
}

/* The empty-message row has no hover: its cell sits in the first column only, so the colour would fill just that column */
.ap-table-card .mud-table-body .mud-table-row:has(> .mud-table-empty-row):hover {
    background-color: transparent !important;
}

/* Cell text */
.ap-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-text-secondary {
    color: var(--app-widget-text-secondary);
}

.ap-tabular {
    font-variant-numeric: tabular-nums;
}

.ap-project-link {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s;
}

.ap-project-link {
    font-weight: 600;
    color: var(--app-admin-accent-ink);
}

.ap-project-link:hover:not(:disabled) {
    text-decoration: underline;
}

.ap-project-link:disabled {
    cursor: default;
    opacity: 0.6;
}

/* Row actions: right-aligned, always visible */
.ap-table-card .action-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

/* "Load more" under a paged table: the prototype's bordered (ghost) button */
.ap-load-more {
    justify-self: center;
    margin-top: 12px;
    height: 32px;
    padding: 0 16px;
    border: 1px solid var(--app-admin-border);
    border-radius: 6px;
    background: transparent;
    color: var(--app-widget-text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
}

.ap-load-more:hover:not(:disabled) {
    background: var(--app-admin-surface-hover);
}

.ap-load-more:disabled {
    color: var(--app-widget-text-muted);
    cursor: not-allowed;
}

.ap-load-more:focus-visible {
    outline: 2px solid var(--app-admin-accent-ink);
    outline-offset: 2px;
}

.ap-empty {
    padding: 40px 20px;
    font-size: 14px;
    text-align: center;
    color: var(--app-widget-text-secondary);
}

.mud-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin: 0 !important;
    height: var(--mud-appbar-height) !important;
    width: 100% !important;
}

.mud-toolbar > * {
    pointer-events: auto;
}

.mud-toolbar .mud-input {
    min-width: 12rem !important;
    max-width: 15rem !important;
    background-color: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) !important;
    overflow: hidden !important;
}

.edit-entity-button:first-child {
    border-radius: 4px 4px 0 0 !important;
}

.edit-entity-button {
    border-bottom: 1px solid !important;
    background-color: #f5f5f4 !important;
}

.edit-entity-button:last-child {
    border-radius: 0 0 4px 4px !important;
    border-bottom: 0px !important;
}

.mud-input-helper-text.mud-input-error {
    font-size: 0.7rem;
}

.dialog-background-title {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e5e5e5;
}

.project-dialog > .mud-dialog-title {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Keep the project form, import views and its confirmation in the same frame. */
.mud-dialog.project-dialog-frame,
.mud-dialog-container:has(.project-dialog-frame-backdrop) .mud-dialog {
    width: min(64rem, calc(100vw - 4rem));
    height: min(42rem, calc(100dvh - 4rem));
    max-width: calc(100vw - 4rem);
    max-height: calc(100dvh - 4rem);
    box-sizing: border-box;
    overflow: hidden;
}

.project-dialog-frame {
    --dataset-summary-width: 100%;
    --dataset-summary-height: 100%;
}

.project-dialog-frame > .mud-dialog-title,
.project-dialog-frame .mud-dialog-actions,
.mud-dialog-container:has(.project-dialog-frame-backdrop) .mud-dialog > .mud-dialog-title,
.mud-dialog-container:has(.project-dialog-frame-backdrop) .mud-dialog .mud-dialog-actions {
    flex-shrink: 0;
}

/* MudDialog renders its focus trap inside an additional content wrapper. */
.project-dialog-frame > div:not(.mud-dialog-title),
.mud-dialog-container:has(.project-dialog-frame-backdrop) .mud-dialog > div:not(.mud-dialog-title) {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.project-dialog-frame .mud-dialog-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.mud-dialog-container:has(.project-dialog-frame-backdrop) .mud-dialog .mud-dialog-content {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

.project-dialog .mud-dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background-color: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
}

header {
    pointer-events: none;
}

.oss-button {
    color: #68b631;
    border: 1px solid #68b631;
    height: auto;
    white-space: normal;
    word-wrap: break-word;
    padding: 0.8em 2em;
    font-size: 0.8em;
    line-height: 1.2;
    cursor: pointer;
    -moz-transition: 0.1s ease;
    -o-transition: 0.1s ease;
    -webkit-transition: 1s ease;
    transition: 0.1s ease;
}

.oss-button:hover {
    color: #fff;
    background-color: #68b631;
}

.version-number {
    left: 2rem;
}

.tooltip {
    height: 100% !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 0.5rem !important;
}

.mud-breadcrumbs {
    font-size: 0.9rem;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    padding: 0;
}

.mud-breadcrumbs .mud-breadcrumb-item {
    position: relative;
}

/* Breadcrumb tooltip */
.mud-breadcrumbs .mud-breadcrumb-item::before {
    content: attr(data-tooltip);
    color: var(--mud-palette-dark-text);
    background-color: var(--mud-palette-grey-darker);
    border-radius: var(--mud-default-borderradius);
    position: absolute;
    top: 1.6rem;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    font-weight: 500;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.4em;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mud-breadcrumb-separator {
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mud-stepper .mud-stepper-nav .mud-step {
    padding: 1rem;
}

.breadcrumb-separator {
    min-width: 0.3rem !important;
}

.breadcrumb-container :not(:last-child):hover {
    text-decoration: underline;
}

.breadcrumb-container > :last-child {
    pointer-events: none;
}

.project-view-buttons {
    position: absolute !important;
    left: 50%;
    transform: translateX(-50%) !important;
    top: 3.175rem;
    padding: 0 0.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem;
    padding: 0.2rem;
    height: 2.15rem;
}

.project-view-button {
    border-left: none !important;
    height: fit-content !important;
    width: 5rem;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-transform: none !important;
}

.project-view-button:hover {
    background-color: transparent !important;
}

.project-view-button.active .name {
    border-bottom: 0.1rem solid rgba(134, 188, 37, 1) !important;
    font-weight: 700 !important;
    background-image: none;
}

.name {
    font-size: 0.8rem;
    border: 0.1rem solid transparent;
    margin: 0.3rem 0.5rem !important;
}

.add-future-state-menu {
    border-radius: 0.3rem;
}

.add-future-state-menu .mud-list {
    border-radius: 0.3rem;
    border: 1px solid #999;
    padding: 0.1rem 0.15rem 0.1rem 0.15rem;
}

.add-future-state-menu .mud-list-item {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.add-future-state-menu .mud-list-item:not(:last-of-type) {
    border-bottom: 1px solid #999;
}

.add-future-state-menu .mud-list-item .mud-list-item-text {
    margin: 0;
}

.add-future-state-menu .mud-list-item .mud-list-item-text .mud-typography {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}

.entity-filter-item .mud-list-item-icon {
    min-width: 2rem !important;
}

.mud-list-item.entity-filter-item {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mud-tab {
    text-transform: none !important;
}

.mud-grid-spacing-xs-6 {
    width: calc(100% + 1rem);
    margin-left: -1rem;
    margin-top: -1rem;
}

.mud-grid-spacing-xs-6 > .mud-grid-item {
    padding-left: 1rem;
    padding-top: 1rem;
}

@keyframes slideUp {
    from {
        bottom: -100%;
    }

    to {
        bottom: 3rem;
    }
}

@keyframes slideDown {
    from {
        bottom: 1rem;
    }

    to {
        bottom: -100%;
    }
}

.required {
    color: #f44336;
}

.spinner {
    border: 0.6rem solid rgba(128, 128, 128, 0.2);
    border-top: 0.6rem solid var(--mud-palette-secondary, #86bc24);
    border-radius: 50%;
    width: 5rem;
    height: 5rem;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 40vh auto auto auto;
}

.loading-progress circle {
    fill: none;
    stroke: #86bc24;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #86bc24;
    stroke-dasharray:
        calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(40vh + 3.3rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

.export-menu {
    border-radius: 0.3rem;
}

.export-menu .mud-list {
    border-radius: 0.3rem;
    border: 1px solid #999;
    padding: 0.1rem 0.15rem 0.1rem 0.15rem;
}

.export-menu .mud-list-item {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.export-menu .mud-list-item:not(:last-of-type) {
    border-bottom: 1px solid #999;
}

.export-menu .mud-list-item .mud-list-item-text {
    margin: 0;
}

.export-menu .mud-list-item .mud-list-item-text .mud-typography {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}

.export-menu .mud-list-item .mud-list-item-text .mud-typography span {
    flex-grow: 1;
    margin-left: 0.5rem;
    margin-right: 1.2rem;
}

.close-drawer-button {
    width: 1.5rem;
    height: 0.5rem;
}

.close-drawer-button > * {
    text-transform: none;
}

.export-drawer-button {
    width: 1.5rem;
    height: 0.5rem;
}

.export-drawer-button > * {
    text-transform: none;
}

.export-snap-report-button {
    background-color: #86bc24;
    color: #000000;
    height: 2.2rem !important;
    max-height: 2.2rem !important;
    width: 14rem !important;
    border-radius: 0.275rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-snap-report-button:hover {
    background-color: #86bc24;
    color: #000000;
}

.snap-index-marker {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1.2rem;
    height: 1rem;
    font-size: 0.7rem;
    background-color: #000000;
    color: #ffffff;
    pointer-events: none;
}

.arrow {
    pointer-events: none;
    cursor: pointer;
    stroke-width: 0.15rem;
    filter: drop-shadow(0 0 0.05rem white);
    fill: none;
}

.arrow.contrast {
    pointer-events: none;
    stroke: white;
    stroke-width: 0.3rem;
    stroke-dasharray: none;
}

.arrow.dashed {
    stroke-dasharray: 8, 4;
}

.arrow__path {
    fill: none;
    pointer-events: stroke;
}

.arrow__path:hover {
    stroke-width: 0.3rem;
    filter: drop-shadow(0 0 0.1rem white);
}

.arrow__head line {
    stroke-dasharray: none;
    stroke-width: 0.15rem;
}

.icon-capsule {
    filter: drop-shadow(0 0.1rem 0 rgb(0, 0, 0, 0.1));
}

.screenshot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 15000;
    pointer-events: none;
    transition: background-color 0.25s ease-in-out;
}

.terms-dialog .mud-dialog-title {
    padding: 0.795rem 1.195rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e5e5e5;
    font-family: "Open Sans", sans-serif;
    position: sticky;
    top: 0;
}

.terms-dialog .mud-dialog-title h6 {
    color: black;
    font-size: 1.475rem;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

/* flows editor styling. The canvas stays as drawn, but every floating panel the editor adds
   (context menu, entity action bar) follows the MudBlazor palette so it reads on both themes. */
.flow-editor-menu {
    color: var(--mud-palette-text-primary);
    position: absolute;
    width: fit-content;
    height: fit-content;
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0.25rem;
    padding: 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 9999;
    overflow-y: auto;
    max-height: 15rem;
    box-shadow: var(--mud-elevation-4);
}

.flow-editor-menu-option {
    padding: 0.2rem 0.3rem;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border-radius: 0.1rem;
}

.flow-editor-menu-option:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.flow-editor-menu-option :first-child {
    margin-right: 1rem;
}

.flow-editor-menu-option :last-child {
    /*margin-left: 3rem;*/
}

.flow-editor-menu-divider {
    border-top: 1px solid var(--mud-palette-lines-default);
    margin: 0rem 0.3rem;
}

/* Entity action bar floating over selected entity */
.flow-editor-entity-action-bar {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    box-shadow: var(--mud-elevation-4);
    z-index: 100;
    pointer-events: auto;
}

.flow-editor-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--mud-palette-action-default);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
    padding: 0;
}

.flow-editor-action-btn:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.flow-editor-action-btn-danger:hover {
    background: var(--mud-palette-error-hover);
    color: var(--mud-palette-error);
}

.flow-editor-link-option {
    color: var(--mud-palette-text-primary);
    font-size: 0.8rem;
    padding: 5px;
    cursor: pointer;
}

.joint-element {
    cursor: pointer;
    stroke-linejoin: bevel; /* (aka round) to prevents bounding box expansion caused by acute angle miter joins */
}

/* Visual indicator for elements in a group selection */
.joint-element.group-selected {
    outline: red dashed 2px;
    outline-offset: -1px;
}

/* Visual indicator for DrawnLine elements in a group selection */
.joint-type-drawnline.group-selected > [joint-selector="line"] {
    outline: red dashed 2px;
}

.not-allowed {
    cursor: not-allowed;
}

.flex-col-reverse {
    display: flex;
    flex-direction: column-reverse;
}

/* Example of applying style to Joint.JS type: DrawnRectangle shape */
/*.joint-type-drawnrectangle rect:first-of-type:hover {*/
/*stroke-width: 6;*/
/*padding: .2rem;*/
/*cursor: move;*/
/*}*/

/* Gray the text on hover for textbox and callout shapes */
/*.joint-type-textbox text:hover, .joint-type-callout text:hover {*/
/*    fill: #53565A;*/
/*}*/
/* -------------------- */

.app-version {
    position: absolute;
    right: 1rem;
    color: var(--theme-shell-text-muted);
}

/* Theme */
:root {
    --deloitte-green: #86bc25;
    /* Admin tables (All Projects, company projects, Companies, Admin) — values mirror the React prototype's src/index.css */
    --app-brand-blue: #00a3e0;
    --app-admin-main-bg: #f5f5f5;
    --app-admin-card-bg: #ffffff;
    --app-admin-surface-hover: #e8e8ec;
    --app-admin-border: #e6e6e6;
    --app-admin-border-dashed: #d9d6cf;
    --app-admin-input-bg: #ffffff;
    --app-admin-input-border: #e6e6e6;
    --app-admin-accent-ink: #4f7314;
    /* On/off switch when on: the brand green in light mode, the brighter accent in dark */
    --app-switch-on: var(--deloitte-green);
    --app-admin-danger: #8a3b0b;
    --app-gauge-track: #eae7e0;
    --app-widget-bg: #ffffff;
    /* Widget text, border and tile colours; the prototype sets them apart from the shell palette. */
    --app-widget-border: #e2e2e6;
    --app-widget-font: 'Open Sans', system-ui, -apple-system, sans-serif;
    --app-widget-divider: #e2e2e6;
    --app-widget-surface-raised: #f6f6f8;
    --app-widget-text-muted: #6b6b70;
    --app-widget-text-primary: #18181b;
    --app-widget-text-secondary: #52525b;
    --app-w-pill-ok-bg: #e5f1ea;
    --app-w-pill-ok-fg: #0e5a3a;
    --app-w-pill-ok-dot: #107a4a;
    --app-w-fill-safe: #107a4a;
    --app-w-lever-neutral-bg: #f4f2ec;
    --app-w-lever-neutral-border: #e4e1da;
    --app-w-lever-neutral-row: #efede7;
    --app-w-lever-inbeat-bg: #eff7ec;
    --app-w-lever-inbeat-border: #cce5c2;
    --app-w-accent-danger: #c62a12;
    --app-w-accent-warn: #b5811c;
    --app-w-accent-ok: #107a4a;
    --app-w-accent-ink: #4f7314;
    --app-w-fill-danger: #e55a3c;
    --app-w-pill-danger-bg: #fbe9e7;
    --app-w-pill-danger-fg: #8a1b0b;
    --app-w-pill-danger-dot: #8a1b0b;
    /* Editorial design-system group — orange-red danger tone (#B85614) */
    --app-w-accent-danger-editorial: #b85614;
    --app-w-pill-danger-bg-editorial: #fbf0e8;
    --app-w-pill-danger-fg-editorial: #8a3b0b;
    --app-w-pill-danger-dot-editorial: #c4611a;
    /* Editorial ok / warn match the defaults in light; dark mutes them (below). */
    --app-w-accent-ok-editorial: #107a4a;
    --app-w-accent-warn-editorial: #b5811c;
    --app-w-pill-ok-fg-editorial: #0e5a3a;
    --app-w-pill-ok-dot-editorial: #107a4a;
    --app-w-pill-warn-fg-editorial: #7a4d00;
    --app-w-pill-warn-dot-editorial: #b5811c;
    --app-w-lever-inbeat-row: #ddebd3;
    --app-w-pill-warn-bg: #fbf1dc;
    --app-w-pill-warn-fg: #7a4d00;
    --app-w-pill-warn-dot: #b5811c;
    --app-w-tint-ok: #eef6f1;
    --app-w-tint-warn: #fbf1dc;
    --app-w-tint-danger: #fbe9e7;
    --app-widget-surface-sunken: #fafafa;
    --app-strip: #f4f4f5;
    --app-widget-border-soft: #e2e2e2;
    --app-w-heat-0-bg: var(--app-widget-bg);
    --app-w-heat-0-ink: var(--widget-text-primary);
    --app-w-heat-1-bg: #fbede9;
    --app-w-heat-1-ink: #1a1a1a;
    --app-w-heat-2-bg: #f7d8d0;
    --app-w-heat-2-ink: #1a1a1a;
    --app-w-heat-3-bg: #f1b9ab;
    --app-w-heat-3-ink: #1a1a1a;
    --app-w-heat-4-bg: #e89281;
    --app-w-heat-4-ink: #ffffff;
    --app-w-heat-5-bg: #d55f46;
    --app-w-heat-5-ink: #ffffff;
    --app-w-border-dashed: #d9d6cf;
    /* Taxable Income widget group — §174 category, NOL lifecycle, and GBC
       credit-type palettes (data encoding; values mirror the React index.css) */
    --app-w-btn-active-fg: #ffffff;
    --app-w-sec174-dom: #0076a8;
    --app-w-sec174-for: #7c3aed;
    --app-w-sec174-beat: #c32f27;
    --app-w-sec174-sec59e: #946000;
    --app-w-sec174-cy: #ed8b00;
    --app-w-nol-used: #5c851a;
    --app-w-nol-expired: #66686b;
    --app-w-gbc-rd: #1d5fd8;
    --app-w-gbc-ce: #127a34;
    --app-w-gbc-other: #6e45d0;
    /* Info accent — Tax-TI stage + net-income rows (Book→Tax→E&P walk) */
    --app-w-accent-info: #0e7490;
    --app-w-tint-info: #e0f2f7;
    /* Categorical data palette — CAMT AFSI driver identities (w-data-1 = danger).
       Slots 2 and 4 darkened with React (2026-09-30) to clear 4.5:1 as text on the light card. */
    --app-w-data-2: #a85a02;
    --app-w-data-3: #6e52b8;
    --app-w-data-4: #107e55;
    --app-w-data-5: #0f6c97;
    /* 6 (teal) — the BIE trend's ATI-ceiling series. Clears 4.5:1 as text on the
       light card (5.02:1), which the old #00A3A1 did not. */
    --app-w-data-6: #0e7c7a;
    /* FTC §904(d) basket palette + chart accents (light) */
    --app-w-ftc-bk-passive: #2a52b0;
    --app-w-ftc-bk-general: #196b30;
    --app-w-ftc-bk-gilti: #6d28d9;
    --app-w-ftc-bk-branch: #8b1a1a;
    --app-w-ftc-bk-treaty: #555555;
    --app-w-ftc-unused: #2a52b0;
    /* Jurisdiction palette (light) — per-country accents for the widgets that encode a country
       as colour. Data encoding: the colour IS the jurisdiction's identity. Read as row-label
       TEXT on the card, so light takes the saturated 600-level hues that hold up on white. */
    --app-w-juris-us: #2563eb;
    --app-w-juris-germany: #059669;
    --app-w-juris-france: #d97706;
    --app-w-juris-uk: #7c3aed;
    --app-w-juris-japan: #0891b2;
    --app-w-juris-ireland: #dc2626;
    --app-w-juris-singapore: #9333ea;
    /* FDDEI §904 sourcing palette (light) — how foreign-derived income sources,
       which is a different read from the FTC credit baskets above: "US Source"
       is foreign-derived for §250 but US-source for §904. */
    --app-w-basket-us-source: #7c3aed;
    --app-w-basket-general: #059669;
    --app-w-basket-passive: #0a7ea4;
    --app-w-basket-treaty: #6b7280;
    --app-w-chart-track: color-mix(in srgb, #000 5%, transparent);
    --app-w-tax-cit: #2563eb;
    /* Inclusions widget group — §951A HTE zones + §956/§954(b)(3) identities (light) */
    --app-w-hte-nearpass: #5a8a1a;
    --app-w-accent-negative: #b52020;
    --app-w-incl-s956: #7c3aed;
    --app-w-incl-subf: #2563eb;
    --app-w-incl-ep: #be185d;
    /* Entity Navigator — ETR heat ramp, 21% as the neutral midpoint (light). Data
       encoding, and also used as the ETR value TEXT, so every step clears AA on the
       light card. A loss jurisdiction has no rate and falls back to the muted token. */
    --app-w-etr-vlow: #046a38;
    --app-w-etr-low: #047857;
    --app-w-etr-mid: #4f7314;
    --app-w-etr-high: #a86200;
    --app-w-etr-vhigh: #c32f27;
    /* Entity Navigator — US tax-classification chips. Data encoding, rendered as a
       filled chip with white text, so these stay dark in both themes (no .mud-dark-mode
       override): contrast is against the chip's own label, not the card. */
    --app-w-enttype-uscorp: #0e5a3a;
    --app-w-enttype-cfc: #1a4fa0;
    --app-w-enttype-dre: #5b3a9e;
    --app-w-enttype-branch: #7a4d00;
    --app-w-enttype-partnership: #0e6e6e;
    /* Entity Navigator — intercompany payment types (light). Read as TEXT on the card,
       so unlike the chips above these do get a brightened dark-theme variant. */
    --app-w-ic-interest: #6d28d9;
    --app-w-ic-royalty: #0369a1;
    --app-w-ic-services: #a65a00;
    --app-w-ic-dividend: #047857;
    /* Scenario identity palette — strategy trajectory lines (light: darkened for
       AA text on white). Data encoding: each color IS a strategy's identity. */
    --app-w-scenario-current: #5e6573;
    --app-w-scenario-s1: #557a17;
    --app-w-scenario-s2: #0b7ba8;
    --app-w-scenario-s3: #8a6d12;
    --app-w-scenario-s4: #7c3aed;
    --app-w-scenario-s5: #0f766e;
    --app-w-scenario-s6: #c2410c;
    --app-w-scenario-s7: #be185d;
    --app-w-scenario-s8: #4338ca;
    /* Provision Impact Timeline — 7-series categorical palette. Data encoding:
       each color IS a provision's identity, and doubles as legend/tooltip text,
       so every value clears AA on the light widget surface. */
    --app-w-ptl-beat: #9a4e29;
    --app-w-ptl-camt: #6f5c9e;
    --app-w-ptl-163j: #946a10;
    --app-w-ptl-gilti: #3f6fa3;
    --app-w-ptl-ftc: #c42a2a;
    --app-w-ptl-fdii: #0e6a3a;
    --app-w-ptl-net: #6e45d0;
    /* Range-slider tones — filled portion + empty track. Deliberately neutral:
       an in-widget control is not a CTA. */
    --app-w-slider-accent: #c2c2ca;
    --app-w-slider-track: #e2e2e6;
    /* Input field background (sunken) */
    --app-input-sunken: #f5f5f8;
    --app-toggle-accent-ink: #4f7314;
    --app-toggle-accent-soft: rgba(134, 188, 37, 0.16);
    --app-toggle-border: #e6e6e6;
    --app-toggle-text-secondary: #52525b;
}

.mud-dark-mode {
    --app-admin-main-bg: #1a1a1a;
    --app-admin-card-bg: #282728;
    --app-admin-surface-hover: #333333;
    --app-admin-border: #444444;
    --app-admin-border-dashed: #3d3d3d;
    --app-admin-input-bg: #282728;
    --app-admin-input-border: #444444;
    --app-admin-accent-ink: #86eb22;
    --app-switch-on: #86eb22;
    --app-admin-danger: #ffaa6f;
    --app-gauge-track: #1f2c42;
    --app-widget-bg: #191b1e;
    --app-widget-border: #444444;
    --app-widget-divider: #393939;
    --app-widget-surface-raised: #333333;
    --app-widget-text-muted: #a0a0a0;
    --app-widget-text-primary: #e6e6e6;
    --app-widget-text-secondary: #cacaca;
    --app-w-pill-ok-bg: #0e2a1e;
    --app-w-pill-ok-fg: #7bd9a8;
    --app-w-pill-ok-dot: #7bd9a9;
    --app-w-fill-safe: #7bd9a9;
    --app-w-lever-neutral-bg: #15223a;
    --app-w-lever-neutral-border: #1f2c42;
    --app-w-lever-neutral-row: #1a2638;
    --app-w-lever-inbeat-bg: #0e2a1e;
    --app-w-lever-inbeat-border: #1f4d38;
    --app-w-accent-ok: #7bd9a8;
    /* Dark keeps the bright brand green — it clears AA on the dark card unmodified. */
    --app-w-accent-ink: #86bc25;
    --app-toggle-accent-ink: #86eb22;
    --app-toggle-accent-soft: rgba(134, 235, 34, 0.18);
    --app-toggle-border: #444444;
    --app-toggle-text-secondary: #cacaca;
    --app-w-accent-danger: #ff8b6f;
    --app-w-accent-warn: #f2c464;
    --app-w-fill-danger: #ff8b6f;
    --app-w-pill-danger-bg: #3a1410;
    --app-w-pill-danger-fg: #ffb7a6;
    --app-w-pill-danger-dot: #ffb7a6;
    /* Editorial design-system group — muted orange-red danger tone */
    --app-w-accent-danger-editorial: #e89a6e;
    --app-w-pill-danger-bg-editorial: #3a2210;
    --app-w-pill-danger-fg-editorial: #e89a6e;
    --app-w-pill-danger-dot-editorial: #e89a6e;
    /* The prototype's muted editorial ok / warn, so bars and pills sit back on the dark card. */
    --app-w-accent-ok-editorial: #74c49a;
    --app-w-accent-warn-editorial: #d4af61;
    --app-w-pill-ok-fg-editorial: #74c49a;
    --app-w-pill-ok-dot-editorial: #74c49a;
    --app-w-pill-warn-fg-editorial: #d4af61;
    --app-w-pill-warn-dot-editorial: #d4af61;
    --app-w-lever-inbeat-row: #163826;
    --app-w-pill-warn-bg: #3a2a0e;
    --app-w-pill-warn-fg: #f2c464;
    --app-w-pill-warn-dot: #f2c464;
    --app-w-tint-ok: #7bd9a814;
    --app-w-tint-warn: #f2c4641a;
    --app-w-tint-danger: #ff8b6f1a;
    --app-widget-surface-sunken: #000c0d;
    --app-strip: #222426;
    --app-widget-border-soft: #2a2526;
    --app-w-heat-0-bg: var(--widget-bg);
    --app-w-heat-0-ink: var(--widget-text-primary);
    --app-w-heat-1-bg: #2a1b1e;
    --app-w-heat-1-ink: #f0eee8;
    --app-w-heat-2-bg: #3a1e22;
    --app-w-heat-2-ink: #f0eee8;
    --app-w-heat-3-bg: #54221e;
    --app-w-heat-3-ink: #ffd9cc;
    --app-w-heat-4-bg: #7a2e1f;
    --app-w-heat-4-ink: #ffd9cc;
    --app-w-heat-5-bg: #a33b22;
    --app-w-heat-5-ink: #ffe6dc;
    --app-w-border-dashed: #2a3854;
    /* Taxable Income widget group — dark-theme palette */
    --app-w-btn-active-fg: #18181c;
    --app-w-sec174-dom: #4ba3d4;
    --app-w-sec174-for: #a78bfa;
    --app-w-sec174-beat: #e8736b;
    --app-w-sec174-sec59e: #f2a93d;
    --app-w-sec174-cy: #f2a93d;
    --app-w-nol-used: #a3d36b;
    --app-w-nol-expired: #b0b2b5;
    --app-w-gbc-rd: #5b9bf0;
    --app-w-gbc-ce: #4fc275;
    --app-w-gbc-other: #a98bea;
    /* Info accent — Tax-TI stage + net-income rows (Book→Tax→E&P walk) */
    --app-w-accent-info: #67e8f9;
    --app-w-tint-info: rgba(103, 232, 249, 0.1);
    /* Categorical data palette — CAMT AFSI driver identities (w-data-1 = danger) */
    --app-w-data-2: #e09848;
    --app-w-data-3: #9378d4;
    --app-w-data-4: #4db88a;
    /* 5 (blue) — see the light block. Clears 4.5:1 on the dark card (7.34:1). */
    --app-w-data-5: #5fb3d9;
    /* 6 (teal) — see the light block. Clears 4.5:1 on the dark card (8.63:1). */
    --app-w-data-6: #4fc9c6;
    /* FTC §904(d) basket palette + chart accents (dark) */
    --app-w-ftc-bk-passive: #6e8fe0;
    --app-w-ftc-bk-general: #4fb877;
    --app-w-ftc-bk-gilti: #a98bf5;
    --app-w-ftc-bk-branch: #e0796e;
    --app-w-ftc-bk-treaty: #9ca3ad;
    --app-w-ftc-unused: #7a98d4;
    /* Jurisdiction palette (dark) — see the light block. Dark sits in the same calmer band as the
       scenario palette so seven country labels read against the near-black card without punching
       out of it. */
    --app-w-juris-us: #7aa8e6;
    --app-w-juris-germany: #6fb37a;
    --app-w-juris-france: #e0a755;
    --app-w-juris-uk: #a594d4;
    --app-w-juris-japan: #6cb2c4;
    --app-w-juris-ireland: #d4857d;
    --app-w-juris-singapore: #b58ad8;
    /* FDDEI §904 sourcing palette (dark) — see the light block. */
    --app-w-basket-us-source: #a78bfa;
    --app-w-basket-general: #34d399;
    --app-w-basket-passive: #38bdf8;
    --app-w-basket-treaty: #9ca3af;
    --app-w-chart-track: color-mix(in srgb, #fff 18%, transparent);
    --app-w-tax-cit: #60a5fa;
    /* Inclusions widget group — §951A HTE zones + §956/§954(b)(3) identities (dark) */
    --app-w-hte-nearpass: #a3d95e;
    --app-w-accent-negative: #e08080;
    --app-w-incl-s956: #b794f6;
    --app-w-incl-subf: #7aa2f7;
    --app-w-incl-ep: #f472b6;
    /* Entity Navigator — ETR heat ramp (dark: brightened for the dark canvas). See
       the light block. */
    --app-w-etr-vlow: #4db88a;
    --app-w-etr-low: #34d399;
    --app-w-etr-mid: #9dcb54;
    --app-w-etr-high: #f2a93b;
    --app-w-etr-vhigh: #f1746a;
    /* Entity Navigator — intercompany payment types (dark). The tax-type chips are
       deliberately absent here; see the light block. */
    --app-w-ic-interest: #b794f6;
    --app-w-ic-royalty: #5fb3d9;
    --app-w-ic-services: #f2a93b;
    --app-w-ic-dividend: #4fb877;
    /* Scenario identity palette — strategy trajectory lines (dark: brightened
       for the dark canvas) */
    --app-w-scenario-current: #9ca3af;
    --app-w-scenario-s1: #a3d36b;
    --app-w-scenario-s2: #5cc8f5;
    --app-w-scenario-s3: #f0cf6a;
    --app-w-scenario-s4: #c4a5fc;
    --app-w-scenario-s5: #5eead4;
    --app-w-scenario-s6: #fdba74;
    --app-w-scenario-s7: #f9a8d4;
    --app-w-scenario-s8: #a5b4fc;
    /* Provision Impact Timeline — 7-series categorical palette (dark: brightened
       so each series still clears AA as legend text on the near-black canvas) */
    --app-w-ptl-beat: #d99873;
    --app-w-ptl-camt: #a99ad6;
    --app-w-ptl-163j: #d4af61;
    --app-w-ptl-gilti: #7faad9;
    --app-w-ptl-ftc: #e08080;
    --app-w-ptl-fdii: #74c49a;
    --app-w-ptl-net: #b69cf0;
    /* Range-slider tones — the empty track must clear the near-black canvas,
       so it sits lighter than the divider. */
    --app-w-slider-accent: #6f7480;
    --app-w-slider-track: #3c4049;
    /* Input field background (sunken) */
    --app-input-sunken: #3a3a3a;
}

/* ── Editorial design-system danger tone ──
   Mirrors the React index.css [data-widget-redesign] editorial token scope:
   this widget group uses an orange-red danger accent (#B85614 light /
   #E89A6E dark) instead of the default red (#C62A12 / #FF8B6F), and in dark
   mode mutes its ok and warn tones (#74C49A / #D4AF61). The override is set
   on the widget root so it (and its charts/pills) win over the inherited
   .widget-card value. Widgets outside this list (e.g. beat-w010)
   intentionally keep the default tones. */
[data-widget-redesign="exec-tax-provision"],
[data-widget-redesign="ftc-editorial"],
[data-widget-redesign="fdii-editorial"],
[data-widget-redesign="beat-w011"],
[data-widget-redesign="beat-w015"],
[data-widget-redesign="beat-w049"],
[data-widget-redesign="beat-w112"],
[data-widget-redesign="beat-w130"],
[data-widget-redesign="beat-w132"] {
    --w-accent-danger: var(--app-w-accent-danger-editorial);
    --w-pill-danger-bg: var(--app-w-pill-danger-bg-editorial);
    --w-pill-danger-fg: var(--app-w-pill-danger-fg-editorial);
    --w-pill-danger-dot: var(--app-w-pill-danger-dot-editorial);
    --w-accent-ok: var(--app-w-accent-ok-editorial);
    --w-accent-warn: var(--app-w-accent-warn-editorial);
    --w-pill-ok-fg: var(--app-w-pill-ok-fg-editorial);
    --w-pill-ok-dot: var(--app-w-pill-ok-dot-editorial);
    --w-pill-warn-fg: var(--app-w-pill-warn-fg-editorial);
    --w-pill-warn-dot: var(--app-w-pill-warn-dot-editorial);
}

/* Specific toggles styling */
.dense-toggles-popover .mud-list-item,
.dense-toggles-popover .mud-list-item-text,
.dense-toggles-popover .mud-typography {
    font-size: 0.6875rem !important;
}

.mini-expand-icon .mud-expand-panel-icon {
    transform: scale(0.65);
    transform-origin: center right;
}

.fs-top-action .mud-icon-button,
.fs-bottom-action .mud-icon-button {
    width: 24px !important;
    height: 24px !important;
}
.fs-top-action .mud-icon-root,
.fs-bottom-action .mud-icon-root {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
}

/* Role assignments dialog (AssignUserDialog). Global because MudDialog renders outside the
   component's scoped-CSS boundary; dark-mode overrides live in dark-mode.css. */
.mud-dialog.role-assignments-dialog {
    --roles-accent: var(--brand-green-ink);
    --roles-radius: 6px;
    --roles-input-background: var(--app-input-sunken);
    --roles-remove-color: var(--theme-shell-text-secondary);
    width: 42rem;
    max-width: calc(100vw - 2rem);
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--roles-radius);
}

.role-assignments-dialog .mud-dialog-title {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.role-assignments-dialog .mud-dialog-title .mud-typography {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-shell-text-primary);
}

.role-assignments-dialog .mud-dialog-title .mud-button-close {
    top: 0.75rem;
    right: 1rem;
    color: var(--theme-shell-text-secondary);
}

.role-assignments-dialog .mud-dialog-content {
    padding: 1.5rem;
}

.role-assignments-dialog .roles-loading {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.role-assignments-dialog .roles-project-label,
.role-assignments-dialog .roles-section-label {
    color: var(--theme-shell-text-secondary);
}

.role-assignments-dialog .roles-section-label {
    font-weight: 600;
}

.role-assignments-dialog .roles-project-label strong {
    font-weight: 600;
    color: var(--theme-shell-text-primary);
}

.role-assignments-dialog .roles-section-heading {
    margin-bottom: 0.5rem;
}

.role-assignments-dialog .roles-add-button {
    padding: 0.25rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--roles-accent);
}

.role-assignments-dialog .roles-empty {
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--theme-shell-text-secondary);
}

.role-assignments-dialog .mud-dialog-actions {
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    border-top: 1px solid var(--mud-palette-lines-default);
    background-color: transparent;
}

.role-assignments-dialog .roles-cancel-button,
.role-assignments-dialog .roles-save-button {
    padding: 0.5rem 1rem;
    border-radius: var(--roles-radius);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Fixed width and a text-sized spinner so the button doesn't jump while saving. */
.role-assignments-dialog .roles-save-button {
    min-width: 5.5rem;
}

.role-assignments-dialog .roles-save-button .mud-progress-circular {
    width: 1.125rem;
    height: 1.125rem;
}

.role-assignments-dialog .roles-cancel-button {
    color: var(--theme-shell-text-primary);
    border-color: var(--mud-palette-lines-default);
}

.role-assignments-dialog .roles-save-button:not(:disabled):not(.mud-disabled) {
    background-color: var(--mud-palette-secondary);
    color: #18181b; /* dark ink on the green button in both themes, so not a theme-flipping token */
}

.btn-primary-action {
    background-color: var(--brand-green) !important;
    color: #000000 !important;
    text-transform: none !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.btn-primary-action:disabled,
.btn-primary-action.mud-disabled {
    background-color: #e0e0e0 !important;
    color: #9e9e9e !important;
}

/* AI Chat Drawer Global Styles */
.mud-drawer.mud-drawer-persistent.ai-chat-drawer,
.mud-drawer.mud-drawer-mini.ai-chat-drawer {
    position: absolute !important;
    top: var(--mud-appbar-height) !important;
    bottom: var(--app-footer-height, 2.5rem) !important;
    height: auto !important;
    border-right: 1px solid var(--theme-shell-border) !important;
    background-color: var(--theme-sidebar-bg) !important;
    overflow-x: hidden !important;
}
.ai-chat-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 8px;
    z-index: 10;
    display: flex;
    justify-content: center;
    cursor: col-resize;
    touch-action: none;
    outline: none;
}
.ai-chat-resize-handle::after {
    content: "";
    width: 2px;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.15s ease;
}
.ai-chat-resize-handle:hover::after,
.ai-chat-resize-handle:focus-visible::after,
body.ai-chat-resizing .ai-chat-resize-handle::after {
    background-color: var(--accent);
}
body.ai-chat-resizing {
    cursor: col-resize;
    user-select: none;
}
/* The drawer and page would otherwise animate behind the pointer. */
body.ai-chat-resizing .mud-drawer,
body.ai-chat-resizing .mud-main-content,
body.ai-chat-resizing .mud-appbar {
    transition: none !important;
}
/* Sized like the scenario tabs' menu button (ScenarioHeader.razor.css): 1.375rem round, 0.875rem icon. */
.project-actions-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
    padding: 0.125rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--theme-shell-text-primary);
    cursor: pointer;
}

.project-actions-button .mud-icon-root {
    width: 0.875rem;
    height: 0.875rem;
    font-size: 0.875rem;
}

.project-actions-button:hover {
    background: var(--theme-shell-surface-hover);
}

.project-actions-button:focus-visible {
    outline: 0.125rem solid var(--brand-green);
    outline-offset: 0.0625rem;
}

.project-lock-status-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* The lock icon and its loading spinner occupy the same 14px box. */
.project-lock-status-badge .mud-icon-root.mud-svg-icon,
.project-lock-status-spinner {
    width: 0.875rem;
    height: 0.875rem;
    font-size: 0.875rem;
}

.project-lock-status-spinner {
    flex-shrink: 0;
    box-sizing: border-box;
    border-width: 2px;
}

.project-lock-status-badge--mine {
    color: var(--brand-green);
}

.project-lock-status-badge--other {
    color: var(--mud-palette-warning);
}

.mud-popover.toggle-dropdown-popover {
    max-width: min(26rem, calc(100vw - 2rem));
}

/* ── Popped-out AI chat window (Layouts/ChatPopoutLayout.razor) ─────────── */
.ai-chat-popout {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--theme-sidebar-bg);
}

.ai-chat-popout-message {
    margin: auto;
    padding: 1.5rem;
    text-align: center;
    color: var(--theme-shell-text-secondary);
}

/* The corner chat button. Hover or keyboard focus reveals the mic (sliding out from under the
   button) or, while popped out, the window actions above it. The mic stays out during voice mode.
   Leaving waits 160ms before hiding, so the pointer can cross the gap onto what was revealed. */
.ai-launcher {
    position: fixed;
    bottom: 3.5rem;
    left: 2rem;
    z-index: 9999;
}

.ai-launcher-main {
    position: relative;
    z-index: 2;
    display: flex;
}

/* Only visibility gates the pointer: it's deferred, so a revealed control stays hoverable through
   the close delay. A pointer-events switch would flip at once and drop the pointer in the gap. */
.ai-launcher-reveal {
    opacity: 0;
    visibility: hidden;
    transition: transform 200ms ease-out 160ms, opacity 200ms ease-out 160ms, visibility 0s linear 360ms;
}

.ai-launcher:hover .ai-launcher-reveal,
.ai-launcher:has(:focus-visible) .ai-launcher-reveal,
.ai-launcher--voice .ai-launcher-mic {
    opacity: 1;
    visibility: visible;
    transition: transform 200ms ease-out, opacity 200ms ease-out, visibility 0s;
}

.ai-launcher-mic {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
    transform: translateX(0) scale(0.6);
    transform-origin: bottom left;
}

.ai-launcher:hover .ai-launcher-mic,
.ai-launcher:has(:focus-visible) .ai-launcher-mic,
.ai-launcher--voice .ai-launcher-mic {
    transform: translateX(calc(100% + 0.75rem)) scale(1);
}

.ai-launcher .ai-popout-menu {
    display: flex;
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.5rem);
    width: max-content;
    transform: translateY(6px);
}

.ai-launcher:hover .ai-popout-menu,
.ai-launcher:has(:focus-visible) .ai-popout-menu {
    transform: translateY(0);
}

/* Durations line up with the transition lists above: transform, opacity, visibility. */
@media (prefers-reduced-motion: reduce) {
    .ai-launcher .ai-launcher-reveal {
        transition-duration: 0s, 200ms, 0s;
    }
}

.ai-popout-menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--theme-shell-border);
    background-color: var(--theme-sidebar-bg);
}

.ai-popout-menu .mud-button-root {
    color: var(--theme-shell-text-primary);
    justify-content: flex-start;
}

/* ── Widget option menus (OptionMenu.razor) ──
   Global because MudMenu portals the popover out of the component's scope. Sizes are px, like the
   widgets these menus sit on: the root font size grows with the viewport, so rem would outgrow them. */
.mud-popover.option-menu {
    background: var(--app-widget-bg, var(--mud-palette-surface));
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    max-height: min(320px, 60vh);
    min-width: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

/* A compare cell's menus are a fixed width and their heading sits on the options without a rule. */
.mud-popover.option-menu.compare-menu {
    width: 224px;
}

.compare-menu .option-menu-head {
    border-bottom: none;
    margin-bottom: 0;
    padding: 4px 12px 2px;
}

/* An Executive Summary widget's "Data from" list. */
.mud-popover.option-menu.data-source-menu {
    width: 260px;
}

.data-source-menu .option-menu-head {
    border-bottom: none;
    margin-bottom: 0;
}

.option-menu-head {
    border-bottom: 1px solid var(--mud-palette-lines-default);
    color: var(--app-widget-text-muted);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
    padding: 6px 12px 4px;
    text-transform: uppercase;
}

.option-menu-item {
    align-items: center;
    background: transparent;
    border: none;
    color: var(--app-widget-text-secondary);
    cursor: pointer;
    display: flex;
    font-family: var(--font-display);
    font-size: 12px;
    gap: 8px;
    justify-content: flex-start;
    line-height: 16px;
    padding: 6px 12px;
    text-align: left;
    transition: background-color 0.15s;
    width: 100%;
}

.option-menu-item .mud-icon-root {
    flex-shrink: 0;
    font-size: 11px;
    height: 11px;
    width: 11px;
}

.option-menu-item:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

/* The brand green, matching the header flask's "scenario changed" state. */
.option-menu-item.is-active {
    color: var(--mud-palette-secondary);
}

.option-menu-item--danger {
    color: var(--mud-palette-error);
}

.option-menu-divider {
    background: var(--mud-palette-lines-default);
    height: 1px;
    margin: 4px 0;
}

.option-menu-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.option-menu-list {
    background: transparent !important;
    padding: 0 !important;
}

.option-menu-spacer {
    display: inline-block;
    flex-shrink: 0;
    width: 11px;
}

/* The widget ⋯ menu, wide enough for "Percentages" beside its current pick (DashboardWidget.razor). */
.mud-popover.option-menu.widget-menu {
    width: 14.5rem;
}

/* The widget ⋯ menu's Currency and Percentages rows and the submenus they open beside themselves. */
.mud-popover.option-menu.rounding-menu {
    margin: -5px 4px 0;
    min-width: 180px;
}

.option-menu-list .mud-menu {
    display: flex;
    width: 100%;
}

.rounding-menu-label {
    flex: 1;
}

.rounding-menu-value {
    color: var(--app-widget-text-muted);
    flex-shrink: 0;
    font-size: 11px;
}

@media (hover: hover) {
    .option-menu-item:hover:not(:disabled) {
        background: var(--app-widget-surface-raised);
    }
}

/* ── Widget comparison dialog frame (WidgetCompareDialog.razor) ──
   Global because MudDialog renders the frame and backdrop outside the component's scope. */
.mud-dialog.widget-compare-dialog {
    background: var(--mud-palette-background);
    border: 1px solid var(--app-widget-border);
    border-radius: 16px;
    height: 90vh;
    max-height: 90vh;
    max-width: 90vw;
    overflow: hidden;
    width: 90vw;
}

.widget-compare-backdrop {
    backdrop-filter: blur(4px);
}

.widget-compare-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
