/* Unified object workbench: native paper controls around the scientific plot. */
.dt-host {
  position: relative;
}
.dt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
body .diagram-tool-launch {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  font: inherit;
  cursor: pointer;
}
body .dt-panel {
  --dt-ink: var(--design-ink);
  --dt-muted: var(--design-muted);
  --dt-line: var(--design-line);
  position: fixed;
  z-index: 10020;
  right: 18px;
  top: 110px;
  bottom: 16px;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 88px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--dt-line);
  border-radius: var(--design-radius-surface);
  background: var(--design-surface);
  color: var(--dt-ink);
  box-shadow: none;
  isolation: isolate;
  font: inherit;
  caret-color: var(--design-primary);
  scrollbar-color: var(--design-scrollbar) var(--design-inset);
}
body .dt-panel[hidden],
.dt-panel [hidden],
.dt-rail-navigation[hidden],
.dt-context-empty[hidden] {
  display: none !important;
}
.dt-panel * {
  box-sizing: border-box;
}
.dt-panel ::selection {
  background: var(--design-selected);
  color: var(--design-ink);
}
body .dt-panel button {
  min-height: var(--md-sys-size-target, 40px);
  padding: 8px 10px;
  border: 1px solid var(--dt-line);
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--design-surface);
  color: var(--dt-ink);
  font: inherit;
  font-size: calc(12px * var(--ui-font-scale, 1));
  line-height: 1.5;
  cursor: pointer;
}
body .dt-panel button:hover {
  background: var(--design-inset);
}
body .dt-panel button:disabled {
  opacity: 0.46;
  cursor: default;
}
body .dt-panel :is(button, input, select):focus-visible {
  outline: 2px solid var(--md-sys-color-focus, var(--design-primary));
  outline-offset: 2px;
}
.dt-panel > :not(.dt-scroll) {
  flex-shrink: 0;
}
.dt-head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--md-sys-size-target);
  padding: 0 8px;
}
body .dt-head h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--dt-ink);
  font-size: calc(14px * var(--ui-font-scale, 1));
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: break-word;
}
body .dt-head button {
  flex: none;
  position: relative;
  width: var(--md-sys-size-target);
  min-width: var(--md-sys-size-target);
  height: var(--md-sys-size-target);
  min-height: var(--md-sys-size-target);
  padding: 0;
  font-size: 0;
  border: 0;
  background: transparent;
}
.dt-head button::after {
  content: '';
  position: absolute;
  inset: 10px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 5 10 10M15 5 5 15' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.dt-head .dt-collapse::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7 5 5 5-5' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.dt-panel[data-collapsed='true'] .dt-collapse::after {
  transform: rotate(180deg);
}
.dt-history {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 0 auto;
  padding: 0;
  flex: none;
}
body .dt-panel .dt-history button {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--md-sys-size-target);
  height: var(--md-sys-size-target);
  min-height: var(--md-sys-size-target);
  min-width: var(--md-sys-size-target);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dt-muted);
  font-size: 0;
}
.dt-history button::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m7 4-4 4 4 4M3 8h8a5 5 0 0 1 0 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.dt-history .dt-redo::before {
  transform: scaleX(-1);
}
body .dt-history .dt-help-toggle::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 7a2 2 0 0 1 4 0c0 2-2 2-2 4m0 2v.1' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
body .dt-history .dt-help-toggle[aria-expanded='true'] {
  background: var(--design-selected);
}
.dt-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: var(--md-sys-size-target, 40px);
  padding: 0 8px 8px;
  border: 0;
}
body .dt-panel .dt-tabs > [data-dt-view] {
  min-width: var(--md-sys-size-target);
  padding: 6px;
  font-size: calc(12px * var(--ui-font-scale, 1));
  border-radius: var(--design-radius-control);
  white-space: nowrap;
}
.dt-tabs > .dt-history {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin: 0;
}
.dt-history .dt-help-toggle { margin-right: auto; }
body .dt-tabs [data-dt-view='library'] {
  background: var(--design-surface);
  color: var(--design-ink);
}
body .dt-tabs [aria-expanded='true'] {
  background: var(--design-inset);
  border-color: var(--design-muted);
}
body .dt-panel .dt-tabs > [data-dt-view='objects'] {
  width: var(--md-sys-size-target);
  font-size: 0;
  padding: 8px;
}
.dt-tabs > [data-dt-view='objects']::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m9 4-6 6 6 6M3 10h14' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.dt-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 10px;
  scrollbar-width: thin;
  border-top: 1px solid var(--dt-line);
}
.dt-caption,
.dt-empty,
.dt-hint,
.dt-status,
.dt-result,
.dt-reference-help {
  font-size: calc(12px * var(--ui-font-scale, 1));
  line-height: 1.7;
  color: var(--dt-muted);
  overflow-wrap: anywhere;
}
body .dt-panel h3 {
  margin: 0 0 10px;
  font-size: calc(14px * var(--ui-font-scale, 1));
  font-weight: 600;
  color: var(--dt-ink);
  line-height: 1.5;
}
.dt-caption {
  margin: 0 0 14px;
}
body .dt-panel:not([data-help='true']) .dt-library > .dt-caption {
  display: none;
}
.dt-empty {
  margin: 0;
  padding: 8px 0 18px;
}
.dt-hint {
  margin: 0 14px 10px;
}
.dt-panel:not([data-help='true']):not([data-placing='true']) > .dt-hint {
  display: none;
}
body .dt-place,
body .dt-cancel-place {
  margin: 0 14px 8px;
}
body .dt-place {
  background: var(--design-inset);
}
.dt-add {
  display: block;
}
.dt-add-group {
  margin: 18px 0 6px;
  font: inherit;
  font-size: calc(12px * var(--ui-font-scale, 1));
  font-weight: 600;
  color: var(--dt-muted);
}
.dt-add-group-tools {
  display: grid;
  gap: 0;
}
body .dt-panel .dt-add button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--md-sys-size-target, 40px);
  border: 0;
  border-bottom: 1px solid var(--dt-line);
  border-radius: 0;
  text-align: start;
  background: transparent;
  box-shadow: none;
}
.dt-add button::before {
  content: '';
  width: 14px;
  height: 14px;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4v12M4 10h12' stroke='black' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
body .dt-panel .dt-add button:hover {
  background: var(--design-inset);
}
.dt-object-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex: none;
}
.dt-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--design-inset);
  border-radius: 16px;
  margin: 0 0 20px;
  max-height: 210px;
  overflow: auto;
  scrollbar-width: thin;
}
.dt-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--dt-line);
}
body .dt-panel .dt-row button {
  flex: 1;
  min-width: 0;
  padding: 9px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: start;
  overflow-wrap: anywhere;
}
body .dt-panel .dt-row button[aria-pressed='true'] {
  background: var(--design-inset);
  font-weight: 600;
  box-shadow: inset 0 -1px var(--design-muted);
}
.dt-toggle {
  display: grid;
  place-items: center;
  width: var(--md-sys-size-target, 40px);
  min-height: var(--md-sys-size-target, 40px);
  flex: none;
  cursor: pointer;
}
body .dt-panel input[type='checkbox'] {
  accent-color: var(--design-primary);
  width: 17px;
  height: 17px;
  margin: 0;
}
body .dt-panel .dt-row > :is(.dt-more, .dt-row-more) {
  flex: 0 0 var(--md-sys-size-target);
  width: var(--md-sys-size-target);
  height: var(--md-sys-size-target);
  padding: 8px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--dt-muted);
}
:is(.dt-more, .dt-row-more) svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}
body .dt-panel .dt-row > :is(.dt-more, .dt-row-more):hover {
  background: var(--design-inset);
}
.dt-inspector {
  padding: 16px 12px;
  border: 1px solid var(--dt-line);
  border-radius: 16px;
  background: var(--design-surface);
}
.dt-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 12px;
}
.dt-inspector-section {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--dt-line);
  font-size: inherit;
}
.dt-fields label,
.dt-city-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--dt-muted);
  font-size: calc(12px * var(--ui-font-scale, 1));
  line-height: 1.5;
}
.dt-fields .dt-name-edit,
.dt-fields label:has(select) {
  grid-column: 1/-1;
}
.dt-city-picker {
  margin: 14px 0;
}
body
  .dt-panel
  input:not([type='checkbox']):not([type='file']):not([type='range']):not([type='radio']),
