/* MXplorer Studio, piste « Signal »: the tokens every page and component draws from. */
:root {
    --mx-night: #0b2545;          /* structure, titles */
    --mx-mist: #eef3f9;           /* hover, quiet panels */
    --mx-wave: #3cc0c0;           /* accent of the symbol */
    --mx-ink: #0b2545;
    --mx-ink-soft: #34466a;       /* body text */
    --mx-muted: #4a5b78;
    --mx-line: #dbe3ee;
    --mx-line-strong: #c5d0df;
    --mx-bg: #f7f9fc;
    --mx-surface: #ffffff;

    --mx-pivot: #2457c5;
    --mx-pivot-tint: #e6edfb;
    --mx-insights: #c4511f;
    --mx-insights-tint: #fbeee7;
    --mx-dashboard: #0a8f8f;
    --mx-dashboard-ink: #0a7a7a;
    --mx-dashboard-tint: #e3f4f4;
    --mx-variables: #9a6b00;
    --mx-variables-ink: #7d5600;
    --mx-variables-tint: #f8f0dc;
    --mx-report: #b0306a;
    --mx-report-ink: #962657;
    --mx-report-tint: #fbe9f1;
    --mx-planning: #3d8b37;
    --mx-planning-ink: #2f6f2a;
    --mx-planning-tint: #e8f3e6;
    --mx-admin: #3b4a66;
    --mx-admin-ink: #2c3850;
    --mx-admin-tint: #e9edf4;

    /* Data, whatever the module: the first series of every chart (wwwroot/js/charts.js, palette). */
    --mx-data: #2457c5;

    --mx-font: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --mx-font-num: 'JetBrains Mono', ui-monospace, Consolas, monospace;

    --mx-radius: 12px;
    --mx-radius-sm: 8px;
    --mx-radius-pill: 20px;
    --mx-shadow: 0 1px 2px rgba(11, 37, 69, 0.08);
    --mx-shadow-lift: 0 4px 14px rgba(11, 37, 69, 0.12);

    /* The page's accent: its module's colour (MainLayout sets data-module). MX Pivot by default. */
    --mx-accent: var(--mx-pivot);
    --mx-accent-ink: var(--mx-pivot);
    --mx-accent-tint: var(--mx-pivot-tint);
    --mx-accent-line: #b9cbf1;
}

main[data-module="insights"] {
    --mx-accent: var(--mx-insights);
    --mx-accent-ink: #a8431a;
    --mx-accent-tint: var(--mx-insights-tint);
    --mx-accent-line: #f0c6b2;
}

main[data-module="variables"] {
    --mx-accent: var(--mx-variables);
    --mx-accent-ink: var(--mx-variables-ink);
    --mx-accent-tint: var(--mx-variables-tint);
    --mx-accent-line: #e8d5a3;
}

main[data-module="report"] {
    --mx-accent: var(--mx-report);
    --mx-accent-ink: var(--mx-report-ink);
    --mx-accent-tint: var(--mx-report-tint);
    --mx-accent-line: #efc0d5;
}

main[data-module="planning"] {
    --mx-accent: var(--mx-planning);
    --mx-accent-ink: var(--mx-planning-ink);
    --mx-accent-tint: var(--mx-planning-tint);
    --mx-accent-line: #bcdcb8;
}

main[data-module="admin"] {
    --mx-accent: var(--mx-admin);
    --mx-accent-ink: var(--mx-admin-ink);
    --mx-accent-tint: var(--mx-admin-tint);
    --mx-accent-line: #c8d0de;
}

main[data-module="dashboard"] {
    --mx-accent: var(--mx-dashboard);
    --mx-accent-ink: var(--mx-dashboard-ink);
    --mx-accent-tint: var(--mx-dashboard-tint);
    --mx-accent-line: #a9dcdc;
}

main a:not(.btn), main .btn-link {
    color: var(--mx-accent-ink);
}

.btn-outline-primary {
    --bs-btn-color: var(--mx-accent-ink);
    --bs-btn-border-color: var(--mx-accent-line);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--mx-accent);
    --bs-btn-hover-border-color: var(--mx-accent);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--mx-accent);
    --bs-btn-active-border-color: var(--mx-accent);
}

