.factory-hero {
  color: #1e382e;
  background: #eaf0e7;
  padding: clamp(22px, 3.4vw, 48px) 0 clamp(24px, 4vw, 50px);
}
.factory-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 24px;
  margin-bottom: clamp(18px, 2.3vw, 30px);
}
.factory-intro h1 {
  margin: 0;
  font-size: clamp(31px, 5.4vw, 78px);
  line-height: 1.03;
  font-weight: 800;
  letter-spacing: -.056em;
}
.factory-explore {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 14px;
}
.factory-explore:hover { text-decoration: underline; }
#dnd-factory {
  --gold: #ffe26b;
  --rule: #aabcae;
  --muted: #425d50;
}
#dnd-factory [hidden] { display: none; }
.factory-controls {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-bottom: 0;
  background: #f5f8f0;
}
.factory-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  flex: 1;
  min-width: 0;
}
.factory-controls button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  min-height: 46px;
  padding: 5px;
  color: #253d32;
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 650;
  cursor: pointer;
  line-height: 1.15;
}
.factory-choices button:nth-child(6) { border-right: 0; }
.factory-controls button:hover { background: #e2ebdb; }
.factory-controls button[aria-pressed="true"] {
  color: #fff9df;
  background: #263d33;
  box-shadow: inset 0 -3px var(--gold);
}
.factory-controls button:focus-visible { outline-offset: -4px; }
#dnd-factory .stage {
  position: relative;
  isolation: isolate;
  height: clamp(170px, 45vw, 570px);
  background: #a1ccae;
  overflow: hidden;
  border: 1px solid var(--rule);
}
#dnd-factory .factory-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#dnd-factory .factory-layer :is(img, canvas) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#dnd-factory .detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
  min-height: 90px;
  background: #f5f8f0;
  border: 1px solid var(--rule);
  border-top: none;
  padding: 12px 18px;
}
#dnd-factory .detail[hidden] { display: none; }
.factory-description { margin: 0; font-size: 15px; line-height: 1.55; }
.factory-description strong { font-weight: 750; }
.factory-links, .factory-links a {
  display: flex;
  align-items: center;
}
.factory-links { flex-shrink: 0; flex-wrap: wrap; gap: 4px 16px; }
.factory-links a { min-height: 44px; gap: 5px; font-size: 13px; font-weight: 650; }
.factory-links a:hover { text-decoration: underline; }
.factory-links a span { color: #56705e; }
.factory-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 720px) {
  .factory-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .factory-choices button:nth-child(3) { border-right: 0; }
  .factory-choices button:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .factory-intro { display: block; }
  .factory-intro h1 br { display: none; }
  .factory-intro .factory-explore { margin-top: 4px; }
}
@media (max-width: 480px) {
  .factory-intro { margin-bottom: 8px; }
  #dnd-factory .detail { align-items: flex-start; flex-direction: column; padding: 12px; min-height: 120px; gap: 1px; }
}


@media (max-width: 850px) {
  #dnd-factory .detail { align-items: stretch; flex-direction: column; gap: 2px; }
}
@media (max-width: 620px) {
  #dnd-factory .stage { height: auto; aspect-ratio: 2; }
  #dnd-factory .factory-layer :is(img, canvas) {
    inset: auto; top: var(--scene-y,0%); left: var(--scene-x,0%);
    width: var(--scene-width,100%); max-width: none; height: auto; aspect-ratio: 2;
  }
  #dnd-factory .detail { min-height: 120px; padding: 10px 12px; justify-content: flex-start; }
  .factory-description { min-height: 48px; }
  .factory-links { column-gap: 11px; }
  .factory-links a { font-size: 12px; }
}