/* Product theme roles are independent of public/workspace geometry. The generated
   HostSync palette remains the color authority; canonical logo gold is untouched. */
.hostsync-theme {
    --hs-showcase-canvas: var(--hostsync-background);
    --hs-showcase-panel: var(--hostsync-surface);
    --hs-showcase-border: var(--hostsync-border-control);
    --hs-showcase-divider: var(--hostsync-border);
    --hs-showcase-text: var(--hostsync-text);
    --hs-showcase-support: var(--hostsync-secondary);
    --hs-showcase-control-border: var(--hostsync-border-control);
    --hs-showcase-action-ink: var(--hostsync-on-action);
    --hs-showcase-overlay: var(--hostsync-backdrop);
    --hs-showcase-card-gradient: linear-gradient(180deg, transparent 20%, var(--hostsync-background) 100%);
}

/* HostSync ambient branding: approved four-corner navigation honeycomb.
   The canonical SVG owns honey colors and cell geometry independently of skins.
   Named corner views avoid multiplying the navigation canvas attenuation into
   this opacity. Keep the asset query equal to its SHA-256 prefix when edited. */
:is(body.ho-guest-shell, .hostsync-presentation-root, .hivesync-shell--hostsync-theme) {
    --hostsync-honeycomb-opacity: .16;
    --hostsync-honeycomb-size: 1536px;
    --hostsync-honeycomb-top: 64px;
    --hostsync-honeycomb-bottom: 76px;
}
:is(body.ho-guest-shell, .hostsync-presentation-root,
    .hivesync-shell--hostsync-theme > .hivesync-shell__main) {
    position: relative;
    isolation: isolate;
}

@media (min-width: 801px) {
    :is(body.ho-guest-shell, .hostsync-presentation-root,
        .hivesync-shell--hostsync-theme > .hivesync-shell__main)::before,
    :is(body.ho-guest-shell, .hostsync-presentation-root,
        .hivesync-shell--hostsync-theme > .hivesync-shell__main)::after,
    .hivesync-shell--hostsync-theme > .hivesync-shell__header::before,
    .hostsync-presentation-root .ho-header::before {
        content: "";
        position: fixed;
        inset: var(--hostsync-honeycomb-top) 0 auto;
        height: 210px;
        z-index: -1;
        pointer-events: none;
        background-image: url('../images/hivesync-honeycomb-ambient.svg?v=2d1db18d6ad7bf96#corner-left'), url('../images/hivesync-honeycomb-ambient.svg?v=2d1db18d6ad7bf96#corner-right');
        background-position: left -16px top -10px, right -16px top -10px;
        background-size: calc(var(--hostsync-honeycomb-size) * .1166666667) calc(var(--hostsync-honeycomb-size) * .1388888889);
        background-repeat: no-repeat;
        opacity: var(--hostsync-honeycomb-opacity);
    }
    :is(body.ho-guest-shell, .hostsync-presentation-root,
        .hivesync-shell--hostsync-theme > .hivesync-shell__main)::after {
        inset: auto 0 var(--hostsync-honeycomb-bottom);
        transform: rotate(180deg);
    }
    /* Continue the same corner ink through opaque mastheads, behind their controls. */
    .hivesync-shell--hostsync-theme > .hivesync-shell__header::before,
    .hostsync-presentation-root .ho-header::before {
        position: absolute;
        inset: 0;
        height: 100%;
    }
    .hostsync-presentation-root .ho-header { position:relative; isolation:isolate; }

}

/* Shared title-band treatment. Reserve visible artwork lanes within the header;
   no artwork paints underneath the title, actions or property image. */
