/*
 * Magiq site stylesheet.
 * Loaded after css/magiq-tokens.css (brand tokens and fonts, deployed from magiq-theme/static), magiq-theme.min.css and
 * _content/DevExpress.ExpressApp.Blazor/styles.css.
 * Covers what the SCSS theme cannot: XAF header/navigation, login page, splash screen, dashboard utilities and
 * responsive rules. Every color goes through the --magiq-* tokens of magiq-tokens.css.
 * Brand reference: docs/spec/05-ui-marque-dashboard.md. SCSS counterpart: magiq-theme/src/_tokens.scss.
 */

/* ==========================================================================
   3. Base
   ========================================================================== */

html,
body {
    height: 100%;
}

body {
    font-family: var(--magiq-font-family);
    color: var(--magiq-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

app {
    display: block;
    height: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-tight);
}

a {
    text-underline-offset: 0.15em;
}

::selection {
    background-color: var(--magiq-ink);
    color: var(--magiq-yellow);
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

/* Tabular figures wherever numbers are compared in columns */
.dxbl-grid,
.dxbl-tree-list,
.dxbl-pivot-table,
.dxbl-spin-edit,
.dxbl-date-edit,
.xaf-grid-display-item,
.magiq-tabular {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   4. Application shell (XAF ApplicationWindowTemplate)
   ========================================================================== */

/* Header: white bar with a hairline instead of the classic drop shadow */
.app .header {
    min-height: var(--magiq-header-height);
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
    border-bottom: 1px solid var(--magiq-border);
}

body:not(.dxbl-theme-fluent) .app .header {
    box-shadow: none;
}

.header-logo {
    flex-shrink: 0;
    width: 7.5rem;
    height: 1.75rem;
    background-image: url("../images/Logo.svg");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
}

.app .header .xaf-view-caption-lg {
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-tight);
}

.app .header .xaf-object-caption {
    color: var(--magiq-text-muted);
}

.app .header .btn-header {
    border-radius: var(--magiq-radius-pill);
}

/* A long object caption ("Client / 1000 - Boulangerie du Lac Sarl") ends with an ellipsis instead of pushing the account
   and settings buttons out of a phone screen (review P2-UX-03, D-126): the heading may shrink, the buttons may not. */
.app .header-right-side > [role="heading"] {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.app .header-right-side > .d-flex.ms-auto {
    flex: none;
}

/* Warning messages (possible duplicate, renumbered record): ink on amber, 9.8:1, instead of XAF's white text (2.1:1,
   below WCAG AA) - review P2-A11Y-01, D-126. Values of --magiq-warning and --magiq-ink. */
.xaf-alert.alert-warning {
    background-color: #F59E0B !important;
    color: #0A0A0A !important;
}

.xaf-alert.alert-warning .text-white,
.xaf-alert.alert-warning .xaf-alert-button {
    color: #0A0A0A !important;
}

/* Sidebar column: soft gray rail continued in the header's left side */
.app .xaf-sidebar {
    background-color: var(--magiq-surface-muted);
    border-right: 1px solid var(--magiq-border);
}

body:not(.dxbl-theme-fluent) .app .xaf-sidebar {
    box-shadow: none;
}

@media (min-width: 576px) {
    .app:not(.collapse-toggle) .header-left-side {
        align-self: stretch;
        background-color: var(--magiq-surface-muted);
        border-right: 1px solid var(--magiq-border);
    }
}

.app .xaf-sidebar .about-info {
    color: var(--magiq-text-muted);
    opacity: 1;
}

/* Navigation (DxAccordion / DxTreeView): pill items, yellow active item (colors come from the theme) */
.xaf-sidebar .xaf-accordion {
    --dxbl-accordion-group-border-width: 0;
    --dxbl-accordion-group-item-text-padding-y: 0.4375rem;
    padding: 0.5rem 0;
}

.xaf-sidebar .xaf-accordion .dxbl-accordion-group-header {
    font-weight: var(--magiq-font-weight-semibold);
}

.xaf-sidebar .xaf-accordion .dxbl-accordion-item:not(.dxbl-accordion-group) > .dxbl-accordion-item-content,
.xaf-sidebar .xaf-tree-view .dxbl-treeview-item-content {
    margin: 0.0625rem 0.5rem;
    border-radius: var(--magiq-radius-pill);
    font-weight: var(--magiq-font-weight-medium);
}

.xaf-sidebar .xaf-accordion .dxbl-accordion-item.dxbl-active:not(.dxbl-accordion-group) > .dxbl-accordion-item-content,
.xaf-sidebar .xaf-tree-view .dxbl-treeview-item-content.dxbl-active {
    color: var(--magiq-on-accent);
    font-weight: var(--magiq-font-weight-semibold);
}

/* Bootstrap buttons (XAF styles.css forces a 0.2rem radius on .btn) */
body:not(.dx-external-theme) .btn {
    border-radius: var(--magiq-radius-pill);
}

/* Toolbar captions */
.main-toolbar .dxbl-btn:not(.dxbl-btn-primary) {
    font-weight: var(--magiq-font-weight-medium);
}

/* Form layout group captions */
.dxbl-fl .dxbl-group-header {
    letter-spacing: var(--magiq-letter-spacing-tight);
}

/* ==========================================================================
   5. Splash screen (XAF SplashScreen component)
   ========================================================================== */

.loading-items-center .loading-image {
    width: 3.5rem;
    height: 3.5rem;
}

.loading-items-center .loading-image-wrapper {
    background-color: var(--magiq-ink) !important;
}

.loading-items-center .loading-floated-circle {
    border-top-color: var(--magiq-yellow) !important;
}

.loading-caption {
    font-family: var(--magiq-font-family);
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-logo);
    color: var(--magiq-text);
}

/* ==========================================================================
   6. Login page (XAF LogonWindowTemplate: #logon-template-component)
   Mobile: yellow brand band on top. Desktop (>= 992px): yellow side panel + form column.
   ========================================================================== */

#logon-template-component {
    min-height: 100%;
    background-color: var(--magiq-surface);
}

#logon-template-component .logon-template-header {
    position: relative;
    min-height: 8rem;
    padding: 2rem 1.5rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: var(--magiq-yellow) !important;
    background-image:
        radial-gradient(circle at 15% 20%, var(--magiq-yellow-light) 0, transparent 45%),
        radial-gradient(circle at 85% 90%, var(--magiq-yellow-lighter) 0, transparent 40%);
    color: var(--magiq-ink);
    overflow: hidden;
}

#logon-template-component .logon-template-header .header-logo {
    width: 11rem;
    height: 2.75rem;
    margin: 0;
    background-image: url("../images/LogoOnYellow.svg");
    background-position: center;
}

#logon-template-component .logon-template-body {
    background-color: var(--magiq-surface);
}

#logon-template-component .logon-main-container {
    padding: 2rem 1rem 3rem;
}

#logon-template-component .logon-main.card {
    width: 100%;
    max-width: 26rem;
    border: 1px solid var(--magiq-border-subtle);
    border-radius: var(--magiq-radius-xl);
    background-color: var(--magiq-surface);
    box-shadow: var(--magiq-shadow);
}

#logon-template-component .logon-main.card .card-header {
    padding: 1.75rem 1.75rem 0;
    border-bottom: 0;
    background-color: transparent;
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-tight);
}

#logon-template-component .logon-main.card .card-body {
    padding: 1.25rem 1.75rem 1.75rem;
}

#logon-template-component .logon-viewsite .dxbl-text-edit {
    --dxbl-text-edit-padding-y: 0.5625rem;
}

#logon-template-component .logon-toolbar {
    padding-top: 1.25rem;
}

#logon-template-component .logon-toolbar .dxbl-btn {
    min-height: var(--magiq-touch-target);
    font-size: 1rem;
    font-weight: var(--magiq-font-weight-semibold);
}

#logon-template-component .middle-text-separator {
    color: var(--magiq-text-subtle);
}

/* Optional slots for a customized logon template (tagline, secondary links) */
.magiq-login-tagline {
    max-width: 22rem;
    margin: 0;
    color: var(--magiq-ink);
    font-size: 1.75rem;
    line-height: 1.1;
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-tight);
}

.magiq-login-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 1.25rem;
    font-size: 0.875rem;
}

@media (max-width: 575.98px) {
    #logon-template-component .logon-main-container {
        align-items: flex-start;
        padding: 1.25rem 1rem 2rem;
    }

    #logon-template-component .logon-main.card {
        border: 0;
        box-shadow: none;
    }

    #logon-template-component .logon-main.card .card-header {
        padding: 0.5rem 0.25rem 0;
    }

    #logon-template-component .logon-main.card .card-body {
        padding: 1rem 0.25rem 1.5rem;
    }
}

@media (min-width: 992px) {
    #logon-template-component {
        display: grid;
        grid-template-columns: minmax(22rem, 40%) 1fr;
        grid-template-rows: 100%;
        height: 100%;
    }

    #logon-template-component .logon-template-header {
        grid-column: 1;
        grid-row: 1;
        min-height: 100%;
        padding: 3rem;
    }

    #logon-template-component .logon-template-header .header-logo {
        width: 15rem;
        height: 3.75rem;
    }

    #logon-template-component .logon-template-body {
        grid-column: 2;
        grid-row: 1;
        overflow: auto;
    }
}

/* ==========================================================================
   7. Popups
   ========================================================================== */

.dxbl-modal > .dxbl-modal-root > .dxbl-popup.xafPopup {
    box-shadow: var(--magiq-shadow-lg);
}

/* ==========================================================================
   8. Dashboard and content utilities (custom Razor components)
   ========================================================================== */

.magiq-grid {
    display: grid;
    gap: var(--magiq-gap);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.magiq-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.magiq-span-2 {
    grid-column: span 2;
}

.magiq-span-full {
    grid-column: 1 / -1;
}

.magiq-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--magiq-border-subtle);
    border-radius: var(--magiq-radius-lg);
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
    box-shadow: var(--magiq-shadow-sm);
    transition: box-shadow var(--magiq-duration) var(--magiq-ease), transform var(--magiq-duration) var(--magiq-ease);
}

.magiq-card--xl {
    border-radius: var(--magiq-radius-xl);
}

.magiq-card--ink {
    border-color: transparent;
    background-color: var(--magiq-ink);
    color: var(--magiq-text-inverse);
}

.magiq-card--accent {
    border-color: transparent;
    background-color: var(--magiq-yellow);
    color: var(--magiq-ink);
}

a.magiq-card,
button.magiq-card,
.magiq-card--interactive {
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

a.magiq-card:hover,
button.magiq-card:hover,
.magiq-card--interactive:hover {
    box-shadow: var(--magiq-shadow);
    transform: translateY(-1px);
}

a.magiq-card:focus-visible,
button.magiq-card:focus-visible,
.magiq-card--interactive:focus-visible {
    outline: 2px solid var(--magiq-text);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--magiq-focus-ring);
}

