.reference-task-layout {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.reference-task-layout > .interactive-fields { margin-top: 0; }

.reference-diagram {
  margin: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid #b9d3d5;
  border-radius: 16px;
  background: #f7fcfb;
}

.reference-diagram:focus-visible { outline: 3px solid #f49b33; outline-offset: 2px; }

.reference-diagram svg { display: block; width: 100%; height: auto; max-height: 430px; margin: auto; }
.reference-base, .reference-axis { stroke: #173f78; stroke-width: 2.2; }
.reference-grid { stroke: #cddfe0; stroke-width: 1; }
.reference-highlight { fill: #f49b33; stroke: #f49b33; stroke-width: 7; stroke-linecap: round; }
.reference-endpoint { fill: #f7fcfb; stroke: #f49b33; stroke-width: 4; }
.reference-endpoint.is-closed { fill: #f49b33; }
.reference-row-label, .reference-boundary-label, .reference-tick, .reference-axis-label, .reference-curve-label, .reference-graph-number { fill: #123f7c; font: 600 16px system-ui, sans-serif; }
.reference-boundary-label { font-size: 13px; text-anchor: middle; }
.reference-tick { font-size: 12px; text-anchor: middle; }
.reference-tick.y { text-anchor: end; }
.reference-axis-label { text-anchor: end; }
.reference-curve { fill: none; stroke: #f49b33; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.reference-curve.power-one { stroke: #287c80; }
.reference-curve.power-two { stroke: #f49b33; }
.reference-curve.power-three { stroke: #7d5bb2; }
.reference-curve-label.power-one { fill: #287c80; }
.reference-curve-label.power-two { fill: #b86a0b; }
.reference-curve-label.power-three { fill: #6d469e; }
.reference-panel { fill: #fffdf8; stroke: #cddfe0; }
.reference-graph-number { font-size: 18px; text-anchor: middle; }
.reference-polygon-shape { fill: #f8d39d; fill-opacity: .72; stroke: #173f78; stroke-width: 4; stroke-linejoin: round; }
.reference-polygon-inner { stroke: #173f78; stroke-width: 3; }

@media (max-width: 650px) {
  .reference-diagram {
    padding: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
  }
  .reference-diagram svg { width: 640px; min-width: 640px; max-height: none; }
}