body .dt-panel select {
  width: 100%;
  min-height: var(--md-sys-size-target, 40px);
  padding: 8px 9px;
  border: 1px solid var(--dt-line);
  border-radius: var(--md-sys-shape-corner-extra-small);
  background: var(--design-surface);
  color: var(--dt-ink);
  font: inherit;
  font-size: calc(15px * var(--ui-font-scale, 1));
  font-variant-numeric: tabular-nums;
}
body .dt-panel input:disabled {
  background: var(--design-inset);
  color: var(--dt-muted);
}
body .dt-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--md-sys-size-target, 40px);
  grid-column: 1/-1;
  font-size: calc(12px * var(--ui-font-scale, 1));
}
.dt-result {
  grid-column: 1 / -1;
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}
.dt-result:empty {
  display: none;
}
.dt-reference-help {
  margin: 16px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--design-inset);
}
.dt-object-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.dt-location {
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--dt-line);
}
.dt-location p {
  white-space: pre-line;
  font-size: calc(12px * var(--ui-font-scale, 1));
  line-height: 1.7;
  margin: 0 0 10px;
  color: var(--dt-muted);
}
body .dt-location button {
  width: 100%;
  background: var(--design-selected);
}
.dt-location .observer-link-settings {
  margin: 12px 0 0;
}
.dt-location .observer-link-settings label:has(#observerConstraint),
.dt-location #observerLinkReadout {
  display: none;
}
.dt-file-actions {
  display: grid;
  gap: 8px;
}
.dt-file-actions button {
  text-align: start;
}
.dt-import-review {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.dt-import-review:empty {
  display: none;
}
.dt-import-review p {
  width: 100%;
  margin: 0;
}
body .dt-panel > .dt-footer {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--dt-line);
  background: var(--design-inset);
}
.dt-panel .dt-footer > .dt-status {
  flex: 1;
  margin: 0;
  min-height: 20px;
  font-size: calc(12px * var(--ui-font-scale, 1));
}
body .dt-panel .dt-object-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 170px;
  padding: 8px 0;
  border: 1px solid var(--dt-line);
  border-radius: var(--md-sys-shape-corner-extra-small);
  background: var(--design-surface);
  color: var(--dt-ink);
}
.dt-object-menu:not(:popover-open) {
  display: none;
}
body .dt-panel .dt-object-menu button {
  display: block;
  min-height: var(--md-sys-size-target);
  padding: 8px 12px;
  border-radius: var(--md-sys-shape-corner-extra-small);
  width: 100%;
  border: 0;
  text-align: start;
  background: transparent;
}
body .dt-panel .dt-object-menu button:hover {
  background: var(--design-inset);
}
.dt-field-error {
  font: inherit;
  font-size: calc(12px * var(--ui-font-scale, 1));
  line-height: 1.55;
  color: var(--design-error-ink);
}
.dt-fields label:has(.dt-field-error) {
  grid-column: 1/-1;
}
body .dt-panel [aria-invalid='true'] {
  border-color: var(--design-error-line);
  background: var(--design-error-surface);
}
.dt-track-label::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--reference-color);
  vertical-align: middle;
}
body .dt-host canvas:focus-visible,
body .dt-host[tabindex]:focus-visible {
  outline: 2px solid var(--design-inset);
  outline-offset: -2px;
}
.dt-rail-navigation {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  padding: 6px 0;
  margin: 0 0 4px;
  background: var(--design-inset);
}
body .dt-rail-navigation button {
  flex: 1;
  min-width: 0;
  padding: 6px;
  font-size: calc(12px * var(--ui-font-scale, 1));
  white-space: normal;
}
body .dt-rail-navigation button:focus-visible {
  outline: 2px solid var(--md-sys-color-focus, var(--design-primary));
  outline-offset: 2px;
}
body :is(.ui-parameters, body[data-page='space'] .side).dt-navigation-ready,
body :is(.ui-parameters, body[data-page='space'] .side).dt-rail-active {
  padding-top: 0;
}
:is(
    .ui-parameters,
    body[data-page='space'] .side
  ).dt-navigation-ready[data-editor-view='references']
  > :not(.dt-rail-navigation):not(.motion-menu-header):not(.dt-panel):not(
    .dt-context-empty
  ):not(.sb-controls) {
  display: none !important;
}
:is(
    .ui-parameters,
    body[data-page='space'] .side
  ).dt-navigation-ready[data-editor-view='conditions']
  > :is(.dt-panel, .dt-context-empty, .sb-controls) {
  display: none !important;
}
body .dt-rail-active[data-editor-view='references']:has(> .dt-panel:not([hidden])) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body .dt-panel.dt-docked {
  position: relative;
  inset: auto !important;
  z-index: auto;
  width: 100% !important;
  max-width: none;
  flex: 1;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--design-inset);
}
.dt-docked .dt-scroll {
  background: var(--design-surface);
}
.dt-panel[data-empty='true'] .dt-scroll[data-view='objects'] {
  background: transparent;
  border-top: 0;
}
body .dt-context-empty {
  padding: 18px 14px;
  color: var(--design-ink);
  font: inherit;
  font-size: calc(13px * var(--ui-font-scale, 1));
  line-height: 1.7;
}
.dt-context-empty p {
  margin: 0 0 16px;
}
body .dt-context-empty button {
  width: 100%;
  min-height: var(--md-sys-size-target, 40px);
  padding: 9px 12px;
  border: 1px solid var(--design-line);
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--design-surface);
  color: var(--design-ink);
  font: inherit;
}
body.scene-builder-active
  :is(
    .ui-parameters,
    body[data-page='space'] .side
  ).dt-navigation-ready[data-editor-view='references']
  > .sb-controls {
  display: block !important;
}
body.scene-builder-active
  :is(.ui-parameters, body[data-page='space'] .side).dt-navigation-ready
  > .dt-context-empty {
  display: none !important;
}
body .dt-back-list {
  display: none;
}
.dt-panel[data-collapsed='true'] > .dt-scroll,
.dt-panel[data-collapsed='true'] > .dt-tabs,
.dt-panel[data-collapsed='true'] > .dt-history,
.dt-panel[data-collapsed='true'] > .dt-actions,
.dt-panel[data-collapsed='true'] > .dt-hint {
  display: none;
}
body .dt-panel[data-collapsed='true'] {
  height: auto;
  bottom: auto !important;
}
@media (min-width: 1000px) and (min-height: 650px) {
  .dt-scroll[data-view='objects'] {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .dt-objects:not([hidden]) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }
  .dt-list {
    flex: 0 1 auto;
  }
  .dt-inspector {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 16px 12px;
  }
}
@media (max-width: 760px) {
  body .dt-panel {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    width: auto !important;
    max-height: 58dvh;
    border-radius: var(--design-radius-surface);
  }
  .dt-head {
    padding-top: 8px;
  }
  .dt-history {
    padding-bottom: 4px;
  }
  .dt-tabs {
    padding-bottom: 8px;
  }
  .dt-scroll {
    padding: 14px;
  }
  .dt-panel[data-detail='true'] .dt-object-heading,
  .dt-panel[data-detail='true'] .dt-list {
    display: none;
  }
  body .dt-panel[data-detail='true'] .dt-back-list {
    display: block;
    min-height: var(--md-sys-size-target, 40px);
    position: sticky;
    top: -14px;
    margin: 0 0 14px;
    width: 100%;
    z-index: 2;
    background: var(--design-inset);
  }
  .dt-panel[data-detail='false'] .dt-inspector {
    display: none;
  }
  .dt-panel[data-placing='true'] .dt-scroll,
  .dt-panel[data-placing='true'] .dt-history {
    display: none;
  }
  .dt-panel[data-placing='true'] {
    max-height: 44dvh;
  }
  .dt-list {
    max-height: none;
  }
  body
    .dt-panel
    input:not([type='checkbox']):not([type='file']):not([type='range']):not(
      [type='radio']
    ),
  body .dt-panel select {
    font-size: calc(16px * var(--ui-font-scale, 1));
  }
}
@media (max-width: 760px) and (max-height: 600px) {
  body .dt-panel {
    max-height: calc(100dvh - 24px);
  }
}
@media (pointer: coarse), (max-width: 760px) {
  body .dt-panel button,
  body .diagram-tool-launch {
    min-height: var(--md-sys-size-target, 40px);
    min-width: var(--md-sys-size-target, 40px);
  }
  .dt-toggle {
    width: var(--md-sys-size-target, 40px);
    min-height: var(--md-sys-size-target, 40px);
  }
  body
    .dt-panel
    input:not([type='checkbox']):not([type='file']):not([type='range']):not(
      [type='radio']
    ),
  body .dt-panel select {
    min-height: var(--md-sys-size-target, 40px);
  }
}