.magiq-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.magiq-card-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: var(--magiq-font-weight-semibold);
    letter-spacing: var(--magiq-letter-spacing-tight);
}

.magiq-card-subtitle {
    margin: 0;
    color: var(--magiq-text-muted);
    font-size: 0.8125rem;
}

.magiq-card--ink .magiq-card-subtitle {
    color: var(--magiq-gray-300);
}

/* KPI tile */
.magiq-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.magiq-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.magiq-kpi-label {
    color: var(--magiq-text-muted);
    font-size: 0.8125rem;
    font-weight: var(--magiq-font-weight-medium);
}

.magiq-kpi-value {
    overflow: hidden;
    color: var(--magiq-text);
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-tight);
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.magiq-kpi-meta {
    color: var(--magiq-text-muted);
    font-size: 0.8125rem;
}

.magiq-kpi-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--magiq-radius-lg);
    background-color: var(--magiq-hover-overlay);
    color: var(--magiq-text);
    transition: background-color var(--magiq-duration) var(--magiq-ease), color var(--magiq-duration) var(--magiq-ease);
}

.magiq-kpi-icon > svg {
    width: 1.5rem;
    height: 1.5rem;
}

a.magiq-card:hover .magiq-kpi-icon,
button.magiq-card:hover .magiq-kpi-icon,
.magiq-card--interactive:hover .magiq-kpi-icon {
    background-color: var(--magiq-ink);
    color: var(--magiq-yellow);
}

.magiq-kpi--alert .magiq-kpi-value {
    color: var(--magiq-danger);
}

/* Trend / status pills */
.magiq-badge,
.magiq-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: fit-content;
    padding: 0.125rem 0.5rem;
    border-radius: var(--magiq-radius-pill);
    background-color: var(--magiq-accent-soft);
    color: var(--magiq-ink);
    font-size: 0.75rem;
    line-height: 1.25rem;
    font-weight: var(--magiq-font-weight-semibold);
    white-space: nowrap;
}

.magiq-badge--success,
.magiq-kpi-trend--up {
    background-color: var(--magiq-success-bg);
    color: var(--magiq-success-text);
}

.magiq-badge--danger,
.magiq-kpi-trend--down {
    background-color: var(--magiq-danger-bg);
    color: var(--magiq-danger-text);
}

.magiq-badge--warning {
    background-color: var(--magiq-warning-bg);
    color: var(--magiq-warning-text);
}

.magiq-badge--info {
    background-color: var(--magiq-info-bg);
    color: var(--magiq-info-text);
}

.magiq-badge--neutral,
.magiq-kpi-trend--neutral {
    background-color: var(--magiq-surface-sunken);
    color: var(--magiq-gray-700);
}

.magiq-badge--ink {
    background-color: var(--magiq-ink);
    color: var(--magiq-yellow);
}

/* Pill buttons (black with yellow caption, as on magiq.ch) */
.magiq-pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--magiq-radius-pill);
    background-color: var(--magiq-action);
    color: var(--magiq-on-action);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: var(--magiq-font-weight-semibold);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--magiq-duration) var(--magiq-ease), transform var(--magiq-duration) var(--magiq-ease), box-shadow var(--magiq-duration) var(--magiq-ease);
}

.magiq-pill-button:hover {
    background-color: var(--magiq-action-hover);
    color: var(--magiq-on-action);
    transform: scale(1.03);
}

.magiq-pill-button:active {
    background-color: var(--magiq-action-pressed);
    transform: scale(0.99);
}

.magiq-pill-button:focus-visible {
    outline: 2px solid var(--magiq-text);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--magiq-focus-ring);
}

.magiq-pill-button:disabled,
.magiq-pill-button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.magiq-pill-button > svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.magiq-pill-button--secondary {
    border-color: var(--magiq-border-strong);
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
}

.magiq-pill-button--secondary:hover,
.magiq-pill-button--secondary:active {
    background-color: var(--magiq-surface-sunken);
    color: var(--magiq-text);
}

.magiq-pill-button--accent {
    background-color: var(--magiq-yellow);
    color: var(--magiq-ink);
}

.magiq-pill-button--accent:hover,
.magiq-pill-button--accent:active {
    background-color: var(--magiq-yellow-light);
    color: var(--magiq-ink);
}

