#compare-panel .bench-atlas-result > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .35rem .85rem;
  padding: .65rem 1rem;
}
.atlas-order-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .65rem; }
#compare-panel .bench-atlas-result > header h4 { font-size: 1.1rem; font-weight: 750; }
#compare-panel .bench-atlas-result > header p { margin: 0; }
.atlas-precision {
  color: var(--bench-caption);
  font-size: .78rem;
}

.atlas-engine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: .7rem;
  padding: 0 1rem 1rem;
}
#compare-panel .atlas-engine {
  --atlas-ink: #48694e;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: clip;
  margin: 0;
  border: 1px solid var(--bench-line);
  border-radius: .65rem;
  background: white;
  container-type: inline-size;
}
#compare-panel .atlas-engine[data-atlas-lane="opticut"] { --atlas-ink: #637f8a; }
#compare-panel .atlas-engine[data-atlas-lane="cutlistOptimizer"] { --atlas-ink: #a18459; }
.atlas-engine-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.05rem;
  gap: .4rem;
  padding: .45rem .8rem;
}
#compare-panel .atlas-engine-head h5 {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  direction: rtl;
  margin: 0;
  color: #26362c;
  font-size: 1rem;
  font-weight: 700;
}
.atlas-engine-head h5::before {
  width: .52rem;
  height: .52rem;
  flex: none;
  border-radius: 50%;
  background: var(--atlas-ink);
  content: '';
}
.atlas-engine-count {
  flex: none;
  padding: .05rem .45rem;
  border-radius: .35rem;
  background: #f2f4ef;
  color: #45544a;
  font-size: .8rem;
}