.btn-outline-secondary {
    --bs-btn-color: var(--mx-ink-soft);
    --bs-btn-border-color: var(--mx-line-strong);
    --bs-btn-hover-color: var(--mx-night);
    --bs-btn-hover-bg: var(--mx-mist);
    --bs-btn-hover-border-color: var(--mx-line-strong);
    --bs-btn-active-color: var(--mx-night);
    --bs-btn-active-bg: var(--mx-mist);
    --bs-btn-active-border-color: var(--mx-line-strong);
}

.form-control, .form-select {
    border-color: var(--mx-line-strong);
    color: var(--mx-night);
}

.form-check-input:checked {
    background-color: var(--mx-accent);
    border-color: var(--mx-accent);
}

html, body {
    font-family: var(--mx-font);
    color: var(--mx-ink-soft);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--mx-night);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.mx-num {
    font-family: var(--mx-font-num);
    font-variant-numeric: tabular-nums;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--mx-pivot);
}

.btn-primary {
    --bs-btn-bg: var(--mx-night);
    --bs-btn-border-color: var(--mx-night);
    --bs-btn-hover-bg: #163a66;
    --bs-btn-hover-border-color: #163a66;
    --bs-btn-active-bg: #071a33;
    --bs-btn-active-border-color: #071a33;
    --bs-btn-disabled-bg: var(--mx-night);
    --bs-btn-disabled-border-color: var(--mx-night);
    color: #fff;
}

.btn {
    font-weight: 600;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--mx-wave);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--mx-wave);
            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(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
.grid-total {
    margin-right: 1.5rem;
    font-weight: 600;
}

/* Buttons and error messages, shared by every page and component. */
.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.primary-btn {
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.primary-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.secondary-btn {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* ---- Printing a dashboard (wwwroot/js/print.js) ---------------------------------------------------------------
   body.dash-printing while it prints — or on screen, to see the page as it prints. An A4 sheet in landscape: no menu,
   no controls; the header says what the figures are of; the grid at the sheet's width (277 mm ≈ 1045 px), its widgets
   never cut across two pages. */
@page {
    size: A4 landscape;
    margin: 10mm;
}

body.dash-printing .sidebar,
body.dash-printing .dash-bar,
body.dash-printing .dash-edit-bar,
body.dash-printing .dash-edit-messages,
body.dash-printing .dash-panel,
body.dash-printing .widget-tools,
body.dash-printing .chart-tools,
body.dash-printing #blazor-error-ui {
    display: none !important;
}

body.dash-printing .page,
body.dash-printing main,
body.dash-printing article {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
}

body.dash-printing .dash-print-head {
    display: flex !important;
}

body.dash-printing .dash-signature {
    display: block !important;
}

body.dash-printing .dash-grid {
    width: 1045px;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
}

body.dash-printing .widget {
    break-inside: avoid;
    border-color: #d8d7d2 !important;
    /* Where the grid places it, whatever the screen's width: no narrow-screen stacking while printing. */
    grid-column: var(--col) !important;
    grid-row: var(--row) !important;
}

body.dash-printing .dash-grid {
    grid-template-columns: repeat(var(--columns), minmax(0, 1fr)) !important;
}

/* In portrait (print.js): the grid at the sheet's narrower width (190 mm). */
body.dash-printing.dash-portrait .dash-grid {
    width: 718px;
}

/* A chart printed as its image (charts.js freezeAll), over the live chart, hidden. */
.widget-chart.frozen {
    position: relative;
}

.widget-chart.frozen > div {
    visibility: hidden;
}

.widget-chart.frozen > .chart-frozen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Page by page: a grid per page, each on its own sheet. */
body.dash-printing .dash-print-page {
    break-after: page;
    margin-bottom: 12px;
}

body.dash-printing .dash-print-page:last-child {
    break-after: auto;
}

@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---- The explorer's views (Insights/ExplorerHierarchy, ExplorerPareto) ----------------------------- */
.eh-bar, .eh-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
}

.eh-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: #52514e;
    font-size: 0.8rem;
}

