/* The full simulator keeps its existing layout unless ?embed=1 is present. */
html.amt-e96-embed,
html.amt-e96-embed body {
  height: auto;
  min-height: 0;
  margin: 0;
}

.amt-e96-embed .nav {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  min-height: 0;
  display: block;
  padding: 13px 24px;
}
.amt-e96-embed .nav > .brand,
.amt-e96-embed .nav > .machine-tag,
.amt-e96-embed .nav > .nav-bottom,
.amt-e96-embed main > .project-switcher {
  display: none;
}
.amt-e96-embed .nav nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 0 0 2px;
  overflow-x: auto;
  overflow-y: hidden;
}
.amt-e96-embed .nav nav button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 12px;
}
.amt-e96-embed body > main {
  height: auto;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 20px 24px 24px;
  overflow: visible;
}
.amt-e96-embed main > header {
  padding-bottom: 18px;
}
.amt-e96-embed .toolbar {
  justify-content: flex-start;
  padding: 16px 0;
}
.amt-e96-embed .workspace {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: stretch;
}
.amt-e96-embed .visual {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.amt-e96-embed .view-bar {
  flex: 0 0 auto;
}
.amt-e96-embed #scene {
  flex: 0 0 auto;
  height: clamp(480px, 42vw, 720px);
}
.amt-e96-embed #scene > canvas {
  /* Override OrbitControls' inline touchAction so vertical gestures can scroll. */
  touch-action: pan-y !important;
}
.amt-e96-embed .inspector {
  padding: 24px 20px;
}

/* embed.js moves this row outside #scene, keeping controls off the canvas. */
.amt-e96-embed .visual > .scene-bottom {
  position: static;
  inset: auto;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  min-height: 56px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: #f7f9f0;
  backdrop-filter: none;
  font-size: 10px;
}
.amt-e96-embed .visual > .scene-bottom > span {
  display: inline;
  margin-right: auto;
}
.amt-e96-embed .scene-bottom label {
  min-width: 0;
  gap: 8px;
  font-size: 10px;
}
.amt-e96-embed .scene-bottom select {
  max-width: 150px;
  padding: 5px 16px 5px 0;
  font-size: 11px;
}
.amt-e96-embed .scene-bottom button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #cad4c2;
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
}
.amt-e96-embed .embed-work-settings {
  flex: 0 0 auto;
  padding: 20px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.amt-e96-embed .embed-work-settings > h3 {
  margin: 0 0 16px;
  font-size: 13px;
}
.amt-e96-embed .embed-work-settings .field-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.amt-e96-embed .embed-work-settings .field-select label {
  min-width: 0;
}
.amt-e96-embed .embed-work-settings .field-select select {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #cbd5c4;
  border-radius: 3px;
  background: #f8faf3;
}
.amt-e96-embed .embed-work-settings .capacity-note {
  max-width: none;
  margin: 16px 0 0;
}

@media (max-width: 1099px) {
  .amt-e96-embed .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .amt-e96-embed #scene {
    height: clamp(460px, 56vw, 620px);
  }
  .amt-e96-embed .inspector {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 24px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .amt-e96-embed .inspector .section-label,
  .amt-e96-embed .inspector .notice,
  .amt-e96-embed .inspector .inspector-actions {
    grid-column: 1 / -1;
  }
  .amt-e96-embed .inspector h2,
  .amt-e96-embed .inspector p,
  .amt-e96-embed .inspector .progress-label,
  .amt-e96-embed .inspector .track,
  .amt-e96-embed .inspector .power-line {
    grid-column: 1;
  }
  .amt-e96-embed .inspector p { margin: 0; }
  .amt-e96-embed .inspector .metric-pair {
    grid-column: 2;
    grid-row: 2 / 4;
    padding: 0;
    margin: 0;
    border: 0;
  }
  .amt-e96-embed .inspector .row-title {
    grid-column: 2;
    grid-row: 4;
    margin: 0;
  }
  .amt-e96-embed .inspector #row-status {
    grid-column: 2;
    grid-row: 5 / 7;
  }
}

@media (max-width: 640px) {
  .amt-e96-embed .nav { padding: 11px 12px; }
  .amt-e96-embed .nav nav button { padding: 10px 12px; font-size: 11px; }
  .amt-e96-embed body > main { padding: 17px 12px 20px; }
  .amt-e96-embed main > header { gap: 12px; align-items: flex-start; }
  .amt-e96-embed .header-right { flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
  .amt-e96-embed .header-right .badge { display: none; }
  .amt-e96-embed .toolbar { gap: 16px; }
  .amt-e96-embed .field-select { gap: 14px 18px; }
  .amt-e96-embed .field-select label { min-width: 0; }
  .amt-e96-embed .toolbar > .actions { justify-content: flex-start; }
  .amt-e96-embed .embed-work-settings { padding: 18px 12px; }
  .amt-e96-embed .embed-work-settings .field-select { gap: 16px 14px; }
  .amt-e96-embed #scene { height: 420px; }
  .amt-e96-embed .view-bar { padding: 0 12px; gap: 10px; }
  .amt-e96-embed .tabs { gap: 14px; flex: 0 0 auto; }
  .amt-e96-embed #asset-label { text-align: right; font-size: 8px; }
  .amt-e96-embed .scene-overlay { inset: 16px 14px auto; gap: 12px; }
  .amt-e96-embed .scene-name { font-size: 23px; }
  .amt-e96-embed .scene-name span { max-width: 150px; line-height: 1.5; font-size: 8px; }
  .amt-e96-embed .scene-meta { max-width: 44%; font-size: 10px; line-height: 1.5; }
  .amt-e96-embed .visual > .scene-bottom { justify-content: flex-start; gap: 9px 12px; padding: 12px; }
  .amt-e96-embed .visual > .scene-bottom > span { flex-basis: 100%; margin: 0; }
  .amt-e96-embed .scene-bottom label { flex-basis: 100%; justify-content: space-between; }
  .amt-e96-embed .inspector { display: flex; flex-direction: column; gap: 0; padding: 20px 16px; }
  .amt-e96-embed .inspector .section-label { margin-bottom: 14px; }
  .amt-e96-embed .inspector h2 { margin-bottom: 5px; }
  .amt-e96-embed .inspector p { margin-bottom: 15px; }
  .amt-e96-embed .inspector .metric-pair { padding: 12px 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
  .amt-e96-embed .inspector .track { margin: 10px 0 17px; }
  .amt-e96-embed .inspector .power-line { margin: 7px 0; }
  .amt-e96-embed .inspector .row-title { margin: 18px 0 10px; }
  .amt-e96-embed .inspector .notice { margin-top: 15px; }
}