.atlas-engine-canvas,
#compare-panel .atlas-engine-overview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-block: 1px solid var(--bench-line);
  background-color: #f4f5f1;
  background-image: radial-gradient(#d8ddd4 .7px, transparent .8px);
  background-size: 9px 9px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
#compare-panel .atlas-engine-overview {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  border-block-start: 1px solid var(--bench-line);
  cursor: zoom-in;
}
.atlas-engine-canvas.is-zoomed { cursor: grab; touch-action: none; }
.atlas-engine-canvas.is-zoomed:active { cursor: grabbing; }
.atlas-engine-canvas:focus-visible,
#compare-panel .atlas-engine-overview:focus-visible { outline: 2px solid var(--bench-accent); outline-offset: -2px; }
:is(.atlas-engine-canvas, .atlas-engine-overview) > svg { position: absolute; inset: 0; width: 100%; height: 100%; direction: ltr; }
.atlas-board, .atlas-piece { vector-effect: non-scaling-stroke; }
.atlas-board { fill: #f8f9f4; stroke: #627266; stroke-width: 1.2; }
.atlas-piece { fill: #d3e0cf; stroke: #607364; stroke-width: .8; }
.atlas-piece:nth-child(5n + 2) { fill: #ecdcc8; }
.atlas-piece:nth-child(5n + 3) { fill: #d5e0e5; }
.atlas-piece:nth-child(5n + 4) { fill: #e3dfea; }
.atlas-piece:nth-child(5n + 5) { fill: #e7e9cf; }

#compare-panel .atlas-canvas-status:not(:empty), #compare-panel .atlas-engine-canvas > button:not([hidden]) {
  position: absolute;
  inset-inline-start: 50%;
  top: 46%;
  translate: 50% -50%;
  white-space: nowrap;
}
.atlas-canvas-status { font-size: .82rem; color: var(--bench-caption); }
#compare-panel .atlas-engine-canvas > button:not([hidden]) { top: 71%; background: #fff; }
.atlas-engine-controls, .atlas-sheet-stepper, .atlas-zoom-tools, .atlas-engine-links {
  display: flex;
  align-items: center;
}
.atlas-engine-controls {
  justify-content: space-between;
  gap: .18rem;
  padding: .12rem .35rem;
  border-block-end: 1px solid var(--bench-line);
}
.atlas-sheet-position { font-size: .8rem; white-space: nowrap; }
.atlas-zoom-tools { direction: ltr; }
#compare-panel .atlas-tool {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  border-radius: .35rem;
  background: transparent;
  color: var(--bench-accent);
  font-size: .8rem;
}
#compare-panel .atlas-tool:disabled { opacity: .38; }
#compare-panel .atlas-tool[data-atlas-zoom="reset"] { color: #43564a; opacity: 1; }
#compare-panel .atlas-order-expand {
  width: auto;
  gap: .4rem;
  padding-inline: .65rem;
  border: 1px solid var(--bench-line);
  background: white;
  color: var(--bench-accent);
  font-weight: 650;
  white-space: nowrap;
}
#compare-panel .atlas-tool svg, #compare-panel .atlas-engine-links svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#compare-panel .atlas-engine-canvas > .atlas-tool { width: auto; padding-inline: .7rem; }
#compare-panel .atlas-tool[hidden] { display: none; }
@media (hover: hover) {
  #compare-panel .atlas-tool:not(:disabled):hover, #compare-panel .atlas-engine-links a:hover {
    background: #edf2ec;
    color: var(--bench-accent);
  }
}
.atlas-engine-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: .65rem 0;
}
.atlas-engine-stats > div {
  display: grid;
  text-align: center;
  gap: .12rem;
}
.atlas-engine-stats > div + div { border-inline-start: 1px solid var(--bench-line); }
.atlas-engine-stats dt { color: var(--bench-caption); font-size: .75rem; }
.atlas-engine-stats dd { margin: 0; color: #29372f; font-size: .92rem; font-weight: 650; }
.atlas-engine-stats dd small { font-size: .72rem; font-weight: 400; }
.atlas-engine-links {
  justify-content: space-between;
  gap: .35rem;
  margin-top: auto;
  padding: .13rem .45rem;
  border-block-start: 1px solid var(--bench-line);
}
#compare-panel .atlas-engine-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .3rem;
  padding-inline: .4rem;
  border-radius: .35rem;
  text-decoration: none;
  color: var(--bench-accent);
  font-size: .83rem;
  font-weight: 650;
}
#compare-panel .atlas-engine-links .atlas-edit { font-weight: 740; }
.atlas-order-dialog {
  width: min(55rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--bench-line);
  border-radius: .85rem;
  background: #f3f3f0;
  color: #29362c;
}
.atlas-order-dialog::backdrop { background: rgb(26 43 33 / .46); }
#compare-panel .atlas-order-dialog-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .55rem;
  padding: .65rem clamp(.7rem, 2vw, 1.25rem);
  border-block-end: 1px solid var(--bench-line);
  background: white;
}
#compare-panel .atlas-order-dialog-head h3 { margin: 0; font-size: 1.2rem; }
.atlas-order-dialog-body { padding: .75rem clamp(.65rem, 2vw, 1.25rem) 1rem; }
.atlas-detail-engines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .25rem;
  margin-block-end: .7rem;
  padding: .25rem;
  border: 1px solid var(--bench-line);
  border-radius: .5rem;
  background: white;
}
#compare-panel :is(.atlas-detail-engines button, .atlas-order-close) {
  min-height: 44px;
  padding: .25rem .45rem;
  border: 1px solid var(--bench-line);
  border-radius: .4rem;
  color: var(--bench-accent);
  font-size: .87rem;
  font-weight: 650;
}
#compare-panel .atlas-detail-engines button { border-color: transparent; }
#compare-panel .atlas-detail-engines [aria-pressed="true"] { background: var(--bench-accent); color: white; }
#compare-panel .atlas-detail-views .atlas-engine[hidden] { display: none; }
.atlas-order-dialog .atlas-engine-canvas { max-height: min(45dvh, 27rem); }
#compare-panel .atlas-order-dialog-body > .bench-atlas-detail { margin-top: .7rem; border: 1px solid var(--bench-line); border-radius: .5rem; background: white; }
#compare-panel .atlas-detail-precision { margin: .6rem 0 0; color: var(--bench-caption); font-size: .85rem; }
@container (max-width: 271px) {
  .atlas-engine-controls { flex-wrap: wrap; justify-content: center; }
  .atlas-engine-controls > div { justify-content: center; }
}
@media (max-width: 779px) {
  .atlas-engine-grid { grid-template-columns: minmax(0, 1fr); gap: .65rem; padding: 0 .6rem .6rem; }
  #compare-panel .bench-atlas-result > header { gap: .18rem .55rem; padding: .75rem .7rem .65rem; }
  .atlas-order-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .atlas-order-dialog .atlas-engine-canvas { aspect-ratio: 1.3; }
  .atlas-precision { font-size: .73rem; }
}
