/* A tab's page fills the work area (main.work, a flex column) as a page would, with the same gap between its parts. */
.ws-pane {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Hidden behind another tab: laid out in the same box (the work area's padding, MainLayout.razor.css), so nothing in it
   moves or loses its scroll position, but not painted and not reachable. */
.ws-pane.ws-hidden {
    position: absolute;
    inset: 0 10px 10px 2px;
    visibility: hidden;
    pointer-events: none;
    z-index: -1;
}

/* Nothing inside a hidden tab is drawn or clicked, not even a child that sets visibility:visible itself (the ticket's
   condensed header, fixed, showed through on every other tab). content-visibility:hidden skips the whole subtree's
   painting and hit-testing but keeps its layout and scroll positions, so switching back is instant and in place.
   (It replaced a rule that forced visibility:hidden on every element inside: flipping that on thousands of elements at
   each switch painted the new tab blank for a moment, the flicker between Tickets and Mail / Chat.) */
.ws-pane.ws-hidden {
    content-visibility: hidden;
}

/* A tab is shown or hidden in one frame, never through a transition. */
.ws-pane {
    transition: none !important;
}

/* The page background layer (MainLayout .tc-bgfx, css/textures.css) changes in one frame too: for the hexagon
   backgrounds it sits above the page (faint, blended), for the others below it, so a frame with the old place and the
   new art covered the page while switching between Tickets and Mail / Chat. */
.tc-bgfx,
.tc-bgfx * {
    transition: none !important;
}

@media (max-width: 767px) {
    .ws-pane {
        gap: 0;
    }

    .ws-pane.ws-hidden {
        inset: 0;
    }
}

/* The work area holds the hidden panes (absolutely placed in it). */
main.work {
    position: relative;
}

/* The compose dock and the mini chat windows, at the bottom right of every page (the dock rightmost). */
.ws-float {
    position: fixed;
    right: 14px;
    bottom: 12px;
    z-index: 60;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 28px);
}

    .ws-float > * {
        pointer-events: auto;
    }

    .ws-float > .cd-host {
        pointer-events: none;
    }

@media (max-width: 767px) {
    .ws-float {
        left: 8px;
        right: 8px;
        bottom: calc(66px + env(safe-area-inset-bottom));
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 6px;
    }
}

/* Right-click on a ticket link (workspace.js): a small menu built in script, so it is styled here, not in a component. */
.ws-linkmenu {
    position: fixed;
    z-index: 1000;
    min-width: 210px;
    display: flex;
    flex-direction: column;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

    .ws-linkmenu button {
        border: 0;
        background: transparent;
        color: var(--text);
        font: inherit;
        font-size: 13px;
        text-align: left;
        padding: 7px 10px;
        border-radius: 7px;
        cursor: pointer;
    }

        .ws-linkmenu button:hover, .ws-linkmenu button:focus-visible {
            background: var(--hover);
            outline: none;
        }
