I've modified topbox
tcolorbox to use three parameters (one optional and two mandatory), the second mandatory parameter is the title for the outer box. This title. It doesn't work for long titles.
\documentclass{article}
\usepackage{varwidth}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\newtcolorbox{topbox}[3][]{enhanced,
before skip=2mm,after skip=2mm,
colback=black!5,colframe=black!50,boxrule=0.2mm,
attach boxed title to top left={xshift=1cm,yshift*=1mm-\tcboxedtitleheight},
varwidth boxed title*=-3cm,
boxed title style={frame code={
\path[fill=tcbcolback!30!black]
([yshift=-1mm,xshift=-1mm]frame.north west)
arc[start angle=0,end angle=180,radius=1mm]
([yshift=-1mm,xshift=1mm]frame.north east)
arc[start angle=180,end angle=0,radius=1mm];
\path[left color=tcbcolback!60!black,right color=tcbcolback!60!black,
middle color=tcbcolback!80!black]
([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east)
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east)
-- (frame.south east) -- (frame.south west)
-- ([xshift=-1mm,yshift=-1mm]frame.north west)
[sharp corners]-- cycle;
},interior engine=empty,
},
fonttitle=\bfseries,
title={#2},
enhanced, breakable,
enlarge top initially by=1cm,
% enlarge bottom finally by=5mm,
enlarge left by=5mm,
enlarge right by=5mm,
width=\linewidth-10mm,
overlay unbroken and first={
\draw[green!70!black, line width=.5mm, rounded corners]
([xshift=-5mm]frame.south west)|-([yshift=9mm]frame.north)-|
([xshift=5mm]frame.south east);
\coordinate (outernw) at ([shift={(-5mm,1cm)}]frame.north west);
\node[fill=green!70!black, minimum height=5mm,
anchor=north west, text=white, rounded corners] at ([xshift=1cm]outernw)
(outertitle) {#3};
\path[fill=green!30!black]
([yshift=-1mm,xshift=-1mm]outertitle.north west)
arc[start angle=0,end angle=180,radius=1mm]
([yshift=-1mm,xshift=1mm]outertitle.north east)
arc[start angle=180,end angle=0,radius=1mm];
\path[left color=green!60!black,right color=green!60!black,
middle color=green!80!black]
([xshift=-2mm]outertitle.north west) -- ([xshift=2mm]outertitle.north east)
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]outertitle.north east)
-- (outertitle.south east) -- (outertitle.south west)
-- ([xshift=-1mm,yshift=-1mm]outertitle.north west)
[sharp corners]-- cycle;
\node[text=white] at (outertitle) {#3};
},
overlay middle and last={
\draw[green!70!black, line width=.5mm]
([xshift=-5mm]frame.north west)--([xshift=-5mm]frame.south west)
([xshift=5mm]frame.north east)--([xshift=5mm]frame.south east);
},
#1
}
\newtcolorbox{middlebox}[2][]{
title=#2,
enhanced, breakable,
% enlarge top initially by=1cm,
% enlarge bottom finally by=5mm,
enlarge left by=5mm,
enlarge right by=5mm,
width=\linewidth-10mm,
overlay unbroken={
\draw[green!70!black, line width=.5mm]
([shift={(-5mm,5mm)}]frame.north west)--([shift={(-5mm,-5mm)}]frame.south west)
([shift={(5mm,5mm)}]frame.north east)--([shift={(5mm,-5mm)}]frame.south east);
},
overlay first={
\draw[green!70!black, line width=.5mm]
([shift={(-5mm,5mm)}]frame.north west)--([xshift=-5mm]frame.south west)
([shift={(5mm,5mm)}]frame.north east)--([xshift=5mm]frame.south east);
},
overlay middle={
\draw[green!70!black, line width=.5mm]
([xshift=-5mm]frame.north west)--([xshift=-5mm]frame.south west)
([xshift=5mm]frame.north east)--([xshift=5mm]frame.south east);
},
overlay last={
\draw[green!70!black, line width=.5mm]
([xshift=-5mm]frame.north west)--([shift={(-5mm,-5mm)}]frame.south west)
([xshift=5mm]frame.north east)--([shift={(5mm,-5mm)}]frame.south east);
},
#1
}
\newtcolorbox{bottombox}[2][]{
title=#2,
enhanced, breakable,
% enlarge top initially by=1cm,
enlarge bottom finally by=5mm,
enlarge left by=5mm,
enlarge right by=5mm,
width=\linewidth-10mm,
overlay unbroken and last={
\draw[green!70!black, line width=.5mm, rounded corners]
([xshift=-5mm]frame.north west)|-([yshift=-5mm]frame.south)
-|([xshift=5mm]frame.north east);
},
overlay first={
\draw[green!70!black, line width=.5mm]
([xshift=-5mm]frame.north west)--([xshift=-5mm]frame.south west)
([xshift=5mm]frame.north east)--([xshift=5mm]frame.south east);
},
overlay middle={
\draw[green!70!black, line width=.5mm, rounded corners]
([xshift=-5mm]frame.north west)--([xshift=-5mm]frame.south west)
([xshift=5mm]frame.north east)--([xshift=5mm]frame.south east);
},
#1
}
\begin{document}
\lipsum[1]
\begin{topbox}{this is the title}{Outer title}
\lipsum[1-2]
\end{topbox}
\begin{middlebox}[colframe=red, colback=pink!10]{this is the title}
\lipsum[1-5]
\end{middlebox}
\begin{middlebox}[colframe=brown!70!black, colback=brown!10]{this is the title}
\lipsum[1-2]
\end{middlebox}
\begin{bottombox}[colframe=blue, colback=cyan!10]{this is the title}
\lipsum[1-3]
\end{bottombox}
\lipsum[1]
\end{document}

Note Previous code has been updated for compatibility with tcolorbox v4.20. If you're using previous versions, rename colors with form tcbcol...
to older form tcbcol@...
.