.magiq-pill-button--sm {
    min-height: 2rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.magiq-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Text helpers */
.magiq-greeting {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: var(--magiq-font-weight-bold);
    letter-spacing: var(--magiq-letter-spacing-tight);
}

.magiq-muted {
    color: var(--magiq-text-muted);
}

.magiq-link {
    color: var(--magiq-text);
    font-weight: var(--magiq-font-weight-medium);
    text-decoration: underline;
    text-decoration-color: var(--magiq-yellow-dark);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

.magiq-link:hover {
    color: var(--magiq-text);
    text-decoration-color: var(--magiq-text);
}

/* Loading skeleton */
.magiq-skeleton {
    min-height: 1rem;
    border-radius: var(--magiq-radius-sm);
    background: linear-gradient(90deg, var(--magiq-gray-100) 25%, var(--magiq-gray-200) 37%, var(--magiq-gray-100) 63%);
    background-size: 400% 100%;
    animation: magiq-skeleton 1.4s ease infinite;
}

@keyframes magiq-skeleton {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ==========================================================================
   8b. Sales documents (P3 WP-D, D-136)
   ========================================================================== */

/* Totals bar of a document form and of a line form (Editors/DocumentTotals): a card on a desktop, under the lines. */
.magiq-doc-totals {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    max-width: 26rem;
    margin-left: auto;
    padding: 0.75rem 1rem;
    border: 1px solid var(--magiq-border);
    border-radius: var(--magiq-radius-md, 0.75rem);
    background: var(--magiq-surface-muted);
}

.magiq-doc-totals-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    line-height: 1.5;
}

.magiq-doc-totals-amount {
    white-space: nowrap;
    text-align: right;
}

.magiq-doc-totals-total {
    margin-top: 0.25rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--magiq-border-strong);
    font-size: 1.125rem;
    font-weight: var(--magiq-font-weight-bold);
}

.magiq-doc-totals-included {
    color: var(--magiq-text-muted);
    font-size: 0.875rem;
}

/*
 * Review P3 P3-UX-02 (D-143), revised by P7 WP-C (R7): from 768 px the totals of a document form stay in view as a compact
 * card at the end of the lines (the layout item is sticky at the bottom of the screen while the lines are in view, 11.5);
 * the floating card of D-143 covered the last rows and the footer of the grid. The line form (popup) keeps its card in place.
 */
@media (min-width: 768px) {
    .main-content .magiq-doc-totals {
        z-index: 20;
        /* A bar as wide as the lines, like the footer of their grid: it never sits over a column of the rows. */
        width: 100%;
        max-width: none;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: flex-end;
        gap: 0.125rem 1.25rem;
        padding: 0.5rem 1rem;
        background: var(--magiq-surface);
        box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
    }

    .main-content .magiq-doc-totals-row {
        gap: 0.375rem;
        font-size: 0.875rem;
    }

    .main-content .magiq-doc-totals-total {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 1.0625rem;
    }
}

/* ==========================================================================
   9. Responsive
   ========================================================================== */

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

@media (max-width: 767.98px) {
    :root {
        --magiq-gap: 0.75rem;
    }

    .magiq-grid,
    .magiq-grid--2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .magiq-span-2 {
        grid-column: auto;
    }

    .magiq-card {
        padding: 1rem;
    }

    .magiq-kpi-value {
        font-size: 1.5rem;
    }

    .magiq-greeting {
        font-size: 1.375rem;
    }

    /* Compact XAF paddings */
    .main-toolbar {
        padding: 0.5rem;
    }

    .main-content.xaf-flex-auto {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .app .header .xaf-view-caption-lg {
        font-size: 1.0625rem;
        line-height: 1.4rem;
    }

    /* Review P14 (LUX-10): on a phone the title of the view keeps the room of its decorative icon (« Saisie du temps » was cut to « Saisie … »). */
    .app .header .xaf-caption-icon-container {
        display: none;
    }

    .app .header .xaf-caption-icon-container + .xaf-caption-container {
        max-width: 100%;
    }

    /* Full-screen XAF popups (detail views, lookups); small confirmation dialogs stay centered */
    .dxbl-modal > .dxbl-modal-root > .dxbl-popup.xafPopup:not(.xaf-confirmation-dialog) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        inset: auto !important;
        transform: none !important;
        align-self: stretch !important;
        justify-self: stretch !important;
        border-width: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .dxbl-modal > .dxbl-modal-root > .dxbl-popup.xafPopup:not(.xaf-confirmation-dialog) > .dxbl-modal-content {
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    /*
     * P3 WP-D (D-136): on a phone the totals of a document form stay in view, as a bar fixed at the bottom of the screen;
     * the form gets room for it below its last field. In a line form (full-screen popup) the bar stays above the
     * OK / Cancel buttons, at the bottom of the scrolling body.
     */
    .main-content .magiq-doc-totals {
        position: fixed;
        z-index: 20;
        right: 0;
        bottom: 0;
        left: 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.125rem 1rem;
        padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom));
        max-width: none;
        margin: 0;
        border-width: 1px 0 0;
        border-radius: 0;
        background: var(--magiq-surface);
        box-shadow: 0 -4px 12px rgb(0 0 0 / 8%);
    }

    .main-content .magiq-doc-totals-row {
        gap: 0.375rem;
        font-size: 0.8125rem;
    }

    .main-content .magiq-doc-totals-total {
        margin: 0 0 0 auto;
        padding: 0;
        border: 0;
        font-size: 1.0625rem;
    }

    .main-content:has(.magiq-doc-totals) {
        padding-bottom: 5.5rem;
    }

    .xafPopup .magiq-doc-totals {
        position: fixed;
        z-index: 2;
        right: 0;
        bottom: var(--magiq-popup-footer-height, 3.5rem);
        left: 0;
        max-width: none;
        margin: 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.125rem 1rem;
        padding: 0.5rem 1rem;
        border-width: 1px 0;
        border-radius: 0;
        background: var(--magiq-surface);
        box-shadow: 0 -4px 12px rgb(0 0 0 / 8%);
    }

    .xafPopup .magiq-doc-totals-row {
        gap: 0.375rem;
        font-size: 0.8125rem;
    }

    .xafPopup .magiq-doc-totals-total {
        margin: 0 0 0 auto;
        padding: 0;
        border: 0;
        font-size: 1.0625rem;
    }

    .xafPopup:has(.magiq-doc-totals) .dxbl-modal-body {
        padding-bottom: 5.5rem;
    }

    /*
     * Review P3 P3-UX-01 (D-143): XAF stacks its messages at the bottom of the screen, above everything (z-index 31000),
     * where they covered the OK / Cancel buttons of the popups and the totals bar; on a phone they come at the top instead
     * (closed after their duration by js/custom.js: XAF never closes them on a phone).
     */
    .xaf-alerts-stack {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }

    .xaf-alerts-stack-inner {
        justify-content: flex-start;
    }

    /* Review P3 P3-UX-05 (D-143): read-only information texts of the popups wrap instead of being cut. */
    .xafPopup textarea[readonly] {
        resize: none;
    }
}

/*
 * P4 WP-D (plan §11.3, §11.4): a read-only number (paid amount, balance, counters of the previews) shows no spin buttons;
 * the counters of the e-banking import read as status badges (green ready, yellow already settled, orange different
 * amount or duplicate, red not found, grey ignored), their caption above the value.
 */
dxbl-spinedit[is-read-only] .dxbl-spin-btns {
    display: none;
}

dxbl-form-layout-item:has(> label[class*="xaf-item-"][class*="count"]) dxbl-spinedit[is-read-only] {
    border-left-width: 0.375rem;
    font-weight: 700;
}

dxbl-form-layout-item:has(> label.xaf-item-readycount) dxbl-spinedit[is-read-only] { border-left-color: rgb(46, 160, 67); }
dxbl-form-layout-item:has(> label.xaf-item-alreadybalancedcount) dxbl-spinedit[is-read-only] { border-left-color: rgb(212, 167, 0); }
dxbl-form-layout-item:has(> label.xaf-item-amountnotequalcount) dxbl-spinedit[is-read-only],
dxbl-form-layout-item:has(> label.xaf-item-duplicatecount) dxbl-spinedit[is-read-only] { border-left-color: rgb(230, 126, 34); }
dxbl-form-layout-item:has(> label.xaf-item-notfoundcount) dxbl-spinedit[is-read-only] { border-left-color: rgb(200, 35, 51); }
dxbl-form-layout-item:has(> label.xaf-item-ignoredcount) dxbl-spinedit[is-read-only] { border-left-color: rgb(140, 140, 140); }

/*
 * Review P4 MOB-P4-01 (D-158): a read-only memo (the warning of the e-banking import, the information texts of the popups)
 * grows with its text instead of hiding its last lines behind a scroll bar, up to a height where it scrolls; RowCount stays
 * the height where field-sizing is not supported.
 */
dxbl-memo-editor[is-read-only] > textarea {
    field-sizing: content;
    max-height: 24rem;
    overflow-y: auto;
    resize: none;
}

/*
 * Review P4 MOB-P4-01 (D-158): on a phone the summary of the e-banking import (file kind, selection, the seven status
 * counters) is a grid of compact badges, three per row, instead of eleven stacked fields: the rows to select come one
 * screen higher.
 */
@media (max-width: 767.98px) {
    dxbl-form-layout-item:has(> label:is(.xaf-item-filekind, .xaf-item-selectedcount, .xaf-item-selectedamount, .xaf-item-totalcount,
        .xaf-item-readycount, .xaf-item-alreadybalancedcount, .xaf-item-amountnotequalcount, .xaf-item-duplicatecount,
        .xaf-item-notfoundcount, .xaf-item-ignoredcount)) {
        flex: 0 0 33.3333% !important;
        max-width: 33.3333% !important;
        width: 33.3333% !important;
        padding-bottom: 0.25rem;
    }

    dxbl-form-layout-item > label:is(.xaf-item-filekind, .xaf-item-selectedcount, .xaf-item-selectedamount, .xaf-item-totalcount,
        .xaf-item-readycount, .xaf-item-alreadybalancedcount, .xaf-item-amountnotequalcount, .xaf-item-duplicatecount,
        .xaf-item-notfoundcount, .xaf-item-ignoredcount) {
        font-size: 0.75rem;
        line-height: 1.1;
        max-width: 100%;
        /* P7 WP-C (R11): two lines rather than a cut ("Montant sélection…", "Opérations ignorée…"); the counters stay aligned. */
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        min-height: 2.2em;
        overflow: hidden;
        white-space: normal;
    }
}

/* Touch devices: minimum 44 px targets */
@media (pointer: coarse) {
    .main-toolbar .dxbl-btn,
    .app .header .btn-header,
    .xafPopup .dxbl-modal-footer .dxbl-btn,
    .magiq-pill-button {
        min-height: var(--magiq-touch-target);
    }

    /* P4 WP-D (plan §11.4): the selection boxes of the previews (imports, e-banking, reminders, subscriptions) are 44 px targets. */
    .xafPopup .dxbl-grid .dxbl-grid-selection-cell,
    .xaf-detail-view .dxbl-grid .dxbl-grid-selection-cell {
        min-width: var(--magiq-touch-target);
        height: var(--magiq-touch-target);
    }

    /* P3 WP-D: the rows of a line list open the line form on a phone. */
    .xaf-nested-frame .dxbl-grid .dxbl-grid-table > tbody > tr > td {
        height: var(--magiq-touch-target);
    }

    .app .header .btn-header {
        min-width: var(--magiq-touch-target);
    }
}

@media (prefers-reduced-motion: reduce) {
    .magiq-card,
    .magiq-kpi-icon,
    .magiq-pill-button {
        transition: none;
    }

    a.magiq-card:hover,
    button.magiq-card:hover,
    .magiq-card--interactive:hover,
    .magiq-pill-button:hover,
    .magiq-pill-button:active {
        transform: none;
    }

    .magiq-skeleton {
        animation: none;
    }
}

/* ==========================================================================
   10. P7 WP-B — visual polish (D-183 to D-186): icons, shell, toolbars, lists,
       badges, read-only editors, messages. Tokens only (magiq-tokens.css).
   ========================================================================== */

/* 10.1 Navigation: no underline, ink icons of 20 px, spaced groups, gray hover (D-184) */
.xaf-sidebar a.dxbl-accordion-item-content,
.xaf-sidebar a.dxbl-accordion-item-content:hover,
.xaf-sidebar a.dxbl-accordion-item-content:focus,
.xaf-sidebar .xaf-nav-link,
.xaf-sidebar .clickable-xaf-nav-item > a .xaf-nav-link,
.xaf-sidebar .clickable-xaf-nav-item > div > a .xaf-nav-link,
.xaf-sidebar .dxbl-treeview-item-content {
    color: inherit;
    text-decoration: none;
}

.xaf-sidebar .xaf-nav-menu-item-icon {
    width: var(--magiq-nav-icon);
    height: var(--magiq-nav-icon);
    flex-shrink: 0;
}

.xaf-sidebar .xaf-accordion .dxbl-accordion-item:not(.dxbl-accordion-group) > .dxbl-accordion-item-content {
    margin-top: 0.125rem;
    margin-bottom: 0.125rem;
}

.xaf-sidebar .xaf-accordion .dxbl-accordion-item:not(.dxbl-accordion-group):not(.dxbl-active) > .dxbl-accordion-item-content:hover {
    background-color: var(--magiq-gray-100);
}

.xaf-sidebar .xaf-accordion > * > .dxbl-accordion-item:not(:first-child) {
    margin-top: 0.25rem;
}

.xaf-sidebar .xaf-accordion .dxbl-accordion-item[aria-level="1"] > .dxbl-accordion-item-content,
.xaf-sidebar .xaf-accordion a[aria-level="1"] {
    font-weight: var(--magiq-font-weight-semibold);
}

/* 10.2 Header: logo -> dashboard (custom.js), the mark on a phone, the logo kept when the navigation is closed */
.app .header .header-logo {
    cursor: pointer;
}

@media (min-width: 576px) {
    .app:not(.main-ribbon-template).collapse-toggle .header-logo {
        display: block !important;
    }
}

@media (max-width: 575.98px) {
    .app .header .header-logo {
        display: block !important;
        width: 2rem;
        height: 2rem;
        margin-left: 0.25rem !important;
        margin-right: 0.5rem !important;
        background-image: url("../images/LogoMark.svg");
    }
}

/* Account menu: the full email (wrapped, never cut), links without underline */
.app .account-main .user-name {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
    font-weight: var(--magiq-font-weight-semibold);
}

.app .account-main {
    min-width: 17rem;
}

.app .account-main .dxbl-btn-outline-link,
.app .account-main .dxbl-btn-outline-link:hover,
.app .account-main .dxbl-btn-outline-link .dxbl-btn-caption {
    text-decoration: none !important;
    font-weight: var(--magiq-font-weight-semibold);
}

.app .account-main .logo-container {
    background-color: var(--magiq-ink) !important;
    color: var(--magiq-yellow) !important;
}

/* 10.3 Toolbars: white pills of 36 px (44 px on a touch screen), ink icons of 20 px, faded when disabled (D-185) */
.main-toolbar .dxbl-toolbar .dxbl-btn:not(.dxbl-btn-primary),
.xaf-nested-frame .dxbl-toolbar .dxbl-btn:not(.dxbl-btn-primary) {
    min-height: var(--magiq-toolbar-button);
    min-width: var(--magiq-toolbar-button);
    border-radius: var(--magiq-radius-pill);
}

.dxbl-toolbar .xaf-toolbar-item-icon,
.dxbl-toolbar img.dxbl-image {
    width: 1.25rem;
    height: 1.25rem;
}

.dxbl-toolbar .dxbl-btn:disabled,
.dxbl-toolbar .dxbl-btn.dxbl-disabled {
    opacity: 0.4;
}

.dxbl-toolbar .dxbl-btn:disabled img,
.dxbl-toolbar .dxbl-btn.dxbl-disabled img {
    opacity: 1;
}

/* Review P7 V-09 (D-193): a disabled primary action (« Enregistrer » of a saved form) is a neutral pill, never yellow on a
   light grey (spec 05 §1) nor the heaviest control of a phone toolbar: sunken surface, hairline border, subtle text and a
   faded icon (the theme sets the same colors as --dxbl-btn-disabled-*; the 40 % fade of 10.3 is not added on top). */
.dxbl-btn.dxbl-btn-primary:disabled,
.dxbl-btn.dxbl-btn-primary.dxbl-disabled {
    --dxbl-btn-disabled-bg: var(--magiq-surface-sunken);
    --dxbl-btn-disabled-border-color: var(--magiq-border);
    --dxbl-btn-disabled-color: var(--magiq-text-subtle);
    --dxbl-btn-disabled-opacity: 1;
    opacity: 1;
    background-color: var(--magiq-surface-sunken) !important;
    border-color: var(--magiq-border) !important;
    color: var(--magiq-text-subtle) !important;
    box-shadow: none !important;
}

.dxbl-btn.dxbl-btn-primary:disabled img,
.dxbl-btn.dxbl-btn-primary.dxbl-disabled img {
    filter: var(--magiq-icon-filter-subtle) !important;
    opacity: 0.55 !important;
}

/* Review P7 V-04 (D-193): the create action of a root list (« Nouvelle facture », « Nouveau », « Générer les rappels »:
   CustomCSSClassName magiq-primary-action, App/Magiq.Blazor.Server/Model.xafml) is its one primary action — an ink pill with
   a yellow caption (yellow with an ink caption in the dark theme), its icon in the caption's color. Root lists only: the
   same action in a form or a nested list stays secondary next to « Enregistrer ». P11 WP-A (D-264): « Nouvelle opportunité » of CRM ›
   Pipeline (a page, not a list) too. */
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .dxbl-btn.magiq-primary-action:not(:disabled):not(.dxbl-disabled),
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .magiq-primary-action > .dxbl-btn:not(:disabled):not(.dxbl-disabled),
#main-view-content:has(.magiq-pipeline) .main-toolbar .dxbl-btn.magiq-primary-action:not(:disabled):not(.dxbl-disabled),
#main-view-content:has(.magiq-pipeline) .main-toolbar .magiq-primary-action > .dxbl-btn:not(:disabled):not(.dxbl-disabled) {
    background-color: var(--magiq-action) !important;
    border-color: var(--magiq-action) !important;
    color: var(--magiq-on-action) !important;
    font-weight: var(--magiq-font-weight-semibold);
}

