/* =====================================================
   INRADR — Popups — XAF popup chrome (.dxbl-popup.xafPopup) and popup form layout
   inradr-feature layer (adapter): DevExpress / XAF / vendor selectors and tokens only.
   Maps inradr-design values (var(--inradr-*)) onto the framework; no new base values and
   no hex literals. Internal --dxbl-* tokens are set on the element that declares them and
   carry "re-verify on DX upgrade" (full list: inradr-feature/README.md).
   Never target a bare .dxbl-modal (it also matches the XAF skip link).
   ===================================================== */

/* DOM (26.1 captures 'Confirmation dialog header title (WP-16)' and the setup wizard popup in
   'Alert stack (WP-09)'): dxbl-modal.dxbl-modal > dxbl-modal-root.dxbl-modal-root >
   dxbl-modal-dialog.dxbl-popup.xafPopup[.xaf-popup-dialog.xaf-confirmation-dialog] > div.dxbl-modal-content >
   dxbl-popup-header.dxbl-modal-header > div.dxbl-modal-header-default > (div.view-caption-root +
   button.dxbl-popup-header-button), then div.dxbl-modal-body and div.dxbl-modal-footer > dxbl-toolbar.
   XAF puts 'xafPopup' on every popup it opens (26.1 sources PopupWindowTemplateBase.cs:48,
   PopupDialogTemplateBase.cs:57), so DX-internal popups and the skip link stay untouched.
   Kept as Fluent on purpose: radius, shadow, backdrop and z-index (OQ-31 a), the close button (26.1
   PopupWindowTemplateClosingController shows it in every XAF popup and runs the unsaved-changes check;
   Fluent draws it flat) and the footer toolbar (both captures show OK/Cancel uncollapsed, the ellipsis
   is .dxbl-toolbar-hidden-item with an inline display:none, so the plan's ellipsis fallback is not added). */

/* ── Chrome: paddings and title tokens ────────────────────────────
   Declared on the host (core.min.css 26.1.4 '.dxbl-modal{...--dxbl-popup-header-font-size:var(--dxbl-popups-header-font-size);
   --dxbl-popup-header-padding-top:var(--dxbl-popups-header-padding-top);...}') and read by its parts
   ('.dxbl-modal>.dxbl-modal-root>.dxbl-popup>.dxbl-modal-content>.dxbl-modal-header{font-size:var(--dxbl-popup-header-font-size);
   ...padding:var(--dxbl-popup-header-padding-top) var(--dxbl-popup-header-padding-x) var(--dxbl-popup-header-padding-bottom);
   color:var(--dxbl-popup-header-color)...}', same pattern for -body and -footer). The dialog sits between
   the two and nothing in between redeclares them (only a popup without header or footer redeclares the
   body top/bottom on .dxbl-modal-content), so the dialog is the narrowest element that scopes them to
   XAF popups. Fluent already renders no header/footer border and 12px/24px footer top/bottom.
   Re-verify on DX upgrade. */
.dxbl-popup.xafPopup {
    --dxbl-popup-header-padding-top: var(--dxds-spacing-200);        /* 20px (A); Fluent 24px */
    --dxbl-popup-header-padding-bottom: var(--dxds-spacing-200);     /* 20px (A); Fluent 12px */
    --dxbl-popup-header-padding-x: var(--inradr-spacing-popup-header-x);
    --dxbl-popup-body-padding-top: var(--inradr-space-2xs);          /* 12px (A); Fluent 4px */
    --dxbl-popup-body-padding-bottom: var(--inradr-space-md);        /* 24px (A); Fluent 4px */
    --dxbl-popup-body-padding-x: var(--inradr-spacing-popup-body-x);
    --dxbl-popup-footer-padding-x: var(--inradr-spacing-popup-body-x);
    /* Title = H2 in the heading colour (navy; Dark: #F5F5F5) (OQ-29 b); the Fluent line-height (28px) stays. */
    --dxbl-popup-header-font-size: var(--inradr-text-h2-size);
    --dxbl-popup-header-font-weight: var(--inradr-text-h2-weight);
    --dxbl-popup-header-color: var(--inradr-color-text-heading);
}