/* All plot-overlay actions share the established dark canvas control palette.
   Light menus and timeline playback retain their existing roles. */
body .dt-host .diagram-tool-launch,
body .ui-plot #viewReset {
  min-height: var(--md-sys-size-target, 40px);
  padding: 8px 12px;
  border: 1px solid var(--design-canvas-action-line);
  border-radius: var(--design-radius-control);
  background: var(--design-canvas-action-surface);
  color: var(--design-canvas-action-ink);
  box-shadow: none;
  font-family: var(--design-font);
  font-size: calc(12px * var(--ui-font-scale, 1));
  font-weight: 400;
  line-height: 1.5;
}
/* Pane actions belong to the pane toolbar, leaving data and plot hints uncovered. */
body .ui-diagram-card-head > .diagram-tool-launch {
  position: static;
  flex: none;
  margin: 0 0 0 auto;
  min-height: var(--md-sys-size-target);
  padding: 8px 12px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--design-primary);
  font: 500 calc(12px * var(--ui-font-scale, 1))/1.5 var(--design-font);
}
body[data-page='space'] #reset.stage-reset {
  min-height: var(--md-sys-size-target, 40px);
  border: 1px solid var(--design-canvas-action-line);
  border-radius: var(--design-radius-control);
  background: var(--design-canvas-action-surface);
  color: var(--design-canvas-action-ink);
  box-shadow: none;
  font-family: var(--design-font);
  font-weight: 400;
  line-height: 1.5;
}
body .dt-host .diagram-tool-launch:hover,
body .ui-plot #viewReset:hover,
body[data-page='space'] #reset.stage-reset:hover {
  background: var(--design-inset);
  border-color: var(--design-line);
  color: var(--design-canvas-action-ink);
}
body .dt-host .diagram-tool-launch:focus-visible,
body .ui-plot #viewReset:focus-visible,
body[data-page='space'] #reset.stage-reset:focus-visible {
  outline: 2px solid var(--design-inset);
  outline-offset: 3px;
}
body.customization-active[data-page='lab'] #stage :is(.diagram-tool-launch, #viewReset) {
  right: 12px;
  min-width: 104px;
}
body.customization-active[data-page='lab'] #stage #viewReset {
  bottom: 12px;
}
body[data-page='space'] #reset.stage-reset {
  width: var(--md-sys-size-target, 40px);
  min-width: var(--md-sys-size-target, 40px);
  padding: 8px;
  font-size: calc(18px * var(--ui-font-scale, 1));
}
@media (pointer: coarse), (max-width: 760px) {
  body .dt-host .diagram-tool-launch,
  body .ui-plot #viewReset,
  body[data-page='space'] #reset.stage-reset {
    min-height: var(--md-sys-size-target, 40px);
  }
  body[data-page='space'] #reset.stage-reset {
    width: var(--md-sys-size-target, 40px);
    min-width: var(--md-sys-size-target, 40px);
  }
}