#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .dxbl-btn.magiq-primary-action:not(:disabled):hover,
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .magiq-primary-action > .dxbl-btn:not(:disabled):hover,
#main-view-content:has(.magiq-pipeline) .main-toolbar .dxbl-btn.magiq-primary-action:not(:disabled):hover,
#main-view-content:has(.magiq-pipeline) .main-toolbar .magiq-primary-action > .dxbl-btn:not(:disabled):hover {
    background-color: var(--magiq-action-hover) !important;
    border-color: var(--magiq-action-hover) !important;
}

#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .dxbl-btn.magiq-primary-action:not(:disabled):not(.dxbl-disabled) img,
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .magiq-primary-action > .dxbl-btn:not(:disabled):not(.dxbl-disabled) img,
#main-view-content:has(.magiq-pipeline) .main-toolbar .dxbl-btn.magiq-primary-action:not(:disabled):not(.dxbl-disabled) img,
#main-view-content:has(.magiq-pipeline) .main-toolbar .magiq-primary-action > .dxbl-btn:not(:disabled):not(.dxbl-disabled) img {
    filter: var(--magiq-on-action-icon-filter) !important;
}

/* Review P13 (UI-P13-03): the create action disabled by the read-only mode of a suspended or cancelled subscription is the neutral pill of a
   disabled primary action (V-09), with the weight of the selectors above — never a yellow caption on grey. */
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .dxbl-btn.magiq-primary-action:is(:disabled, .dxbl-disabled),
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .magiq-primary-action > .dxbl-btn:is(:disabled, .dxbl-disabled),
#main-view-content:has(.magiq-pipeline) .main-toolbar .dxbl-btn.magiq-primary-action:is(:disabled, .dxbl-disabled),
#main-view-content:has(.magiq-pipeline) .main-toolbar .magiq-primary-action > .dxbl-btn:is(:disabled, .dxbl-disabled) {
    opacity: 1 !important;
    background-color: var(--magiq-surface-sunken) !important;
    border-color: var(--magiq-border) !important;
    color: var(--magiq-text-subtle) !important;
    box-shadow: none !important;
}

#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .dxbl-btn.magiq-primary-action:is(:disabled, .dxbl-disabled) img,
#main-view-content:has(.dxbl-grid.magiq-root-list) .main-toolbar .magiq-primary-action > .dxbl-btn:is(:disabled, .dxbl-disabled) img,
#main-view-content:has(.magiq-pipeline) .main-toolbar .dxbl-btn.magiq-primary-action:is(:disabled, .dxbl-disabled) img,
#main-view-content:has(.magiq-pipeline) .main-toolbar .magiq-primary-action > .dxbl-btn:is(:disabled, .dxbl-disabled) img {
    filter: var(--magiq-icon-filter-subtle) !important;
    opacity: 0.55 !important;
}

/* Popup buttons (OK / Cancel): 44 px pills, OK at the right */
.xafPopup .dxbl-modal-footer .dxbl-btn {
    min-height: 2.5rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    border-radius: var(--magiq-radius-pill);
}

/* 10.4 Lists (D-186): ink cell links underlined on hover, one line per row in the root lists, footer on one line */
.dxbl-grid td a.grid-cell-object-link,
.dxbl-grid td xaf-navigation-click-helper a {
    color: var(--magiq-text);
    text-decoration: none;
}

.dxbl-grid td a.grid-cell-object-link:hover,
.dxbl-grid td a.grid-cell-object-link:focus-visible,
.dxbl-grid td xaf-navigation-click-helper a:hover {
    text-decoration: underline;
    text-decoration-color: var(--magiq-yellow-dark);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

/* The root lists (not the nested lists of a form, whose designations may wrap, D-143): one line, ellipsis, tooltip by custom.js.
   Review P9 (UI-P9-03): the nested logs of a form (« Communications », magiq-single-line-list) too. */
.dxbl-grid.magiq-root-list .dxbl-grid-table > tbody > tr > td[role="gridcell"],
.dxbl-grid.magiq-single-line-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dxbl-grid.magiq-root-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] .xaf-wrap-ellipsis,
.dxbl-grid.magiq-root-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] xaf-navigation-click-helper,
.dxbl-grid.magiq-single-line-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] .xaf-wrap-ellipsis,
.dxbl-grid.magiq-single-line-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] xaf-navigation-click-helper {
    white-space: nowrap;
}

.dxbl-grid .dxbl-grid-header-content > span[role="presentation"] {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dxbl-grid .dxbl-grid-footer-row [dxbl-grid-summary-item] {
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
    font-weight: var(--magiq-font-weight-semibold);
}

.dxbl-grid .dxbl-grid-footer-row > td {
    overflow: visible !important;
    text-overflow: clip !important;
}

/* A right-aligned total ("Somme : 93'418.85") overflows to the left, over the empty footer cells, never past the grid. */
.dxbl-grid .dxbl-grid-footer-row > td.dxbl-align-right > [dxbl-grid-summary-item] {
    display: flex;
    justify-content: flex-end;
}

/* A pager with one page only says nothing */
.dxbl-pager:not(:has(button + button)) {
    display: none;
}

/* 10.5 Status badges (StatusBadge editor, D-185): text + soft color, never the color alone */
.magiq-status-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.0625rem 0.5rem;
    border-radius: var(--magiq-radius-pill);
    background-color: var(--magiq-muted-soft);
    color: var(--magiq-on-muted-soft);
    font-size: 0.75rem;
    line-height: 1.25rem;
    font-weight: var(--magiq-font-weight-semibold);
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.magiq-status-badge--neutral { background-color: var(--magiq-gray-100); color: var(--magiq-gray-800); }
.magiq-status-badge--muted { background-color: var(--magiq-muted-soft); color: var(--magiq-on-muted-soft); }
.magiq-status-badge--info { background-color: var(--magiq-info-soft); color: var(--magiq-on-info-soft); }
.magiq-status-badge--success { background-color: var(--magiq-success-soft); color: var(--magiq-on-success-soft); }
.magiq-status-badge--warning { background-color: var(--magiq-warning-soft); color: var(--magiq-on-warning-soft); }
.magiq-status-badge--danger { background-color: var(--magiq-danger-soft); color: var(--magiq-on-danger-soft); }
.magiq-status-badge--loss { background-color: var(--magiq-loss-soft); color: var(--magiq-on-loss-soft); }

/* P14 WP-C (D-356): on a phone a badge of a list wraps instead of being cut (« Utilisée en partie », « Teilweise verwendet » in the column
   of the state of a phone variant, audit clippedBadges); one line from 576 px, as before. */
@media (max-width: 575.98px) {
    .dxbl-grid .magiq-status-badge {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        line-height: 1.125rem;
        padding-block: 0.125rem;
    }
}

.xaf-detail-view .magiq-status-badge {
    font-size: 0.8125rem;
    line-height: 1.5rem;
    padding: 0.125rem 0.75rem;
}

/* 10.6 Read-only editors (accountant, locked documents, View mode): a value, not a disabled field (D-185) */
dxbl-input-editor[is-read-only],
.dxbl-text-edit[is-read-only],
dxbl-combobox[is-read-only],
dxbl-date-edit[is-read-only],
dxbl-spinedit[is-read-only],
dxbl-memo-editor[is-read-only] {
    --dxbl-text-edit-border-color: transparent;
    --dxbl-text-edit-bg: var(--magiq-surface-muted);
    border-color: transparent !important;
    background-color: var(--magiq-surface-muted) !important;
    box-shadow: none !important;
    color: var(--magiq-text) !important;
}

[is-read-only] .dxbl-edit-btn-dropdown,
[is-read-only] .dxbl-edit-btn-clear,
[is-read-only] > .dxbl-btn-group-right {
    display: none !important;
}

dxbl-input-editor[is-read-only] input,
dxbl-combobox[is-read-only] input,
dxbl-date-edit[is-read-only] input,
dxbl-spinedit[is-read-only] input,
dxbl-memo-editor[is-read-only] textarea {
    /* P7 WP-D (D-191): the text takes the color of its editor (--magiq-text, set above) or of the conditional appearance
       that paints it (the soft pairs of MagiqColors), in both themes. */
    -webkit-text-fill-color: currentColor;
    opacity: 1 !important;
}

/* 10.7 Messages (toasts, §4.4): AA colors, a close target of 44 px, above the popups and the totals card */
.xaf-alerts-stack {
    z-index: 1100000 !important;
}

.xaf-alert.alert-success {
    background-color: var(--magiq-toast-success) !important;
    color: var(--magiq-white) !important;
}

.xaf-alert.alert-danger {
    background-color: var(--magiq-toast-danger) !important;
    color: var(--magiq-white) !important;
}

.xaf-alert.alert-info {
    background-color: var(--magiq-yellow-lighter) !important;
    color: var(--magiq-ink) !important;
}

.xaf-alert.alert-info .text-white,
.xaf-alert.alert-info .xaf-alert-button,
.xaf-alert.alert-info .xaf-alert-close {
    color: var(--magiq-ink) !important;
}

.xaf-alert .xaf-alert-close {
    min-width: var(--magiq-touch-target);
    min-height: var(--magiq-touch-target);
}

.xaf-alert {
    border-radius: var(--magiq-radius-md) !important;
    box-shadow: var(--magiq-shadow) !important;
}

/* Problems shown in a page (scanner, previews, statistics): an alert box instead of a red resizable memo. P7 WP-D (D-185,
   D-191): the soft pair of the kind, from the tokens, so the box reads in both themes — danger (problem, duplicates),
   warning (warnings), information (the notice of a statistics page). The page parameters carry no color of their own. */
dxbl-form-layout-item:has(> label[class*="xaf-item-problem"]) .dxbl-text-edit,
dxbl-form-layout-item:has(> label[class*="xaf-item-duplicates"]) .dxbl-text-edit,
dxbl-form-layout-item:has(> label[class*="xaf-item-warning"]) .dxbl-text-edit,
dxbl-form-layout-item:has(> label[class*="xaf-item-notice"]) .dxbl-text-edit {
    --magiq-message-bg: var(--magiq-danger-soft);
    --magiq-message-text: var(--magiq-on-danger-soft);
    border-left: 0.25rem solid var(--magiq-danger) !important;
    border-radius: var(--magiq-radius-sm) !important;
    background-color: var(--magiq-message-bg) !important;
}

dxbl-form-layout-item:has(> label[class*="xaf-item-warning"]) .dxbl-text-edit {
    --magiq-message-bg: var(--magiq-warning-soft);
    --magiq-message-text: var(--magiq-on-warning-soft);
    border-left-color: var(--magiq-warning) !important;
}

dxbl-form-layout-item:has(> label[class*="xaf-item-notice"]) .dxbl-text-edit {
    --magiq-message-bg: var(--magiq-info-soft);
    --magiq-message-text: var(--magiq-on-info-soft);
    border-left-color: var(--magiq-info) !important;
}

dxbl-form-layout-item:has(> label[class*="xaf-item-problem"]) .dxbl-text-edit :is(textarea, input),
dxbl-form-layout-item:has(> label[class*="xaf-item-duplicates"]) .dxbl-text-edit :is(textarea, input),
dxbl-form-layout-item:has(> label[class*="xaf-item-warning"]) .dxbl-text-edit :is(textarea, input),
dxbl-form-layout-item:has(> label[class*="xaf-item-notice"]) .dxbl-text-edit :is(textarea, input) {
    resize: none;
    background-color: transparent !important;
    color: var(--magiq-message-text) !important;
    -webkit-text-fill-color: var(--magiq-message-text);
    font-weight: var(--magiq-font-weight-medium);
}

/* 10.8 Navigation between 576 and 1199 px (D-184): closed by default (custom.js), a drawer over the content when opened,
   so that the main area keeps the width of the window. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .app:not(.collapse-toggle) .xaf-sidebar {
        position: fixed;
        z-index: 40;
        top: var(--magiq-header-height);
        bottom: 0;
        left: 0;
        box-shadow: var(--magiq-shadow-lg) !important;
    }

    .app:not(.collapse-toggle) .sidebar-sm-shadow {
        display: block;
        position: fixed;
        z-index: 39;
        inset: var(--magiq-header-height) 0 0 0;
        background-color: var(--magiq-backdrop);
    }
}

/* Review P7 V-02 (D-193): the same drawer on a phone. Under 576 px XAF opens the navigation with .collapse-toggle (the reverse
   of 576-1199 px) and kept the sidebar in the flex row of the page, which squeezed the page into the 105 px left of it
   (« Bien démarrer » one letter per line). The sidebar is laid over the page, which keeps the width of the window under the
   backdrop (XAF's backdrop started at 270 px; it covers the page from the header down, a tap on it closes the navigation). */
@media (max-width: 575.98px) {
    .app.collapse-toggle .xaf-sidebar {
        position: fixed;
        z-index: 40;
        top: var(--magiq-header-height);
        bottom: 0;
        left: 0;
        max-width: calc(100vw - 3rem);
        box-shadow: var(--magiq-shadow-lg) !important;
    }

    .app.collapse-toggle .sidebar-sm-shadow {
        display: block;
        position: fixed;
        z-index: 39;
        inset: var(--magiq-header-height) 0 0 0;
        width: auto;
        height: auto;
        opacity: 1;
        background-color: var(--magiq-backdrop);
    }
}

/* 10.9 Touch screens: 44 px targets for the toolbar buttons, the pager and the popup buttons (R4) */
@media (pointer: coarse) {
    .main-toolbar .dxbl-toolbar .dxbl-btn,
    .xaf-nested-frame .dxbl-toolbar .dxbl-btn,
    .dxbl-pager .dxbl-btn,
    .xafPopup .dxbl-modal-footer .dxbl-btn {
        min-height: var(--magiq-touch-target);
        min-width: var(--magiq-touch-target);
    }

    .xaf-sidebar .xaf-accordion .dxbl-accordion-item-content {
        min-height: var(--magiq-touch-target);
    }
}

/* 10.10 Login page (D-187): brand panel with the tagline and three points (desktop), text links under the button */
#logon-template-component .magiq-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 26rem;
}

