/* Static styles that InnerFormSkeleton.razor and ListFull.razor used to render inline in a <style>
   element of every instance - one 17 KB copy per form, tab component and list template, re-sent in
   each render batch and re-parsed by the browser (adding a stylesheet restyles the whole document).
   Linked once, last in StyleLinksComponent, so the rules still come after the theme stylesheets. */

/* ---- InnerFormSkeleton ---- */
.inner-form-window {
    overflow: visible !important;
    pointer-events: auto !important;
}

/* Chromeless-cover mode (activities): no title bar; the form's own cover is the top of
   the window and the window controls float over it as a translucent pill, top-right. */
.inner-form-window.chromeless-cover .inner-form-scroll {
    margin-top: 0 !important;
}

.cover-float-controls {
    position: absolute;
    /* Tucked fully inside the top-right: enough top offset to sit clear of the rounded
       corner, and enough right inset to clear the content scrollbar (~17px) plus a margin
       so the pill never overhangs the edge. */
    top: 10px;
    right: 30px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 2px 3px;
    border-radius: 999px;
    background: rgba(23, 28, 38, 0.6);
}

    .cover-float-controls button,
    .cover-float-controls .cover-float-btn {
        width: 26px;
        height: 26px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
    }

        .cover-float-controls button:hover,
        .cover-float-controls .cover-float-btn:hover {
            background: rgba(255, 255, 255, 0.18);
        }

    .cover-float-controls i {
        color: #fff;
    }

    /* The close control is a ButtonDropdown; neutralise its default (bright) borderless
       hover so it matches the translucent pill instead of flashing white. */
    .cover-float-controls .ButtonDropdown,
    .cover-float-controls .ButtonDropdownSide {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #fff !important;
        border-radius: 50% !important;
    }

    .cover-float-controls .ButtonDropdownSide {
        width: 26px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .cover-float-controls .ButtonDropdownSide:hover {
            background: rgba(255, 255, 255, 0.18) !important;
            color: #fff !important;
        }

.page-form-window {
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.inner-form-window.maximized {
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    min-height: 0 !important;
    /* Square corners when maximized - rounded corners clip a full-bleed cover and show white
       triangles in the top corners. Also drop the 1px ui_border-1 frame that leaves a thin
       light line around the edges. */
    border-radius: 0 !important;
    border: none !important;
}


.inner-form-window .dxbl-tabs {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

    .inner-form-window .dxbl-tabs-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: visible !important;
}

.inner-form-window.maximized .dxbl-tabs-content {
    overflow: hidden !important;
}

/* The panel sits under its tab strip, so 100% of the tab manager alone overflowed by the strip's height
   (a tab inside a tab twice) and pushed a grid's pager below the form; it shrinks to the space left. */
.inner-form-window .dxbl-tabs-content-panel {
    height: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}

.inner-form-window.maximized .dxbl-tabs-content-panel {
    overflow: hidden !important;
}

/* Maximized clipping (above) is meant for tabs whose content scrolls internally (lists,
   trees, spreadsheet). A plain form-field tab that is taller than the window would just be
   clipped with no way to reach the bottom. For those tabs let the content overflow so the
   outer .main-tab-content scroller can reach it. */
.inner-form-window.maximized .dxbl-tabs-content:not(:has(.ListFullContentWrapper)):not(:has(.TreeListContentWrapper)):not(:has(.spreadsheet-tab-content)),
.inner-form-window.maximized .dxbl-tabs-content-panel:not(:has(.ListFullContentWrapper)):not(:has(.TreeListContentWrapper)):not(:has(.spreadsheet-tab-content)) {
    overflow: visible !important;
}

/* inner-form-content-wrapper is a bounded-height flex ITEM (via align-self:stretch
   in InnerFormSkeletonContent's flex-row context), but it is not a flex container,
   so its block children cannot inherit that bounded height. Making it a flex column
   allows the form's outer load-content-body to become a flex child and receive a
   definite height, which in turn lets dxbl-tabs → dxbl-tabs-content-panel also
   resolve to a definite height and anchor the full height chain. */
.inner-form-window .inner-form-content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* When the form's own LoadContent wraps a tab manager (all "New*" forms), make it
   fill inner-form-content-wrapper. This completes the height chain so that
   dxbl-tabs-content-panel becomes height-bounded, enabling the rule below to
   constrain the list and keep the horizontal scrollbar in the visible area. */
.inner-form-window .inner-form-content-wrapper > .load-content-body:has(.dxbl-tabs):not(.hiddenHeight) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* The per-tab content element (.dxbl-tabs-content, a child of the content panel)
   is now a bounded-height flex column. LoadContent wraps the list in a plain block
   (.load-content-body) that would otherwise break the flex height chain down to
   the list. The grid would then grow to its full row height and its horizontal
   scrollbar would end up below the visible area (scroll works, but bar is hidden).
   Scoped with :has() to only the wrappers that contain a list, leaving form-field
   tabs alone. */
.inner-form-window .dxbl-tabs-content > .load-content-body:has(.ListFullContentWrapper):not(.hiddenHeight) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Same reasoning as the ListFull rule above, for XTreeListGroup's own host div
   (.TreeListContentWrapper) - a separate component with its own height mechanics
   (h-100 + optional MaxHeight cap), not covered by the :has(.ListFullContentWrapper)
   selector above. */
.inner-form-window .dxbl-tabs-content > .load-content-body:has(.TreeListContentWrapper):not(.hiddenHeight) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.univer-spreadsheet-wrapper {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}


.inner-form-window .inner-form-scroll {
    min-height: 0;
    overflow-y: auto;
}

.save-panel-holder {
    flex-shrink: 0;
    background-color: var(--bs-body-bg, white);
    border-top: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    padding: 0.5rem;
    width: 100%;
    gap: 10px;
    box-sizing: border-box;
    z-index: 2;
}

.inner-form-window .main-tab-content {
    height: 100%;
    max-height: 100%;
    min-height: 100%;
}

.inner-form-window.maximized .main-tab-content {
    overflow-y: auto !important;
}

.inner-form-window .spreadsheet-tab-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.inner-form-window .dxbl-tabs-content:has(.spreadsheet-tab-content) {
    overflow: visible !important;
}

.spreadsheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
}

.spreadsheet-toolbar-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.spreadsheet-toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    color: #0f766e;
    background: #ccfbf1;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
    flex-shrink: 0;
}

.spreadsheet-toolbar-text {
    min-width: 0;
}

.spreadsheet-title {
    font-weight: 700;
    color: #172033;
    line-height: 1.1;
}

.spreadsheet-subtitle {
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.1;
}

.spreadsheet-name {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
    border-radius: 3px;
    padding: 0 2px;
    margin-left: -2px;
}

.spreadsheet-name:hover {
    background: rgba(100, 116, 139, 0.12);
}

.spreadsheet-name.editing {
    cursor: text;
    overflow: visible;
    text-overflow: clip;
    outline: none;
    background: #fff;
    color: #172033;
    box-shadow: 0 0 0 1px #2563eb;
}

.spreadsheet-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.spreadsheet-autosave-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    user-select: none;
}

.spreadsheet-autosave-status.saved {
    color: #16a34a;
}

.spreadsheet-autosave-status.saving {
    color: #2563eb;
}

.spreadsheet-autosave-status.pending {
    color: #b45309;
}

.spreadsheet-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.spreadsheet-action-button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.spreadsheet-action-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.spreadsheet-action-button.secondary {
    color: #334155;
    background: #ffffff;
    border-color: #cbd5e1;
}

.spreadsheet-action-button.secondary:not(:disabled):hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.spreadsheet-action-button.primary {
    color: #ffffff;
    background: #0f766e;
    border-color: #0f766e;
}

.spreadsheet-action-button.primary:not(:disabled):hover {
    background: #115e59;
    border-color: #115e59;
}

.spreadsheet-workspace {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem;
}

.inner-form-window .spreadsheet-wrapper {
    position: relative;
    flex: 1 1 auto;
    height: auto;
    min-height: 400px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.spreadsheet-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(2px);
    z-index: 1000;
}

