.entry-profile .profile-header:has(.entry-traversal-toolbar){flex-wrap:wrap;container-type:inline-size}
.entry-traversal-toolbar{display:grid;grid-template-columns:minmax(0,1fr) max-content max-content;align-items:center;gap:12px;width:100%;margin-top:0}
/* Keep context and actions in one vertically centered row on wide headers. */
.entry-traversal-context{display:flex;align-items:center;gap:6px 16px;min-width:0}
.entry-traversal-context>.scene-profile-title-row:empty{display:none}
.entry-traversal-context>.profile-kicker{flex:1;min-width:0;line-height:1.5;overflow-wrap:anywhere;justify-content:flex-start;text-align:left}
.entry-traversal-context>.profile-kicker>*{min-width:0;max-width:100%}
.entry-traversal-toolbar>.entry-profile-actions{justify-self:end}
.entry-profile[data-type=scene] .entry-traversal-toolbar>.entry-profile-actions{width:100%;min-width:0;flex-shrink:1;flex-wrap:nowrap;justify-content:flex-end}
.entry-profile-actions>.scene-profile-actions{width:auto;justify-content:flex-start;flex:0 1 max-content;min-width:48px;max-width:180px}
.entry-profile-actions>.scene-profile-actions .scene-number-field{width:100%;min-height:40px;height:auto;padding-inline:6px;overflow-wrap:anywhere}
@container(max-width:1150px){.entry-profile-actions>.scene-profile-actions{flex:0 1 80px}}
.entry-adjacent-navigation{width:max-content;max-width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;min-width:0}
.entry-adjacent-navigation .secondary-action{white-space:nowrap;min-height:38px}
.entry-adjacent-navigation button:disabled{opacity:.45;cursor:default}
.entry-adjacent-navigation button:focus-visible{outline:2px solid var(--bright);outline-offset:3px}
.player-entry-navigation{padding:0 0 16px;margin-bottom:16px;border-bottom:1px solid var(--line)}
/* Let the breadcrumb wrap above the adjacent navigation/action groups. */
@container(max-width:780px){.entry-traversal-toolbar{grid-template-columns:minmax(0,1fr) max-content}.entry-traversal-toolbar>.entry-traversal-context{grid-column:1/-1;grid-row:1}.entry-traversal-toolbar>.entry-adjacent-navigation{grid-column:1;grid-row:2;justify-self:end}.entry-traversal-toolbar>.entry-profile-actions{grid-column:2;grid-row:2;justify-content:flex-end}}
/* Keep the four-button row stable across platform font metrics. */
@container (min-width:600.01px) and (max-width:780px){.entry-traversal-toolbar>.entry-adjacent-navigation{flex-wrap:nowrap}.entry-traversal-toolbar>.entry-adjacent-navigation .secondary-action{min-width:0;white-space:normal}}
@container(max-width:600px){.entry-traversal-toolbar{grid-template-columns:minmax(0,1fr)}.entry-traversal-toolbar>.entry-traversal-context{grid-column:1}.entry-traversal-toolbar>.entry-adjacent-navigation{justify-self:center;width:100%}.entry-traversal-toolbar>.entry-profile-actions{grid-column:1;grid-row:3}}
@container(max-width:420px){.entry-traversal-toolbar{grid-template-columns:minmax(0,1fr)}.entry-traversal-toolbar>.entry-profile-actions{grid-column:1;grid-row:auto;justify-self:center;justify-content:center}.entry-profile[data-type=scene] .entry-traversal-toolbar>.entry-profile-actions{width:100%}.entry-profile-actions>.scene-profile-actions{flex:1 1 48px}.entry-traversal-context{display:block}.entry-traversal-context>.profile-kicker{display:block}.entry-traversal-context>.profile-kicker>b{margin-inline:6px}.entry-traversal-toolbar>.entry-adjacent-navigation{width:100%}.entry-traversal-toolbar>.entry-adjacent-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.entry-traversal-toolbar>.entry-adjacent-navigation .secondary-action{min-width:0;min-height:44px;padding-inline:6px;font-size:.78rem;white-space:normal}}
@container(max-width:190px){.entry-profile[data-type=scene] .entry-profile-actions>[data-duplicate-entry]{width:80px;padding-inline:6px;line-height:1.15}.entry-profile-actions>.scene-profile-actions .scene-number-field{padding-inline:4px;font-size:.72rem}}
@media(max-width:600px){.entry-profile .profile-header:has(.entry-traversal-toolbar){padding:16px 18px}}

/* Medium scene headers keep navigation left of the scene reference and actions. */
@container(min-width:781px){
  .entry-profile[data-type=scene] .entry-traversal-toolbar:has(.entry-adjacent-navigation button:not(:disabled)){grid-template-columns:minmax(0,1fr) max-content max-content}
  .entry-profile[data-type=scene] .entry-traversal-toolbar:has(.entry-adjacent-navigation button:not(:disabled))>.entry-profile-actions{width:auto;flex-wrap:nowrap}
  .entry-profile[data-type=scene] .entry-traversal-toolbar:has(.entry-adjacent-navigation button:not(:disabled))>.entry-profile-actions>:is([data-duplicate-entry],[data-delete-entry]){white-space:nowrap;flex-shrink:0}
}
/* Intrinsic navigation columns must not shrink the existing desktop reference. */
@container(min-width:781px) and (max-width:1150px){
  .entry-profile[data-type=scene] .entry-profile-actions>.scene-profile-actions{flex:0 0 80px}
}
/* Preserve desktop scene actions when there is no adjacent destination. */
@container(min-width:781px){.entry-profile[data-type=scene] .entry-traversal-toolbar:not(:has(.entry-adjacent-navigation button:not(:disabled))){grid-template-columns:minmax(0,1fr) max-content minmax(0,1fr)}}

/* Player visibility guidance belongs beneath the complete Reveal/Foundry row. */
.entry-profile.vision-profile-ready .profile-reveal-controls .location-help{grid-column:1/-1}

/* Keep the mobile scene reference and its two actions on one touch-friendly row. */
@media(max-width:760px){
  .entry-profile[data-type=scene] .entry-traversal-toolbar>.entry-profile-actions{display:grid;grid-template-columns:48px minmax(0,1.2fr) minmax(0,1fr);align-items:stretch;gap:8px}
  .entry-profile[data-type=scene] .entry-profile-actions>.scene-profile-actions{width:48px;min-width:0;max-width:none;align-items:stretch}
  .entry-profile[data-type=scene] .entry-profile-actions>.scene-profile-actions .scene-number-field{min-width:0;min-height:44px;height:100%;padding:6px 4px;font-size:.8rem;overflow-wrap:anywhere}
  .entry-profile[data-type=scene] .entry-profile-actions>:is([data-duplicate-entry],[data-delete-entry]){width:100%;min-width:0;min-height:44px;padding:8px 6px;font-size:clamp(.75rem,3.5vw,.85rem);line-height:1.2;white-space:normal}
}
/* Reclaim the nested inset on small phones before reducing readable action text. */
@media(max-width:374px){
  .entry-profile[data-type=scene] .profile-header:has(.entry-traversal-toolbar){margin-inline:-6px;padding-inline:0}
}