#logon-template-component .magiq-login-tagline,
#logon-template-component .magiq-login-points {
    display: none;
}

#logon-template-component .magiq-login-points {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--magiq-ink);
    font-size: 1rem;
    line-height: 1.4;
}

#logon-template-component .magiq-login-points li {
    position: relative;
    padding-left: 1.75rem;
}

#logon-template-component .magiq-login-points li + li {
    margin-top: 0.75rem;
}

#logon-template-component .magiq-login-points li::before {
    content: "";
    position: absolute;
    top: 0.3rem;
    left: 0;
    width: 1rem;
    height: 1rem;
    border-radius: var(--magiq-radius-pill);
    background-color: var(--magiq-ink);
    box-shadow: inset 0 0 0 0.3rem var(--magiq-yellow-light);
}

#logon-template-component .magiq-login-links {
    justify-content: space-between;
    align-items: center;
    color: var(--magiq-text-muted);
}

#logon-template-component .magiq-login-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--magiq-touch-target);
}

@media (min-width: 992px) {
    #logon-template-component .magiq-login-brand {
        align-items: flex-start;
        margin: auto 0;
    }

    #logon-template-component .magiq-login-brand .header-logo {
        background-position: left center;
    }

    #logon-template-component .magiq-login-tagline {
        display: block;
        max-width: 24rem;
        font-size: 2rem;
    }

    #logon-template-component .magiq-login-points {
        display: block;
    }
}

/* ==========================================================================
   11. P7 WP-C — responsive pass (D-189, rules R1 to R12 of the P7 plan §5.1).
       Breakpoints on the main area: phone < 576, small 576-767, tablet 768-991,
       desktop >= 992 (the navigation is a drawer under 1200 px, 10.8).
   ========================================================================== */

/* 11.1 Phone variants of the root lists (R2, *_ListView_Phone): four columns on one line, compact cells, a narrow badge. */
@media (max-width: 767.98px) {
    .dxbl-grid.magiq-root-list .dxbl-grid-table > tbody > tr > td[role="gridcell"],
    .dxbl-grid.magiq-root-list .dxbl-grid-table > thead > tr > th,
    .dxbl-grid.magiq-root-list .dxbl-grid-footer-row > td,
    .dxbl-grid.magiq-single-line-list .dxbl-grid-table > tbody > tr > td[role="gridcell"],
    .dxbl-grid.magiq-single-line-list .dxbl-grid-table > thead > tr > th {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }

    .dxbl-grid.magiq-root-list .dxbl-grid-table > tbody > tr[data-visible-index] > td[role="gridcell"],
    .dxbl-grid.magiq-single-line-list .dxbl-grid-table > tbody > tr[data-visible-index] > td[role="gridcell"] {
        height: 2.5rem;
    }

    /* P12 WP-E: 4 px of padding — « Nicht verrechenbar » whole in the 128 px of the state of a time entry on a phone (D-239). */
    .dxbl-grid.magiq-root-list .magiq-status-badge,
    .dxbl-grid.magiq-single-line-list .magiq-status-badge {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        font-size: 0.6875rem;
    }
}

/* 11.2 Touch screens (R4): 44 px for the selection boxes, the buttons of the editors, the tabs, the check boxes of a form */
@media (pointer: coarse) {
    .dxbl-grid .dxbl-grid-selection-cell,
    .dxbl-grid th.dxbl-grid-selection-cell {
        min-width: var(--magiq-touch-target);
        width: var(--magiq-touch-target);
    }

    .dxbl-grid .dxbl-grid-selection-cell .dxbl-checkbox {
        min-height: var(--magiq-touch-target);
        justify-content: center;
    }

    .xaf-detail-view dxbl-input-editor:not([is-read-only]),
    .xaf-detail-view dxbl-combobox:not([is-read-only]),
    .xaf-detail-view dxbl-date-edit:not([is-read-only]),
    .xaf-detail-view dxbl-spinedit:not([is-read-only]),
    .xafPopup dxbl-input-editor:not([is-read-only]),
    .xafPopup dxbl-combobox:not([is-read-only]),
    .xafPopup dxbl-date-edit:not([is-read-only]),
    .xafPopup dxbl-spinedit:not([is-read-only]) {
        min-height: var(--magiq-touch-target);
    }

    .xaf-detail-view .dxbl-edit-btn-dropdown,
    .xaf-detail-view .dxbl-edit-btn-clear,
    .xafPopup .dxbl-edit-btn-dropdown,
    .xafPopup .dxbl-edit-btn-clear {
        min-width: var(--magiq-touch-target);
    }

    .dxbl-tabs .dxbl-tabs-item,
    .dxbl-tabs [role="tab"] {
        min-height: var(--magiq-touch-target);
    }

    .xaf-detail-view dxbl-form-layout-item .dxbl-checkbox,
    .xafPopup dxbl-form-layout-item .dxbl-checkbox {
        min-height: var(--magiq-touch-target);
        min-width: var(--magiq-touch-target);
    }

    /* DevExpress sizes the page buttons with a more specific rule (min-width 30 px). */
    .dxbl-pager.dxbl-btn-group > .dxbl-btn.dxbl-pager-page-btn,
    .dxbl-pager.dxbl-btn-group > button {
        min-width: var(--magiq-touch-target) !important;
        min-height: var(--magiq-touch-target) !important;
    }
}

/* 11.3 Tabs of a form (R5): one scrolling row with a fade at the cut edge; custom.js brings the active tab into view. */
.xaf-detail-view .dxbl-tabs-tablist,
.xafPopup .dxbl-tabs-tablist {
    scrollbar-width: none;
}

/* 11.4 Popups (R6, PopupSizeController): a short dialog of at most 40 rem on a desktop; on a phone every popup is full
   screen and its OK / Cancel stay at the bottom of the screen while its body scrolls. */
.dxbl-popup.xafPopup.magiq-popup-dialog {
    max-width: min(40rem, calc(100vw - 2rem));
}