body[data-page='space'] .stage-hint {
  right: 64px;
}

body .dt-panel .dt-head :is(button, .dt-collapse) {
  font-size: 0;
}

/* Resolve touch ownership before pointerdown, including labels above WebGL. */
.dt-editing,
.dt-editing .label,
body.customization-active .dt-host .label {
  touch-action: none;
}
@media (max-width: 760px) {
  body .dt-panel[data-collapsed='true'] {
    bottom: 12px !important;
  }
}

@media (min-width: 1000px) and (min-height: 650px) {
  .dt-list {
    max-height: clamp(44px, 16dvh, 150px);
    min-height: var(--md-sys-size-target, 40px);
  }
  .dt-inspector {
    flex: 1 0 120px;
    min-height: 100px;
  }
}

.dt-scroll,
.dt-inspector,
.dt-list {
  overflow-anchor: none;
}
.dt-panel[data-placing='true'] > .dt-hint {
  display: block;
}

.dt-panel[data-limit='true'] > .dt-hint {
  display: block;
}

body[data-page='space'] .side.dt-rail-active {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

@media (pointer: coarse), (max-width: 760px) {
  body .dt-panel .dt-head button {
    width: var(--md-sys-size-target, 40px);
    height: var(--md-sys-size-target, 40px);
    min-height: var(--md-sys-size-target, 40px);
  }
  body .dt-panel .dt-history button {
    width: var(--md-sys-size-target, 40px);
    min-width: var(--md-sys-size-target, 40px);
    min-height: var(--md-sys-size-target, 40px);
    height: var(--md-sys-size-target, 40px);
  }
  body .dt-panel .dt-tabs > [data-dt-view] {
    min-height: var(--md-sys-size-target, 40px);
  }
  .dt-head {
    min-height: 48px;
  }
  .dt-tabs {
    min-height: 48px;
  }
}

body .dt-panel > .dt-status {
  margin: 0;
  padding: 8px 10px;
  max-height: 58px;
  overflow: auto;
  flex: none;
}

@media (pointer: coarse), (max-width: 760px) {
  body .dt-panel .dt-tabs > [data-dt-view='objects'] {
    width: var(--md-sys-size-target, 40px);
    flex-basis: var(--md-sys-size-target, 40px);
    min-width: var(--md-sys-size-target, 40px);
  }
}
