/* AstroLoop 20260909-tab-header-cleanup-1
 * Presentation only: the OpenMCT title remains the page name.
 * Keep original controls/DOM for direct and delegated event handlers.
 * Never hide panel headings, mission context, warnings or source information.
 */

/* Remove only the duplicate page-name/description blocks. */
html body .al-display-root .al-display-header > .al-display-title-row,
html body .al-astra-page > .al-astra-header > div:first-child,
html body #al-act3-root > .al-act3-header > div:first-child,
html body #al-res4-root > .al-res4-header > div:first-child,
html body .al-ch-page > .al-ch-header > div:first-child,
html body .fp-console > .fp-header > div:first-child,
html body #al-os3-root > .al-os3-header > div:first-child,
html body .al-cv > .al-cv__header > div:first-child,
html body .al-dtm > .al-dtm__header > div:first-child,
html body .hm-page > .hm-heading > div:first-child {
    display: none !important;
}

/* Retain bound elements but remove layout-edit actions from sight and focus. */
html body .al-display-root .al-display-header-actions [data-action="edit-layout"],
html body .al-display-root .al-display-header-actions [data-action="save-layout"],
html body .al-display-root .al-display-header-actions [data-action="reset-layout"],
html body .al-astra-page .al-astra-header-actions [data-astra-action="edit-layout"] {
    display: none !important;
}

/* Use the same page gutter; constrain the toolbar to the actual view width. */
html body .al-display-root > .al-display-shell,
html body .al-astra-page,
html body #al-act3-root,
html body #al-res4-root,
html body .al-ch-page,
html body .fp-console,
html body #al-os3-root,
html body .al-cv,
html body .hm-page {
    box-sizing: border-box !important;
    padding: 12px !important;
    min-width: 0 !important;
    width: 100% !important;
}

/* Astra alone puts its context before its header. Preserve all content heights. */
html body .al-astra-page {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}
html body .al-astra-page > * {
    flex-shrink: 0 !important;
}
html body .al-astra-page > .al-astra-header {
    order: -1 !important;
}

/* Twin keeps its map-sizing grid; prevent implicit min-content track expansion. */
html body .al-dtm {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* One compact action row at the start of each tab, above mission/context data. */
html body .al-display-root .al-display-header,
html body .al-astra-page > .al-astra-header,
html body #al-act3-root > .al-act3-header,
html body #al-res4-root > .al-res4-header,
html body .al-ch-page > .al-ch-header,
html body .fp-console > .fp-header,
html body #al-os3-root > .al-os3-header,
html body .al-cv > .al-cv__header,
html body .al-dtm > .al-dtm__header,
html body .hm-page > .hm-heading {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    gap: 0 !important;
}
/* Twin has no padded shell: inset just its header, without changing map rows. */
html body .al-dtm > header.al-dtm__header {
    width: calc(100% - 24px) !important;
    margin: 12px 12px 8px !important;
}

/* Reserve the right-hand slot so filters can wrap without displacing Refresh.
 * All specialized actions stay in their original containers, in DOM order.
 */
html body .al-display-root .al-display-header-actions,
html body .al-astra-page .al-astra-header-actions,
html body #al-act3-root .al-act3-refresh-row,
html body #al-res4-root > .al-res4-header > div:last-child,
html body .al-ch-page > .al-ch-header,
html body .fp-console > .fp-header > .fp-actions,
html body #al-os3-root .al-os3-header-controls,
html body .al-cv > .al-cv__header > .al-cv__actions,
html body .al-dtm > .al-dtm__header > .al-dtm__header-actions,
html body .hm-page > .hm-heading > .hm-toolbar {
    box-sizing: border-box !important;
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    padding: 0 112px 0 0 !important;
    margin: 0 !important;
    gap: 8px !important;
}
html body .al-ch-page > .al-ch-header {
    margin-bottom: 8px !important;
}

/* Activity nests its context and action row in a single mission-side wrapper. */
html body #al-act3-root .al-act3-mission-side {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
}
html body #al-act3-root .al-act3-refresh-row {
    order: -1 !important;
}

/* Only page-header Refresh buttons; leave retry/refresh controls in panels alone.
 * Retain native text, disabled/loading state, focus behavior and click handlers.
 */
html body .al-display-root .al-display-header-actions [data-action="refresh"],
html body .al-astra-page .al-astra-header-actions [data-astra-action="refresh"],
html body #al-act3-root .al-act3-refresh-row > #al-act3-refresh,
html body #al-res4-root .al-res4-header #al-res4-refresh,
html body .al-ch-page > .al-ch-header > [data-ch-action="refresh"],
html body .fp-console > .fp-header > .fp-actions > [data-action="refresh"],
html body #al-os3-root .al-os3-header-controls > #al-os3-refresh,
html body .al-cv > .al-cv__header > .al-cv__actions > [data-action="refresh"],
html body .al-dtm > .al-dtm__header > .al-dtm__header-actions > [data-refresh],
html body .hm-page > .hm-heading > .hm-toolbar > [data-action="refresh"] {
    box-sizing: border-box !important;
    position: absolute !important;
    inset: 0 0 auto auto !important;
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Filter widths may shrink inside their reserved lane, not beneath Refresh. */
html body #al-os3-root .al-os3-header-controls > select {
    min-width: 0 !important;
    max-width: 100% !important;
}