@media (max-width: 767.98px) {
    .dxbl-modal > .dxbl-modal-root > .dxbl-popup.xafPopup:not(.xaf-confirmation-dialog) > .dxbl-modal-content {
        display: flex;
        flex-direction: column;
    }

    .dxbl-modal > .dxbl-modal-root > .dxbl-popup.xafPopup:not(.xaf-confirmation-dialog) > .dxbl-modal-content > .dxbl-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .dxbl-modal > .dxbl-modal-root > .dxbl-popup.xafPopup:not(.xaf-confirmation-dialog) > .dxbl-modal-content > .dxbl-modal-footer {
        flex: none;
        position: sticky;
        bottom: 0;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--magiq-border);
        background: var(--magiq-surface);
    }

    .xafPopup .dxbl-modal-footer .dxbl-btn {
        min-height: var(--magiq-touch-target);
    }
}

/* 11.5 Totals of a document (R7): from 768 px a card at the end of the lines, sticky at the bottom of the screen while the
   lines are in view and in its place under them once they are scrolled past (it no longer covers the grid footer nor the
   tabs below). Under 768 px the bar fixed at the bottom of the screen stays (section 9). */
@media (min-width: 768px) {
    .main-content dxbl-form-layout-item:has(> .dxbl-fl-ctrl > .magiq-doc-totals) {
        position: sticky;
        z-index: 20;
        bottom: 0.75rem;
        pointer-events: none;
    }

    .main-content dxbl-form-layout-item:has(> .dxbl-fl-ctrl > .magiq-doc-totals) > .dxbl-fl-ctrl {
        display: flex;
        justify-content: flex-end;
    }

    .main-content .magiq-doc-totals {
        pointer-events: auto;
    }
}

.dxbl-tabs-tablist-scrollable .dxbl-scroll-viewer.magiq-scroll-more-right {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}

.dxbl-tabs-tablist-scrollable .dxbl-scroll-viewer.magiq-scroll-more-left {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent);
}

.dxbl-tabs-tablist-scrollable .dxbl-scroll-viewer.magiq-scroll-more-left.magiq-scroll-more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
}

/* 11.6 Previews (R10): the drop zone of the file upload editor (XaaS FileUpload) is a dashed card with its button as a pill
   (it was bare text above a black bar as wide as the page); the summary and the rows appear once a file is read (appearances
   PreviewHiddenUntilRead). On a phone the help text above the drop zone shows two lines; a tap opens it (custom.js). */
.custom-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 9rem;
    padding: 1.25rem 1rem;
    border: 2px dashed var(--magiq-gray-300) !important;
    border-radius: var(--magiq-radius-md) !important;
    background-color: var(--magiq-surface-muted) !important;
    text-align: center;
}

.custom-drop-zone.custom-drop-zone-hover {
    border-color: var(--magiq-yellow-dark) !important;
    background-color: var(--magiq-yellow-lighter) !important;
}

.custom-drop-zone .drop-file-icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.25rem !important;
    background-color: var(--magiq-text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.custom-drop-zone .drop-file-label {
    font-weight: var(--magiq-font-weight-semibold);
}

.custom-drop-zone > span.m-1 {
    color: var(--magiq-text-muted);
    font-size: 0.875rem;
}

.custom-drop-zone > .dxbl-btn {
    width: auto !important;
    min-height: var(--magiq-touch-target);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: var(--magiq-radius-pill);
}

@media (max-width: 767.98px) {
    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > div[data-item-name$="Help"]) label.xaf-static-text {
        position: relative;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        padding-right: 1.75rem;
        color: var(--magiq-text-muted);
        cursor: pointer;
    }

    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > div[data-item-name$="Help"]) label.xaf-static-text.magiq-help-open {
        display: block;
    }

    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > div[data-item-name$="Help"]) label.xaf-static-text::after {
        content: "";
        position: absolute;
        right: 0.25rem;
        bottom: 0.2rem;
        width: 1rem;
        height: 1rem;
        background-color: var(--magiq-ink);
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    }

    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > div[data-item-name$="Help"]) label.xaf-static-text.magiq-help-open::after {
        transform: rotate(180deg);
    }

    .custom-drop-zone {
        min-height: 7rem;
    }
}

/* 11.7 Toolbar of a list on a phone (R3): a narrower search box (230 px in XAF) leaves room for the list filter next to
   "New" and "…" (annex D: search and create 0, filter 2). */
@media (max-width: 575.98px) {
    .main-toolbar dxbl-input-editor.xaf-action-fulltextsearch {
        width: 9.5rem !important;
    }
}

/* 11.8 Touch screens (R4), continued: DevExpress sizes its toolbar buttons, the buttons of its editors and its check boxes
   with more specific rules; on a touch screen every one of them is a 44 px target (audit "smallTargets" of the P7 plan). */
@media (pointer: coarse) {
    .dxbl-toolbar .dxbl-btn,
    .dxbl-toolbar .dxbl-toolbar-btn-ellipsis > .dxbl-btn {
        min-width: var(--magiq-touch-target) !important;
        min-height: var(--magiq-touch-target) !important;
    }

    dxbl-form-layout-item dxbl-input-editor:not([is-read-only]),
    dxbl-form-layout-item dxbl-combobox:not([is-read-only]),
    dxbl-form-layout-item dxbl-date-edit:not([is-read-only]),
    dxbl-form-layout-item dxbl-spinedit:not([is-read-only]),
    dxbl-form-layout-item dxbl-tagbox:not([is-read-only]),
    .dxbl-toolbar dxbl-input-editor,
    .dxbl-toolbar dxbl-combobox {
        min-height: var(--magiq-touch-target) !important;
    }

    dxbl-form-layout-item .dxbl-edit-btn-dropdown,
    dxbl-form-layout-item .dxbl-edit-btn-clear,
    dxbl-form-layout-item .dxbl-btn-group-right > .dxbl-btn,
    .dxbl-toolbar dxbl-input-editor .dxbl-btn,
    .dxbl-toolbar dxbl-combobox .dxbl-btn {
        min-width: var(--magiq-touch-target) !important;
        min-height: calc(var(--magiq-touch-target) - 2px) !important;
    }

    dxbl-form-layout-item dxbl-check.dxbl-checkbox {
        min-height: var(--magiq-touch-target) !important;
    }

    .dxbl-grid .dxbl-grid-selection-cell dxbl-check.dxbl-checkbox,
    .dxbl-grid td dxbl-check.dxbl-checkbox {
        min-width: var(--magiq-touch-target) !important;
        min-height: var(--magiq-touch-target) !important;
        justify-content: center;
    }

    dxbl-form-layout-item a.xaf-ellipsis {
        display: inline-flex;
        align-items: center;
        min-height: var(--magiq-touch-target);
    }
}

/* 11.9 Options of a form (R12): on a phone (and wherever the caption is above its editor) a check box reads "[x] Caption" on
   one line, the caption a 44 px target next to its box, instead of a caption with its box on the next line. */
@media (max-width: 767.98px) {
    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > dxbl-check.dxbl-checkbox) {
        display: flex !important;
        flex-direction: row-reverse;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
    }

    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > dxbl-check.dxbl-checkbox) > .dxbl-fl-cpt {
        flex: 1 1 auto;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: var(--magiq-touch-target);
        display: inline-flex;
        align-items: center;
        cursor: pointer;
    }

    dxbl-form-layout-item:has(> .dxbl-fl-ctrl > dxbl-check.dxbl-checkbox) > .dxbl-fl-ctrl {
        flex: none;
        width: auto !important;
    }
}

/* 11.10 The close button of a popup on a touch screen (R4). */
@media (pointer: coarse) {
    .xafPopup .dxbl-modal-header button,
    .xafPopup .dxbl-popup-header button {
        min-width: var(--magiq-touch-target) !important;
        min-height: var(--magiq-touch-target) !important;
    }
}

/* 11.11 Touch screens, continued (final audit at 375 px): the items and the close button of the "…" sheet of a toolbar, a
   check box of a form as wide as it is high; in a root list on a phone a tap on a cell opens the record (R2), the links of
   the cells (client, invoice, article) are plain text there. */
