#view-tools {
  overflow: hidden;
}

#view-tools .tool-source-shell {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#view-tools .tool-source-shell::before {
  content:"";position:absolute;top:0;left:0;right:0;height:52px;z-index:2;
  background:var(--panel);border-bottom:var(--bd-w) solid var(--line);pointer-events:none;
}
#view-tools .tool-source-frame{position:relative;top:-52px;height:calc(100% + 52px);flex:none}

#view-tools .tool-source-new-window{position:absolute;right:var(--sp-2);top:var(--sp-2);z-index:var(--z-toolbar);width:30px;height:30px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--panel);color:var(--gray);text-decoration:none}
#view-tools .tool-source-new-window:hover{border-color:var(--blue);color:var(--blue)}

#view-tools .tool-source-head {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-bottom: var(--bd-w) solid var(--line);
  background: var(--surface-2);
}

#view-tools .tool-source-head>div {
  min-width: 180px;
}

#view-tools .tool-source-login {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

#view-tools .tool-source-space {
  flex: 1;
  min-width: var(--sp-2);
}

#view-tools .tool-source-frame {
  display: block;
  width: 100%;
  min-width: 0;
  flex: 1;
  min-height: 0;
  border: 0;
  background: var(--bg);
}

#view-tools .tool-source-error {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--sp-2);
  color: var(--danger);
}

#view-tools .tool-source-error span {
  color: var(--muted);
  line-height: 1.7;
}

#view-tools .tool-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

#view-tools .tool-source-loading {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-3);
}

@media (max-width: 760px) {
  #view-tools {
    overflow: auto;
  }

  #view-tools .tool-source-shell {
    min-height: 76vh;
  }

  #view-tools .tool-source-head>div {
    min-width: 0;
    flex: 1 1 100%;
  }
}
