/* Only the opted-in workspace overrides the legacy main height/minimum. */
#hp-workspace { display: grid; grid-template-rows: minmax(0, 3fr) 8px minmax(0, 1fr); min-width: 0; min-height: 0; }
#hp-workspace > main { height: 100%; min-height: 0; }
#hp-splitter { cursor: row-resize; touch-action: none; background: var(--borde); position: relative; z-index: 11; }
#hp-splitter::after { content: ""; position: absolute; width: 54px; height: 2px; top: 3px; left: calc(50% - 27px); background: var(--tenue); }
#hp-splitter:hover, #hp-splitter:focus-visible { background: #40516a; }
#hp-box { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; border-bottom: 1px solid var(--borde); }
#hp-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; padding: 2px 8px; }
#hp-heading h2 { margin: 0; font-size: 11px; white-space: nowrap; color: #00e6b0; }
#hp-summary { order: 1; min-width: 0; color: var(--texto); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hp-instance { max-width: 130px; font: inherit; font-size: 11px; background: var(--panel); color: var(--texto); border: 1px solid var(--borde); }
#hp-context { order: 2; flex-basis: 100%; min-width: 0; margin: 0; color: var(--tenue); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Only the chart host follows the measured SPX rectangle; controls/splitter stay full width. */
#hp-chart { width: 100%; justify-self: start; min-width: 0; min-height: 0; position: relative; overflow: hidden; }
@media (max-width: 700px) { #hp-heading { flex-wrap: wrap; gap: 2px 8px; } #hp-context { flex-basis: 100%; } }
/* HP remains full width with its original fixed-height row, including its full-width heading.
   Only the unused chart-side remainder can host Market State; stacked content grows the document. */
#hp-lower { position: relative; display: grid; grid-template-rows: var(--hp-height) auto; min-width: 0; min-height: 0; }
#hp-lower > #hp-box { grid-row: 1; }
#hp-lower > #market-state { grid-row: 2; }
/* Absolute positioning uses the wrapper, not the stacked second-row grid area. */
#hp-lower.market-sidebar #market-state { position: absolute; grid-area: auto; left: var(--market-left); top: var(--market-top); right: 0; bottom: 0; overflow: auto; }