@media (pointer: coarse) {
    .dxbl-toolbar-dropdown .dxbl-toolbar-dropdown-item-list .dxbl-btn,
    .dxbl-toolbar-dropdown .dxbl-toolbar-dropdown-item-list [role="menuitem"],
    .dxbl-toolbar-dropdown .dxbl-popup-header button,
    .dxbl-toolbar-dropdown .dxbl-btn-close {
        min-height: var(--magiq-touch-target) !important;
        min-width: var(--magiq-touch-target) !important;
    }

    dxbl-form-layout-item dxbl-check.dxbl-checkbox {
        min-width: var(--magiq-touch-target) !important;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .dxbl-grid.magiq-root-list td a.grid-cell-object-link,
    .dxbl-grid.magiq-root-list td xaf-navigation-click-helper a {
        pointer-events: none;
        color: inherit;
    }
}

/* ==========================================================================
   12. P7 WP-D — themes (D-191): the light and dark themes in the Preferences panel
   ========================================================================== */

/* XAF shows the caption of a theme as it is configured (appsettings.json: "Magiq", "Magiq Dark"; the caption is the key
   of the choice stored in the browser): the panel reads « Clair » / « Sombre » in the language of the page instead. */
.themes-menu-tms .nav-link.magiq .theme-name,
.themes-menu-tms .nav-link.magiq-dark .theme-name {
    font-size: 0;
}

.themes-menu-tms .nav-link.magiq .theme-name::after,
.themes-menu-tms .nav-link.magiq-dark .theme-name::after {
    font-size: 0.875rem;
}

.themes-menu-tms .nav-link.magiq .theme-name::after { content: "Clair"; }
.themes-menu-tms .nav-link.magiq-dark .theme-name::after { content: "Sombre"; }
:lang(de) .themes-menu-tms .nav-link.magiq .theme-name::after { content: "Hell"; }
:lang(de) .themes-menu-tms .nav-link.magiq-dark .theme-name::after { content: "Dunkel"; }
:lang(it) .themes-menu-tms .nav-link.magiq .theme-name::after { content: "Chiaro"; }
:lang(it) .themes-menu-tms .nav-link.magiq-dark .theme-name::after { content: "Scuro"; }
:lang(en) .themes-menu-tms .nav-link.magiq .theme-name::after { content: "Light"; }
:lang(en) .themes-menu-tms .nav-link.magiq-dark .theme-name::after { content: "Dark"; }

/* The swatch of each theme: yellow square on white, yellow square on ink (the brand in both). */
.themes-menu-tms .nav-link.magiq .image,
.themes-menu-tms .nav-link.magiq-dark .image {
    box-shadow: inset 0 0 0 1px var(--magiq-border-strong);
}

/* A theme of the panel is a 44 px target on a touch screen (R4). */
@media (pointer: coarse) {
    .themes-menu-tms .nav-link {
        min-height: var(--magiq-touch-target);
        display: flex;
        align-items: center;
    }
}

/* P7 WP-D, final audit at 375 px (R4): the remaining small targets of the shell — the expand buttons of the navigation
   groups and the clear button of its filter, « Mon compte » in the account menu, the language list of the Preferences
   panel, the buttons of the file list of an upload (« Tout retirer », remove a file). */
@media (pointer: coarse) {
    .xaf-sidebar .dxbl-accordion-group-header .dxbl-btn-tool,
    .xaf-sidebar .dxbl-navigation-filter .dxbl-btn,
    .account-main .dxbl-btn-outline-link,
    .theme-settings .language-switcher .dxbl-edit-btn-dropdown,
    .dxbl-upload .dxbl-btn {
        min-width: var(--magiq-touch-target) !important;
        min-height: var(--magiq-touch-target) !important;
    }
}

/* P7 WP-D (D-185, D-191): an editor painted by a conditional appearance (XAF writes the soft background and dark text
   pair of MagiqColors inline on the input, or as an xaf-dynamic-* class in a grid cell) shows its text in the color of the
   pair, also in the dark theme, where a read-only editor fills its text in the light color of the theme. */
textarea[style*="background-color"],
input[style*="background-color"],
[class*="xaf-dynamic-"] textarea,
[class*="xaf-dynamic-"] input {
    -webkit-text-fill-color: currentColor !important;
}

/* ==========================================================================
   12.1 Review P7 (D-193) — the Preferences panel (gear of the header) in the brand (V-06): XAF's theme-switcher.css sets
        Helvetica on every element of the panel, titles the theme group with its configured caption (« Magiq », the key of
        the choice stored in the browser) on a card whose edge closed above the items, and paints the chosen theme as a
        square block. Space Grotesk, a « Thème » label ×4, two pills with round swatches inside the panel.
   ========================================================================== */
:root .settings-bar,
:root .settings-bar * {
    font-family: var(--magiq-font-family) !important;
}

.settings-bar {
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
}

.settings-bar .themes-menu li.theme-group {
    color: var(--magiq-text);
    font-size: 0.9375rem;
}

.settings-bar .themes-menu li.theme-group:first-child {
    border-bottom-color: var(--magiq-border);
}

.settings-bar .themes-menu-tms-hdr li.theme-group.card {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-bottom: 0;
    padding-top: 0.75rem;
    font-size: 0 !important;
}

.settings-bar .themes-menu-tms-hdr li.theme-group.card::after {
    content: "Thème";
    font-size: 0.9375rem;
    font-weight: var(--magiq-font-weight-semibold);
}

:lang(de) .settings-bar .themes-menu-tms-hdr li.theme-group.card::after { content: "Design"; }
:lang(it) .settings-bar .themes-menu-tms-hdr li.theme-group.card::after { content: "Tema"; }
:lang(en) .settings-bar .themes-menu-tms-hdr li.theme-group.card::after { content: "Theme"; }

.settings-bar .themes-menu.themes-menu-tms ul.nav.nav-pills {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.25rem 1rem 1rem;
}

.settings-bar .themes-menu-tms .nav-item {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

.settings-bar .themes-menu-tms .nav-link {
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--magiq-border-strong);
    border-radius: var(--magiq-radius-pill);
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
    font-weight: var(--magiq-font-weight-medium);
}

.settings-bar .themes-menu-tms .nav-link:hover {
    background-color: var(--magiq-hover-overlay);
}

.settings-bar .themes-menu-tms .nav-link.active,
.settings-bar .themes-menu-tms .nav-link.active:hover {
    border-color: var(--magiq-yellow);
    background-color: var(--magiq-yellow);
}

.settings-bar .themes-menu-tms .nav-link.active .theme-name,
.settings-bar .themes-menu-tms .nav-link.active .theme-name::after {
    color: var(--magiq-ink) !important;
    font-weight: var(--magiq-font-weight-semibold);
}

.settings-bar .themes-menu li > a > .image {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin: 0;
    border: 0;
    border-radius: 50%;
}

.settings-bar .themes-menu-tms .nav-link.active .image {
    box-shadow: inset 0 0 0 1px var(--magiq-ink);
}

.settings-bar .themes-menu-tms .nav-link:focus-visible {
    outline: 2px solid var(--magiq-text);
    outline-offset: 2px;
}

/* ==========================================================================
   12.2 Review P7 (D-193) — charts of the dashboard and of « Analyses » (V-05, A11Y-04): DevExtreme writes its own font on
        every text of the SVG (Segoe UI on Windows); the brand font with tabular figures instead. The yellow bars get an edge
        that stands out 3:1 from the white card (--magiq-chart-bar-edge; none needed on the dark card), the colors of the
        series follow the theme (Magiq.Module MagiqChartColors).
   ========================================================================== */
.magiq-dashboard-chart text,
.magiq-dashboard-chart tspan,
.magiq-analysis-chart text,
.magiq-analysis-chart tspan,
.dxc-tooltip,
.dxc-tooltip * {
    font-family: var(--magiq-font-family) !important;
    font-variant-numeric: tabular-nums;
}

.magiq-dashboard-chart .dxc-series-group > .dxc-series:first-child .dxc-markers rect,
.magiq-analysis-chart .dxc-series-group > .dxc-series:first-child .dxc-markers rect {
    stroke: var(--magiq-chart-bar-edge) !important;
    stroke-width: 1px !important;
}

/* ==========================================================================
   12.3 Review P7 (D-193) — lookups and combo boxes on a touch screen (MOB-05): the client of a new invoice was chosen in a
        list of rows of 30 px, 200 px high, whose third column was cut. Rows of 44 px, a list of up to 60 % of the screen,
        its columns fitted to the width (Client_LookupListView: the locality only from 576 px).
   ========================================================================== */
@media (pointer: coarse) {
    .dxbl-dropdown,
    .dxbl-dropdown-dialog {
        --dxbl-edit-dropdown-max-height: 60dvh;
    }

    .dxbl-dropdown .dxbl-list-box-render-container,
    .dxbl-dropdown-dialog .dxbl-list-box-render-container {
        max-height: 60dvh !important;
    }

    .dxbl-dropdown .dxbl-list-box-item,
    .dxbl-dropdown [role="option"],
    .dxbl-dropdown-dialog .dxbl-list-box-item,
    .dxbl-dropdown-dialog [role="option"] {
        min-height: var(--magiq-touch-target);
    }

    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"] > tbody > tr > td,
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] > tbody > tr > td {
        height: var(--magiq-touch-target);
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
}

/* Under 400 px a lookup of several columns fits the screen (it scrolled sideways, the locality of a client cut): the number,
   then the name over the rest of the width; the third column and the next ones are left out. */
@media (max-width: 399.98px) {
    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"],
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
    }

    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"] col:nth-child(1),
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] col:nth-child(1) {
        width: 4.5rem !important;
    }

    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"] col:nth-child(2),
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] col:nth-child(2) {
        width: calc(100% - 4.5rem) !important;
    }

    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"] col:nth-child(n + 3),
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] col:nth-child(n + 3) {
        width: 0 !important;
        visibility: collapse;
    }

    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"] tr > :nth-child(n + 3),
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] tr > :nth-child(n + 3) {
        display: none;
    }

    .dxbl-dropdown .dxbl-list-box-render-container table[role="listbox"] td,
    .dxbl-dropdown-dialog .dxbl-list-box-render-container table[role="listbox"] td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ==========================================================================
   12.4 Review P7 (D-193) — connection lost and application error (MOB-04): Blazor's own dialogs are in English and the error
        panel of XAF points to the browser console and a log file. Pages/_Host.cshtml renders both in the language of the
        page (Resources/HostTexts*.resx); custom.js retries, resumes or reloads.
   ========================================================================== */
/* XAF's styles.css fades the dialog (opacity 0.9 !important), MudBlazor paints it white (!important) and restyles its buttons
   (uppercase, its own colors): the identifiers of the dialogs below win over both. */
.magiq-host-overlays > #components-reconnect-modal {
    opacity: 1 !important;
    z-index: 100000 !important;
    background-color: var(--magiq-backdrop) !important;
}

#components-reconnect-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--magiq-backdrop);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-paused,
#components-reconnect-modal.components-reconnect-resume-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.magiq-host-dialog {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    width: min(26rem, 100%);
    padding: 1.5rem;
    border: 1px solid var(--magiq-border-subtle);
    border-radius: var(--magiq-radius-lg);
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
    font-family: var(--magiq-font-family);
    box-shadow: var(--magiq-shadow-lg);
}

.magiq-host-dialog h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: var(--magiq-font-weight-semibold);
}

.magiq-host-dialog p {
    margin: 0;
    color: var(--magiq-text-muted);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.magiq-host-dialog .magiq-host-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-self: stretch;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

#components-reconnect-modal .magiq-host-button,
#blazor-error-ui .magiq-host-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--magiq-touch-target);
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--magiq-action);
    border-radius: var(--magiq-radius-pill);
    background-color: var(--magiq-action);
    color: var(--magiq-on-action);
    font: inherit;
    font-weight: var(--magiq-font-weight-semibold);
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    cursor: pointer;
}

#components-reconnect-modal .magiq-host-button--secondary,
#blazor-error-ui .magiq-host-button--secondary {
    border-color: var(--magiq-border-strong);
    background-color: var(--magiq-surface);
    color: var(--magiq-text);
}

#components-reconnect-modal .magiq-host-button:hover,
#blazor-error-ui .magiq-host-button:hover {
    background-color: var(--magiq-action-hover);
}

#components-reconnect-modal .magiq-host-button--secondary:hover,
#blazor-error-ui .magiq-host-button--secondary:hover {
    background-color: var(--magiq-hover-overlay);
}

#components-reconnect-modal .magiq-host-button:focus-visible,
#blazor-error-ui .magiq-host-button:focus-visible {
    outline: 2px solid var(--magiq-text);
    outline-offset: 2px;
}

.magiq-host-dialog .magiq-host-spinner {
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid var(--magiq-border);
    border-top-color: var(--magiq-yellow);
    border-radius: 50%;
    animation: magiq-host-spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .magiq-host-dialog .magiq-host-spinner {
        animation: none;
    }
}

/* One state at a time: what belongs to the other states of the dialog is hidden. */
#components-reconnect-modal [data-state] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show [data-state~="show"],
#components-reconnect-modal.components-reconnect-retrying [data-state~="show"],
#components-reconnect-modal.components-reconnect-paused [data-state~="paused"],
#components-reconnect-modal.components-reconnect-failed [data-state~="failed"],
#components-reconnect-modal.components-reconnect-resume-failed [data-state~="failed"],
#components-reconnect-modal.components-reconnect-rejected [data-state~="rejected"] {
    display: block;
}

#components-reconnect-modal.components-reconnect-paused .magiq-host-actions[data-state~="paused"],
#components-reconnect-modal.components-reconnect-failed .magiq-host-actions[data-state~="failed"],
#components-reconnect-modal.components-reconnect-resume-failed .magiq-host-actions[data-state~="failed"],
#components-reconnect-modal.components-reconnect-rejected .magiq-host-actions[data-state~="rejected"] {
    display: flex;
}

