/* CraftGrid One — header polish v1.
   Presentation-only overrides for the shared authenticated header.
   Preserves existing navigation, claims, search, trial status and account behavior. */

.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    min-width: 0;
}

/* Give the logo and wordmark a stable, calm silhouette. */
.craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-grid-mark {
    flex: 0 0 34px;
    border: 1px solid rgba(213, 231, 249, .15) !important;
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035)) !important;
    box-shadow: 0 2px 7px rgba(3, 18, 36, .12) !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-copy {
    flex: 0 0 auto;
    min-width: 0;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-copy strong {
    letter-spacing: -.035em;
    text-rendering: geometricPrecision;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-copy small {
    color: rgba(218, 232, 246, .65) !important;
    letter-spacing: .095em;
    white-space: nowrap;
}

/* ERP is a quiet product-type tag, not a second logo or primary action. */
.craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-erp-badge {
    flex: 0 0 auto;
    align-self: center;
    margin: 0 5px 0 1px !important;
    padding: 3px 6px !important;
    min-height: 18px;
    border: 1px solid rgba(209, 229, 248, .20) !important;
    border-radius: 6px !important;
    background: rgba(219, 235, 250, .075) !important;
    color: rgba(232, 243, 252, .82) !important;
    box-shadow: none !important;
    font-size: .54rem !important;
    font-weight: 700 !important;
    letter-spacing: .09em !important;
    line-height: 1 !important;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease;
}

.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand:hover .cg-brand-erp-badge,
.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand:focus-visible .cg-brand-erp-badge {
    background: rgba(219, 235, 250, .12) !important;
    border-color: rgba(209, 229, 248, .30) !important;
}

/* Replace the text pipe with a consistent hairline, and give the workspace
   context enough separation to read as a second level of information. */
.craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-divider {
    display: inline-block !important;
    flex: 0 0 1px;
    width: 1px;
    height: 24px;
    margin-inline: 7px 9px !important;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 1px;
    background: linear-gradient(180deg, rgba(220, 235, 249, .12), rgba(220, 235, 249, .58), rgba(220, 235, 249, .12));
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-name {
    display: inline-block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: clamp(130px, 20vw, 330px) !important;
    margin: 0 2px 0 0;
    overflow: hidden;
    color: rgba(241, 247, 255, .88) !important;
    font-size: .81rem !important;
    font-weight: 500 !important;
    letter-spacing: .005em !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Trial countdown remains highly legible, with less visual weight and glow. */
.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill {
    flex: 0 0 auto;
    min-height: 31px !important;
    margin-left: 7px !important;
    padding: 5px 10px !important;
    border-color: rgba(229, 192, 85, .83) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #fff7dc 0%, #ffefbb 100%) !important;
    color: #33445a !important;
    box-shadow: 0 1px 4px rgba(9, 28, 49, .10) !important;
    font-size: 10px !important;
    font-weight: 650 !important;
    letter-spacing: .005em !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill > i {
    color: #92701a !important;
    font-size: 11px !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-subscription-badge {
    margin-left: 7px !important;
    border-radius: 999px !important;
    box-shadow: 0 1px 4px rgba(9, 28, 49, .08) !important;
}

/* Wider desktop: keep the header cluster balanced and stop long tenant names
   from pushing global search and account controls out of alignment. */
@media (min-width: 1200px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand {
        gap: 8px !important;
        padding-inline: 1px;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-name {
        max-width: clamp(150px, 19vw, 330px) !important;
    }
}

/* Compact laptops: retain the information hierarchy while protecting search. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand {
        gap: 6px !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-divider {
        margin-inline: 4px 6px !important;
        height: 21px;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-name {
        max-width: clamp(100px, 14vw, 170px) !important;
        font-size: .76rem !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-erp-badge {
        margin-right: 2px !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill,
    .craftgrid-authenticated-shell .craftgrid-topbar .cg-subscription-badge {
        margin-left: 3px !important;
    }
}

/* Tablets keep the same hierarchy without over-constraining the logo. */
@media (min-width: 576px) and (max-width: 991.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand {
        gap: 7px !important;
        max-width: calc(100vw - 245px);
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-divider {
        margin-inline: 4px 6px !important;
        height: 20px;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-company-context-name {
        max-width: 24vw !important;
        font-size: .75rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-erp-badge {
        transition: none !important;
    }
}


/* v2 — real header hierarchy. The workspace/context is now a sibling of the
   logo link (not part of the clickable brand anchor), so each element gets a
   deliberate layout slot and cannot make the brand region look crowded. */
.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand {
    flex: 0 0 auto !important;
    gap: 7px !important;
    margin-right: 7px !important;
    padding-inline: 0 !important;
    text-decoration: none !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-brand-erp-badge {
    align-self: center;
    margin: 0 0 0 2px !important;
    padding: 3px 6px !important;
    border: 1px solid rgba(200, 223, 244, .22) !important;
    border-radius: 6px !important;
    background: rgba(215, 233, 250, .07) !important;
    color: rgba(229, 241, 252, .78) !important;
    font-size: .52rem !important;
    letter-spacing: .08em !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 8px;
    min-width: 0;
    max-width: clamp(170px, 19vw, 310px);
    height: 34px;
    margin: 0 9px 0 1px;
    padding: 0 11px 0 10px;
    border: 1px solid rgba(217, 234, 249, .12);
    border-radius: 9px;
    background: rgba(255, 255, 255, .035);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    color: rgba(236, 245, 253, .88);
}

/* The icon replaces the old text pipe as the visual cue for workspace context. */
.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
    display: none !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context > i {
    flex: 0 0 auto;
    width: 15px;
    color: #8ab8d7;
    font-size: 12px;
    text-align: center;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden;
    color: rgba(236, 245, 253, .90) !important;
    font-size: .78rem !important;
    font-weight: 550 !important;
    letter-spacing: .005em !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context + .cg-trial-header-pill,
.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context + .cg-subscription-badge {
    margin-left: 1px !important;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand {
        gap: 6px !important;
        margin-right: 4px !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
        max-width: clamp(130px, 16vw, 190px);
        gap: 6px;
        margin-right: 5px;
        padding-inline: 8px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
        max-width: 22vw;
        height: 31px;
        gap: 6px;
        margin-inline: 2px 5px;
        padding-inline: 7px;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
        font-size: .72rem !important;
    }
}

@media (max-width: 767.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
        display: none !important;
    }
}

/* v3 — shared, balanced header layout for Platform Admin and Tenant Admin.
   Keep logo/context together on the left, and trial/search/notifications together
   as a right-aligned tools group. Presentation only; existing routes and actions remain. */
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 300px);
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-mobile-menu {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    margin: 0 12px 0 0 !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    gap: 9px !important;
    margin: 0 12px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-grid-mark {
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 5px !important;
    border-radius: 9px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    overflow: visible !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy strong {
    font-size: 1.02rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy small {
    margin-top: 2px !important;
    font-size: .50rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-erp-badge {
    flex: 0 0 auto !important;
    margin: 0 0 0 1px !important;
    padding: 3px 6px !important;
    border: 1px solid rgba(200, 223, 244, .24) !important;
    border-radius: 6px !important;
    background: rgba(215, 233, 250, .075) !important;
    color: rgba(229, 241, 252, .82) !important;
    font-size: .52rem !important;
    letter-spacing: .07em !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: clamp(185px, 23vw, 370px) !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid rgba(217, 234, 249, .16) !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, .045) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
    color: rgba(236, 245, 253, .90) !important;
    overflow: hidden !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
    display: none !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context > i {
    flex: 0 0 15px !important;
    width: 15px !important;
    color: #9cc5e0 !important;
    font-size: 12px !important;
    text-align: center !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
    display: block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    color: rgba(239, 247, 255, .93) !important;
    font-size: .78rem !important;
    font-weight: 600 !important;
    letter-spacing: .005em !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    gap: 12px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-trial-header-pill,
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-subscription-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-trial-header-pill {
    min-height: 36px !important;
    padding: 6px 13px !important;
    border-color: rgba(229, 192, 85, .86) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #fff8e0 0%, #ffefbf 100%) !important;
    color: #33445a !important;
    box-shadow: 0 1px 3px rgba(9, 28, 49, .09) !important;
    font-size: .70rem !important;
    font-weight: 650 !important;
    letter-spacing: .005em !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-trial-header-pill > i {
    margin-right: 5px !important;
    color: #92701a !important;
    font-size: 12px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
    display: block !important;
    flex: 0 1 520px !important;
    width: clamp(265px, 31vw, 520px) !important;
    min-width: 245px !important;
    max-width: 520px !important;
    margin: 0 !important;
    align-self: center !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search .cg-global-search-bar {
    width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .vr {
    height: 25px;
    margin-inline: 4px !important;
    opacity: .35;
}

/* Compact laptop: preserve all items but shrink the context and search gently. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        max-width: calc(100% - 270px) !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
        max-width: clamp(125px, 16vw, 185px) !important;
        gap: 6px !important;
        padding-inline: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        gap: 6px !important;
        margin-right: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        gap: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex-basis: 320px !important;
        width: clamp(210px, 25vw, 320px) !important;
        min-width: 210px !important;
    }
}

/* Tablets retain one compact row; the workspace label disappears below md. */
@media (min-width: 576px) and (max-width: 991.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
        gap: 0 !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        flex: 1 1 auto !important;
        max-width: none !important;
        margin-right: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-mobile-menu {
        margin-right: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        gap: 7px !important;
        margin-right: 0 !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        flex: 0 0 auto !important;
        gap: 6px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
}

/* Phones: logo stays left; search trigger, notifications and profile stay right. */
@media (max-width: 575.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        overflow: visible !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        flex: 1 1 auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin-right: 4px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-mobile-menu {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        margin-right: 7px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 145px !important;
        gap: 6px !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-grid-mark {
        flex: 0 0 32px !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy strong {
        font-size: .94rem !important;
        letter-spacing: -.04em !important;
        white-space: nowrap !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy small,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-erp-badge {
        display: none !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin-left: auto !important;
        gap: 4px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        margin: 0 !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster .cg-global-search-mobile-trigger,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-icon-button,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-user-button {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions {
        flex: 0 0 auto !important;
        margin: 0 !important;
        gap: 4px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .vr {
        display: none !important;
    }
}

@media (max-width: 359.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        max-width: 130px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-mobile-menu {
        flex-basis: 34px !important;
        width: 34px !important;
        min-width: 34px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster .cg-global-search-mobile-trigger,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-icon-button,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-user-button {
        flex-basis: 34px !important;
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
    }
}

@media (max-width: 767.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
        display: none !important;
    }
}


/* v4 — keep the shared header aligned for Platform Admin and Tenant Admin;
   show account identity and a dedicated, CSRF-protected sign-out action. */
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: min(58%, 760px) !important;
    justify-content: flex-start !important;
    align-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    gap: 10px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
    flex: 1 1 420px !important;
    width: clamp(220px, 29vw, 500px) !important;
    min-width: 210px !important;
    max-width: 500px !important;
    margin: 0 !important;
}

/* Compact identity chip: platform sign-in is no longer represented by only the
   small avatar at the bottom of the navigation rail. */
/* Sign-out is intentionally explicit but restrained: a soft rose accent is
   visible on the navy header without competing with the workspace/trial pills. */
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-form {
    display: flex;
    flex: 0 0 auto;
    margin: 0;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    min-width: 42px;
    height: 40px;
    min-height: 40px;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid rgba(255, 179, 179, .35) !important;
    border-radius: 11px !important;
    background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)) !important;
    color: #f9e5e5 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 2px 6px rgba(5, 19, 34, .08) !important;
    font-size: .74rem !important;
    font-weight: 650 !important;
    white-space: nowrap !important;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button > i {
    color: #ffc3c6;
    font-size: 15px;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button:hover {
    border-color: rgba(255, 163, 168, .72) !important;
    background: linear-gradient(180deg, rgba(198, 55, 67, .28), rgba(153, 35, 49, .20)) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button:focus-visible {
    outline: 2px solid #ffe2a5 !important;
    outline-offset: 2px !important;
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-label {
        display: none;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        width: 40px;
        padding: 0 !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        gap: 8px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        width: clamp(215px, 25vw, 360px) !important;
        min-width: 205px !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        max-width: 52% !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
        max-width: 165px !important;
        padding-inline: 8px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        gap: 6px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        width: 220px !important;
        min-width: 190px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-label {
        display: none;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0 !important;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-label {
        display: none;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0 !important;
    }
}

@media (max-width: 575.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-label {
        display: none;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0 !important;
    }
}

@media (max-width: 359.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        transition: none !important;
    }
}

/* v4 responsive guardrails: the final desktop rules above must not override
   the original icon-only search controls on tablet/mobile. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        max-width: 56% !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 1 1 300px !important;
        width: clamp(230px, 25vw, 360px) !important;
        min-width: 220px !important;
        max-width: 360px !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        max-width: 52% !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        flex: 1 1 auto !important;
        gap: 6px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 1 1 220px !important;
        width: 220px !important;
        min-width: 190px !important;
        max-width: 240px !important;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        flex: 1 1 auto !important;
        max-width: none !important;
        margin-right: 8px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        gap: 6px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
}

@media (max-width: 575.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
        flex-wrap: nowrap !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster {
        flex: 1 1 auto !important;
        max-width: none !important;
        margin-right: 4px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-mobile-menu {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        margin-right: 7px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 145px !important;
        gap: 6px !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-grid-mark {
        flex: 0 0 32px !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy strong {
        font-size: .94rem !important;
        white-space: nowrap !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy small,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-erp-badge {
        display: none !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin-left: auto !important;
        gap: 4px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions {
        flex: 0 0 auto !important;
        gap: 4px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .vr {
        display: none !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-icon-button,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-user-button,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 !important;
    }
}

@media (max-width: 359.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-layout {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-mobile-menu {
        flex-basis: 32px !important;
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        margin-right: 5px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        max-width: 118px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-grid-mark {
        flex-basis: 29px !important;
        width: 29px !important;
        height: 29px !important;
        min-width: 29px !important;
    }
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-icon-button,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-actions .craftgrid-user-button,
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .cg-header-signout-button {
        flex-basis: 32px !important;
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
    }
}

/* 1200–1399px: keep a visible signed-in indicator while using an avatar-only
   capsule to preserve room for tenant context, trial status, and global search. */


/* v5 — final brand/context refinement requested after live review.
   The signed-in identity remains in the sidebar profile; the header keeps a dedicated sign-out action.
   Workspace/company text is plain header text, not a bordered capsule. */
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-header-account-summary {
    display: none !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: clamp(150px, 23vw, 380px) !important;
    height: auto !important;
    margin: 0 12px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
    color: rgba(236, 245, 253, .90) !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
    display: inline-block !important;
    flex: 0 0 1px !important;
    width: 1px !important;
    height: 23px !important;
    margin: 0 13px 0 1px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 1px !important;
    background: linear-gradient(180deg, rgba(220, 235, 249, .12), rgba(220, 235, 249, .62), rgba(220, 235, 249, .12)) !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Plain text context is intentional; avoid a second badge beside the ERP tag. */
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context > i {
    display: none !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
    display: block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: rgba(239, 247, 255, .93) !important;
    font-size: .79rem !important;
    font-weight: 550 !important;
    letter-spacing: .005em !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

@media (max-width: 767.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
        display: none !important;
    }
}


/* v6 — improve readability and breathing room for brand/workspace text.
   The workspace remains plain text (not a capsule); reserve enough room for
   longer company names by slightly reducing search width on wide desktops. */
body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
    gap: 11px !important;
    margin-right: 16px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy {
    margin-left: 2px !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy strong {
    font-size: 1.06rem !important;
    letter-spacing: -.028em !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .16);
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand .cg-brand-copy small {
    color: rgba(237, 246, 255, .82) !important;
    font-size: .52rem !important;
    letter-spacing: .10em !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
    margin-left: 4px !important;
    margin-right: 12px !important;
    max-width: clamp(240px, 24vw, 400px) !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
    height: 25px !important;
    margin: 0 20px 0 1px !important;
    background: linear-gradient(180deg, rgba(220, 235, 249, .20), rgba(241, 248, 255, .78), rgba(220, 235, 249, .20)) !important;
}

body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
    color: #f8fbff !important;
    font-size: .84rem !important;
    font-weight: 650 !important;
    letter-spacing: .008em !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .14);
}

/* Give the full company name more room without letting search dominate. */
@media (min-width: 1400px) and (max-width: 1919.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-right-cluster > .cg-header-global-search {
        flex: 0 1 450px !important;
        width: clamp(280px, 27vw, 470px) !important;
        min-width: 280px !important;
        max-width: 470px !important;
    }
}

/* Tablet layout stays compact, while keeping workspace text readable. */
@media (min-width: 768px) and (max-width: 991.98px) {
    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster > .craftgrid-brand {
        gap: 8px !important;
        margin-right: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-left-cluster .cg-topbar-workspace-context {
        margin-left: 2px !important;
        margin-right: 5px !important;
        max-width: 22vw !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
        margin-right: 8px !important;
    }

    body.craftgrid-authenticated-shell:not(.craftgrid-login-layout) .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
        font-size: .76rem !important;
    }
}

/* v3 — shared plain-text workspace context for both Platform Admin and Tenant Admin.
   Keep the label clear and slightly to the right of the ERP badge, without a capsule. */
.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    gap: 0 !important;
    min-width: 0 !important;
    max-width: clamp(180px, 24vw, 360px) !important;
    height: auto !important;
    margin: 0 12px 0 5px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(241, 247, 255, .92) !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
    display: inline-block !important;
    flex: 0 0 1px !important;
    width: 1px !important;
    height: 23px !important;
    margin: 0 15px 0 9px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 1px !important;
    background: linear-gradient(180deg, rgba(220, 235, 249, .12), rgba(220, 235, 249, .58), rgba(220, 235, 249, .12)) !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context > i {
    display: none !important;
}

.craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
    display: block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    color: rgba(245, 249, 255, .94) !important;
    font-size: .84rem !important;
    font-weight: 600 !important;
    letter-spacing: .01em !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

@media (min-width: 1200px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
        max-width: clamp(210px, 25vw, 390px) !important;
        margin-right: 15px !important;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context {
        max-width: 23vw !important;
        margin-right: 7px !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-divider {
        margin-right: 8px !important;
    }

    .craftgrid-authenticated-shell .craftgrid-topbar .cg-topbar-workspace-context .cg-company-context-name {
        font-size: .76rem !important;
    }
}


/* Trial status: compact desktop indicator with an in-flow disclosure panel.
   Mobile hides the header control and shows the same notice as normal dismissible text. */
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    margin: 0 !important;
    z-index: auto;
}
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-height: 40px !important;
    max-width: clamp(170px, 19vw, 280px) !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    border: 1px solid #d5e3ed !important;
    border-radius: 13px !important;
    background: #fff !important;
    color: #17334c !important;
    box-shadow: 0 2px 6px rgba(12, 37, 61, .12) !important;
    cursor: pointer;
    list-style: none;
    text-align: left;
    text-decoration: none !important;
    font-size: .69rem !important;
    font-weight: 650 !important;
    line-height: 1.15 !important;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill:hover {
    border-color: #9db8cd !important;
    box-shadow: 0 3px 9px rgba(12, 37, 61, .16) !important;
}
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill:focus-visible {
    outline: 2px solid #5ba5e8;
    outline-offset: 2px;
}
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill > [data-cg-trial-header-icon] {
    display: inline-grid;
    place-items: center;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    margin: 0 !important;
    border-radius: 50%;
    background: #fff4d5;
    color: #8c6500 !important;
    font-size: .82rem !important;
}
.cg-trial-header-content { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; gap: 4px; }
.cg-trial-header-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cg-trial-header-label-compact { display: none; }
.cg-trial-header-progress {
    display: block;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7ee;
}
.cg-trial-header-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #17a66a;
    transition: width .2s linear, background-color .15s ease;
}
.cg-trial-header-chevron { flex: 0 0 auto; color: #597188; font-size: .66rem; transition: transform .15s ease; }
.cg-trial-header-details--open .cg-trial-header-chevron { transform: rotate(180deg); }

body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--warning .cg-trial-header-pill { border-color: #e9ca78 !important; }
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--warning [data-cg-trial-header-icon] { background: #fff2ce; color: #946300 !important; }
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--warning .cg-trial-header-progress-fill { background: #e5a51b; }
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--urgent .cg-trial-header-pill,
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--expired .cg-trial-header-pill { border-color: #efb2b2 !important; }
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--urgent [data-cg-trial-header-icon],
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--expired [data-cg-trial-header-icon] { background: #ffe5e3; color: #b42323 !important; }
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--urgent .cg-trial-header-progress-fill,
body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details--expired .cg-trial-header-progress-fill { background: #d92d20; }

.cg-trial-notice-shell {
    display: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 0 1rem;
    padding: 0;
}
.cg-trial-notice-shell.cg-trial-notice-shell--open { display: block; }
.cg-trial-notice-shell .cg-trial-countdown-banner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
}
.cg-trial-notice-shell .cg-trial-countdown-copy { min-width: 0; overflow-wrap: anywhere; }
.cg-trial-notice-shell .cg-trial-countdown-copy > span {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.cg-trial-desktop-start-date { display: block !important; flex-basis: 100%; color: #687d91; font-size: .75rem !important; }
.cg-trial-notice-shell .cg-trial-countdown-dismiss { align-self: center; }
.cg-trial-notice-shell .cg-trial-countdown-banner[hidden] { display: none !important; }

@media (max-width: 991.98px) {
    body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill {
        min-height: 36px !important;
        max-width: 154px !important;
        gap: 6px !important;
        padding: 4px 7px !important;
        border-radius: 10px !important;
        font-size: .66rem !important;
    }
    .cg-trial-header-label { display: none; }
    .cg-trial-header-label-compact { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .cg-trial-header-progress { height: 4px; }
}

@media (max-width: 767.98px) {
    /* Avoid clipped dropdown UI on mobile; the notice is normal document content below the header. */
    body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-details { display: none !important; }
    .cg-trial-notice-shell { display: none; width: 100%; max-width: 100%; min-width: 0; padding: 0; margin: 0 0 .75rem; }
    .cg-trial-notice-shell.cg-trial-notice-shell--mobile-eligible:not(.cg-trial-notice-shell--dismissed) { display: block; }
    .cg-trial-notice-shell.cg-trial-notice-shell--open:not(.cg-trial-notice-shell--mobile-eligible) { display: none !important; }
    .cg-trial-notice-shell.cg-trial-notice-shell--dismissed { display: none !important; }
    .cg-trial-notice-shell .cg-trial-countdown-banner {
        grid-template-columns: 1.45rem minmax(0, 1fr) auto;
        align-items: start;
        gap: .45rem;
        padding: .55rem .58rem;
    }
    .cg-trial-notice-shell .cg-trial-countdown-icon {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 1.4rem;
        height: 1.4rem;
        font-size: .82rem;
    }
    .cg-trial-notice-shell .cg-trial-countdown-copy {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .1rem;
    }
    .cg-trial-notice-shell .cg-trial-countdown-copy > strong { font-size: .8rem; }
    .cg-trial-notice-shell .cg-trial-countdown-copy > span { font-size: .75rem; }
    .cg-trial-notice-shell .cg-trial-countdown-action {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        margin-top: .25rem;
        padding: .32rem .6rem;
    }
    .cg-trial-notice-shell .cg-trial-countdown-dismiss {
        grid-column: 3;
        grid-row: 1;
        width: 1.5rem;
        height: 1.5rem;
    }
    .cg-trial-desktop-start-date { display: none !important; }
}

@media (max-width: 359.98px) {
    .cg-trial-notice-shell .cg-trial-countdown-copy > span { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
    body.craftgrid-authenticated-shell .craftgrid-topbar .cg-trial-header-pill,
    .cg-trial-header-progress-fill,
    .cg-trial-header-chevron { transition: none !important; }
}

/* Remove only the ERP tag beside the CraftGrid One wordmark.
   Keep the separate subscription/plan badge in the right header cluster. */
.craftgrid-authenticated-shell .craftgrid-topbar .craftgrid-brand > .cg-brand-erp-badge {
    display: none !important;
}