.eh-muted {
    color: #8a8984;
    font-size: 0.85rem;
}

.eh-level {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.1rem 0.25rem 0.1rem 0.6rem;
    border: 1px solid #c9c8c3;
    border-radius: 999px;
    background: #fff;
}

.eh-level-btn {
    border: none;
    background: none;
    color: #8a8984;
    padding: 0 0.3rem;
    line-height: 1;
}

.eh-level-btn:hover {
    color: #0b0b0b;
}

.eh-arrow {
    color: #8a8984;
}

.eh-add {
    width: auto;
    max-width: 16rem;
}

.eh-spacer {
    flex: 1 1 auto;
}

.eh-crumb {
    border: none;
    background: none;
    padding: 0;
    color: #2a78d6;
    max-width: 18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eh-crumb.current {
    color: #0b0b0b;
    font-weight: 600;
}

.eh-total {
    margin-left: 0.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.eh-change {
    margin-left: 0.4rem;
    font-weight: 400;
    color: #52514e;
}

.eh-filter {
    margin-left: auto;
}

.eh-chart {
    /* The page's content is a flex column: an empty box (the chart draws inside) would shrink to nothing. */
    flex-shrink: 0;
    height: 520px;
    border: 1px solid #e7e6e2;
    border-radius: 8px;
    background: #fff;
    transition: opacity 0.2s;
}

.eh-chart.eh-loading {
    opacity: 0.5;
}

.eh-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8984;
    font-size: 0.85rem;
    background: repeating-linear-gradient(-45deg, #fbfbfa, #fbfbfa 8px, #f4f3f0 8px, #f4f3f0 16px);
}

.eh-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #52514e;
}

.eh-scale {
    display: inline-block;
    width: 140px;
    height: 10px;
    border-radius: 2px;
    background: linear-gradient(90deg, #d64545, #e3e1dc 50%, #1f9e6e);
}

.eh-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 0.6rem;
    border-radius: 2px;
}

.eh-swatch.new {
    background: #0f6b48;
}

.eh-swatch.other {
    background: #c9c8c3;
}

.eh-legend .eh-muted {
    margin-left: auto;
    font-size: 0.75rem;
}

.ep-layout {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0.75rem;
    align-items: start;
}

.ep-chart {
    height: 420px;
}

.ep-side {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e7e6e2;
    border-radius: 8px;
    background: #fff;
    font-size: 0.85rem;
}

.ep-thresholds {
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.ep-thresholds th {
    color: #8a8984;
    font-weight: 400;
    font-size: 0.75rem;
}

.ep-thresholds td {
    padding: 0.15rem 0.3rem 0.15rem 0;
}

.ep-thresholds tbody tr {
    cursor: pointer;
}

.ep-thresholds tbody tr:hover, .ep-thresholds tr.picked {
    background: #e8f0fb;
}

.ep-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ep-n {
    width: 6.5rem;
}

.ep-advice {
    margin: 0;
}

@media (max-width: 900px) {
    .ep-layout {
        grid-template-columns: 1fr;
    }

    .eh-chart {
        height: 400px;
    }
}

/* ---- The explorer's variation (Insights/ExplorerVariation) -------------------------------------- */
.ev-cards {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ev-card, .ev-panel {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.7rem 1rem;
    border: 1px solid #e7e6e2;
    border-radius: 8px;
    background: #fff;
    min-width: 0;
}

.ev-panel {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

.ev-card-name {
    color: #52514e;
    font-size: 0.8rem;
}

.ev-card-value {
    font-size: 1.35rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ev-cards .up, .ev-table .up {
    color: #0f7a52;
}

.ev-cards .down, .ev-table .down {
    color: #a3302f;
}

.ev-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.ev-chart {
    flex-shrink: 0;
}

.ev-waterfall {
    height: 360px;
}

.ev-quadrant {
    height: 480px;
}

.ev-columns {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 0 0.75rem;
}

.ev-table {
    width: 100%;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    table-layout: fixed;
}

.ev-table th {
    color: #8a8984;
    font-weight: 400;
    text-align: right;
    width: 4.3rem;
}

.ev-table th:first-child {
    width: auto;
}

.ev-table td {
    padding: 0.15rem 0 0.15rem 0.4rem;
    text-align: right;
    white-space: nowrap;
}

.ev-table td.ev-member {
    padding-left: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ev-table tbody tr {
    cursor: pointer;
}

.ev-table tbody tr:hover {
    background: #f4f3f0;
}

@media (max-width: 640px) {
    .ev-columns {
        grid-template-columns: 1fr;
    }
}

/* ---- The explorer's insights and decomposition (Insights/ExplorerInsights, ExplorerDecomposition) ------- */
.ei-list {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 0.6rem;
}

.ei-card {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e7e6e2;
    border-left: 4px solid #8a8984;
    border-radius: 8px;
    background: #fff;
}

.ei-card.up {
    border-left-color: #1f9e6e;
}

.ei-card.down {
    border-left-color: #d64545;
}

.ei-card.warn {
    border-left-color: #eda100;
}

.ei-icon {
    flex: 0 0 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #f4f3f0;
    color: #52514e;
    text-align: center;
    line-height: 1.6rem;
    font-size: 0.9rem;
}

.ei-body {
    flex: 1 1 auto;
    min-width: 0;
}

.ei-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0b0b0b;
}

.ei-text {
    font-size: 0.82rem;
    color: #52514e;
}

.ei-filter {
    flex: 0 0 auto;
    align-self: center;
}

.ei-note {
    flex-shrink: 0;
    margin: 0.6rem 0 0;
    font-size: 0.75rem;
}

.ed-tree {
    flex-shrink: 0;
    /* Scrolls by itself: the page keeps its width. */
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.ed-column {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #e7e6e2;
    border-radius: 8px;
    background: #fff;
}

.ed-root {
    flex-basis: 170px;
}

.ed-chooser {
    flex-basis: 270px;
    background: #fbfbfa;
}

.ed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.ed-link {
    align-self: center;
    color: #8a8984;
    font-size: 1.3rem;
}

.ed-member {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "label value change" "bar bar bar";
    align-items: center;
    gap: 0.1rem 0.4rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.ed-member:hover {
    background: #f4f3f0;
}

.ed-member.selected {
    background: #e8f0fb;
    box-shadow: 0 0 0 1px #2a78d6 inset;
}

.ed-member.other {
    color: #8a8984;
    cursor: default;
}

.ed-member-label {
    grid-area: label;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ed-member-value {
    grid-area: value;
    font-variant-numeric: tabular-nums;
}

.ed-change {
    grid-area: change;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.ed-change.up {
    color: #0f7a52;
}

.ed-change.down {
    color: #a3302f;
}

.ed-bar {
    grid-area: bar;
    display: block;
    height: 5px;
    border-radius: 2px;
    background: #f4f3f0;
    overflow: hidden;
}

.ed-bar > span {
    display: block;
    height: 100%;
    background: #2a78d6;
}

.ed-bar > span.up {
    background: #1f9e6e;
}

.ed-bar > span.down {
    background: #d64545;
}

.ed-member.other .ed-bar > span {
    background: #c9c8c3;
}

.ed-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #e7e6e2;
    border-radius: 6px;
    background: #fff;
    text-align: left;
    font-size: 0.8rem;
}

.ed-choice:hover:not(:disabled) {
    border-color: #2a78d6;
}

.ed-choice:disabled {
    opacity: 0.5;
}

.ed-choice.best {
    border-color: #2a78d6;
}

.ed-choice-name {
    font-weight: 600;
}

.ed-choice-why {
    color: #52514e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ed-choice .ed-bar {
    grid-area: auto;
}

/* ---- From the explorer to the rest: actions and segments (Insights/ExplorerActions, ExplorerSegments) ---- */
.ea, .es {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ea-btn {
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 0.1rem 0.5rem;
}

.ea.compact .ea-btn {
    padding: 0 0.35rem;
    font-size: 0.7rem;
}

.ex-card-head .ea {
    margin-left: auto;
}

.ea-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 300px;
    padding: 0.75rem;
    border: 1px solid #c9c8c3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    font-size: 0.82rem;
    font-weight: 400;
    white-space: normal;
}

.ea-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ea-radio {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.ea-done {
    color: #0f7a52;
}

.es-active {
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: #4a3aa7;
    color: #fff;
    font-size: 0.78rem;
    white-space: nowrap;
}

.es-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.es-list li {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 4px;
}

.es-list li:hover, .es-list li.active {
    background: #f4f3f0;
}

.es-apply {
    flex: 1 1 auto;
    border: none;
    background: none;
    padding: 0.25rem 0.4rem;
    text-align: left;
    color: #2a78d6;
}

.es-delete {
    padding: 0 0.4rem;
    font-size: 0.72rem;
}

.es-save {
    display: flex;
    gap: 0.4rem;
}

/* ---- The explorer's analysis context (Insights/ExplorerContext) -------------------------------- */
.ec {
    flex-shrink: 0;
    position: relative;
    margin-bottom: 0.6rem;
}

.ec-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.ec-title {
    margin-right: 0.2rem;
}

.ec-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.05rem 0.2rem 0.05rem 0.55rem;
    border: 1px solid #c9c8c3;
    border-radius: 999px;
    background: #fff;
}

.ec-source {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #f4f3f0;
    color: #52514e;
    font-size: 0.78rem;
    cursor: help;
}

.ec-source.aggregate {
    background: #e3f4ec;
    color: #0f6b48;
}

.ec-badge {
    margin-left: auto;
    padding: 0 0.4rem;
    border-radius: 4px;
    background: #e3f4ec;
    color: #0f6b48;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: help;
}

.ec-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(520px, 100%);
    padding: 0.75rem;
    border: 1px solid #c9c8c3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.ec-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.ec-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.ec-list li:hover {
    background: #f4f3f0;
}

.ec-list label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
}

.ec-list li.ec-hidden {
    display: none;
}

/* The context summed up: a link-like button; its dimensions in the tooltip. */
.ec-summary {
    border: 1px solid var(--mx-line-strong);
    border-radius: 999px;
    background: var(--mx-surface);
    color: var(--mx-ink-soft);
    padding: 0.05rem 0.6rem;
    font-size: 0.82rem;
    cursor: pointer;
}

.ec-summary:hover,
.ec-summary[aria-expanded="true"] {
    border-color: var(--mx-accent);
    color: var(--mx-ink);
}

/* The sign-in pages (Auth/SignIn.razor, Auth/PlaceSignIn.razor): one card on the page. */
.signin {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--mx-bg);
}

.signin-card {
    width: min(380px, 100%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 2rem 1.75rem;
    background: var(--mx-surface);
    border: 1px solid var(--mx-line);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(11, 37, 69, 0.08);
}

.signin-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.signin-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--mx-night);
}

.signin-name span {
    color: var(--mx-wave);
}

.signin-label {
    font-weight: 600;
    color: var(--mx-ink);
}

.signin-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mx-muted);
}

.signin-problem {
    margin: 0;
    color: #b42318;
    font-size: 0.9rem;
}

/* « Montre-moi » (MX Assistant's courses, wwwroot/js/tour.js): the element to use, outlined in the assistant's colour. */
.mx-tour-on {
    outline: 3px solid #6b4fd8 !important;
    /* Inside the element: a menu or a panel that clips its children would hide it outside. */
    outline-offset: -3px;
    border-radius: 6px;
    animation: mx-tour-pulse 1.2s ease-in-out 3;
}

@keyframes mx-tour-pulse {
    50% { outline-color: rgba(107, 79, 216, 0.25); }
}

.mx-tour-badge {
    position: absolute;
    z-index: 2000;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6b4fd8;
    color: #fff;
    font: 700 12px/22px Manrope, system-ui, sans-serif;
    text-align: center;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .mx-tour-on { animation: none; }
}