.spreadsheet-loading-card {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 0.75rem;
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

/* Windowed (non-maximized) form: the window is height:fit-content (indefinite), so
   the height:100% links from .dxbl-tabs down to .spreadsheet-tab-content resolve to
   auto and the spreadsheet collapses to .spreadsheet-wrapper's 400px min-height,
   leaving dead space below. Flex stretching distributes the real space without
   needing definite heights. Engaged only while the spreadsheet tab is the active
   one, so the Main tab keeps its plain scrolling layout. */
.inner-form-window .inner-form-scroll:has(.dxbl-tabs-content.dxbl-active .spreadsheet-tab-content) {
    display: flex;
    flex-direction: column;
}

.inner-form-window .inner-form-scroll:has(.dxbl-tabs-content.dxbl-active .spreadsheet-tab-content) > .dxbl-tabs {
    flex: 1 1 auto;
    min-height: 0;
}

.inner-form-window .dxbl-tabs-content-panel:has(> .dxbl-tabs-content.dxbl-active .spreadsheet-tab-content) {
    flex: 1 1 auto;
    min-height: 0;
}

.inner-form-window .dxbl-tabs-content.dxbl-active > .spreadsheet-tab-content {
    flex: 1 1 auto;
    min-height: 0;
}


.inner-form-window.maximized .inner-form-scroll {
    overflow-y: hidden !important;
}

.inner-form-window.maximized .inner-form-scroll,
.inner-form-window.maximized .dxbl-tabs-content,
.inner-form-window.maximized .dxbl-tabs-content-panel,
.inner-form-window.maximized .InnerFormSkeletonContent,
.inner-form-window.maximized .spreadsheet-wrapper {
    min-height: 0 !important;
    height: 100% !important;
}

/* Presence avatars in the form header: the shared ViewedByUsers CSS is built for a vertical
   sidebar (absolutely-positioned, stacked icons). Re-flow it into a compact horizontal row
   with a tooltip that drops below the avatar. [2026-07-10] */
.inner-form-presence {
    margin-right: 0.25rem;
}

.inner-form-presence .app-connected-user-list-wrapper {
    flex-direction: row;
    gap: 0;
    align-items: center;
    padding-left: 6px;
}

.inner-form-presence .app-connected-user-wrapper {
    flex-direction: row;
    align-items: center;
    margin-left: -6px;
}

.inner-form-presence .app-connected-user-wrapper:first-child {
    margin-left: 0;
}

.inner-form-presence .app-connected-user-icon {
    position: static;
    margin: 0;
    height: 1.75rem;
    width: 1.75rem;
    min-height: 0;
    border-radius: 50%;
    border: 2px solid var(--bs-body-bg, #fff);
    outline: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.inner-form-presence .app-connected-user-summary {
    left: auto;
    right: 0;
    top: 2.25rem;
    z-index: 3000;
}

.co-edit-banner {
    background-color: #e7f1ff;
    color: #084298;
    border: 1px solid #b6d4fe;
    border-radius: 4px;
    padding: 0.3rem 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    gap: 0.4rem;
}



/* Scroll to top button */
.scroll-to-top-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bs-primary, var(--action-primary, #007bff));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0.8;
}

.scroll-to-top-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.scroll-to-top-btn:active {
    transform: scale(0.95);
}

/* ---- ListFull ---- */
.dxbl-list-box-item-selected{
    color: #000 !important;
}

.dxbl-splitter-pane-content{
    padding-top: 0 !important;
    
}



.dxbl-grid.ui_dxdatagrid.all-pointer {
    padding-top: 0 !important;
}

.dxbl-grid-group-panel-container{
    margin: 2px !important;
}


.dxbl-text{
    margin-bottom: 0 !important;
}

.terra-live-row-blink,
.terra-live-row-blink > td,
.terra-live-row-blink .dxbl-grid-cell {
    animation: terra-live-row-blink 1.4s ease-out 1;
}

@keyframes terra-live-row-blink {
    0% {
        background-color: rgba(72, 187, 120, 0.24) !important;
        box-shadow: inset 0 0 0 9999px rgba(72, 187, 120, 0.18);
    }
    45% {
        background-color: rgba(72, 187, 120, 0.14) !important;
        box-shadow: inset 0 0 0 9999px rgba(72, 187, 120, 0.10);
    }
    100% {
        background-color: transparent;
        box-shadow: inset 0 0 0 9999px rgba(72, 187, 120, 0);
    }
}

/* The filter-values menu renders its "Apply" action as .dxbl-btn-primary, but in this
   theme the button's base background resolves to near-transparent (only the hover colour
   shows) and the disabled state is barely visible. Pin it to the system primary blue
   (--action-primary) so it matches the other primary buttons. Scoped to the filter menu
   so no other primary button is affected. */
.dxbl-filter-menu-dropdown .dxbl-btn-primary {
    background-color: var(--action-primary) !important;
    border-color: var(--action-primary) !important;
    color: #fff !important;
}

.dxbl-filter-menu-dropdown .dxbl-btn-primary:hover {
    background-color: #0069d9 !important;
    border-color: #0062cc !important;
}

.dxbl-filter-menu-dropdown .dxbl-btn-primary.dxbl-disabled,
.dxbl-filter-menu-dropdown .dxbl-btn-primary:disabled {
    background-color: var(--action-primary) !important;
    border-color: var(--action-primary) !important;
    color: #fff !important;
    opacity: 0.65 !important;
}


/* ---- Input chips (Terra Logistics' ui_input-chip) ----
   The values chosen in a multi-select lookup (XLookUpEdit, MultiSelect with Bubbles; GlobalXLookUpEdit.js builds them)
   under the field: pills washed in the accent, a cross to take one off. A value with a colour from the database
   (--state on the chip) is washed in that colour instead, as the state pills. Colours from the Terra tokens
   (Terra.DesignSystem tokens.css), Terra Logistics' light values where a host has none (WebMobileEngine). */
.ui_input-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.ui_input-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: 100%;
    padding: 0.12rem 0.55rem;
    border: 1px solid var(--terra-primary-line, #cfe0f6);
    border-radius: 999px;
    background-color: var(--terra-primary-wash, #eef4fc);
    color: var(--terra-primary-ink, #1c5cab);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
}

    .ui_input-chip:has(> .ui_input-chip-remove) {
        padding-right: 0.15rem;
    }

    .ui_input-chip.has-state {
        border-color: color-mix(in srgb, var(--state) 70%, var(--terra-bg-surface, #ffffff));
        background-color: color-mix(in srgb, var(--state) 26%, var(--terra-bg-surface, #ffffff));
        color: color-mix(in srgb, var(--state) 25%, var(--terra-text-primary, #0f172a));
    }

.ui_input-chip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui_input-chip-remove {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background-color: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
}

    /* Bootstrap's x: its cross fills 0.43 of the box, so 1.1rem draws Terra Logistics' 0.62rem fa-xmark */
    .ui_input-chip-remove > svg {
        width: 1.1rem;
        height: 1.1rem;
    }

    .ui_input-chip-remove:hover {
        background-color: var(--terra-primary-line, #cfe0f6);
        opacity: 1;
    }

    .ui_input-chip.has-state > .ui_input-chip-remove:hover {
        background-color: color-mix(in srgb, var(--state) 45%, var(--terra-bg-surface, #ffffff));
    }

    .ui_input-chip-remove:focus-visible {
        outline: 2px solid var(--terra-primary, #2a78d6);
        opacity: 1;
    }

/* ---- List cells (Terra Logistics' cell-* / ui-tag / mini-meter / flag-cell) ----
   A list column a page draws as one of the Terra look's cells (ListFull.RegisterCellKind, ListCell; the markup in
   Components/Elements/Lists/ListCells.razor; the UI gallery shows each): two lines, a number with its unit, progress,
   a place, a planned date, yes / no, a tag. Colours from the Terra tokens, Terra Logistics' light values where a host
   has none (the look switched off). */
.cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    line-height: 1.3;
}

.cell-main {
    min-width: 0;
    overflow: hidden;
    color: var(--terra-text-primary, #0f172a);
    font-weight: 600;
    text-overflow: ellipsis;
}

.cell-sub {
    min-width: 0;
    overflow: hidden;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.76rem;
    text-overflow: ellipsis;
}

    .cell-sub > i,
    .cell-main > i {
        width: 0.95rem;
        margin-right: 0.25rem;
        color: var(--terra-text-muted, #64748b);
        font-size: 0.72rem;
        text-align: center;
    }

/* One line cut with "…", the whole text in the tooltip */
.cell-clip {
    display: block;
    white-space: nowrap;
}

.cell-none {
    color: var(--terra-text-muted, #64748b);
}

/* ListCell.Avatar: a 28 px round picture (or initials) before the name; the cell keeps the row's height */
.cell-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .cell-avatar > .cell-clip {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.cell-avatar-pic {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--terra-border, #e2e8f0);
}

    .cell-avatar-pic.is-initials {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--terra-primary-wash, #eef2ff);
        color: var(--terra-primary-ink, #3730a3);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.02em;
    }

/* ListCell.When / LongText: one line, the whole value in the tooltip */
.cell-when {
    white-space: nowrap;
}

.cell-long {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A text with a small icon before it (ListCell.IconText) - an activity's type */
.cell-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.cell-icon-text .cell-icon {
    flex-shrink: 0;
    width: 14px;
    font-size: 12px;
    text-align: center;
    color: var(--terra-text-muted, #6c757d);
}

.erp-dark .cell-icon-text .cell-icon {
    color: var(--erp-text-muted);
}

.erp-dark .cell-avatar-pic {
    background: var(--erp-surface);
    border-color: var(--erp-border);
}

.erp-dark .cell-avatar-pic.is-initials {
    background: var(--erp-strip);
    color: var(--erp-text-emph);
}

.cell-num {
    width: 100%;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

    .cell-num .cell-unit {
        margin-left: 0.25rem;
        color: var(--terra-text-muted, #64748b);
        font-size: 0.76rem;
        font-weight: 500;
    }

/* A planned date: the tag sits after the actual date */
.cell-plan .cell-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    overflow: visible;
}

    .cell-plan .cell-sub > i {
        width: auto;
        margin: 0;
        color: var(--terra-success, #11865c);
    }

.cell-place {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
}

    .cell-place > .cell-stack {
        flex: 1 1 auto;
    }

.cell-place-mark {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    margin-top: 0.05rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: var(--terra-primary-wash, #eef4fc);
    color: var(--terra-primary, #2a78d6);
    font-size: 0.62rem;
}

button.cell-place-mark {
    cursor: pointer;
}

    button.cell-place-mark:hover,
    button.cell-place-mark:focus-visible {
        background-color: var(--terra-primary-line, #cfe0f6);
    }

    button.cell-place-mark:focus-visible {
        outline: 2px solid var(--terra-primary, #2a78d6);
        outline-offset: 1px;
    }

/* Yes / no: a small green tick, a muted tick (when yes is the normal case) or a muted dash */
.flag-cell {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.8rem;
}

    .flag-cell.is-on {
        border-radius: 50%;
        background-color: var(--terra-success-bg, #effaef);
        color: var(--terra-success-text, #006300);
        font-size: 0.66rem;
    }

    .flag-cell.is-plain {
        font-size: 0.72rem;
    }

/* A small tag: a delay, "late", a kind; the tone only where it means something */
.ui-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.45rem;
    border: 1px solid var(--terra-border, #e2e8f0);
    border-radius: 999px;
    background-color: var(--terra-bg-surface-deep, #f8fafc);
    color: var(--terra-text-body, #475569);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.55;
    white-space: nowrap;
}

    .ui-tag > i {
        font-size: 0.62rem;
    }

    .ui-tag.is-good {
        border-color: color-mix(in srgb, var(--terra-success, #11865c) 35%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-success-bg, #effaef);
        color: var(--terra-success-text, #006300);
    }

    .ui-tag.is-warn {
        border-color: color-mix(in srgb, var(--terra-warning, #fab219) 45%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-warning-bg, #fff6e0);
        color: var(--terra-warning-text, #7a4f00);
    }

    .ui-tag.is-bad {
        border-color: color-mix(in srgb, var(--terra-danger, #d03b3b) 35%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-danger-bg, #fdf1f1);
        color: var(--terra-danger-text, #a82727);
    }

    .ui-tag.is-info {
        border-color: var(--terra-primary-line, #cfe0f6);
        background-color: var(--terra-primary-wash, #eef4fc);
        color: var(--terra-primary-ink, #1c5cab);
    }

/* Done of all: "7 / 12" over a bar, green once all are done */
.mini-meter {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 6rem;
}

.mini-meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

    .mini-meter-head strong {
        color: var(--terra-text-primary, #0f172a);
        font-variant-numeric: tabular-nums;
        font-weight: 700;
    }

.mini-meter-bar {
    position: relative;
    height: 0.4rem;
    overflow: hidden;
    border-radius: 999px;
    background-color: var(--terra-border, #e2e8f0);
}

    .mini-meter-bar > span {
        display: block;
        height: 100%;
        border-radius: 999px;
        background-color: var(--terra-primary, #2a78d6);
    }

.mini-meter.is-good .mini-meter-bar > span {
    background-color: var(--terra-success, #11865c);
}

/* ---- Record headers (Terra Logistics' rec-head; Components/Elements/Records) ----
   The top of an open record: RecordHeader (icon, code, state pill, RecordAlerts, a who / when line, tools), StatePath,
   RecordTile / RingMeter in div.rec-tiles; RecordNote (div.rec-notes) where there is no header; rec-empty for an empty
   panel. The state pill (ListCells.State) as anywhere outside a grid. Colours from the Terra tokens, Terra Logistics'
   light values where a host has none. The UI gallery shows each. */
.state-pill {
    --state: color-mix(in srgb, var(--terra-border-strong, #cbd5e1), var(--terra-text-muted, #64748b));
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.1rem 0.6rem 0.1rem 0.45rem;
    border: 1px solid color-mix(in srgb, var(--state) 70%, var(--terra-bg-surface, #ffffff));
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--state) 26%, var(--terra-bg-surface, #ffffff));
    color: color-mix(in srgb, var(--state) 25%, var(--terra-text-primary, #0f172a));
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

    .state-pill::before {
        flex: 0 0 auto;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        background-color: var(--state);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--terra-shadow-ink, #0f172a) 18%, transparent);
        content: "";
    }

.rec-head {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--terra-border, #e2e8f0);
    border-radius: 0.875rem;
    background-color: var(--terra-bg-grid, #ffffff);
    box-shadow: 0 1px 2px var(--terra-shadow-sm, rgba(15, 23, 42, 0.06));
    color: var(--terra-text-primary, #0f172a);
    container-type: inline-size;
}

.rec-head-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
}

.rec-title {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.7rem;
    min-width: 0;
}

    .rec-title h4 {
        margin: 0;
        color: var(--terra-text-primary, #0f172a);
        font-size: 1.3rem;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

.rec-title-sub {
    flex-basis: 100%;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.8rem;
}

    .rec-title-sub > span > i {
        margin-right: 0.3rem;
    }

    .rec-title-sub > span + span::before {
        margin: 0 0.45rem;
        color: var(--terra-border-strong, #cbd5e1);
        content: "·";
    }

.rec-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* The record's icon before its code */
.rec-hero-icon {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.75rem;
    background-color: var(--terra-primary-wash, #eef4fc);
    color: var(--terra-primary, #2a78d6);
    font-size: 1.05rem;
}

/* RecordAlert: what needs attention, a pill beside the state (as tall as it); a button when it opens what helps */
.rec-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.1rem 0.6rem 0.1rem 0.5rem;
    border: 1px solid var(--terra-primary-line, #cfe0f6);
    border-radius: 999px;
    background-color: var(--terra-primary-wash, #eef4fc);
    color: var(--terra-primary-ink, #1c5cab);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

    .rec-alert > i {
        font-size: 0.75rem;
    }

    .rec-alert.is-warn {
        border-color: color-mix(in srgb, var(--terra-warning, #fab219) 45%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-warning-bg, #fff6e0);
        color: var(--terra-warning-text, #7a4f00);
    }

    .rec-alert.is-bad {
        border-color: color-mix(in srgb, var(--terra-danger, #d03b3b) 35%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-danger-bg, #fdf1f1);
        color: var(--terra-danger-text, #a82727);
    }

    .rec-alert.is-plain {
        border-color: var(--terra-border, #e2e8f0);
        background-color: var(--terra-bg-surface-deep, #f8fafc);
        color: var(--terra-text-body, #475569);
    }

button.rec-alert {
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

    button.rec-alert:hover {
        border-color: color-mix(in srgb, currentColor 45%, transparent);
        box-shadow: 0 1px 2px color-mix(in srgb, var(--terra-shadow-ink, #0f172a) 8%, transparent);
    }

    button.rec-alert:focus-visible {
        outline: 2px solid var(--terra-primary, #2a78d6);
        outline-offset: 1px;
    }

    .rec-alert > .rec-alert-go {
        margin-left: -0.1rem;
        font-size: 0.6rem;
        opacity: 0.65;
    }

.rec-alert-count {
    min-width: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background-color: color-mix(in srgb, currentColor 14%, transparent);
    font-size: 0.7rem;
    text-align: center;
}

/* StatePath: a circle per state on a line filled up to the current one */
.rec-steps {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rec-step {
    --state: var(--terra-primary, #2a78d6);
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    text-align: center;
}

    /* The line to the previous step */
    .rec-step + .rec-step::before {
        position: absolute;
        top: calc(1.05rem - 1.5px);
        right: calc(50% + 1.45rem);
        left: calc(-50% + 1.45rem);
        height: 3px;
        border-radius: 2px;
        background-color: var(--terra-border, #e2e8f0);
        content: "";
    }

    .rec-step.is-passed + .rec-step::before {
        background-color: var(--terra-success, #11865c);
    }

.rec-step-dot {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border: 2px solid var(--terra-border, #e2e8f0);
    border-radius: 50%;
    background-color: var(--terra-bg-surface, #ffffff);
    color: var(--terra-text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 700;
}

.rec-step.is-passed .rec-step-dot {
    border-color: var(--terra-success, #11865c);
    background-color: var(--terra-success-bg, #effaef);
    color: var(--terra-success, #11865c);
}

.rec-step.is-current .rec-step-dot {
    border-color: var(--state);
    background-color: var(--state);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--state) 25%, var(--terra-bg-surface, #ffffff));
    color: color-mix(in srgb, var(--state) 25%, var(--terra-nav, #0f172a));
}

.rec-step-name {
    max-width: 100%;
    overflow: hidden;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-step.is-passed .rec-step-name {
    color: var(--terra-text-body, #475569);
}

.rec-step.is-current .rec-step-name {
    color: var(--terra-text-primary, #0f172a);
    font-weight: 700;
}

.rec-step-date {
    color: var(--terra-text-muted, #64748b);
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* Pressable steps (StatePath.StepClick): the circle and name as one button, laid out as the step itself */
.rec-step-btn {
    display: flex;
    flex-direction: inherit;
    align-items: center;
    gap: inherit;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0.15rem 0.3rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

    .rec-step-btn:hover:not(:disabled) {
        background-color: var(--terra-bg-hover, #f1f5f9);
    }

    .rec-step-btn:hover:not(:disabled) .rec-step-dot {
        border-color: var(--state);
    }

    .rec-step-btn:focus-visible {
        outline: 2px dotted var(--terra-primary, #2a78d6);
        outline-offset: 2px;
    }

    .rec-step-btn:disabled {
        cursor: default;
    }

/* Compact (in a header): one line, a small circle with the name beside it, a line to the next; dates in the tooltip */
.rec-steps.is-compact {
    align-items: center;
    gap: 0.5rem;
}

    .rec-steps.is-compact .rec-step {
        flex: 1 1 auto;
        flex-direction: row;
        gap: 0.4rem;
        text-align: left;
    }

        .rec-steps.is-compact .rec-step:last-child {
            flex: 0 0 auto;
        }

        .rec-steps.is-compact .rec-step + .rec-step::before {
            display: none;
        }

        .rec-steps.is-compact .rec-step:not(:last-child)::after {
            flex: 1 1 auto;
            min-width: 0.75rem;
            height: 2px;
            border-radius: 2px;
            background-color: var(--terra-border, #e2e8f0);
            content: "";
        }

        .rec-steps.is-compact .rec-step.is-passed:not(:last-child)::after {
            background-color: var(--terra-success, #11865c);
        }

    .rec-steps.is-compact .rec-step-dot {
        flex: none;
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.66rem;
    }

    .rec-steps.is-compact .rec-step.is-current .rec-step-dot {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--state) 25%, var(--terra-bg-surface, #ffffff));
    }

    .rec-steps.is-compact .rec-step-name {
        flex: none;
    }

    .rec-steps.is-compact .rec-step-date {
        display: none;
    }

/* Key figures as tiles (RecordTile): an icon chip, the label over the value with its unit and a note, a ring for a share */
.rec-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.6rem;
}

.rec-tile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--terra-border, #e2e8f0);
    border-radius: 0.75rem;
    background-color: var(--terra-bg-surface, #ffffff);
}

    .rec-tile > .ring-meter {
        width: 2.35rem;
        height: 2.35rem;
    }

    .rec-tile.is-good {
        border-color: color-mix(in srgb, var(--terra-success, #11865c) 35%, var(--terra-bg-surface, #ffffff));
        background-color: color-mix(in srgb, var(--terra-success-bg, #effaef) 55%, var(--terra-bg-surface, #ffffff));
    }

        .rec-tile.is-good .rec-tile-value {
            color: var(--terra-success-text, #006300);
        }

    .rec-tile.is-warn {
        border-color: color-mix(in srgb, var(--terra-warning, #fab219) 45%, var(--terra-bg-surface, #ffffff));
        background-color: color-mix(in srgb, var(--terra-warning-bg, #fff6e0) 55%, var(--terra-bg-surface, #ffffff));
    }

        .rec-tile.is-warn .rec-tile-value {
            color: var(--terra-warning-text, #7a4f00);
        }

    .rec-tile.is-bad {
        border-color: color-mix(in srgb, var(--terra-danger, #d03b3b) 35%, var(--terra-bg-surface, #ffffff));
        background-color: color-mix(in srgb, var(--terra-danger-bg, #fdf1f1) 55%, var(--terra-bg-surface, #ffffff));
    }

        .rec-tile.is-bad .rec-tile-value {
            color: var(--terra-danger-text, #a82727);
        }

.rec-tile-body {
    flex: 1 1 auto;
    min-width: 0;
}

.rec-tile-icon {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background-color: var(--terra-primary-wash, #eef4fc);
    color: var(--terra-primary, #2a78d6);
    font-size: 0.82rem;
}

    .rec-tile-icon.is-good {
        background-color: var(--terra-success-bg, #effaef);
        color: var(--terra-success, #11865c);
    }

    .rec-tile-icon.is-plain {
        background-color: var(--terra-bg-surface-deep, #f8fafc);
        color: var(--terra-text-body, #475569);
    }

    .rec-tile-icon.is-warn {
        background-color: var(--terra-warning-bg, #fff6e0);
        color: var(--terra-warning-text, #7a4f00);
    }

    .rec-tile-icon.is-bad {
        background-color: var(--terra-danger-bg, #fdf1f1);
        color: var(--terra-danger, #d03b3b);
    }

.rec-tile-label {
    overflow: hidden;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.rec-tile-value {
    display: flex;
    align-items: baseline;
    min-width: 0;
    margin-top: 0.05rem;
    color: var(--terra-text-primary, #0f172a);
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.rec-tile-unit {
    margin-left: 0.25rem;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0;
}

.rec-tile-note {
    min-width: 0;
    margin-left: 0.45rem;
    overflow: hidden;
    color: var(--terra-text-muted, #64748b);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0;
    text-overflow: ellipsis;
}

/* RingMeter: a share as a ring with the figure in it */
.ring-meter {
    position: relative;
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
}

    .ring-meter > svg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .ring-meter circle {
        fill: none;
        stroke-width: 4.5;
    }

    .ring-meter .ring-track {
        stroke: var(--terra-border, #e2e8f0);
    }

    .ring-meter .ring-value {
        stroke: var(--terra-primary, #2a78d6);
        stroke-linecap: round;
    }

    .ring-meter.is-good .ring-value {
        stroke: var(--terra-success, #11865c);
    }

    .ring-meter.is-warn .ring-value {
        stroke: var(--terra-warning, #fab219);
    }

    .ring-meter.is-bad .ring-value {
        stroke: var(--terra-danger, #d03b3b);
    }

    .ring-meter > span {
        position: relative;
        color: var(--terra-text-primary, #0f172a);
        font-size: 0.62rem;
        font-variant-numeric: tabular-nums;
        font-weight: 700;
    }

/* A narrow header (a form window, a phone): only the current state named; no icon before the code; the tiles two by
   two without their chip and ring */
@container (max-width: 40rem) {
    .rec-steps.is-compact .rec-step:not(.is-current) .rec-step-name {
        display: none;
    }
}

@container (max-width: 30rem) {
    .rec-hero-icon,
    .rec-tile > .rec-tile-icon,
    .rec-tile > .ring-meter {
        display: none;
    }

    .rec-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Two by two a tile is too narrow for the value and its note on one line: the note goes under the value */
    .rec-tile-value {
        flex-wrap: wrap;
    }

    .rec-tile-note {
        flex-basis: 100%;
        margin-left: 0;
    }
}

/* RecordNote: a tinted line about the open record (where it has no header), the action that helps on the right */
.rec-notes {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.rec-note {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--terra-primary-line, #cfe0f6);
    border-radius: 0.75rem;
    background-color: var(--terra-primary-wash, #eef4fc);
    color: var(--terra-primary-ink, #1c5cab);
    font-size: 0.82rem;
    line-height: 1.35;
}

    .rec-note.is-warn {
        border-color: color-mix(in srgb, var(--terra-warning, #fab219) 45%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-warning-bg, #fff6e0);
        color: var(--terra-warning-text, #7a4f00);
    }

    .rec-note.is-bad {
        border-color: color-mix(in srgb, var(--terra-danger, #d03b3b) 35%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-danger-bg, #fdf1f1);
        color: var(--terra-danger-text, #a82727);
    }

    .rec-note.is-good {
        border-color: color-mix(in srgb, var(--terra-success, #11865c) 35%, var(--terra-bg-surface, #ffffff));
        background-color: var(--terra-success-bg, #effaef);
        color: var(--terra-success-text, #006300);
    }

    .rec-note.is-plain {
        border-color: var(--terra-border, #e2e8f0);
        background-color: var(--terra-bg-surface-deep, #f8fafc);
        color: var(--terra-text-body, #475569);
    }

.rec-note-icon {
    flex: 0 0 auto;
    font-size: 0.9rem;
}

.rec-note-body {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.5rem;
    min-width: 0;
}

    .rec-note-body strong {
        font-weight: 700;
    }

.rec-note-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.4rem;
    margin-left: auto;
}

/* A panel's empty state in one muted line ("No invoices yet") */
.rec-empty {
    color: var(--terra-text-muted, #64748b);
    font-size: 0.78rem;
}


/* ===== PHONE (<768px): shared overrides; desktop untouched ===== */
@media (max-width: 767.98px) {
    /* Shell */
    .MainFormContentHost {
        left: 0 !important;
        width: 100% !important;
    }

    .MainFormContentHost .MainFormGridArea {
        height: calc(100dvh - 50px) !important;
        padding-inline: 0.25rem;
    }

    .appUpperRow {
        width: 100%;
        padding-left: 3rem;
    }

    .appUpperLogo {
        left: 3rem;
        height: 26px;
    }

    .appUpperRow > div[style*="width: 200px"] {
        display: none;
    }

    /* The header search (Trello 17144) gets a second line of the bar, full width; the page starts below it. */
    .appUpperRow.has-gsearch {
        height: 100px;
        align-items: flex-start;
    }

        /* The first line's pieces keep the bar's 50px; stretched to 100px they lay over the search and took its taps. */
        .appUpperRow.has-gsearch > .appUpperCentre,
        .appUpperRow.has-gsearch > .appUserTopInfo {
            height: 50px !important;
        }

    .appUpperRow.has-gsearch .gsearch {
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 2;
        min-width: 0;
        padding: 0 10px 10px;
    }

    .appUpperRow.has-gsearch .gsearch-box {
        height: 40px;
    }

    .appUpperRow.has-gsearch .gsearch-input {
        font-size: 16px; /* 16px stops iOS zooming into the field */
    }

    .appUpperRow.has-gsearch .gsearch-list {
        left: 10px;
        right: 10px;
        top: 46px;
        max-height: calc(100dvh - 160px);
    }

    .appUpperRow.has-gsearch .gsearch-row {
        min-height: 44px;
    }

    .MainFormContentHost.has-gsearch {
        top: 100px !important;
    }

    .MainFormContentHost.has-gsearch .MainFormGridArea {
        height: calc(100dvh - 100px) !important;
    }

    /* The quick-access bar (Trello 17145) gets its own line under the search (or under the first line without it):
       the pin button, then every chip in a row that scrolls sideways - no "Dar N" list on a phone. */
    .appUpperRow.has-qaccess {
        height: 92px;
        align-items: flex-start;
    }

    .appUpperRow.has-gsearch.has-qaccess {
        height: 142px;
    }

        .appUpperRow.has-qaccess > .appUpperCentre,
        .appUpperRow.has-qaccess > .appUserTopInfo {
            height: 50px !important;
        }

    .appUpperRow.has-qaccess .qa-bar {
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 2;
        height: 42px;
        padding: 0 10px 8px 6px;
    }

    .appUpperRow.has-gsearch.has-qaccess .qa-bar {
        top: 100px;
    }

    /* The row is its own stacking level (z-index 2), like the list's filter panel further down the page, which would
       paint over an open menu: while a menu is open the row goes above the page. */
    .appUpperRow.has-qaccess .qa-bar.qa-bar-open {
        z-index: 1040;
    }

    .appUpperRow.has-qaccess .qa-chips {
        overflow-x: auto;
        scrollbar-width: none;
    }

    /* A long press opens the chip's menu: no drag, no text selection, no system callout taking it first. */
    .appUpperRow.has-qaccess .qa-chip {
        height: 32px;
        padding: 0 12px;
        font-size: 13px;
        -webkit-user-drag: none;
        -webkit-touch-callout: none;
        user-select: none;
    }

    .appUpperRow.has-qaccess .qa-rename {
        height: 40px;
        font-size: 16px; /* 16px stops iOS zooming into the field */
    }

        .appUpperRow.has-qaccess .qa-chip.qa-chip-hidden {
            position: static;
            visibility: visible;
            pointer-events: auto;
        }

    .appUpperRow.has-qaccess .qa-more {
        display: none;
    }

    .appUpperRow.has-qaccess .qa-popup {
        top: 96px;
    }

    .appUpperRow.has-gsearch.has-qaccess .qa-popup {
        top: 146px;
    }

    .appUpperRow.has-qaccess .qa-popup-item {
        min-height: 44px;
    }

    .MainFormContentHost.has-qaccess {
        top: 92px !important;
    }

    .MainFormContentHost.has-gsearch.has-qaccess {
        top: 142px !important;
    }

    .MainFormContentHost.has-qaccess .MainFormGridArea {
        height: calc(100dvh - 92px) !important;
    }

    .MainFormContentHost.has-gsearch.has-qaccess .MainFormGridArea {
        height: calc(100dvh - 142px) !important;
    }

    /* Forms */
    [data-column-count] {
        grid-template-columns: 1fr !important;
    }

    .card-content-wrapper {
        padding: 0.5rem;
    }

    .innerform-savepanel > [data-column-count] {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    input,
    textarea,
    select,
    .dxbl-text-edit-input {
        font-size: 16px;
    }

    /* Popups: full screen like .maximized */
    div:has(> .inner-form-window:not(.page-form-window)) {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }

    .inner-form-window:not(.page-form-window) {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-width: 0 !important;
        min-height: 0 !important;
        border-radius: 0 !important;
        overflow: auto;
    }

    /* Filters / toolbars */
    .innerform-filterpanel {
        flex-wrap: wrap !important;
        padding: 0.5rem;
    }

    .innerform-filterpanelControls,
    .innerform-filterpanelButtons {
        flex-wrap: wrap;
    }

    /* Time tracker */
    .tt-c2 {
        left: 40px;
        width: 110px;
        min-width: 110px;
    }

    .tt-c1 {
        width: 40px;
        min-width: 40px;
    }

    .tt-r2 {
        right: 0;
    }

    .tt-sticky-r {
        position: static;
    }
}

@media (max-width: 767.98px) {
    /* List: left panel stacks above the grid */
    .ListFullWrapper {
        flex-direction: column !important;
        overflow-y: auto;
    }

    .ListFullWrapper > .dxbl-splitter-pane,
    .ListFullWrapper > dxbl-splitter-pane {
        width: 100% !important;
        min-width: 0 !important;
        flex-basis: auto !important;
    }

    .ListTemplateLeftPanel {
        max-height: 40vh;
        overflow: auto;
    }

    /* DevExpress popups / windows / dropdowns stay inside the viewport */
    .dxbl-popup-portal .dxbl-popup,
    .dxbl-modal-content,
    .dxbl-window,
    .dxbl-dropdown {
        max-width: 100vw !important;
    }

    .dxbl-window {
        left: 0 !important;
        width: 100vw !important;
    }

    .ui_toast-container {
        max-width: 96vw;
    }

    /* Overflow safety net */
    .inner-form-window img,
    .inner-form-window textarea,
    .inner-form-window .dxbl-text-edit,
    .inner-form-window .dxbl-listbox {
        max-width: 100%;
    }

    .inner-form-window .card-body,
    .inner-form-window .card-content-wrapper {
        min-width: 0;
        overflow-x: auto;
    }

    html,
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 767.98px) {
    /* Tabs: swipe-scroll strip, thumb-sized tabs */
    .dxbl-tabs-tablist .dxbl-scroll-viewer-content {
        height: 2.75rem;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .dxbl-tabs-tablist .dxbl-scroll-viewer-content::-webkit-scrollbar {
        display: none;
    }

    .dxbl-tabs-item {
        --dxbl-tabs-tab-padding-x: 0.75rem;
        min-height: 2.75rem;
        white-space: nowrap;
        font-size: 14px;
        scroll-snap-align: start;
    }

    .dxbl-tabs-tablist .dxbl-scroll-viewer-content ul {
        scroll-snap-type: x proximity;
    }
}

@media (max-width: 767.98px) {
    /* List grids as cards (rows marked by GridCards.js) */
    .ui_dxdatagrid table.dxbl-grid-table:has(tr[data-card-row]) {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
    }

    .ui_dxdatagrid table.dxbl-grid-table:has(tr[data-card-row]) > colgroup,
    .ui_dxdatagrid table.dxbl-grid-table:has(tr[data-card-row]) > thead {
        display: none;
    }

    .ui_dxdatagrid table.dxbl-grid-table:has(tr[data-card-row]) > tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 0;
    }

    tr[data-card-row] {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        background: #fff;
        border: 1px solid #dfdfdf;
        border-radius: 6px;
        padding: 10px 12px;
        height: auto !important;
    }

    tr[data-card-row] > td {
        display: block;
        position: static !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        border: 0 !important;
        padding: 0 !important;
        font-size: 13px;
        overflow-wrap: anywhere;
        background: transparent !important;
    }

    tr[data-card-row] > td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        color: #6b7280;
    }

    tr[data-card-row] > td[data-card-title] {
        grid-column: 1 / -1;
        order: -1;
        font-size: 15px;
        font-weight: 600;
    }

    tr[data-card-row] > td[data-card-title]::before {
        display: none;
    }

    tr[data-card-row] > td[data-card-util] {
        grid-column: 1 / -1;
        order: -2;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 12px;
        min-height: 36px;
    }

    tr[data-card-row] > td:not([data-card-util]):empty {
        display: none;
    }
}

@media (max-width: 767.98px) {
    /* Card tweaks from first phone test */
    tr[data-card-row] > td[data-card-util] {
        grid-column: auto;
        min-height: 0 !important;
        height: auto !important;
        line-height: 1;
    }

    tr[data-card-row] > td[data-card-util] * {
        min-height: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    tr[data-card-row] > td[data-card-util]:last-of-type,
    tr[data-card-row] > td[data-card-util] ~ td[data-card-util] {
        justify-content: flex-end;
    }

    tr[data-card-row] > td[data-card-util]:first-child {
        justify-content: flex-start;
    }

    tr[data-card-row] > td > * {
        padding-left: 0 !important;
        text-align: left !important;
    }

    .dxbl-grid-group-panel,
    .dxbl-grid-group-panel-container {
        display: none !important;
    }

    .appUpperLogo {
        height: 18px;
    }
}

@media (max-width: 767.98px) {
    /* Card layout v2: flex rows, no sideways scroll, folded extras, no footer */
    tr[data-card-row] {
        display: flex !important;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 4px 12px;
    }

    tr[data-card-row] > td {
        flex: 1 1 calc(50% - 6px);
        box-sizing: border-box;
    }

    tr[data-card-row] > td[data-card-title] {
        flex: 1 0 100%;
        order: -1;
    }

    tr[data-card-row] > td[data-card-util] {
        flex: 0 0 auto;
        order: -2;
        display: inline-flex;
        align-items: center;
        gap: 12px;
    }

    tr[data-card-row] > td[data-card-util]:first-child {
        margin-right: auto;
    }

    tr[data-card-row] > td[data-card-blank] {
        display: none;
    }

    tr[data-card-row][data-card-more]:not([data-card-open]) > td[data-card-extra] {
        display: none;
    }

    tr[data-card-row][data-card-more]::after {
        content: "\0025BE";
        flex: 1 0 100%;
        text-align: center;
        color: #1e9be9;
        font-size: 14px;
        line-height: 24px;
        border-top: 1px solid #eef0f2;
        margin-top: 4px;
        order: 99;
    }

    tr[data-card-row][data-card-more][data-card-open]::after {
        content: "\0025B4";
    }

    .ui_dxdatagrid:has(tr[data-card-row]) .dxbl-scroll-viewer-content {
        overflow-x: hidden !important;
    }

    .ui_dxdatagrid:has(tr[data-card-row]) .dxbl-scroll-viewer-hor-scroll-bar {
        display: none !important;
    }

    /* No footer summary, no page-size selector; pager only when there are several pages */
    .ui_dxdatagrid tfoot,
    .ui_dxdatagrid .dxbl-pager-page-size-selector {
        display: none !important;
    }

    .ui_dxdatagrid[data-card-single-page] .dxbl-grid-bottom-panel {
        display: none !important;
    }

    /* List stats strip: drop the "Iš viso" block */
    .list-stats-states,
    .list-stats-divider {
        display: none !important;
    }

    /* ... and wrap its tiles two to a line: past the second one they were cut off (Pasiūlymai's "Būsena") */
    .list-stats-panel {
        flex-wrap: wrap;
    }

    .list-stats-panel > .list-stats-tile {
        flex: 1 1 9rem;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    /* Card action line: edit, delete and checkbox side by side, thumb-sized */
    tr[data-card-row] > td[data-card-util] {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 48% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-start !important;
        gap: 14px;
        min-height: 44px !important;
    }

    tr[data-card-row] > td[data-card-util] ~ td[data-card-util] {
        margin-left: auto !important;
    }

    tr[data-card-row] > td[data-card-util] > div {
        display: flex !important;
        align-items: center;
        gap: 14px !important;
        min-width: 0 !important;
        width: auto !important;
    }

    tr[data-card-row] > td[data-card-util] svg {
        width: 28px !important;
        height: 28px !important;
        padding: 8px;
        box-sizing: content-box;
    }

    tr[data-card-row] > td[data-card-util] input[type="checkbox"],
    tr[data-card-row] > td[data-card-util] .dxbl-checkbox-check-element {
        width: 26px !important;
        height: 26px !important;
    }

    tr[data-card-row] > td[data-card-util] .dxbl-checkbox {
        padding: 9px;
    }
}

@media (max-width: 767.98px) {
    tr[data-card-row] > td[data-card-util] svg {
        width: 22px !important;
        height: 22px !important;
        padding: 11px;
    }

    tr[data-card-row] > td[data-card-util] input[type="checkbox"],
    tr[data-card-row] > td[data-card-util] .dxbl-checkbox-check-element {
        width: 22px !important;
        height: 22px !important;
    }

    .appUpperLogo {
        height: 14px;
        top: 18px;
        left: 3.25rem;
    }

    /* The two-factor reminder takes the logo's place (TwoFactorReminderBanner.razor.css): together they ran under
       the menu button. */
    .appUpperRow:has(.tfa-reminder) .appUpperLogo {
        display: none;
    }
}

/* The two-factor reminder in the top bar: its wrapper may shrink, so the text shortens instead of pushing the chip off
   the left edge under the menu button; and on a wide screen the 200px gap kept for the logo stays 200px (squeezed, it
   let the chip run over the logo) */
.appUpperRow > div:has(> .tfa-reminder-host) {
    min-width: 0;
}

.appUpperRow > div[style*="width: 200px"] {
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    /* Inner forms (popups such as New client) */
    .inner-form-window:not(.page-form-window) {
        display: flex;
        flex-direction: column;
    }

    .inner-form-window .card-header {
        flex-wrap: nowrap;
        padding-inline: 0.5rem;
    }

    /* Maximise is meaningless full screen; presence avatars take header room */
    .inner-form-window .card-header button:has(.fa-expand, .fa-compress),
    .inner-form-window .card-header .inner-form-presence {
        display: none !important;
    }

    .inner-form-window .inner-form-scroll {
        overflow-x: hidden;
        overflow-y: auto;
        padding-inline: 0.25rem;
        margin-top: 0.25rem !important;
        -webkit-overflow-scrolling: touch;
    }

    .inner-form-window .inner-form-content-wrapper {
        padding-right: 0 !important;
        width: 100% !important;
    }

    /* Card headers carrying buttons (address cards) wrap instead of overflowing */
    .inner-form-window .card-header span[style*="margin-left: auto"] {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    /* Thumb-sized inputs and save bar */
    .inner-form-window .dxbl-text-edit,
    .inner-form-window .dxbl-dropdown-edit,
    .inner-form-window .dxbl-combobox,
    .inner-form-window .dxbl-date-edit {
        min-height: 44px;
    }

    .innerform-savepanel button,
    .innerform-savepanel .dxbl-btn {
        min-height: 44px;
    }

    .innerform-savepanel {
        padding: 0.25rem 0.5rem;
    }

    /* Logo upload: whole zone is the tap target, drag hint is useless */
    .logo-drop-zone .drag-drop-hint {
        display: none;
    }

    .logo-drop-zone .avatar-button,
    .logo-drop-zone .avatar-rentangle {
        min-height: 64px;
    }
}

@media (max-width: 767.98px) {
    /* Tabs: compact two-level strip */
    .dxbl-tabs {
        --dxbl-tabs-font-size: 14px;
        --dxbl-tabs-tab-padding-x: 0.65rem;
        --dxbl-tabs-tab-padding-y: 0.25rem;
    }

    .dxbl-tabs-item,
    .dxbl-tabs-item .dxbl-text {
        font-size: 14px !important;
        line-height: 1.2;
    }

    .dxbl-tabs-item {
        min-height: 2.5rem;
        padding-block: 0.25rem;
        border-left-width: 2px !important;
    }

    .dxbl-tabs-tablist .dxbl-scroll-viewer-content {
        height: 2.5rem;
    }

    .dxbl-scroll-viewer-content ul {
        border-bottom-width: 3px !important;
    }

    .dxbl-tabs-content-panel {
        margin-top: 0.25rem !important;
    }

    /* Bottom bar: one row, equal thumb-sized buttons */
    .innerform-savepanel > [data-column-count] {
        flex-wrap: nowrap !important;
        justify-content: stretch;
        align-items: stretch;
        gap: 0.4rem;
    }

    .innerform-savepanel > [data-column-count] > * {
        flex: 1 1 0;
        min-width: 0;
    }

    .innerform-savepanel > [data-column-count] > div[style*="width: 10px"] {
        display: none;
    }

    /* An empty leading spacer (ImagePreviewInnerForm) takes no room; a leading Reports/Actions dropdown sizes like the rest */
    .innerform-savepanel > [data-column-count] > :first-child:empty:not(:only-child) {
        flex: 0 0 auto;
    }

    .innerform-savepanel button,
    .innerform-savepanel .dxbl-btn {
        font-size: 14px;
        padding-inline: 0.4rem;
        width: 100%;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    /* Bottom bar: every control the same width and height */
    .innerform-savepanel > [data-column-count] > :not(:first-child:empty:not(:only-child)),
    .innerform-savepanel > [data-column-count] > :only-child {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .innerform-savepanel .ButtonDropdown {
        display: flex !important;
        width: 100% !important;
        height: 44px;
    }

    .innerform-savepanel .ButtonDropdown .ButtonDropdownSide.OneClickAction {
        flex: 1 1 auto;
        justify-content: center;
    }

    .innerform-savepanel .ButtonDropdown p {
        margin: 0;
        font-size: 14px;
    }

    .innerform-savepanel .dxbl-btn,
    .innerform-savepanel button {
        height: 44px;
    }

    /* Tabs: a bit smaller again */
    .dxbl-tabs-item,
    .dxbl-tabs-item .dxbl-text {
        font-size: 13px !important;
    }

    .dxbl-tabs-item {
        min-height: 2.25rem;
        --dxbl-tabs-tab-padding-x: 0.5rem;
    }

    .dxbl-tabs-tablist .dxbl-scroll-viewer-content {
        height: 2.25rem;
    }
}

@media (max-width: 767.98px) {
    /* Tab picker (TabPicker.js): a marked strip shows only its active tab; a tap opens the list */
    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) button:not(.dxbl-tabs-item),
    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) .dxbl-btn:not(.dxbl-tabs-item) {
        display: none !important;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) .dxbl-scroll-viewer-content {
        height: auto !important;
        overflow: visible !important;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) ul {
        display: flex;
        flex-direction: column;
        border-bottom: 0 !important;
        padding: 0;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) li {
        position: relative;
        width: 100%;
        margin: 0 !important;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) li:not(:has(.dxbl-active)) {
        display: none;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) li::after {
        content: "\0025BE";
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #6b7280;
        pointer-events: none;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) .dxbl-tabs-item {
        width: 100% !important;
        box-sizing: border-box;
        min-height: 44px;
        justify-content: flex-start;
        border: 1px solid #1e9be9 !important;
        border-radius: 4px;
        background: #fff !important;
        color: #1e9be9 !important;
        font-weight: 600;
        font-size: 15px !important;
        padding-inline: 12px;
    }

    .dxbl-tabs-tablist:not(.dxbl-date-time-edit-tabs *):is([data-tab-picker], :has(ul > li:nth-child(2))) .dxbl-tabs-item::after {
        display: none !important;
    }

    /* Merged outer strip: hidden (by TabPicker.js) only while its first tab is active AND the inner
       strip that replaces it is actually laid out */
    .dxbl-tabs-tablist[data-tab-hide] {
        display: none !important;
    }

    .tab-picker-menu {
        position: fixed;
        inset: 0;
        z-index: 3000;
        background: rgba(0, 0, 0, 0.4);
        display: flex;
        align-items: flex-end;
    }

    .tab-picker-sheet {
        width: 100%;
        max-height: 80dvh;
        overflow-y: auto;
        background: #fff;
        border-radius: 12px 12px 0 0;
        padding: 6px 0 12px;
    }

    .tab-picker-sheet button {
        display: block;
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
        border: 0;
        border-bottom: 1px solid #f1f3f5;
        background: #fff;
        text-align: left;
        font-size: 15px;
        color: #212529;
    }

    .tab-picker-sheet button.active {
        color: #1e9be9;
        font-weight: 600;
    }

    .tab-picker-sheet button:disabled {
        color: #9c9ca6;
    }
}

@media (max-width: 767.98px) {
    /* Cards: values left-aligned like every other field, smaller action icons, clear expand arrow */
    tr[data-card-row] > td:not([data-card-util]),
    tr[data-card-row] > td:not([data-card-util]) * {
        text-align: left !important;
        justify-content: flex-start !important;
    }

    tr[data-card-row] > td[data-card-util] svg {
        width: 20px !important;
        height: 20px !important;
        padding: 10px;
    }

    tr[data-card-row] > td[data-card-util] {
        gap: 4px;
    }

    tr[data-card-row] > td[data-card-util] input[type="checkbox"],
    tr[data-card-row] > td[data-card-util] .dxbl-checkbox-check-element {
        width: 18px !important;
        height: 18px !important;
    }

    tr[data-card-row] > td[data-card-util] .dxbl-checkbox {
        padding: 12px;
    }

    tr[data-card-row][data-card-more]::after {
        font-size: 22px;
        line-height: 36px;
        font-weight: 700;
        background: #f3f9fe;
        border-radius: 0 0 6px 6px;
        margin: 6px -12px -10px;
        flex: 1 0 calc(100% + 24px);
    }

    /* The whole list page scrolls instead of clipping when cards are expanded */
    .MainFormContentHost .MainFormGridArea {
        overflow-y: auto !important;
    }

    /* List tree: hidden, opened as a full-screen overlay by PhoneListTree.js */
    [data-tree-pane]:not([data-tree-open]) {
        display: none !important;
    }

    [data-tree-pane][data-tree-open] {
        display: block !important;
        visibility: visible !important;
        transform: none !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-width: none !important;
        z-index: 2500;
        background: #fff;
        padding: 56px 8px 8px;
        box-sizing: border-box;
        overflow: auto;
    }

    [data-tree-pane][data-tree-open] .ListTemplateLeftPanel {
        max-height: none;
    }

    .phone-tree-toggle,
    .phone-tree-close {
        display: none;
        position: fixed;
        width: 48px;
        height: 48px;
        border-radius: 24px;
        border: 0;
        background: #1e9be9;
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        align-items: center;
        justify-content: center;
    }

    .phone-tree-toggle[data-show] {
        display: flex;
        left: 12px;
        bottom: 16px;
        z-index: 1200;
    }

    html[data-tree-overlay] .phone-tree-toggle {
        display: none;
    }

    html[data-tree-overlay] .phone-tree-close {
        display: flex;
        top: 8px;
        right: 8px;
        z-index: 2600;
    }
}

@media (max-width: 767.98px) {
    /* Yes/no columns: small checkbox on the same line as the name */
    tr[data-card-row] > td[data-card-bool] {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    tr[data-card-row] > td[data-card-bool]::before {
        display: inline !important;
        font-size: 13px;
        color: #374151;
    }

    tr[data-card-row] > td[data-card-bool] input[type="checkbox"],
    tr[data-card-row] > td[data-card-bool] .dxbl-checkbox-check-element {
        width: 16px !important;
        height: 16px !important;
    }

    tr[data-card-row] > td[data-card-bool] .dxbl-checkbox {
        padding: 0 !important;
        min-height: 0 !important;
    }
}

@media (max-width: 767.98px) {
    /* Empty action cells (list without edit/delete) take no room */
    tr[data-card-row] > td[data-card-util][data-card-blank] {
        display: none !important;
    }

    /* The list splitter's separator and collapse arrow are useless once the tree is an overlay */
    .ListFullWrapper [class*="splitter-sep"],
    .ListFullWrapper [class*="splitter-resiz"],
    .ListFullWrapper [class*="splitter-collapse"],
    .ListFullWrapper [class*="splitter-expand"],
    .ListFullWrapper [class*="splitter-gutter"] {
        display: none !important;
    }

    tr[data-card-row] > td[data-card-bool]::before {
        color: #6b7280;
    }
}

@media (max-width: 767.98px) {
    /* Spreadsheet tab: compact toolbar, thumb-sized equal Import / Export buttons, more sheet */
    .spreadsheet-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        padding: 0.5rem;
    }

    .spreadsheet-toolbar-icon,
    .spreadsheet-toolbar .spreadsheet-title {
        display: none !important;
    }

    .spreadsheet-toolbar-text .spreadsheet-subtitle {
        font-size: 13px;
    }

    .spreadsheet-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .spreadsheet-toolbar-actions .spreadsheet-action-button {
        min-height: 44px;
        width: 100%;
        font-size: 14px;
    }

    .spreadsheet-toolbar-actions .spreadsheet-autosave-status {
        grid-column: 1 / -1;
        justify-content: center;
        min-height: 1.25rem;
    }

    .spreadsheet-workspace {
        padding: 0.25rem;
    }

    .inner-form-window .spreadsheet-wrapper {
        min-height: 0;
        border-radius: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    /* Dashboard: one chart card per row, full width */
    .DashboardPanel {
        width: 100% !important;
        padding: 0.5rem;
    }

    .DashboardPanel .inputcard-contentspannedgroup {
        gap: 0.5rem;
    }

    .DashboardPanelItem {
        min-height: 300px;
        padding: 0.75rem;
    }

    /* Inline minimum widths that exceed a phone screen */
    [style*="min-width:500px"],
    [style*="min-width: 500px"],
    [style*="min-width:300px"],
    [style*="min-width: 300px"],
    [style*="min-width:260px"],
    [style*="min-width: 260px"],
    [style*="min-width:250px"],
    [style*="min-width: 250px"],
    [style*="min-width:230px"],
    [style*="min-width: 230px"],
    [style*="min-width:210px"],
    [style*="min-width: 210px"] {
        min-width: 0 !important;
    }

    /* DevExpress windows opened with a fixed pixel width */
    [class*="dxbl-window"],
    dxbl-window {
        max-width: 100vw !important;
        max-height: 100dvh !important;
    }

    /* Time tracker: stacked filters; the day matrix keeps its own sideways scroll */
    .tt-filter-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .tt-filter-buttons {
        margin-left: 0;
    }

    .tt-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .tt-scroll {
        max-height: calc(100dvh - 260px);
        min-height: 220px;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767.98px) {
    /* Kanban */
    .kanban-filter-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .kanban-filter-actions {
        flex-wrap: wrap;
    }

    .kanban-filter-summary {
        align-self: flex-start;
        white-space: normal;
    }

    .kanban-board {
        padding: 0.5rem;
        border-radius: 8px;
    }

    .kanban-swimlanes-scroll {
        padding-right: 0;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .kanban-column-draggable {
        cursor: default;
    }

    .kanban-col-grip {
        display: none;
    }

    /* Calendar */
    .SchedulerFilterFieldsPanel {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .ListTemplateFitlerPanelButtons {
        margin: 0 !important;
    }

    .scheduler-splitter-container,
    .demo-sc-size {
        min-height: 360px !important;
    }

    .demo-sc-size {
        height: calc(100dvh - 300px) !important;
    }
}

@media (max-width: 767.98px) {
    /* Kanban and Calendar declare their layout in a page <style> that loads after this file:
       these rules need !important / extra specificity to win. */
    .kanban-page .kanban-filter-panel,
    .kanban-filter-panel {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .kanban-page .kanban-filter-fields,
    .kanban-page .kanban-filter-secondary,
    .kanban-page .kanban-filter-actions {
        width: 100% !important;
        flex: 0 0 auto !important;
    }

    .kanban-page .kanban-filter-actions {
        flex-wrap: wrap !important;
        justify-content: flex-start;
    }

    .kanban-page .kanban-filter-checks label,
    .kanban-page .kanban-filter-checks {
        white-space: normal;
    }

    .SchedulerFilterFieldsPanel {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .SchedulerFilterFieldsPanel .ListTemplateFilterFieldsPanelControlWrapper {
        justify-content: flex-start !important;
    }

    .SchedulerFilterFieldsPanel .ListTemplateFitlerPanelButtons {
        margin: 0 !important;
        width: auto !important;
    }
}


@media (max-width: 767.98px) {
    /* Kanban and Calendar: only Raktas until the eye is opened */
    .kanban-page .kanban-filter-fields:has(.kanban-filter-secondary.FilterHidden) > [data-column-count]:first-child > :not(:first-child),
    .SchedulerFilterSelectionPanel:has(> .hidden) > [data-column-count]:first-child > :not(:first-child) {
        display: none !important;
    }
}

.calendar-week-strip {
    display: none;
}

@media (max-width: 767.98px) {
    .calendar-week-strip {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        margin: 0 0 0.5rem;
    }

    .calendar-week-strip button {
        min-height: 56px;
        padding: 2px 0;
        border: 1px solid #dfdfdf;
        border-radius: 8px;
        background: #fff;
        color: #212529;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }

    .calendar-week-strip button span:first-child {
        font-size: 11px;
        color: #6b7280;
        text-transform: capitalize;
    }

    .calendar-week-strip button b {
        font-size: 16px;
    }

    .calendar-week-strip button.today {
        border-color: #1e9be9;
        background: #e6f4fe;
        color: #1e9be9;
    }

    .calendar-week-strip .strip-dots {
        display: flex;
        gap: 2px;
        height: 6px;
    }

    .calendar-week-strip .appointment-dot {
        width: 6px;
        height: 6px;
        border-radius: 3px;
    }
}

@media (max-width: 767.98px) {
    /* Bottom bar, crowded forms (three or more drop-down buttons): two rows
       [?] [Reports] [Actions] / [  ] [Save] [Close], Save under Reports */
    .innerform-savepanel > [data-column-count]:has(> .ButtonDropdown ~ .ButtonDropdown ~ .ButtonDropdown) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.4rem;
        align-items: stretch;
    }

    .innerform-savepanel > [data-column-count]:has(> .ButtonDropdown ~ .ButtonDropdown ~ .ButtonDropdown):has(> div[style*="visibility"]) {
        grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) !important;
    }

    .innerform-savepanel > [data-column-count]:has(> .ButtonDropdown ~ .ButtonDropdown ~ .ButtonDropdown) > .ButtonDropdownGreen {
        grid-column: auto;
    }

    .innerform-savepanel > [data-column-count]:has(> .ButtonDropdown ~ .ButtonDropdown ~ .ButtonDropdown):has(> div[style*="visibility"]) > .ButtonDropdownGreen {
        grid-column: 2;
    }

    .innerform-savepanel > [data-column-count]:has(> .ButtonDropdown ~ .ButtonDropdown ~ .ButtonDropdown) > * {
        flex: none !important;
        min-width: 0 !important;
    }

    /* Drop-down buttons: label shrinks with an ellipsis, chevron never overlaps it */
    .innerform-savepanel .ButtonDropdown .ButtonDropdownSideText {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .innerform-savepanel .ButtonDropdown .ButtonDropdownSide.OneClickAction {
        min-width: 0;
        overflow: hidden;
    }

    .innerform-savepanel .ButtonDropdown .ButtonDropdownSide.MultipleSelectionAction {
        flex: 0 0 auto;
    }
}

@media (max-width: 767.98px) {
    /* Card grids: no header parts or other non-card rows left over (group, filter, summary) */
    .ui_dxdatagrid:has(tr[data-card-row]) thead,
    .ui_dxdatagrid:has(tr[data-card-row]) [class*="grid-header"]:not([class*="empty"]),
    .ui_dxdatagrid:has(tr[data-card-row]) tbody > tr:not([data-card-row]):not([class*="empty"]) {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    /* List action panel: the page's own controls (CustomActionPanel) get a full-width row below
       the built-in buttons instead of being squeezed beside them */
    .ListTemplateActionPanel {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .ListTemplateActionPanel .CustomActionPanel {
        order: 10;
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .ListTemplateActionPanel .CustomActionPanel > * {
        flex: 1 1 100%;
        min-width: 0;
    }

    .ListTemplateActionPanel .CustomActionPanel button {
        width: 100%;
        min-height: 44px;
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    /* The page's own action controls follow the filter eye: hidden while the filters are hidden */
    .ListTemplate:has(.ListTemplateFilterSelectionPanel.FiltersHidden) .ListTemplateActionPanel .CustomActionPanel {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    /* Hidden list filters: only the first control (the key / Raktas field) stays, however the
       page nests its filter groups */
    .ListTemplateFilterSelectionPanel.FiltersHidden [data-column-count] > :not(:first-child) {
        display: none !important;
    }
}

.phone-grid-new {
    display: none;
}

@media (max-width: 767.98px) {
    /* An empty custom-actions container must not become a second line of the list toolbar */
    .ListTemplateActionPanel .CustomActionPanel:not(:has(*)) {
        display: none !important;
    }

    .phone-grid-new[data-show] {
        display: flex;
        position: fixed;
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
        border: 0;
        border-radius: 28px;
        background: #1e9be9;
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        align-items: center;
        justify-content: center;
        z-index: 1200;
    }

    /* Inside a popup form the bottom bar takes the lowest part of the screen */
    .phone-grid-new[data-in-form] {
        bottom: 7.5rem;
        z-index: 3000;
    }
}

@media (max-width: 767.98px) {
    /* List toolbar: [Selected, print] [page's own controls] [columns], one line. The middle
       wrapper is always 100% wide, so a wrapping flex row pushed the right button to a second
       line. A grid keeps the three in one row; the page's controls drop to a row of their own
       only when they exist and the filters are open. */
    .ListTemplateActionPanel {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center;
        gap: 0.5rem !important;
    }

    .ListTemplateActionPanel > div:first-child {
        grid-column: 1;
    }

    .ListTemplateActionPanel > div:last-child {
        grid-column: 3;
        justify-self: end;
    }

    .ListTemplateActionPanel > div:nth-child(2) {
        width: auto !important;
        min-width: 0;
    }

    .ListTemplateActionPanel > div:nth-child(2):has(.CustomActionPanel > *) {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100% !important;
    }

    .ListTemplate:has(.ListTemplateFilterSelectionPanel.FiltersHidden) .ListTemplateActionPanel > div:nth-child(2) {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    /* Gantt (GanttViewOrder3): the page's own <style> loads after this file, hence !important */
    .SchedulerFilterFieldsPanel {
        overflow: visible !important;
        min-height: 0 !important;
    }

    .scheduler-main-container {
        min-height: 60dvh;
    }

    /* Graph panel: whole width, taller, list and chart stacked instead of side by side */
    .gantt-overlay-pane {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 75% !important;
        max-height: none !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .chart-overlay-splitter {
        flex-direction: column !important;
    }

    .chart-overlay-splitter > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

.ncp-switch {
    display: none;
}

@media (max-width: 767.98px) {
    /* NewConstructorProduct: the two 50% halves become one full-width half at a time */
    .ncp-switch {
        display: flex;
        margin: 0 0 0.5rem;
        border: 1px solid #1e9be9;
        border-radius: 6px;
        overflow: hidden;
        width: 100%;
    }

    .ncp-switch button {
        flex: 1 1 0;
        min-height: 44px;
        border: 0;
        background: #fff;
        color: #1e9be9;
        font-size: 15px;
        font-weight: 600;
    }

    .ncp-switch button + button {
        border-left: 1px solid #1e9be9;
    }

    .ncp-switch button.active {
        background: #1e9be9;
        color: #fff;
    }

    .ncp-splitter {
        flex-direction: column !important;
        height: auto !important;
    }

    .ncp-splitter > * {
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-width: 0 !important;
    }

    .ncp-splitter [class*="splitter-sep"],
    .ncp-splitter [class*="splitter-resiz"],
    .ncp-splitter [class*="splitter-collapse"],
    .ncp-splitter [class*="splitter-expand"] {
        display: none !important;
    }

    .ncp-pane-0 .ncp-right,
    .ncp-pane-1 .ncp-left {
        display: none !important;
    }

    .ncp-left,
    .ncp-right {
        min-height: 60dvh;
    }
}

@media (max-width: 767.98px) {
    /* Gantt graph panel: the chart keeps a usable height and the panel scrolls */
    .chart-overlay-splitter {
        overflow-y: auto !important;
    }

    .chart-visual-host {
        min-height: 240px !important;
    }
}

@media (max-width: 767.98px) {
    /* Gantt graph panel as a full-screen sheet under the top bar: chart first, list below, one
       scroll. It was an absolutely placed 75% box inside the page, so it hid the schedule,
       left the chart a thin strip and could sit below the visible screen. */
    .gantt-overlay-pane {
        position: fixed !important;
        top: 50px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        z-index: 2000 !important;
        border-radius: 0 !important;
    }

    .gantt-overlay-pane .chart-content-pane {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chart-overlay-splitter {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
        flex: 0 0 auto !important;
    }

    .chart-overlay-splitter > :has(.chart-visual-host) {
        order: -1;
        height: 300px !important;
    }

    .chart-visual-host {
        min-height: 280px !important;
    }
}

@media (max-width: 767.98px) {
    /* Gantt graph sheet: no splitter arrow/bar (it collapses the list pane to a blank area) and
       no drag grip (the sheet is full screen) */
    .chart-overlay-splitter [class*="splitter-sep"],
    .chart-overlay-splitter [class*="splitter-resiz"],
    .chart-overlay-splitter [class*="splitter-collapse"],
    .chart-overlay-splitter [class*="splitter-expand"],
    .chart-overlay-splitter [class*="splitter-gutter"],
    .gantt-overlay-resize-handle {
        display: none !important;
    }

    .chart-overlay-splitter > * {
        display: block;
    }
}

@media (max-width: 767.98px) {
    /* Gantt graph sheet, final sizing: the chart takes whatever the list does not need, so the
       sheet has no empty band at the bottom; a long list scrolls inside its own half */
    .gantt-overlay-pane .chart-content-pane {
        overflow: hidden !important;
    }

    .chart-overlay-splitter {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .chart-overlay-splitter > :has(.chart-visual-host) {
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 260px !important;
        order: -1;
    }

    .chart-overlay-splitter > :not(:has(.chart-visual-host)) {
        flex: 0 1 auto !important;
        max-height: 50% !important;
        overflow-y: auto !important;
    }

    .chart-visual-host {
        height: 100% !important;
        min-height: 260px !important;
    }
}

@media (max-width: 767.98px) {
    /* Gantt graph sheet: the chart needs a definite height (it drew itself taller than its
       flex-stretched pane and lost its bottom axis); the list takes and scrolls the rest */
    .chart-overlay-splitter > :has(.chart-visual-host) {
        flex: 0 0 auto !important;
        height: 45dvh !important;
        min-height: 260px !important;
    }

    .chart-overlay-splitter > :not(:has(.chart-visual-host)) {
        flex: 1 1 auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 767.98px) {
    /* Time tracker: narrow employee column and slim day columns, so more days fit on screen;
       the Darbuotojas filter drop-down is hidden (only the key field stays) */
    .tt-grid .tt-c2 {
        left: 36px;
        width: 90px;
        min-width: 90px;
    }

    .tt-filter-panel [data-column-count] > :not(:first-child) {
        display: none !important;
    }

    .tt-grid .tt-c1 {
        width: 36px;
        min-width: 36px;
    }

    .tt-grid .tt-day,
    .tt-grid .tt-cell {
        width: 30px;
        min-width: 30px;
        padding-inline: 0;
    }

    .tt-grid {
        font-size: 10px;
    }

    .tt-grid .tt-sum {
        width: 44px;
        min-width: 44px;
    }
}

@media (max-width: 767.98px) {
    /* Time tracker: the sum columns scroll with the days (the header cells kept their right
       offset because .tt-grid thead th is more specific than the earlier rule); the tab-number
       column is dropped and the day columns slimmed, about 13 days fit across */
    .tt-grid thead th.tt-sticky-r,
    .tt-grid .tt-r1,
    .tt-grid .tt-r2 {
        position: static !important;
        right: auto !important;
    }

    .tt-grid thead th.tt-sticky-r {
        position: sticky !important;
        top: 0;
    }

    .tt-grid .tt-c1 {
        display: none;
    }

    .tt-grid .tt-c2 {
        left: 0;
        width: 80px;
        min-width: 80px;
    }

    .tt-grid .tt-day,
    .tt-grid .tt-cell {
        width: 24px;
        min-width: 24px;
    }

    .tt-grid .tt-sum {
        width: 40px;
        min-width: 40px;
    }
}

/* Phone filter panel, as in the Calendar: with the filters hidden, the button and the eye sit in the "Raktas" row;
   with them open, they sit under the fields, left-aligned. */
@media (max-width: 767.98px) {
    .ListTemplateFilterFieldsPanel > .ListTemplateFilterFieldsPanelControlWrapper {
        width: auto !important;
        justify-content: flex-start !important;
        align-items: center;
        margin-top: 0.5rem;
    }

    .ListTemplateFilterFieldsPanel:has(.ListTemplateFilterSelectionPanel.FiltersHidden) {
        position: relative;
    }

    .ListTemplateFilterFieldsPanel:has(.ListTemplateFilterSelectionPanel.FiltersHidden) > .ListTemplateFilterFieldsPanelControlWrapper {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        margin-top: 0;
        z-index: 2;
    }

    /* Room for the buttons beside the first field only; the rest keep the full width. */
    .ListTemplateFilterSelectionPanel.FiltersHidden > [data-column-count]:first-of-type > :first-child {
        margin-right: 8.75rem !important;
        max-width: calc(100% - 8.75rem) !important;
        box-sizing: border-box;
    }
}

/* Phone: a yes/no column's long caption wraps next to its checkbox instead of being cut off in the opened card. */
@media (max-width: 767.98px) {
    tr[data-card-row] > td[data-card-bool] {
        flex: 1 1 100%;
        overflow: visible !important;
        white-space: normal !important;
    }

    tr[data-card-row] > td[data-card-bool]::before {
        flex: 1 1 auto;
        min-width: 0;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
}

/* Config window: settings hub (Config.razor) */
.cfg-hub { padding: 6px 4px 0; display: flex; flex-direction: column; gap: 18px; }
.cfg-hub__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cfg-hub__head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.cfg-hub__head p { margin: 4px 0 0; color: #5b6472; font-size: 13px; }
.cfg-hub__search { width: 340px; height: 40px; box-sizing: border-box; border: 1px solid #dee2e6; border-radius: 8px; padding: 0 14px; background: #fff; color: #212529; font: inherit; }
.cfg-hub__search:focus { outline: 2px solid var(--action-primary); outline-offset: 1px; }
.cfg-group { display: flex; flex-direction: column; gap: 6px; }
.cfg-group__title { font-size: 11px; font-weight: 600; color: #5b6472; text-transform: uppercase; letter-spacing: .05em; }
.cfg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cfg-tile { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #dfdfdf; border-radius: 10px; background: #fff; color: #212529; font: inherit; text-align: left; cursor: pointer; }
.cfg-tile:hover { border-color: var(--action-primary); box-shadow: 0 2px 10px rgba(13, 110, 253, .12); }
.cfg-tile b { display: block; font-weight: 600; }
.cfg-tile__desc { display: block; margin-top: 2px; font-size: 12px; color: #5b6472; }
.cfg-tile__icon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cfg-tile__icon--0 { background: #e7f0ff; color: #0b5ed7; }
.cfg-tile__icon--1 { background: #fff0d6; color: #8a5a00; }
.cfg-tile__icon--2 { background: #d9f2e4; color: #146c43; }
.cfg-tile__icon--3 { background: #efe3fb; color: #6f42c1; }
.cfg-tile__icon--4 { background: #eef1f5; color: #495057; }
.cfg-pagehead { display: flex; align-items: center; gap: 14px; padding: 4px 4px 12px; font-size: 16px; }
.cfg-back { height: 32px; padding: 0 12px; border: 1px solid #dee2e6; border-radius: 6px; background: #f3f5f8; color: #212529; font: inherit; font-size: 13px; cursor: pointer; }
.cfg-back:hover { background: #e5eaf0; }
.cfg-page .dxbl-tabs-tablist { display: none !important; }
html.erp-dark .cfg-hub__head p, html.erp-dark .cfg-group__title, html.erp-dark .cfg-tile__desc { color: var(--erp-text-muted); }
html.erp-dark .cfg-hub__search { background: var(--erp-surface); border-color: var(--erp-border-editor); color: var(--erp-text); }
html.erp-dark .cfg-tile { background: var(--erp-strip); border-color: var(--erp-border); color: var(--erp-text); }
html.erp-dark .cfg-tile:hover { border-color: var(--action-primary); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
html.erp-dark .cfg-tile__icon--0 { background: rgba(76,157,255,.18); color: #8bbcff; }
html.erp-dark .cfg-tile__icon--1 { background: rgba(240,163,71,.18); color: #f0c27a; }
html.erp-dark .cfg-tile__icon--2 { background: rgba(47,174,110,.18); color: #6fd3a0; }
html.erp-dark .cfg-tile__icon--3 { background: rgba(160,120,230,.2); color: #c9a8f5; }
html.erp-dark .cfg-tile__icon--4 { background: var(--erp-hover-neutral); color: var(--erp-text-muted); }
html.erp-dark .cfg-back { background: var(--erp-hover-neutral); border-color: var(--erp-border-editor); color: var(--erp-text); }
html.erp-dark .cfg-back:hover { background: var(--erp-selected); }

/* The window's own scroll area scrolls the tiles, so they reach down to the save bar at any window height */
.cfg-hub { padding-right: 8px; }

/* Config pages (inside .cfg-page): sections as cards, inputs in a grid, options as switch rows */
.cfg-page .card { border: 1px solid #dfdfdf; border-radius: 10px; background: #fff; box-shadow: none; margin-bottom: 14px; }
.cfg-page .card .card-content-wrapper { padding: 14px 16px !important; }
.cfg-page .card-subtitle { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: #5b6472 !important; text-transform: uppercase; letter-spacing: .05em; }
.cfg-page .inputcard-contentspannedgroup { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; gap: 14px 20px !important; align-items: start !important; }
.cfg-page .inputcard-contentspannedgroup .inputcard-contentspannedgroup { grid-column: 1 / -1; }
.cfg-page .inputcard-contentspannedgroup > * { min-width: 0; }
.cfg-page .cw-320, .cfg-page .XLookUpEdit, .cfg-page .XTextEdit, .cfg-page .XMemo { width: 100% !important; max-width: none !important; }
/* options: one row each, after the inputs, label left, switch right */
.cfg-page .inputcard-contentspannedgroup > div:has(> chbox) { order: 5; grid-column: 1 / -1; display: block !important; width: 100%; border-top: 1px solid #eef1f5; }
.cfg-page .inputcard-contentspannedgroup > div:has(> chbox) > chbox { display: flex !important; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 40px; cursor: pointer; }
.cfg-page .inputcard-contentspannedgroup > div:has(> chbox):hover { background: #f8f9fa; }
.cfg-page chbox .dxbl-checkbox-check-element { position: relative; flex: 0 0 auto; width: 38px !important; height: 22px !important; border: 0 !important; border-radius: 999px !important; background: #ced4da !important; transition: background .15s ease; }
.cfg-page chbox .dxbl-checkbox-check-element::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s ease; }
.cfg-page chbox.dxbl-checkbox-checked .dxbl-checkbox-check-element { background: var(--action-primary) !important; }
.cfg-page chbox.dxbl-checkbox-checked .dxbl-checkbox-check-element::after { transform: translateX(16px); }
.cfg-page chbox .dxbl-checkbox-check-element .dxbl-image { display: none !important; }
.cfg-page chbox .dxbl-text { margin: 0 !important; flex: 1 1 auto; }
html.erp-dark .cfg-page .card { background: var(--erp-strip); border-color: var(--erp-border); }
html.erp-dark .cfg-page .card-subtitle { color: var(--erp-text-muted) !important; }
html.erp-dark .cfg-page .inputcard-contentspannedgroup > div:has(> chbox) { border-top-color: var(--erp-border); }
html.erp-dark .cfg-page .inputcard-contentspannedgroup > div:has(> chbox):hover { background: var(--erp-hover); }
html.erp-dark .cfg-page chbox .dxbl-checkbox-check-element { background: #4a505c !important; }
html.erp-dark .cfg-page chbox.dxbl-checkbox-checked .dxbl-checkbox-check-element { background: var(--action-primary) !important; }

/* A group that holds the section cards is a plain stack, not an input grid (it made gaps between cards). */
.cfg-page .inputcard-contentspannedgroup:has(> .card) { display: flex !important; flex-direction: column !important; gap: 0 !important; grid-template-columns: none !important; align-items: stretch !important; }
.cfg-page .card { min-width: 0 !important; width: 100%; box-sizing: border-box; }

/* app.css paints every checkbox ::after in the accent colour; on a switch that hid the knob */
.cfg-page chbox .dxbl-checkbox-check-element::after { background-color: #fff !important; }

/* Rivile object popup: sectioned cards, two columns, roomy spacing (design A) */
.rivile-object-form { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px; }
.rivile-object-form .card { border: 1px solid #dee2e6; border-radius: 4px; background: #fff; box-shadow: none; margin: 0; }
.rivile-object-form .card-content-wrapper { padding: 18px 20px 20px !important; }
.rivile-object-form .card-subtitle { font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #343a40 !important; padding-bottom: 12px; margin: 0 0 16px; border-bottom: 1px solid #e9ecef; }
.rivile-object-form .card-content-wrapper > * + * { margin-top: 16px; }
.rivile-object-form .inputcard-contentspannedgroup { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px 20px !important; padding: 0 !important; }
.rivile-object-form .inputcard-contentspannedgroup[data-column-count="1"] { grid-template-columns: minmax(0, 1fr) !important; }
.rivile-object-form .inputcard-contentspannedgroup > * { width: 100%; min-width: 0; }
html.erp-dark .rivile-object-form .card { background: var(--erp-strip); border-color: var(--erp-border); }
html.erp-dark .rivile-object-form .card-subtitle { color: var(--erp-text) !important; border-bottom-color: var(--erp-border); }

/* Config groups: two columns (a group that asks for more gets them), and groups that follow each other keep a gap */
.cfg-page .inputcard-contentspannedgroup { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.cfg-page .inputcard-contentspannedgroup[data-column-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.cfg-page .inputcard-contentspannedgroup[data-column-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.cfg-page .inputcard-contentspannedgroup[data-column-count="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.cfg-page .inputcard-contentspannedgroup + .inputcard-contentspannedgroup { margin-top: 14px; }
.cfg-page .inputcard-contentspannedgroup:has(> .card) { grid-template-columns: none !important; }

/* A group that keeps its controls in the order they are written (switch, then the list it controls) */
.cfg-page .cfg-seq { grid-template-columns: minmax(0, 1fr) !important; }
.cfg-page .cfg-seq > *, .cfg-page .cfg-seq > div:has(> chbox) { order: 0 !important; }

@media (max-width: 767.98px) {
    .cfg-hub__head { flex-direction: column; align-items: stretch; gap: 12px; }
    .cfg-hub__head > div { width: 100%; }
    .cfg-hub__search { width: 100%; height: 48px; font-size: 16px; }
    .cfg-hub { max-height: none; overflow: visible; padding-right: 4px; }
}

/* Settings page header, phone: the back button stays on one line and tall enough for its text */
@media (max-width: 767.98px) {
    .cfg-back { flex: none; height: auto; min-height: 44px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
}

@media (max-width: 760px) { .cfg-page .inputcard-contentspannedgroup:not(:has(> .card)) { grid-template-columns: minmax(0, 1fr) !important; } }

/* ErrorRetryContent: what a boundary shows once its automatic retries have run out */
.error-retry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin: 4px 0; pointer-events: all;
    border: 1px solid var(--terra-danger, #d9534f); border-radius: 6px; background: var(--terra-danger-bg, #fdf1f1); color: var(--terra-text-primary, #212529); }
.error-retry-button { min-height: 32px; padding: 0 12px; border: 1px solid var(--terra-border, #c8c8c8); border-radius: 6px;
    background: var(--terra-bg-surface, #fff); color: inherit; cursor: pointer; }
.error-retry-button:hover { border-color: var(--action-primary, #5c2d91); }
.error-retry-button:focus-visible { outline: 2px solid var(--action-primary, #5c2d91); outline-offset: 2px; }
.error-retry-details { flex-basis: 100%; font-size: 12px; user-select: text; }