/* ── Plain DxPopups: the same title (124ca7cte30) ─────────────────
   The shell's own popups - quick access, administration hub launcher and log viewer, release notes, support
   dialog - are DxPopups, not XAF popups, and opt in with CssClass 'inradr-popup' on the dxbl-popup dialog
   element. Only the title tokens are taken over; their paddings and bodies keep their own layout. The header
   reads them (core.min.css 26.1.4 '.dxbl-modal>...>.dxbl-modal-header{font-size:var(--dxbl-popup-header-font-size);
   ...font-weight:var(--dxbl-popup-header-font-weight);...color:var(--dxbl-popup-header-color)}'), and the HeaderText
   in .dxbl-modal-title inherits them ('font-size:inherit;line-height:inherit'). Re-verify on DX upgrade. */
.dxbl-popup.inradr-popup {
    --dxbl-popup-header-font-size: var(--inradr-text-h2-size);
    --dxbl-popup-header-font-weight: var(--inradr-text-h2-weight);
    --dxbl-popup-header-color: var(--inradr-color-text-heading);
}

/* ── Titles ───────────────────────────────────────────────────────
   XAF's own caption rules outrank the header font (styles.css 26.1.4
   '.dxbl-theme-fluent.xaf-size-m .xaf-view-caption-lg{font-size:var(--dxds-font-size-base-lg);...}' = 16px/600,
   '-sm' 12px/400, '.xaf-object-caption' 14px/600), so the title elements read the header tokens again, as
   XAF's '.dxbl-theme-fluent .xaf-confirmation-dialog .xaf-object-caption' does. The navy is inherited from
   the header. Re-verify on DX upgrade. */

/* View popups (XAF ViewCaptionComponent): div.xaf-caption-container > span.xaf-view-caption-lg (-sm when
   an object caption follows) + span.xaf-object-caption. */
.dxbl-popup.xafPopup .xaf-caption-container > :is(.xaf-view-caption-lg, .xaf-view-caption-sm) {
    font-size: var(--dxbl-popup-header-font-size);
    line-height: var(--dxbl-popup-header-line-height);
    font-weight: var(--dxbl-popup-header-font-weight);
}

/* Object caption under the view caption: 16px/400 secondary (OQ-29 b).
   DOM: capture "Popup DetailView and footer buttons (WP-16)": .xaf-caption-container > span.xaf-object-caption. */
.dxbl-popup.xafPopup .xaf-caption-container > .xaf-object-caption {
    font-size: var(--inradr-text-h3-size);
    line-height: var(--inradr-text-h3-line-height);
    font-weight: var(--inradr-text-h3-weight);
    color: var(--inradr-color-text-secondary);
}

/* Dialogs (XAF PopupDialogTemplateComponent: confirmation, exception, object-model dialogs) render the
   title as div.view-caption-root > div.xaf-object-caption. XAF sizes it from the header tokens only for the
   confirmation dialog; this gives the other dialogs the same title.
   ANNAHME (WP-00) for the exception and object-model dialogs (same template, not captured): they only open on an
   error or from the model editor, which a test run cannot trigger without side effects. */
.dxbl-popup.xafPopup .view-caption-root > .xaf-object-caption {
    font-size: var(--dxbl-popup-header-font-size);
    line-height: var(--dxbl-popup-header-line-height);
    font-weight: var(--dxbl-popup-header-font-weight);
}

/* ── Caption and layout-group icons hidden (A) ────────────────────
   XAF renders div.xaf-caption-icon-container when the view has an image (ViewCaptionComponent.razor:7-10,
   styles.css '.xaf-caption-icon-container{display:flex;...}') and narrows the caption next to it
   ('.xaf-caption-icon-container + .xaf-caption-container{max-width:calc(100% - ...)}'); with the icon gone
   the title gets the full width back. ANNAHME (WP-00): not measurable: none of the popups in the captures
   (Crud, wizard, import, confirmation) has a view image. */
.dxbl-popup.xafPopup :is(.xaf-caption-icon-container, .xaf-layout-group-icon) {
    display: none;
}