@media (min-width: 801px) {
    .hivesync-shell--hostsync-theme:has(:is(.hostsync-title-band,.hostsync-brand-title)) > .hivesync-shell__main::before,
    .hivesync-shell--hostsync-theme:has(:is(.hostsync-title-band,.hostsync-brand-title)) > .hivesync-shell__header::before,
    body.ho-guest-shell::before { display: none; }

    .page-frame.hostsync-title-band > .page-frame__header:not(.sr-only),
    .hostsync-brand-title {
        position: relative;
        padding: var(--hostsync-title-padding, 24px 100px);
        background: var(--hostsync-title-background, var(--hostsync-surface));
        border-radius: 8px;
        min-height: var(--hostsync-title-min-height, 160px);
        box-sizing: border-box;
    }
    .hostsync-title-band > .page-frame__header:not(.sr-only)::before,
    .hostsync-title-band > .page-frame__header:not(.sr-only)::after,
    .hostsync-brand-title::before,
    .hostsync-brand-title::after {
        content: "";
        position: absolute;
        top: 12px;
        bottom: 12px;
        width: 84px;
        pointer-events: none;
        background-repeat: no-repeat;
        background-size: 179.2px 213.333px;
        opacity: var(--hostsync-honeycomb-opacity);
    }
    .hostsync-title-band > .page-frame__header:not(.sr-only)::before,
    .hostsync-brand-title::before {
        left: 0;
        background-image: url('../images/hivesync-honeycomb-ambient.svg?v=2d1db18d6ad7bf96#corner-left');
        background-position: left -8px top -10px;
    }
    .hostsync-title-band > .page-frame__header:not(.sr-only)::after,
    .hostsync-brand-title::after {
        right: 0;
        background-image: url('../images/hivesync-honeycomb-ambient.svg?v=2d1db18d6ad7bf96#corner-right');
        background-position: right -8px top -10px;
    }
    /* Focused task titles reuse the same approved corner artwork and reserved
       right lane without introducing another tall banner above a compact form.
       Keep the decoration inside the title so account rows and cards stay clear. */
    .hostsync-brand-title--task {
        --hostsync-title-padding: 0 100px 0 0;
        --hostsync-title-background: transparent;
        --hostsync-title-min-height: 0px;
        isolation: isolate;
    }
    .hostsync-brand-title--task::before { display: none; }
    .hostsync-brand-title--task::after {
        top: 0;
        bottom: 0;
        width: 100px;
        height: auto;
        /* The middle cluster stays recognizable even in a one-line task title. */
        background-position: right -8px center;
        z-index: -1;
    }
    .hivesync-shell--hostsync-theme:has(.hostsync-brand-title--task) > .hivesync-shell__main::after { display: none; }

    /* A departure outcome owns the foreground title; retain the existing
       property context above it without another decorated band. */
    body.ho-guest-shell[data-view=depart]:has(.hx-outcome) .hx-header.hostsync-brand-title {
        padding: 0;
        min-height: 0;
        background: transparent;
    }
    body.ho-guest-shell[data-view=depart]:has(.hx-outcome) .hx-header.hostsync-brand-title::before,
    body.ho-guest-shell[data-view=depart]:has(.hx-outcome) .hx-header.hostsync-brand-title::after { display: none; }

    /* Compact guest tasks retain their narrow reading width on desktop. */
    .hostsync-brand-title--compact {
        padding: 20px 48px;
        min-height: 104px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    .hostsync-brand-title--compact::before,
    .hostsync-brand-title--compact::after {
        width: 36px;
        background-size: 89.6px 106.666px;
    }
}

@media print, (forced-colors: active) {
    :is(body.ho-guest-shell, .hostsync-presentation-root,
        .hivesync-shell--hostsync-theme > .hivesync-shell__main)::before,
    :is(body.ho-guest-shell, .hostsync-presentation-root,
        .hivesync-shell--hostsync-theme > .hivesync-shell__main)::after,
    .hivesync-shell--hostsync-theme > .hivesync-shell__header::before,
    .hostsync-presentation-root .ho-header::before,
    .hostsync-title-band > .page-frame__header::before,
    .hostsync-title-band > .page-frame__header::after,
    .hostsync-brand-title::before,
    .hostsync-brand-title::after { display: none; }
}

/* The standalone guest shell has no platform masthead or page-wide legal footer. */
body.ho-guest-shell { --hostsync-honeycomb-top:0px; --hostsync-honeycomb-bottom:24px; }