/* The error panel (shown by Blazor when the circuit fails): a dialog over the page, without developer hints. */
#blazor-error-ui {
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--magiq-backdrop);
}

#blazor-error-ui[style*="block"] {
    display: flex !important;
}

/* 13.1 AI drafts (P8 WP-C, D-205): the banner above the form of a quote, an invoice, a credit note or a client an AI prepared
   and nobody reviewed yet — the soft warning pair of the tokens (AA in both themes: the dark theme redefines the pair), a
   sparkles icon in the color of the text, the full width of the form, the text wrapped on a phone. */
.magiq-ai-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--magiq-border-subtle);
    border-radius: var(--magiq-radius-md);
    background-color: var(--magiq-warning-soft);
    color: var(--magiq-on-warning-soft);
    font-weight: 500;
    line-height: 1.4;
}

.magiq-ai-banner__icon {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.05rem;
}

.magiq-ai-banner__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* 13.2 P8 WP-C: on a touch screen, the link of a read-only reference in a form (the invoice of a credit note, « 10071 ») is a
   target of 44 px at least, however short its text (the height already is). */
@media (pointer: coarse) {
    dxbl-form-layout-item a.combo-box-object-link {
        min-width: var(--magiq-touch-target);
    }
}

/* P10 WP-B (D-248): the text of a notification wraps on a phone (the popup of the bell, Accueil › Notifications): it is read, not
   scanned, and its document and recipient never fit in the width left by the state and the age. */
@media (max-width: 767.98px) {
    .dxbl-grid.magiq-root-list.magiq-notification-list .dxbl-grid-table > tbody > tr > td[role="gridcell"],
    .dxbl-grid.magiq-root-list.magiq-notification-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] .xaf-wrap-ellipsis,
    .dxbl-grid.magiq-root-list.magiq-notification-list .dxbl-grid-table > tbody > tr > td[role="gridcell"] xaf-navigation-click-helper {
        white-space: normal;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }
}

/* P10 WP-B (D-247): the timeline of a document (XaaS TimelineComponent, MudBlazor). A neutral event (sent, link copied) takes the
   surfaces and the text of the theme — MudBlazor's own grey is not themed and stays unreadable in the dark theme — and a long detail
   (an e-mail address) wraps instead of leaving the card on a phone. */
.xaas-timeline .mud-alert.mud-alert-text-normal,
.xaas-timeline .mud-alert.mud-alert-text-normal .mud-alert-icon {
    background-color: var(--magiq-muted-soft);
    color: var(--magiq-on-muted-soft);
}

.xaas-timeline .mud-alert-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Review P10 (BO-P10-05): every state of the timeline in the pairs of the theme (UX-GUIDELINES §1, §4: soft background, dark text
   ≥ 7:1 in both themes) — never MudBlazor's default palette (green 3.2:1, blue 4.0:1, violet dots and dates). XaaS draws an error
   (« Paiement en ligne échoué », « à vérifier ») with MudBlazor's warning severity: it is a danger pair here. The dots take the dark text
   of their pair (≥ 3:1 on the page), the dates of the wide layout the muted text. */
.xaas-timeline .mud-alert.mud-alert-text-success,
.xaas-timeline .mud-alert.mud-alert-text-success .mud-alert-icon {
    background-color: var(--magiq-success-soft);
    color: var(--magiq-on-success-soft);
}

.xaas-timeline .mud-alert.mud-alert-text-info,
.xaas-timeline .mud-alert.mud-alert-text-info .mud-alert-icon {
    background-color: var(--magiq-info-soft);
    color: var(--magiq-on-info-soft);
}

.xaas-timeline .mud-alert.mud-alert-text-warning,
.xaas-timeline .mud-alert.mud-alert-text-warning .mud-alert-icon,
.xaas-timeline .mud-alert.mud-alert-text-error,
.xaas-timeline .mud-alert.mud-alert-text-error .mud-alert-icon {
    background-color: var(--magiq-danger-soft);
    color: var(--magiq-on-danger-soft);
}

.xaas-timeline .mud-timeline-item-dot .mud-timeline-item-dot-inner.mud-timeline-dot-primary,
.xaas-timeline .mud-timeline-item-dot .mud-timeline-item-dot-inner.mud-timeline-dot-default {
    background-color: var(--magiq-on-muted-soft);
}

.xaas-timeline .mud-timeline-item-dot .mud-timeline-item-dot-inner.mud-timeline-dot-success {
    background-color: var(--magiq-on-success-soft);
}

.xaas-timeline .mud-timeline-item-dot .mud-timeline-item-dot-inner.mud-timeline-dot-info {
    background-color: var(--magiq-on-info-soft);
}

.xaas-timeline .mud-timeline-item-dot .mud-timeline-item-dot-inner.mud-timeline-dot-warning,
.xaas-timeline .mud-timeline-item-dot .mud-timeline-item-dot-inner.mud-timeline-dot-error {
    background-color: var(--magiq-on-danger-soft);
}

.xaas-timeline .mud-timeline-item-opposite .mud-typography,
.xaas-timeline .xaas-timeline-date {
    color: var(--magiq-text-muted) !important;
}

/* ==========================================================================
   13. P13 WP-B (D-304) — the banner of the Magiq subscription above the main window (MagiqApplicationWindowTemplate,
       Editors/SubscriptionBanner): the soft pairs of the tokens (both themes), one line on a desktop, wrapped on a phone, the link
       of an administrator and the close button of the end of a trial at 44 px. The window keeps the rest of the height.
   ========================================================================== */
.magiq-app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.magiq-app-shell > .app {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

/* XAF pins its window at the top of a phone (styles.css « Prevent Pull-Down-To-Refresh »: .app absolute at 0, the page never scrolls): the
   shell takes that place and the window follows the banner inside it. */
@media (max-width: 575.98px) {
    .magiq-app-shell {
        position: absolute;
        top: 0;
        width: 100%;
        overflow-y: hidden;
        z-index: 2;
    }

    .magiq-app-shell > .app {
        position: relative;
        top: auto;
        height: auto;
    }
}

.magiq-subscription-banner {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--magiq-border-subtle);
    font-size: 0.9375rem;
    line-height: 1.4;
}

.magiq-subscription-banner--info {
    background-color: var(--magiq-info-soft);
    color: var(--magiq-on-info-soft);
}

.magiq-subscription-banner--warning {
    background-color: var(--magiq-warning-soft);
    color: var(--magiq-on-warning-soft);
}

.magiq-subscription-banner--danger {
    background-color: var(--magiq-danger-soft);
    color: var(--magiq-on-danger-soft);
}

.magiq-subscription-banner__message {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    min-width: 0;
    flex: 1 1 20rem;
    font-weight: 500;
}

.magiq-subscription-banner__icon {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.05rem;
}

.magiq-subscription-banner__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.magiq-subscription-banner__advice {
    margin-left: 0.25rem;
    font-weight: 400;
}

.magiq-subscription-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.magiq-subscription-banner__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--magiq-touch-target, 2.75rem);
    padding: 0.375rem 0.875rem;
    border: 1px solid currentColor;
    border-radius: var(--magiq-radius-pill);
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.magiq-subscription-banner__link:hover {
    background-color: var(--magiq-hover-overlay);
    color: inherit;
}

.magiq-subscription-banner__link:focus-visible,
.magiq-subscription-banner__dismiss:focus-visible {
    outline: 2px solid var(--magiq-focus-ring);
    outline-offset: 2px;
}

.magiq-subscription-banner__dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--magiq-touch-target, 2.75rem);
    height: var(--magiq-touch-target, 2.75rem);
    padding: 0;
    border: 0;
    border-radius: var(--magiq-radius-pill);
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.magiq-subscription-banner__dismiss:hover {
    background-color: var(--magiq-hover-overlay);
}

.magiq-subscription-banner__dismiss svg {
    width: 1.25rem;
    height: 1.25rem;
}

@media (max-width: 767.98px) {
    .magiq-subscription-banner {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .magiq-subscription-banner__actions {
        width: 100%;
        justify-content: space-between;
    }

    .magiq-subscription-banner__link {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* P13 WP-D (D-316): the onboarding wizard — « Suivant » / « Terminer » painted as the primary action (ink on yellow in both themes), the navigation of
   the wizard kept in view at the bottom of the screen (sticky footer above the content) on every width. */
.dxbl-btn.magiq-onboarding-primary,
.magiq-onboarding-primary > .dxbl-btn {
    border-color: var(--magiq-action) !important;
    background-color: var(--magiq-action) !important;
    color: var(--magiq-on-action) !important;
    font-weight: var(--magiq-font-weight-semibold);
}

.dxbl-btn.magiq-onboarding-primary:not(:disabled):hover,
.magiq-onboarding-primary > .dxbl-btn:not(:disabled):hover {
    background-color: var(--magiq-action-hover) !important;
}

.dxbl-fl-item:has(.magiq-onboarding-primary) {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-block: 0.5rem;
    border-top: 1px solid var(--magiq-border-subtle);
    background-color: var(--magiq-surface);
}

/* Review P13 (UI-P13-07): below 992 px the list of the steps is hidden (a compact progress instead) — its column then takes the whole width
   above the form, never a column of 190 px with « Étape 1 sur 8 » beside a narrowed form (768). */
@media (max-width: 991.98px) {
    .dxbl-row:has(> .dxbl-fl-group .magiq-onboarding-steps) > .dxbl-fl-group {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}

/* Review P13 (UI-P13-07): a state of the wizard (the online payments, the sample data) is a text, never a memo with its resize grip. */
#main-view-content:has(.magiq-onboarding-steps) textarea[readonly] {
    resize: none;
    padding-inline: 0;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--magiq-text);
}

/* Review P13 (UI-P13-05): the consequences of « Résilier » (warning) and « Purger » (danger, irreversible) of Plateforme › Tenants, and the
   button that purges painted as a destructive action. */
.magiq-consequences-warning,
.magiq-consequences-danger {
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--magiq-radius-md);
}

.magiq-consequences-warning {
    border-color: var(--magiq-warning);
    background-color: var(--magiq-warning-soft);
    color: var(--magiq-on-warning-soft);
}

.magiq-consequences-danger {
    border-color: var(--magiq-danger);
    background-color: var(--magiq-danger-soft);
    color: var(--magiq-on-danger-soft);
    font-weight: var(--magiq-font-weight-semibold);
}

.magiq-consequences-warning *,
.magiq-consequences-danger * {
    color: inherit !important;
}

.dxbl-modal:has(.magiq-consequences-danger) .dxbl-modal-footer .dxbl-btn-primary,
.dxbl-popup:has(.magiq-consequences-danger) .dxbl-btn-primary {
    border-color: var(--magiq-danger) !important;
    background-color: var(--magiq-danger) !important;
    color: var(--magiq-white) !important;
}