.dxbl-popup.xafPopup .xaf-caption-icon-container + .xaf-caption-container {
    max-width: 100%;
}

/* ── Form layout: labels on top (spec modal-card form variant) ───
   DOM (wizard popup): div.dxbl-modal-body > div.main > div.main-content > layout-editor >
   div.detail-view-content > dxbl-form-layout.dxbl-fl, without .dxbl-fl-with-paddings, so the fields start
   on the header title's 16px edge. The global form layout tokens (inradr-feature-formlayout.css) apply
   here too; the main-window rules (240px caption column, caption-top margins) do not.
   Every form popup sets CaptionLocation=Top in the model (design-system delivery of 2026-09-30, owner
   decision 2026-10-06; it replaces OQ-30 b and the classic popup of the note and appointment masks), so XAF
   sizes it 800px wide (PopupWindowTemplateDetailViewSizeController, caption-top 'min(800px, 80%)'), below the
   spec's 960px maximum. The spec's rows: label above the field 8px apart, 16px between rows, 24px between
   the two columns of a split row. Tokens declared on .dxbl-fl (core.min.css 26.1.4 '.dxbl-fl{...
   --dxbl-fl-item-spacing-x:var(--dxbl-fl-item-spacing-x-m);--dxbl-fl-item-spacing-y:var(--dxbl-fl-item-spacing-y-m);
   ...--dxbl-fl-caption-vertical-padding-bottom:var(--dxds-spacing-20)...}'); the item spacing is split half above
   and half below every item ('.dxbl-col{...margin-top:calc(.5 * var(--dxbl-row-item-spacing-y))...}').
   Re-verify on DX upgrade. */
.dxbl-popup.xafPopup .dxbl-fl {
    --dxbl-fl-item-spacing-x: var(--inradr-gap-grid);                  /* 24px between columns */
    --dxbl-fl-item-spacing-y: var(--inradr-space-sm);                  /* 16px between rows; Fluent 12px */
    --dxbl-fl-caption-vertical-padding-bottom: var(--inradr-space-xs); /* 8px label to field; Fluent 2px */
    /* Horizontal captions (>=992px), left for generated popups without a model setting (e.g. a lookup's New
       dialog), are padded to the popup editor height: 8px + 20px + 8px = the 36px popup editors
       (inradr-feature-editors.css), so caption and value share one line. Fluent pads 6px for its 32px
       editors; caption-top items reset the top padding themselves. */
    --dxbl-fl-caption-padding-y: var(--dxds-spacing-80);
}

/* Caption-top items: A's compact label line (0.875rem/1.15). A property on the caption, not the token:
   --dxbl-fl-caption-line-height is declared on .dxbl-fl and would also shrink the horizontal captions, whose
   padding is sized for one 20px line. */
.dxbl-popup.xafPopup .dxbl-fl .dxbl-fl-item:not(.dxbl-fl-item-horizontal) > .dxbl-fl-cpt {
    line-height: var(--inradr-text-kpi-label-line-height);
}

/* ── Support dialog (OpenSpec add-support-dialog) ─────────────────
   A plain DxPopup of the shell, not an XAF popup: CssClass 'inradr-support-popup' lands on the
   dxbl-popup dialog element. On phone-width viewports the dialog takes the whole screen (wireframe
   behavior); DxPopup writes its Width/MaxHeight parameters as inline styles, hence the !important.
   Re-verify on DX upgrade. */
@media (max-width: 640px) {
    .dxbl-popup.inradr-support-popup {
        width: 100vw !important;      /* !important: DxPopup writes its Width parameter as an inline style */
        min-width: 100vw !important;  /* !important: see above - inline popup sizing */
        max-width: 100vw !important;  /* !important: see above - inline popup sizing */
        height: 100dvh !important;    /* !important: see above - inline popup sizing */
        max-height: 100dvh !important; /* !important: DxPopup writes MaxHeight as an inline style */
        margin: 0 !important;         /* !important: outranks the centring margins of the modal layout */
        border-radius: 0;
    }
}
